Built files from Bizgaze WebServer
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

irnwithewaybill.js 36KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  1. var Bizgaze;
  2. (function (Bizgaze) {
  3. let Apps;
  4. (function (Apps) {
  5. let Integrations;
  6. (function (Integrations) {
  7. let EWayBill;
  8. (function (EWayBill) {
  9. let Components;
  10. (function (Components) {
  11. class irnwithewaybill extends Unibase.Platform.Core.BaseComponent {
  12. constructor() {
  13. super(...arguments);
  14. this.g_VisibleContainerId = 0;
  15. this.g_EwaybillItems = [];
  16. }
  17. jsFiles() {
  18. return ["apps/transact/managers/invoicemanager.js", "apps/transact/managers/inventory/dcmanager.js"];
  19. }
  20. cssFiles() {
  21. return [];
  22. }
  23. html() {
  24. return null;
  25. }
  26. loadControl(containerid, prop) {
  27. var html = `<div class="card">
  28. <div class="table-wrap card simple-scroll-bar bg-white-s bg-white-removed templateviewer-body" style = "height:100% !important" >
  29. <div class="table-responsive tableFixHead dropdown-menu-scrollbar" >
  30. <table class="table table-hover table-bordered mb-0 tblgetewaybilldata" id = "tblgetewaybillitems" >
  31. <thead>
  32. <tr>
  33. <th>ProductName</th>
  34. <th>ProductDesc</th>
  35. <th>Quantity</th>
  36. <th>HSNCode</th>
  37. <th>QtyUnit</th>
  38. <th>CgstRate</th>
  39. <th>SgstRate</th>
  40. <th>TaxableAmount</th>
  41. </tr>
  42. </thead>
  43. <tbody id = "tblgetewaybilliitems" >
  44. </tbody>
  45. </table>
  46. </div>
  47. <div>
  48. </div>`;
  49. $("#" + containerid).html(html);
  50. }
  51. loadControlSettings(controlsettingjson, formpropertyid) {
  52. return null;
  53. }
  54. loadPropertySettings(propertysettings, formpropertyid) {
  55. return null;
  56. }
  57. bindEditFormDetails(formpropertyid, propval, DocPropertyName) {
  58. var ewaybillid = Number(propval);
  59. var instance = this;
  60. }
  61. load() {
  62. Bizgaze.Apps.Integrations.EWayBill.Components.irnwithewaybill.Instance().getInvoiceDetails();
  63. $(".txt_vehicleno").keyup(function () {
  64. $(".txt_vehicleno").val($(".txt_vehicleno").val().toString().toUpperCase());
  65. });
  66. $(".txt_topincode,.txt_frompincode").on("click", function () {
  67. Bizgaze.Apps.Integrations.EWayBill.Components.irnwithewaybill.Instance().GetDistanceByPinCode();
  68. });
  69. }
  70. getAddressById() {
  71. let AutoComplete_branchid = Number($(".txtAutoComplete_branchid").val());
  72. Bizgaze.Apps.Crm.Contacts.Managers.ContactManager.Instance().getAddressById(AutoComplete_branchid).then(function (response) {
  73. if (response.result != null) {
  74. $(".txt_frompincode").val(response.result.ZipCode);
  75. $(".labelSection_FromGSTIN").html("<span>From GSTIN : " + response.result.GSTNO + "</span>");
  76. Bizgaze.Apps.Integrations.EWayBill.Components.irnwithewaybill.Instance().getDistance();
  77. }
  78. });
  79. }
  80. getdcewaydetails() {
  81. let VisibleContainerId = Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length - 1];
  82. let dcid = Number($(".txtAutoComplete_dcid").val());
  83. Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/transact/managers/inventory/dcmanager.js", function () {
  84. Bizgaze.Apps.Transact.Managers.DCManager.Instance().getdc(dcid).then(function (response) {
  85. if (response.result != null) {
  86. $(".txt_frompincode").val(response.result.ShipFromZipCode);
  87. $(".txt_topincode").val(response.result.ShipToZipCode);
  88. let branchid = Number(response.result.BranchId);
  89. $(".labelSection_ToGSTIN").html("<span>To GSTIN : " + response.result.GSTInNo + "</span>");
  90. $(".labelSection_FromGSTIN").html("<span>From GSTIN : " + response.result.GSTInNo + "</span>");
  91. $(".hfAutoCompleteId_invoiceid").val(response.result.InvoiceId);
  92. $(".hdn_refid").val($(".txtAutoComplete_dcid").val());
  93. Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/crm/companies/managers/companymanager.js", function () {
  94. Bizgaze.Apps.CRM.Companies.Managers.CompanyManager.Instance().getBranch(branchid).then(function (response) {
  95. if (response.result != null) {
  96. let BranchName = response.result.BranchName;
  97. let branch = new Option(BranchName, branchid.toString(), true);
  98. $("#" + VisibleContainerId).find(".txtAutoComplete_branchid").append(branch).val(branchid).trigger("change");
  99. }
  100. });
  101. });
  102. Bizgaze.Apps.Integrations.EWayBill.Components.irnwithewaybill.Instance().getDistance();
  103. }
  104. });
  105. });
  106. }
  107. getdc() {
  108. var InstalledAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
  109. var recordid = Number(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_recordid").Value);
  110. var dcid = Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_dcid").Value;
  111. Bizgaze.Apps.Transact.Managers.DCManager.Instance().getdc(dcid).then(function (response) {
  112. if (response.result != null) {
  113. $(".txt_frompincode").val(response.result.BillFromZipCode);
  114. $(".txt_topincode").val(response.result.BillToZipCode);
  115. $(".labelSection_ToGSTIN").html("<span>To GSTIN : " + response.result.GSTNo + "</span>");
  116. }
  117. });
  118. }
  119. getinvoiceewaydetails() {
  120. let VisibleContainerId = Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length - 1];
  121. let Autocomplete_invoiceid = Number($(".txtAutoComplete_invoiceid").val());
  122. Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/transact/managers/invoicemanager.js", function () {
  123. Bizgaze.Apps.Transact.Managers.InvoiceManager.Instance().getInvoiceDetails(Autocomplete_invoiceid).then(function (response) {
  124. if (response.result != null) {
  125. $(".txt_frompincode").val(response.result.BillFromZipCode);
  126. $(".txt_topincode").val(response.result.BillToZipCode);
  127. let branchid = Number(response.result.BranchId);
  128. $(".labelSection_ToGSTIN").html("<span>To GSTIN : " + response.result.GSTNo + "</span>");
  129. $(".labelSection_FromGSTIN").html("<span>From GSTIN : " + response.result.GSTNo + "</span>");
  130. $(".hfAutoCompleteId_dcid").val(response.result.DcId);
  131. $(".hdn_refid").val($(".txtAutoComplete_invoiceid").val());
  132. Bizgaze.Apps.Integrations.EWayBill.Components.irnwithewaybill.Instance().getDistance();
  133. Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/crm/companies/managers/companymanager.js", function () {
  134. Bizgaze.Apps.CRM.Companies.Managers.CompanyManager.Instance().getBranch(branchid).then(function (response) {
  135. if (response.result != null) {
  136. let BranchName = response.result.BranchName;
  137. let branch = new Option(BranchName, branchid.toString(), true);
  138. $("#" + VisibleContainerId).find(".txtAutoComplete_branchid").append(branch).val(branchid).trigger("change");
  139. }
  140. });
  141. });
  142. }
  143. });
  144. });
  145. }
  146. getInvoiceDetails() {
  147. var InstalledAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
  148. var recordid = Number(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_recordid").Value);
  149. var invoiceid = Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_invoiceid").Value;
  150. Bizgaze.Apps.Transact.Managers.InvoiceManager.Instance().getInvoiceDetails(invoiceid).then(function (response) {
  151. if (response.result != null) {
  152. $(".txt_frompincode").val(response.result.BillFromZipCode);
  153. $(".txt_topincode").val(response.result.BillToZipCode);
  154. $(".labelSection_ToGSTIN").html("<span>To GSTIN : " + response.result.GSTNo + "</span>");
  155. }
  156. });
  157. }
  158. getDistance() {
  159. var fromplace = Number($('.txt_frompincode').val());
  160. var apikey = 'AIzaSyBGmahAAg3EVzAUJvttDZsjdZiJenJxGt8';
  161. if (apikey == undefined) {
  162. }
  163. var toplace = Number($('.txt_topincode').val());
  164. if (toplace == 0) {
  165. $('.number_approxdistance').val(0);
  166. }
  167. else {
  168. $.ajax({
  169. url: "https://maps.googleapis.com/maps/api/geocode/json?address=" + fromplace + "%20%22&key=" + apikey + "&sensor=false",
  170. method: "POST",
  171. success: function (data) {
  172. let latitude, longitude, flatitude, flongitude;
  173. flatitude = data.results[0].geometry.location.lat;
  174. flongitude = data.results[0].geometry.location.lng;
  175. $.ajax({
  176. url: "https://maps.googleapis.com/maps/api/geocode/json?address=" + toplace + "%20%22&key=" + apikey + "&sensor=false",
  177. method: "POST",
  178. success: function (_data) {
  179. latitude = _data.results[0].geometry.location.lat;
  180. longitude = _data.results[0].geometry.location.lng;
  181. var dd = getDistanceFromLatLonInKm(flatitude, flongitude, latitude, longitude);
  182. $('.number_approxdistance').val(Math.round(dd));
  183. }
  184. });
  185. }
  186. });
  187. function getDistanceFromLatLonInKm(lat1, lon1, lat2, lon2) {
  188. var R = 6371;
  189. var dLat = deg2rad(lat2 - lat1);
  190. var dLon = deg2rad(lon2 - lon1);
  191. var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +
  192. Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) *
  193. Math.sin(dLon / 2) * Math.sin(dLon / 2);
  194. var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
  195. var d = R * c;
  196. return d;
  197. }
  198. function deg2rad(deg) {
  199. return deg * (Math.PI / 180);
  200. }
  201. }
  202. }
  203. Checkout() {
  204. let instance = this;
  205. $(".modal-body").scrollTop(0);
  206. let cont_id = $("._bizgaze_popup_container:visible").attr("id");
  207. $("#" + cont_id).find("#btnDynamicSave").css("cursor", "pointer");
  208. $(".modal-body").scrollTop(0);
  209. $(".btn_Save_Form, .section_Default,.section_Part-B").removeClass("hidden");
  210. $("#btn_CloseForm_" + $("#hf_FormId").val()).removeClass('hidden');
  211. $(".CheckOutButton,.btn_back ").addClass('hidden');
  212. }
  213. backtoDetails() {
  214. $(".btn_Save_Form, .section_Default").removeClass('hidden');
  215. $(".section_Part-B,.CheckOutButton,.btn_back").addClass('hidden');
  216. $("#btn_CloseForm_" + $("#hf_FormId").val()).removeClass('hidden');
  217. }
  218. ShowPrintButton() {
  219. let instance = this;
  220. let InstalledAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
  221. let EWaybillId = Number(Unibase.Themes.Providers.DetailHelper.recordId);
  222. let detailContainer = "#" + Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length - 1];
  223. $(detailContainer).find(".DetailSetting_" + InstalledAppId + "_Print").removeClass("btn-undefined").addClass("btn-warning");
  224. $(".btn-undefined").addClass("btn-success").removeClass("btn-undefined");
  225. instance.fileCacheHelper.loadJsFile("apps/transact/managers/ewaybill/ewaybillmanager.js", function (response) {
  226. Bizgaze.Apps.Transact.Managers.EWayBillManager.Instance().getEwayBill(EWaybillId).then(function (ewaybillresponse) {
  227. if (ewaybillresponse.result.Notes != null && ewaybillresponse.result.Notes != undefined && ewaybillresponse.result.Notes != "") {
  228. $(detailContainer).find(".li_DetailSetting_" + InstalledAppId + "_ApprovalError").remove();
  229. $(detailContainer).find('#div_App_DefaultWidgetSettings').append(`<div><div class="ActionsApprovalError mx-20 mb-2 rounded py-10 px-0 li_DetailSetting_` + InstalledAppId + `_ApprovalError" id="li_DetailSetting_` + InstalledAppId + `_ApprovalError" style="background-color:rgb(252 250 247);border-left: 3px solid #ff6060;padding:0.5rem 1rem 1rem;"> <p class="font-14 text-danger col-sm-12">` + ewaybillresponse.result.Notes + `</p> </div>`);
  230. $(detailContainer).find('#div_App_DefaultWidgetSettings').addClass('pb-0');
  231. }
  232. });
  233. });
  234. instance.Print();
  235. }
  236. Print() {
  237. let instance = this;
  238. let detailContainer = "#" + Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length - 1];
  239. if ($(".printsetting").length != 0) {
  240. let printhtml = $(".printsetting")[0].outerHTML;
  241. $(".printsetting").remove();
  242. $(detailContainer).find("#div_App_DefaultWidgetSettings").find(".row").append(printhtml);
  243. $(".printsetting").find(".pull-right").removeClass("pull-right");
  244. }
  245. $('.DetailSetting_' + Unibase.Themes.Providers.DetailHelper.installedAppId + '_Print').html('<span><i class=\"fa fa-print\"></i></span>');
  246. $(detailContainer).find('.DetailSetting_' + Unibase.Themes.Providers.DetailHelper.installedAppId + '_Print').click(function () {
  247. let EwaybillId = Unibase.Themes.Providers.DetailHelper.recordId;
  248. Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFiles(["apps/transact/managers/ewaybill/ewaybillmanager.js", "platform/core/helpers/printhelper/printhelper.js"], function () {
  249. Bizgaze.Apps.Transact.Managers.EWayBillManager.Instance().getPrintEWayBill(EwaybillId).then(function (response) {
  250. Unibase.Platform.Helpers.PrintHelper.Instance().printPopup(response.result.PrintHTML);
  251. });
  252. });
  253. });
  254. }
  255. GetDistanceByPinCode() {
  256. let instance = this;
  257. var FromPinCode = $(".txt_frompincode").val().toString();
  258. var ToPinCode = $(".txt_topincode").val().toString();
  259. if (FromPinCode.length == 6 && ToPinCode.length == 6) {
  260. instance.getDistance();
  261. }
  262. }
  263. ShoworHideEWayBillButton() {
  264. let instance = this;
  265. let InstalledAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
  266. let detailContainer = "#" + Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length - 1];
  267. let RefStatusId = Number(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_refstatusid").Value);
  268. if (RefStatusId == 1 || RefStatusId == 2 || RefStatusId == 6) {
  269. $(detailContainer).find('.li_DetailSetting_' + InstalledAppId + '_E-WayBill').addClass('hidden');
  270. }
  271. else {
  272. $(detailContainer).find('.li_DetailSetting_' + InstalledAppId + '_E-WayBill').removeClass('hidden');
  273. }
  274. }
  275. getEwayForm(Pk_Value) {
  276. let instance = Bizgaze.Apps.Integrations.EWayBill.Components.irnwithewaybill.Instance();
  277. instance.fileCacheHelper.loadJsFiles(['platform/forms/managers/formmanager.js', 'platform/apps/managers/appmanager.js'], function () {
  278. var FormUniqueId = 'Bizgaze_Extension_Transact_E-WayBill_App_E-WayBill_OrderDetails__CreateForm';
  279. Unibase.Platform.Forms.Managers.FormManager.Instance().getFormbyUniqueId(FormUniqueId).then(function (response) {
  280. var onLoadCallBack = {
  281. CallBack: function () {
  282. instance.bindewaydata(Pk_Value);
  283. },
  284. Parameters: null,
  285. };
  286. var formviewerObj = {
  287. FormId: response.result.FormId,
  288. AppConfigurationId: 0,
  289. Pk_Value: 0,
  290. PortletWidgetId: 0,
  291. OnSuccess: null,
  292. OnFail: null,
  293. OnLoad: onLoadCallBack,
  294. };
  295. Unibase.Platform.Forms.Components.FormViewer.Instance().init(formviewerObj);
  296. instance.navigationHelper.hideLoading();
  297. });
  298. });
  299. }
  300. bindewaydata(Pk_Value) {
  301. let instance = Bizgaze.Apps.Integrations.EWayBill.Components.irnwithewaybill.Instance();
  302. let VisibleContainerId = Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length - 1];
  303. let _ewaybillid = Pk_Value;
  304. instance.fileCacheHelper.loadJsFiles(["apps/transact/managers/ewaybill/ewaybillmanager.js"], function () {
  305. Bizgaze.Apps.Transact.Managers.EWayBillManager.Instance().getewaybillpayload(_ewaybillid).then(function (res) {
  306. if (res.result != null) {
  307. $('input[type=text]').parent().addClass("floating-label-form-group-with-value");
  308. $(".txt_cessvalue").val(res.result.cessValue);
  309. $(".txt_cessvalue").attr("readonly", "readonly");
  310. $(".txt_cgstvalue").val(res.result.cgstValue);
  311. $(".txt_cgstvalue").attr("readonly", "readonly");
  312. $(".txt_transporterdocno").val(res.result.docNo);
  313. $(".txt_transporterdocno").attr("readonly", "readonly");
  314. $(".txt_dispatchfromgstin").val(res.result.fromGstin);
  315. $(".txt_dispatchfromgstin").attr("readonly", "readonly");
  316. $(".txt_fromaddr1").val(res.result.fromAddr1);
  317. $(".txt_fromaddr1").attr("readonly", "readonly");
  318. $(".txt_fromaddr2").val(res.result.fromAddr2);
  319. $(".txt_fromaddr2").attr("readonly", "readonly");
  320. $(".txt_frompincode").val(res.result.fromPincode);
  321. $(".txt_frompincode").attr("readonly", "readonly");
  322. $(".txt_fromplace").val(res.result.fromPlace);
  323. $(".txt_fromplace").attr("readonly", "readonly");
  324. $(".txt_fromstatecode").val(res.result.fromStateCode);
  325. $(".txt_fromstatecode").attr("readonly", "readonly");
  326. $(".txt_dispatchfromgstin").val(res.result.dispatchFromGSTIN);
  327. $(".txt_dispatchfromgstin").attr("readonly", "readonly");
  328. $(".txt_dispatchfromtradename").val(res.result.dispatchFromTradeName);
  329. $(".txt_dispatchfromtradename").attr("readonly", "readonly");
  330. $(".txt_igstvalue").val(res.result.igstValue);
  331. $(".txt_igstvalue").attr("readonly", "readonly");
  332. $(".txt_sgstvalue").val(res.result.sgstValue);
  333. $(".txt_sgstvalue").attr("readonly", "readonly");
  334. $(".txt_shiptogstin").val(res.result.shipToGSTIN);
  335. $(".txt_shiptogstin").attr("readonly", "readonly");
  336. $(".txt_shiptotradename").val(res.result.shipToTradeName);
  337. $(".txt_transportername").attr("readonly", "readonly");
  338. $(".txt_toaddr1").val(res.result.toAddr1);
  339. $(".txt_toaddr1").attr("readonly", "readonly");
  340. $(".txt_toaddr2").val(res.result.toAddr2);
  341. $(".txt_toaddr2").attr("readonly", "readonly");
  342. $(".txt_toplace").val(res.result.toPlace);
  343. $(".txt_toplace").attr("readonly", "readonly");
  344. $(".txt_tostatecode").val(res.result.toStateCode);
  345. $(".txt_tostatecode").attr("readonly", "readonly");
  346. $(".txt_toplace").attr("readonly", "readonly");
  347. $(".txt_topincode").val(res.result.toPincode);
  348. $(".txt_topincode").attr("readonly", "readonly");
  349. $(".txt_vehicleno").val(res.result.vehicleNo);
  350. $(".dropdown_vehicletype").val(res.result.vehicleType).prop("disabled", true);
  351. $(".dropdown_transmode").val(res.result.transMode).prop("disabled", true);
  352. $(".date_transporterdocdate").val(res.result.transDocDate).prop("disabled", true);
  353. $(".txt_vehicleno").attr("readonly", "readonly");
  354. $(".txt_totalvalue").val(res.result.totalValue);
  355. $(".txt_totalvalue").attr("readonly", "readonly");
  356. $(".txt_totinvvalue").val(res.result.totInvValue);
  357. $(".number_approxdistance").val(res.result.transDistance);
  358. $(".txt_totinvvalue").attr("readonly", "readonly");
  359. var dt = res.result;
  360. var itemlists = dt.itemList;
  361. for (var i = 0; i < itemlists.length; i++) {
  362. var data = itemlists[i];
  363. var html = '<tr class="GetewaybillitemsDetails-list-items">' +
  364. '<td>' + data.productName + ' </td>' +
  365. '<td>' + data.productDesc + ' </td>' +
  366. '<td>' + data.quantity + ' </td>' +
  367. '<td>' + data.hsnCode + ' </td>' +
  368. '<td>' + data.qtyUnit + ' </td>' +
  369. '<td>' + data.cgstRate + ' </td>' +
  370. '<td>' + data.sgstRate + ' </td>' +
  371. '<td>' + data.taxableAmount + ' </td>' +
  372. '</tr>';
  373. $("#tblgetewaybilliitems").append(html);
  374. }
  375. instance.fileCacheHelper.loadJsFile("apps/transact/managers/ewaybill/ewaybillmanager.js", function () {
  376. Bizgaze.Apps.Transact.Managers.EWayBillManager.Instance().getEwayBill(_ewaybillid).then(function (ewaybillresponse) {
  377. if (ewaybillresponse.result != null) {
  378. let SupplyTypeid = Number(ewaybillresponse.result.SupplyTypeId);
  379. let SupplyTypename = ewaybillresponse.result.SupplyTypeName;
  380. let supplytype = new Option(SupplyTypename, SupplyTypeid.toString(), true);
  381. $("#" + VisibleContainerId).find(".txtAutoComplete_supplytypeid").append(supplytype).prop("disabled", true);
  382. $("#" + VisibleContainerId).find(".hfAutoCompleteId_supplytypeid").val(ewaybillresponse.result.SupplyTypeId);
  383. let SubSupplyTypeid = Number(ewaybillresponse.result.SubSupplyTypeId);
  384. let SubSupplyTypeName = ewaybillresponse.result.SubSupplyType;
  385. let SubSupplyType = new Option(SubSupplyTypeName, SubSupplyTypeid.toString(), true);
  386. $("#" + VisibleContainerId).find(".ddl_cascading_subsupplytypeid").append(SubSupplyType).prop("disabled", true);
  387. $("#" + VisibleContainerId).find(".hfAutoCompleteId_subsupplytypeid").val(ewaybillresponse.result.SubSupplyTypeId);
  388. let DocTypeid = Number(ewaybillresponse.result.DocTypeId);
  389. let DocTypeName = ewaybillresponse.result.DocTypeName;
  390. let DocType = new Option(DocTypeName, DocTypeid.toString(), true);
  391. $("#" + VisibleContainerId).find(".ddl_cascading_doctypeid").append(DocType).prop("disabled", true);
  392. $("#" + VisibleContainerId).find(".hfAutoCompleteId_doctypeid").val(ewaybillresponse.result.DocTypeId);
  393. $(".hdn_ewaybillid").val(ewaybillresponse.result.EwayBillId);
  394. $(".hdn_ewaybilldate").val(ewaybillresponse.result.ewaybilldate);
  395. $(".hdn_ewaybillno").val(ewaybillresponse.result.ewaybillno);
  396. $(".hdn_validupto").val(ewaybillresponse.result.validupto);
  397. $(".hdn_refid").val(ewaybillresponse.result.validupto);
  398. let Invoiceid = Number(ewaybillresponse.result.RefId);
  399. instance.fileCacheHelper.loadJsFile("apps/transact/managers/invoicemanager.js", function () {
  400. Bizgaze.Apps.Transact.Managers.InvoiceManager.Instance().getInvoiceDetails(Invoiceid).then(function (response) {
  401. if (response.result != null) {
  402. let Invoiceno = response.result.InvoiceNo;
  403. let invoice = new Option(Invoiceno, Invoiceid.toString(), true);
  404. $("#" + VisibleContainerId).find(".txtAutoComplete_invoiceid").append(invoice).prop("disabled", true);
  405. }
  406. });
  407. });
  408. }
  409. });
  410. });
  411. }
  412. });
  413. });
  414. }
  415. getewaybillsavedata(Ewaybillid) {
  416. let instance = this;
  417. let EwayItemList = new Array();
  418. for (let i = 0; i < instance.g_EwaybillItems.length; i++) {
  419. let EwaybillItem = instance.g_EwaybillItems[i];
  420. EwayItemList.push({
  421. ProductName: EwaybillItem.productName,
  422. Ewaybillid: Ewaybillid,
  423. ProductDesc: EwaybillItem.productDesc,
  424. hsnCode: EwaybillItem.hsnCode,
  425. Quantity: EwaybillItem.quantity,
  426. QtyUnit: EwaybillItem.qtyUnit,
  427. cgstRate: EwaybillItem.cgstRate,
  428. igstRate: EwaybillItem.sgstRate,
  429. taxableAmount: EwaybillItem.taxableAmount,
  430. });
  431. }
  432. return EwayItemList;
  433. }
  434. static Instance() {
  435. if (this.instance === undefined) {
  436. this.instance = new irnwithewaybill();
  437. }
  438. return this.instance;
  439. }
  440. }
  441. Components.irnwithewaybill = irnwithewaybill;
  442. })(Components = EWayBill.Components || (EWayBill.Components = {}));
  443. })(EWayBill = Integrations.EWayBill || (Integrations.EWayBill = {}));
  444. })(Integrations = Apps.Integrations || (Apps.Integrations = {}));
  445. })(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
  446. })(Bizgaze || (Bizgaze = {}));