This commit is contained in:
2023-03-11 17:30:20 +00:00
commit b6c4e025bc
5124 changed files with 1153349 additions and 0 deletions
@@ -0,0 +1,44 @@
var Bizgaze;
(function (Bizgaze) {
let Apps;
(function (Apps) {
let Integrations;
(function (Integrations) {
let EInvoice;
(function (EInvoice) {
let Components;
(function (Components) {
class EInvoice_Setting extends Unibase.Platform.Core.BaseComponent {
loadSettingHtml() {
return ``;
}
bindControlData(controldatajson) {
return "";
}
SaveControlData(controldatajson) {
return "";
}
loadControlPropertiesHtml(Container) {
return ``;
}
bindPropertySettings(prop) {
var propertySettings = prop.PropertySettings;
return "";
}
savePropertySettings(prop) {
var propertySettings = prop.PropertySettings;
return "";
}
static Instance() {
if (this.instance === undefined) {
this.instance = new EInvoice_Setting();
}
return this.instance;
}
}
Components.EInvoice_Setting = EInvoice_Setting;
})(Components = EInvoice.Components || (EInvoice.Components = {}));
})(EInvoice = Integrations.EInvoice || (Integrations.EInvoice = {}));
})(Integrations = Apps.Integrations || (Apps.Integrations = {}));
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
})(Bizgaze || (Bizgaze = {}));
@@ -0,0 +1 @@
{"version":3,"file":"einvoice.settings.js","sourceRoot":"","sources":["einvoice.settings.ts"],"names":[],"mappings":"AAAA,IAAU,OAAO,CAwChB;AAxCD,WAAU,OAAO;IACb,IAAiB,IAAI,CAsCpB;IAtCD,WAAiB,IAAI;QACjB,IAAiB,YAAY,CAmC5B;QAnCD,WAAiB,YAAY;YACzB,IAAiB,QAAQ,CAiCxB;YAjCD,WAAiB,QAAQ;gBACrB,IAAiB,UAAU,CA+B1B;gBA/BD,WAAiB,UAAU;oBACvB,MAAa,gBAAiB,SAAQ,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa;wBACrE,eAAe;4BACX,OAAO,EAAE,CAAC;wBACd,CAAC;wBACD,eAAe,CAAC,eAAoB;4BAChC,OAAO,EAAE,CAAC;wBACd,CAAC;wBACD,eAAe,CAAC,eAAoB;4BAChC,OAAO,EAAE,CAAC;wBACd,CAAC;wBACD,yBAAyB,CAAC,SAAS;4BAC/B,OAAO,EAAE,CAAC;wBACd,CAAC;wBACD,oBAAoB,CAAC,IAAgB;4BAEjC,IAAI,gBAAgB,GAA6B,IAAI,CAAC,gBAAgB,CAAC;4BACvE,OAAO,EAAE,CAAC;wBACd,CAAC;wBACD,oBAAoB,CAAC,IAAgB;4BACjC,IAAI,gBAAgB,GAA6B,IAAI,CAAC,gBAAgB,CAAC;4BACvE,OAAO,EAAE,CAAC;wBACd,CAAC;wBAED,MAAM,CAAC,QAAQ;4BACX,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE;gCAC7B,IAAI,CAAC,QAAQ,GAAG,IAAI,gBAAgB,EAAE,CAAC;6BAC1C;4BACD,OAAO,IAAI,CAAC,QAAQ,CAAC;wBACzB,CAAC;qBACJ;oBA7BY,2BAAgB,mBA6B5B,CAAA;gBACL,CAAC,EA/BgB,UAAU,GAAV,mBAAU,KAAV,mBAAU,QA+B1B;YACL,CAAC,EAjCgB,QAAQ,GAAR,qBAAQ,KAAR,qBAAQ,QAiCxB;QACL,CAAC,EAnCgB,YAAY,GAAZ,iBAAY,KAAZ,iBAAY,QAmC5B;IAEL,CAAC,EAtCgB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAsCpB;AACL,CAAC,EAxCS,OAAO,KAAP,OAAO,QAwChB"}
@@ -0,0 +1,268 @@
var Bizgaze;
(function (Bizgaze) {
let Apps;
(function (Apps) {
let Integrations;
(function (Integrations) {
let EWayBill;
(function (EWayBill_1) {
let Components;
(function (Components) {
class EWayBill extends Unibase.Platform.Core.BaseComponent {
jsFiles() {
return [];
}
cssFiles() {
return [];
}
html() {
return null;
}
load() {
Bizgaze.Apps.Integrations.EWayBill.Components.EWayBill.Instance().getInvoiceDetails();
$(".txt_vehicleno").keyup(function () {
$(".txt_vehicleno").val($(".txt_vehicleno").val().toString().toUpperCase());
});
$(".txt_topincode,.txt_frompincode").on("click", function () {
Bizgaze.Apps.Integrations.EWayBill.Components.EWayBill.Instance().GetDistanceByPinCode();
});
}
getAddressById(id) {
let AutoComplete_branchid = Number($(".txtAutoComplete_branchid").val());
if (id != 0)
AutoComplete_branchid = id;
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/crm/contacts/managers/contactmanager.js", function () {
Bizgaze.Apps.Crm.Contacts.Managers.ContactManager.Instance().getAddressById(AutoComplete_branchid).then(function (response) {
if (response.result != null) {
$(".txt_frompincode").val(response.result.ZipCode).parent().addClass("floating-label-form-group-with-value");
;
$(".labelSection_FromGSTIN").html("<span>From GSTIN : " + response.result.GSTNO + "</span>");
Bizgaze.Apps.Integrations.EWayBill.Components.EWayBill.Instance().getDistance();
$(".hdn_fromplace").val(response.result.AliasName);
$(".hdn_fromstatecode").val(response.result.StateCode);
if (Number($(".txtAutoComplete_branchid").val()) == 0) {
let supplytype = new Option(response.result.AliasName, AutoComplete_branchid.toString(), true);
$(".txtAutoComplete_branchid").append(supplytype);
$(".hfAutoCompleteId_branchid").val(AutoComplete_branchid);
}
}
});
});
}
getInvoiceDetails() {
var InstalledAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
if (Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_invoiceid") != undefined) {
var invoiceid = Number(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_invoiceid").Value);
if (invoiceid != 0) {
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFiles(["apps/transact/managers/invoicemanager.js"], function () {
Bizgaze.Apps.Transact.Managers.InvoiceManager.Instance().getInvoiceDetails(invoiceid).then(function (response) {
if (response.result != null) {
$(".txt_frompincode").val(response.result.BillFromZipCode).parent().addClass("floating-label-form-group-with-value");
$(".txt_topincode").val(response.result.BillToZipCode).parent().addClass("floating-label-form-group-with-value");
$(".labelSection_ToGSTIN").html("<span>To GSTIN : " + response.result.GSTNo + "</span>");
$(".hdn_refid").val(invoiceid);
$(".hdn_dcid").val(response.result.DcId);
$(".hdn_invoiceid").val(invoiceid);
$(".hdn_refinstalledappid").val(response.result.InstalledAppId);
let supplytype = new Option("Outward", "1", true);
$(".txtAutoComplete_supplytypeid").append(supplytype).val(1).trigger("change");
Bizgaze.Apps.Integrations.EWayBill.Components.EWayBill.Instance().getAddressById(response.result.BillFromAddressId);
}
});
});
}
}
else {
if (Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_dcid") != undefined) {
var dcid = Number(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_dcid").Value);
if (dcid != 0) {
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFiles(["apps/transact/managers/inventory/dcmanager.js"], function () {
Bizgaze.Apps.Transact.Managers.DCManager.Instance().getdc(dcid).then(function (response) {
if (response.result != null) {
$(".txt_frompincode").val(response.result.ShipFromZipCode).addClass("floating-label-form-group-with-value");
;
$(".txt_topincode").val(response.result.ShipToZipCode).addClass("floating-label-form-group-with-value");
;
$(".labelSection_ToGSTIN").html("<span>To GSTIN : " + response.result.GSTInNo + "</span>");
$(".hdn_isdc").val("true");
$(".hdn_refid").val(dcid);
$(".hdn_invoiceid").val(response.result.InvoiceId);
$(".hdn_dcid").val(dcid);
$(".hdn_refinstalledappid").val(response.result.DcInstallAppId);
let supplytype = new Option("Inward", "2", true);
$(".txtAutoComplete_supplytypeid").append(supplytype).val(2).trigger("change");
;
Bizgaze.Apps.Integrations.EWayBill.Components.EWayBill.Instance().getAddressById(0);
}
});
});
}
}
}
}
getDistance() {
var fromplace = Number($('.txt_frompincode').val());
var apikey = 'AIzaSyBGmahAAg3EVzAUJvttDZsjdZiJenJxGt8';
if (apikey == undefined) {
}
var toplace = Number($('.txt_topincode').val());
if (toplace == 0) {
$('.number_approxdistance').val(0);
}
else {
$.ajax({
url: "https://maps.googleapis.com/maps/api/geocode/json?address=" + fromplace + "%20%22&key=" + apikey + "&sensor=false",
method: "POST",
success: function (data) {
let latitude, longitude, flatitude, flongitude;
if (data.results.length > 0) {
flatitude = data.results[0].geometry.location.lat;
flongitude = data.results[0].geometry.location.lng;
$.ajax({
url: "https://maps.googleapis.com/maps/api/geocode/json?address=" + toplace + "%20%22&key=" + apikey + "&sensor=false",
method: "POST",
success: function (_data) {
latitude = _data.results[0].geometry.location.lat;
longitude = _data.results[0].geometry.location.lng;
var dd = getDistanceFromLatLonInKm(flatitude, flongitude, latitude, longitude);
$('.number_approxdistance').val(Math.round(dd));
}
});
}
}
});
function getDistanceFromLatLonInKm(lat1, lon1, lat2, lon2) {
var R = 6371;
var dLat = deg2rad(lat2 - lat1);
var dLon = deg2rad(lon2 - lon1);
var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +
Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) *
Math.sin(dLon / 2) * Math.sin(dLon / 2);
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
var d = R * c;
return d;
}
function deg2rad(deg) {
return deg * (Math.PI / 180);
}
}
}
ShowPrintButton() {
debugger;
let instance = this;
let InstalledAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
let EWaybillId = Number(Unibase.Themes.Providers.DetailHelper.recordId);
let detailContainer = "#" + Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length - 1];
$(detailContainer).find(".DetailSetting_" + InstalledAppId + "_Print").removeClass("btn-undefined").addClass("btn-warning");
$(".btn-undefined").addClass("btn-success").removeClass("btn-undefined");
instance.fileCacheHelper.loadJsFile("apps/transact/managers/ewaybill/ewaybillmanager.js", function (response) {
Bizgaze.Apps.Transact.Managers.EWayBillManager.Instance().getEwayBill(EWaybillId).then(function (ewaybillresponse) {
if (ewaybillresponse.result.Notes != null && ewaybillresponse.result.Notes != undefined && ewaybillresponse.result.Notes != "") {
$(detailContainer).find(".li_DetailSetting_" + InstalledAppId + "_ApprovalError").remove();
$(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>`);
$(detailContainer).find('#div_App_DefaultWidgetSettings').addClass('pb-0');
}
});
});
instance.Print();
}
Print() {
let instance = this;
let detailContainer = "#" + Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length - 1];
if ($(".printsetting").length != 0) {
let printhtml = $(".printsetting")[0].outerHTML;
$(".printsetting").remove();
$(detailContainer).find("#div_App_DefaultWidgetSettings").find(".row").append(printhtml);
$(".printsetting").find(".pull-right").removeClass("pull-right");
}
$('.DetailSetting_' + Unibase.Themes.Providers.DetailHelper.installedAppId + '_Print').html('<span><i class=\"fa fa-print\"></i></span>');
$(detailContainer).find('.DetailSetting_' + Unibase.Themes.Providers.DetailHelper.installedAppId + '_Print').click(function () {
let EwaybillId = Unibase.Themes.Providers.DetailHelper.recordId;
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFiles(["apps/transact/managers/ewaybill/ewaybillmanager.js", "platform/core/helpers/printhelper/printhelper.js"], function () {
Bizgaze.Apps.Transact.Managers.EWayBillManager.Instance().getPrintEWayBill(EwaybillId).then(function (response) {
Unibase.Platform.Helpers.PrintHelper.Instance().printPopup(response.result.PrintHTML);
});
});
});
}
GetDistanceByPinCode() {
let instance = this;
var FromPinCode = $(".txt_frompincode").val().toString();
var ToPinCode = $(".txt_topincode").val().toString();
if (FromPinCode.length == 6 && ToPinCode.length == 6) {
instance.getDistance();
}
}
ShoworHideEWayBillButton() {
let instance = this;
let InstalledAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
let detailContainer = "#" + Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length - 1];
let RefStatusId = Number(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_refstatusid").Value);
if (RefStatusId == 1 || RefStatusId == 2 || RefStatusId == 6) {
$(detailContainer).find('.li_DetailSetting_' + InstalledAppId + '_E-WayBill').addClass('hidden');
}
else {
$('.DetailSetting_' + Unibase.Themes.Providers.DetailHelper.installedAppId + '_E-WayBill').addClass('hidden');
let ewaybillid = Number(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_ewaybillid") == undefined ? 0 : Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_ewaybillid").Value);
if (ewaybillid == 0)
$('.DetailSetting_' + Unibase.Themes.Providers.DetailHelper.installedAppId + '_E-WayBill').removeClass('hidden');
}
}
getdcdetails() {
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFiles(["apps/transact/managers/inventory/dcmanager.js"], function () {
Bizgaze.Apps.Transact.Managers.DCManager.Instance().getdc($(".txtAutoComplete_dcid").val()).then(function (response) {
if (response.result != null) {
$(".hfAutoCompleteId_invoiceid").val(response.result.InvoiceId);
$(".hdn_refid").val($(".txtAutoComplete_dcid").val());
}
});
});
}
GetInvoice() {
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFiles(["apps/transact/managers/invoicemanager.js"], function () {
Bizgaze.Apps.Transact.Managers.InvoiceManager.Instance().getInvoiceDetails($(".txtAutoComplete_invoiceid").val()).then(function (response) {
if (response.result != null) {
$(".hfAutoCompleteId_dcid").val(response.result.DcId);
$(".hdn_refid").val($(".txtAutoComplete_invoiceid").val());
}
});
});
}
checkstatus() {
var installedAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
var einvoiceid = String(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + installedAppId + "_ewaybillid").Value);
var statusid = Number(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + installedAppId + "_statusid").Value);
if (statusid != undefined) {
if (statusid == 2) {
$(".DetailSetting_" + installedAppId + "_Cancele-WayBill").addClass("hidden");
$(".DetailSetting_" + installedAppId + "_UpdateVehicleNo").addClass("hidden");
$(".DetailSetting_" + installedAppId + "_e-waybill").addClass("hidden");
}
else {
$(".DetailSetting_" + installedAppId + "_Cancele-WayBill").removeClass("hidden");
$(".DetailSetting_" + installedAppId + "_UpdateVehicleNo").removeClass("hidden");
$(".DetailSetting_" + installedAppId + "_e-waybill").removeClass("hidden");
}
}
}
checkewaybillstatus() {
var installedAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
var ewaybillno = String(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + installedAppId + "_ewaybillno").Value);
if (ewaybillno == " " || ewaybillno == "") {
$(".DetailSetting_" + installedAppId + "_e-waybill").removeClass("hidden");
}
$(".DetailSetting_" + installedAppId + "_e-waybill").addClass("hidden");
}
static Instance() {
if (this.instance === undefined) {
this.instance = new EWayBill();
}
return this.instance;
}
}
Components.EWayBill = EWayBill;
})(Components = EWayBill_1.Components || (EWayBill_1.Components = {}));
})(EWayBill = Integrations.EWayBill || (Integrations.EWayBill = {}));
})(Integrations = Apps.Integrations || (Apps.Integrations = {}));
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
})(Bizgaze || (Bizgaze = {}));
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,446 @@
var Bizgaze;
(function (Bizgaze) {
let Apps;
(function (Apps) {
let Integrations;
(function (Integrations) {
let EWayBill;
(function (EWayBill) {
let Components;
(function (Components) {
class irnwithewaybill extends Unibase.Platform.Core.BaseComponent {
constructor() {
super(...arguments);
this.g_VisibleContainerId = 0;
this.g_EwaybillItems = [];
}
jsFiles() {
return ["apps/transact/managers/invoicemanager.js", "apps/transact/managers/inventory/dcmanager.js"];
}
cssFiles() {
return [];
}
html() {
return null;
}
loadControl(containerid, prop) {
var html = `<div class="card">
<div class="table-wrap card simple-scroll-bar bg-white-s bg-white-removed templateviewer-body" style = "height:100% !important" >
<div class="table-responsive tableFixHead dropdown-menu-scrollbar" >
<table class="table table-hover table-bordered mb-0 tblgetewaybilldata" id = "tblgetewaybillitems" >
<thead>
<tr>
<th>ProductName</th>
<th>ProductDesc</th>
<th>Quantity</th>
<th>HSNCode</th>
<th>QtyUnit</th>
<th>CgstRate</th>
<th>SgstRate</th>
<th>TaxableAmount</th>
</tr>
</thead>
<tbody id = "tblgetewaybilliitems" >
</tbody>
</table>
</div>
<div>
</div>`;
$("#" + containerid).html(html);
}
loadControlSettings(controlsettingjson, formpropertyid) {
return null;
}
loadPropertySettings(propertysettings, formpropertyid) {
return null;
}
bindEditFormDetails(formpropertyid, propval, DocPropertyName) {
var ewaybillid = Number(propval);
var instance = this;
}
load() {
Bizgaze.Apps.Integrations.EWayBill.Components.irnwithewaybill.Instance().getInvoiceDetails();
$(".txt_vehicleno").keyup(function () {
$(".txt_vehicleno").val($(".txt_vehicleno").val().toString().toUpperCase());
});
$(".txt_topincode,.txt_frompincode").on("click", function () {
Bizgaze.Apps.Integrations.EWayBill.Components.irnwithewaybill.Instance().GetDistanceByPinCode();
});
}
getAddressById() {
let AutoComplete_branchid = Number($(".txtAutoComplete_branchid").val());
Bizgaze.Apps.Crm.Contacts.Managers.ContactManager.Instance().getAddressById(AutoComplete_branchid).then(function (response) {
if (response.result != null) {
$(".txt_frompincode").val(response.result.ZipCode);
$(".labelSection_FromGSTIN").html("<span>From GSTIN : " + response.result.GSTNO + "</span>");
Bizgaze.Apps.Integrations.EWayBill.Components.irnwithewaybill.Instance().getDistance();
}
});
}
getdcewaydetails() {
let VisibleContainerId = Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length - 1];
let dcid = Number($(".txtAutoComplete_dcid").val());
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/transact/managers/inventory/dcmanager.js", function () {
Bizgaze.Apps.Transact.Managers.DCManager.Instance().getdc(dcid).then(function (response) {
if (response.result != null) {
$(".txt_frompincode").val(response.result.ShipFromZipCode);
$(".txt_topincode").val(response.result.ShipToZipCode);
let branchid = Number(response.result.BranchId);
$(".labelSection_ToGSTIN").html("<span>To GSTIN : " + response.result.GSTInNo + "</span>");
$(".labelSection_FromGSTIN").html("<span>From GSTIN : " + response.result.GSTInNo + "</span>");
$(".hfAutoCompleteId_invoiceid").val(response.result.InvoiceId);
$(".hdn_refid").val($(".txtAutoComplete_dcid").val());
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/crm/companies/managers/companymanager.js", function () {
Bizgaze.Apps.CRM.Companies.Managers.CompanyManager.Instance().getBranch(branchid).then(function (response) {
if (response.result != null) {
let BranchName = response.result.BranchName;
let branch = new Option(BranchName, branchid.toString(), true);
$("#" + VisibleContainerId).find(".txtAutoComplete_branchid").append(branch).val(branchid).trigger("change");
}
});
});
Bizgaze.Apps.Integrations.EWayBill.Components.irnwithewaybill.Instance().getDistance();
}
});
});
}
getdc() {
var InstalledAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
var recordid = Number(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_recordid").Value);
var dcid = Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_dcid").Value;
Bizgaze.Apps.Transact.Managers.DCManager.Instance().getdc(dcid).then(function (response) {
if (response.result != null) {
$(".txt_frompincode").val(response.result.BillFromZipCode);
$(".txt_topincode").val(response.result.BillToZipCode);
$(".labelSection_ToGSTIN").html("<span>To GSTIN : " + response.result.GSTNo + "</span>");
}
});
}
getinvoiceewaydetails() {
let VisibleContainerId = Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length - 1];
let Autocomplete_invoiceid = Number($(".txtAutoComplete_invoiceid").val());
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/transact/managers/invoicemanager.js", function () {
Bizgaze.Apps.Transact.Managers.InvoiceManager.Instance().getInvoiceDetails(Autocomplete_invoiceid).then(function (response) {
if (response.result != null) {
$(".txt_frompincode").val(response.result.BillFromZipCode);
$(".txt_topincode").val(response.result.BillToZipCode);
let branchid = Number(response.result.BranchId);
$(".labelSection_ToGSTIN").html("<span>To GSTIN : " + response.result.GSTNo + "</span>");
$(".labelSection_FromGSTIN").html("<span>From GSTIN : " + response.result.GSTNo + "</span>");
$(".hfAutoCompleteId_dcid").val(response.result.DcId);
$(".hdn_refid").val($(".txtAutoComplete_invoiceid").val());
Bizgaze.Apps.Integrations.EWayBill.Components.irnwithewaybill.Instance().getDistance();
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/crm/companies/managers/companymanager.js", function () {
Bizgaze.Apps.CRM.Companies.Managers.CompanyManager.Instance().getBranch(branchid).then(function (response) {
if (response.result != null) {
let BranchName = response.result.BranchName;
let branch = new Option(BranchName, branchid.toString(), true);
$("#" + VisibleContainerId).find(".txtAutoComplete_branchid").append(branch).val(branchid).trigger("change");
}
});
});
}
});
});
}
getInvoiceDetails() {
var InstalledAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
var recordid = Number(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_recordid").Value);
var invoiceid = Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_invoiceid").Value;
Bizgaze.Apps.Transact.Managers.InvoiceManager.Instance().getInvoiceDetails(invoiceid).then(function (response) {
if (response.result != null) {
$(".txt_frompincode").val(response.result.BillFromZipCode);
$(".txt_topincode").val(response.result.BillToZipCode);
$(".labelSection_ToGSTIN").html("<span>To GSTIN : " + response.result.GSTNo + "</span>");
}
});
}
getDistance() {
var fromplace = Number($('.txt_frompincode').val());
var apikey = 'AIzaSyBGmahAAg3EVzAUJvttDZsjdZiJenJxGt8';
if (apikey == undefined) {
}
var toplace = Number($('.txt_topincode').val());
if (toplace == 0) {
$('.number_approxdistance').val(0);
}
else {
$.ajax({
url: "https://maps.googleapis.com/maps/api/geocode/json?address=" + fromplace + "%20%22&key=" + apikey + "&sensor=false",
method: "POST",
success: function (data) {
let latitude, longitude, flatitude, flongitude;
flatitude = data.results[0].geometry.location.lat;
flongitude = data.results[0].geometry.location.lng;
$.ajax({
url: "https://maps.googleapis.com/maps/api/geocode/json?address=" + toplace + "%20%22&key=" + apikey + "&sensor=false",
method: "POST",
success: function (_data) {
latitude = _data.results[0].geometry.location.lat;
longitude = _data.results[0].geometry.location.lng;
var dd = getDistanceFromLatLonInKm(flatitude, flongitude, latitude, longitude);
$('.number_approxdistance').val(Math.round(dd));
}
});
}
});
function getDistanceFromLatLonInKm(lat1, lon1, lat2, lon2) {
var R = 6371;
var dLat = deg2rad(lat2 - lat1);
var dLon = deg2rad(lon2 - lon1);
var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +
Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) *
Math.sin(dLon / 2) * Math.sin(dLon / 2);
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
var d = R * c;
return d;
}
function deg2rad(deg) {
return deg * (Math.PI / 180);
}
}
}
Checkout() {
let instance = this;
$(".modal-body").scrollTop(0);
let cont_id = $("._bizgaze_popup_container:visible").attr("id");
$("#" + cont_id).find("#btnDynamicSave").css("cursor", "pointer");
$(".modal-body").scrollTop(0);
$(".btn_Save_Form, .section_Default,.section_Part-B").removeClass("hidden");
$("#btn_CloseForm_" + $("#hf_FormId").val()).removeClass('hidden');
$(".CheckOutButton,.btn_back ").addClass('hidden');
}
backtoDetails() {
$(".btn_Save_Form, .section_Default").removeClass('hidden');
$(".section_Part-B,.CheckOutButton,.btn_back").addClass('hidden');
$("#btn_CloseForm_" + $("#hf_FormId").val()).removeClass('hidden');
}
ShowPrintButton() {
let instance = this;
let InstalledAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
let EWaybillId = Number(Unibase.Themes.Providers.DetailHelper.recordId);
let detailContainer = "#" + Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length - 1];
$(detailContainer).find(".DetailSetting_" + InstalledAppId + "_Print").removeClass("btn-undefined").addClass("btn-warning");
$(".btn-undefined").addClass("btn-success").removeClass("btn-undefined");
instance.fileCacheHelper.loadJsFile("apps/transact/managers/ewaybill/ewaybillmanager.js", function (response) {
Bizgaze.Apps.Transact.Managers.EWayBillManager.Instance().getEwayBill(EWaybillId).then(function (ewaybillresponse) {
if (ewaybillresponse.result.Notes != null && ewaybillresponse.result.Notes != undefined && ewaybillresponse.result.Notes != "") {
$(detailContainer).find(".li_DetailSetting_" + InstalledAppId + "_ApprovalError").remove();
$(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>`);
$(detailContainer).find('#div_App_DefaultWidgetSettings').addClass('pb-0');
}
});
});
instance.Print();
}
Print() {
let instance = this;
let detailContainer = "#" + Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length - 1];
if ($(".printsetting").length != 0) {
let printhtml = $(".printsetting")[0].outerHTML;
$(".printsetting").remove();
$(detailContainer).find("#div_App_DefaultWidgetSettings").find(".row").append(printhtml);
$(".printsetting").find(".pull-right").removeClass("pull-right");
}
$('.DetailSetting_' + Unibase.Themes.Providers.DetailHelper.installedAppId + '_Print').html('<span><i class=\"fa fa-print\"></i></span>');
$(detailContainer).find('.DetailSetting_' + Unibase.Themes.Providers.DetailHelper.installedAppId + '_Print').click(function () {
let EwaybillId = Unibase.Themes.Providers.DetailHelper.recordId;
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFiles(["apps/transact/managers/ewaybill/ewaybillmanager.js", "platform/core/helpers/printhelper/printhelper.js"], function () {
Bizgaze.Apps.Transact.Managers.EWayBillManager.Instance().getPrintEWayBill(EwaybillId).then(function (response) {
Unibase.Platform.Helpers.PrintHelper.Instance().printPopup(response.result.PrintHTML);
});
});
});
}
GetDistanceByPinCode() {
let instance = this;
var FromPinCode = $(".txt_frompincode").val().toString();
var ToPinCode = $(".txt_topincode").val().toString();
if (FromPinCode.length == 6 && ToPinCode.length == 6) {
instance.getDistance();
}
}
ShoworHideEWayBillButton() {
let instance = this;
let InstalledAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
let detailContainer = "#" + Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length - 1];
let RefStatusId = Number(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_refstatusid").Value);
if (RefStatusId == 1 || RefStatusId == 2 || RefStatusId == 6) {
$(detailContainer).find('.li_DetailSetting_' + InstalledAppId + '_E-WayBill').addClass('hidden');
}
else {
$(detailContainer).find('.li_DetailSetting_' + InstalledAppId + '_E-WayBill').removeClass('hidden');
}
}
getEwayForm(Pk_Value) {
let instance = Bizgaze.Apps.Integrations.EWayBill.Components.irnwithewaybill.Instance();
instance.fileCacheHelper.loadJsFiles(['platform/forms/managers/formmanager.js', 'platform/apps/managers/appmanager.js'], function () {
var FormUniqueId = 'Bizgaze_Extension_Transact_E-WayBill_App_E-WayBill_OrderDetails__CreateForm';
Unibase.Platform.Forms.Managers.FormManager.Instance().getFormbyUniqueId(FormUniqueId).then(function (response) {
var onLoadCallBack = {
CallBack: function () {
instance.bindewaydata(Pk_Value);
},
Parameters: null,
};
var formviewerObj = {
FormId: response.result.FormId,
AppConfigurationId: 0,
Pk_Value: 0,
PortletWidgetId: 0,
OnSuccess: null,
OnFail: null,
OnLoad: onLoadCallBack,
};
Unibase.Platform.Forms.Components.FormViewer.Instance().init(formviewerObj);
instance.navigationHelper.hideLoading();
});
});
}
bindewaydata(Pk_Value) {
let instance = Bizgaze.Apps.Integrations.EWayBill.Components.irnwithewaybill.Instance();
let VisibleContainerId = Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length - 1];
let _ewaybillid = Pk_Value;
instance.fileCacheHelper.loadJsFiles(["apps/transact/managers/ewaybill/ewaybillmanager.js"], function () {
Bizgaze.Apps.Transact.Managers.EWayBillManager.Instance().getewaybillpayload(_ewaybillid).then(function (res) {
if (res.result != null) {
$('input[type=text]').parent().addClass("floating-label-form-group-with-value");
$(".txt_cessvalue").val(res.result.cessValue);
$(".txt_cessvalue").attr("readonly", "readonly");
$(".txt_cgstvalue").val(res.result.cgstValue);
$(".txt_cgstvalue").attr("readonly", "readonly");
$(".txt_transporterdocno").val(res.result.docNo);
$(".txt_transporterdocno").attr("readonly", "readonly");
$(".txt_dispatchfromgstin").val(res.result.fromGstin);
$(".txt_dispatchfromgstin").attr("readonly", "readonly");
$(".txt_fromaddr1").val(res.result.fromAddr1);
$(".txt_fromaddr1").attr("readonly", "readonly");
$(".txt_fromaddr2").val(res.result.fromAddr2);
$(".txt_fromaddr2").attr("readonly", "readonly");
$(".txt_frompincode").val(res.result.fromPincode);
$(".txt_frompincode").attr("readonly", "readonly");
$(".txt_fromplace").val(res.result.fromPlace);
$(".txt_fromplace").attr("readonly", "readonly");
$(".txt_fromstatecode").val(res.result.fromStateCode);
$(".txt_fromstatecode").attr("readonly", "readonly");
$(".txt_dispatchfromgstin").val(res.result.dispatchFromGSTIN);
$(".txt_dispatchfromgstin").attr("readonly", "readonly");
$(".txt_dispatchfromtradename").val(res.result.dispatchFromTradeName);
$(".txt_dispatchfromtradename").attr("readonly", "readonly");
$(".txt_igstvalue").val(res.result.igstValue);
$(".txt_igstvalue").attr("readonly", "readonly");
$(".txt_sgstvalue").val(res.result.sgstValue);
$(".txt_sgstvalue").attr("readonly", "readonly");
$(".txt_shiptogstin").val(res.result.shipToGSTIN);
$(".txt_shiptogstin").attr("readonly", "readonly");
$(".txt_shiptotradename").val(res.result.shipToTradeName);
$(".txt_transportername").attr("readonly", "readonly");
$(".txt_toaddr1").val(res.result.toAddr1);
$(".txt_toaddr1").attr("readonly", "readonly");
$(".txt_toaddr2").val(res.result.toAddr2);
$(".txt_toaddr2").attr("readonly", "readonly");
$(".txt_toplace").val(res.result.toPlace);
$(".txt_toplace").attr("readonly", "readonly");
$(".txt_tostatecode").val(res.result.toStateCode);
$(".txt_tostatecode").attr("readonly", "readonly");
$(".txt_toplace").attr("readonly", "readonly");
$(".txt_topincode").val(res.result.toPincode);
$(".txt_topincode").attr("readonly", "readonly");
$(".txt_vehicleno").val(res.result.vehicleNo);
$(".dropdown_vehicletype").val(res.result.vehicleType).prop("disabled", true);
$(".dropdown_transmode").val(res.result.transMode).prop("disabled", true);
$(".date_transporterdocdate").val(res.result.transDocDate).prop("disabled", true);
$(".txt_vehicleno").attr("readonly", "readonly");
$(".txt_totalvalue").val(res.result.totalValue);
$(".txt_totalvalue").attr("readonly", "readonly");
$(".txt_totinvvalue").val(res.result.totInvValue);
$(".number_approxdistance").val(res.result.transDistance);
$(".txt_totinvvalue").attr("readonly", "readonly");
var dt = res.result;
var itemlists = dt.itemList;
for (var i = 0; i < itemlists.length; i++) {
var data = itemlists[i];
var html = '<tr class="GetewaybillitemsDetails-list-items">' +
'<td>' + data.productName + ' </td>' +
'<td>' + data.productDesc + ' </td>' +
'<td>' + data.quantity + ' </td>' +
'<td>' + data.hsnCode + ' </td>' +
'<td>' + data.qtyUnit + ' </td>' +
'<td>' + data.cgstRate + ' </td>' +
'<td>' + data.sgstRate + ' </td>' +
'<td>' + data.taxableAmount + ' </td>' +
'</tr>';
$("#tblgetewaybilliitems").append(html);
}
instance.fileCacheHelper.loadJsFile("apps/transact/managers/ewaybill/ewaybillmanager.js", function () {
Bizgaze.Apps.Transact.Managers.EWayBillManager.Instance().getEwayBill(_ewaybillid).then(function (ewaybillresponse) {
if (ewaybillresponse.result != null) {
let SupplyTypeid = Number(ewaybillresponse.result.SupplyTypeId);
let SupplyTypename = ewaybillresponse.result.SupplyTypeName;
let supplytype = new Option(SupplyTypename, SupplyTypeid.toString(), true);
$("#" + VisibleContainerId).find(".txtAutoComplete_supplytypeid").append(supplytype).prop("disabled", true);
$("#" + VisibleContainerId).find(".hfAutoCompleteId_supplytypeid").val(ewaybillresponse.result.SupplyTypeId);
let SubSupplyTypeid = Number(ewaybillresponse.result.SubSupplyTypeId);
let SubSupplyTypeName = ewaybillresponse.result.SubSupplyType;
let SubSupplyType = new Option(SubSupplyTypeName, SubSupplyTypeid.toString(), true);
$("#" + VisibleContainerId).find(".ddl_cascading_subsupplytypeid").append(SubSupplyType).prop("disabled", true);
$("#" + VisibleContainerId).find(".hfAutoCompleteId_subsupplytypeid").val(ewaybillresponse.result.SubSupplyTypeId);
let DocTypeid = Number(ewaybillresponse.result.DocTypeId);
let DocTypeName = ewaybillresponse.result.DocTypeName;
let DocType = new Option(DocTypeName, DocTypeid.toString(), true);
$("#" + VisibleContainerId).find(".ddl_cascading_doctypeid").append(DocType).prop("disabled", true);
$("#" + VisibleContainerId).find(".hfAutoCompleteId_doctypeid").val(ewaybillresponse.result.DocTypeId);
$(".hdn_ewaybillid").val(ewaybillresponse.result.EwayBillId);
$(".hdn_ewaybilldate").val(ewaybillresponse.result.ewaybilldate);
$(".hdn_ewaybillno").val(ewaybillresponse.result.ewaybillno);
$(".hdn_validupto").val(ewaybillresponse.result.validupto);
$(".hdn_refid").val(ewaybillresponse.result.validupto);
let Invoiceid = Number(ewaybillresponse.result.RefId);
instance.fileCacheHelper.loadJsFile("apps/transact/managers/invoicemanager.js", function () {
Bizgaze.Apps.Transact.Managers.InvoiceManager.Instance().getInvoiceDetails(Invoiceid).then(function (response) {
if (response.result != null) {
let Invoiceno = response.result.InvoiceNo;
let invoice = new Option(Invoiceno, Invoiceid.toString(), true);
$("#" + VisibleContainerId).find(".txtAutoComplete_invoiceid").append(invoice).prop("disabled", true);
}
});
});
}
});
});
}
});
});
}
getewaybillsavedata(Ewaybillid) {
let instance = this;
let EwayItemList = new Array();
for (let i = 0; i < instance.g_EwaybillItems.length; i++) {
let EwaybillItem = instance.g_EwaybillItems[i];
EwayItemList.push({
ProductName: EwaybillItem.productName,
Ewaybillid: Ewaybillid,
ProductDesc: EwaybillItem.productDesc,
hsnCode: EwaybillItem.hsnCode,
Quantity: EwaybillItem.quantity,
QtyUnit: EwaybillItem.qtyUnit,
cgstRate: EwaybillItem.cgstRate,
igstRate: EwaybillItem.sgstRate,
taxableAmount: EwaybillItem.taxableAmount,
});
}
return EwayItemList;
}
static Instance() {
if (this.instance === undefined) {
this.instance = new irnwithewaybill();
}
return this.instance;
}
}
Components.irnwithewaybill = irnwithewaybill;
})(Components = EWayBill.Components || (EWayBill.Components = {}));
})(EWayBill = Integrations.EWayBill || (Integrations.EWayBill = {}));
})(Integrations = Apps.Integrations || (Apps.Integrations = {}));
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
})(Bizgaze || (Bizgaze = {}));
File diff suppressed because one or more lines are too long
@@ -0,0 +1,43 @@
var Bizgaze;
(function (Bizgaze) {
let Apps;
(function (Apps) {
let Integrations;
(function (Integrations) {
let EWayBill;
(function (EWayBill) {
let Components;
(function (Components) {
class irnwithewaybillsettings {
loadControlPropertiesHtml(controlpropList, container) {
return ``;
}
bindPropertySettings(prop) {
var propertySettings = prop.PropertySettings;
return "";
}
savePropertySettings(prop) {
var propertySettings = prop.PropertySettings;
return "";
}
loadSettingHtml() {
return null;
}
bindControlData(controldatajson) {
return null;
}
SaveControlData(controldatajson) {
return controldatajson;
}
static Instance() {
if (this._instance === undefined)
this._instance = new irnwithewaybillsettings();
return this._instance;
}
}
Components.irnwithewaybillsettings = irnwithewaybillsettings;
})(Components = EWayBill.Components || (EWayBill.Components = {}));
})(EWayBill = Integrations.EWayBill || (Integrations.EWayBill = {}));
})(Integrations = Apps.Integrations || (Apps.Integrations = {}));
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
})(Bizgaze || (Bizgaze = {}));
@@ -0,0 +1 @@
{"version":3,"file":"irnwithewaybillsettings.js","sourceRoot":"","sources":["irnwithewaybillsettings.ts"],"names":[],"mappings":"AAAA,IAAU,OAAO,CAyChB;AAzCD,WAAU,OAAO;IACb,IAAiB,IAAI,CAuCpB;IAvCD,WAAiB,IAAI;QACjB,IAAiB,YAAY,CAqC5B;QArCD,WAAiB,YAAY;YACzB,IAAiB,QAAQ,CAmCxB;YAnCD,WAAiB,QAAQ;gBACrB,IAAiB,UAAU,CAiC1B;gBAjCD,WAAiB,UAAU;oBAEvB,MAAa,uBAAuB;wBAChC,yBAAyB,CAAC,eAAsC,EAAE,SAAS;4BACvE,OAAO,EAAE,CAAC;wBACd,CAAC;wBACD,oBAAoB,CAAC,IAAgB;4BACjC,IAAI,gBAAgB,GAA6B,IAAI,CAAC,gBAAgB,CAAC;4BACvE,OAAO,EAAE,CAAC;wBACd,CAAC;wBACD,oBAAoB,CAAC,IAAgB;4BACjC,IAAI,gBAAgB,GAA6B,IAAI,CAAC,gBAAgB,CAAC;4BACvE,OAAO,EAAE,CAAC;wBACd,CAAC;wBACD,eAAe;4BACX,OAAO,IAAI,CAAC;wBAChB,CAAC;wBACD,eAAe,CAAC,eAAoB;4BAChC,OAAO,IAAI,CAAC;wBAChB,CAAC;wBACD,eAAe,CAAC,eAAoB;4BAChC,OAAO,eAAe,CAAC;wBAC3B,CAAC;wBAID,MAAM,CAAC,QAAQ;4BACX,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS;gCAC5B,IAAI,CAAC,SAAS,GAAG,IAAI,uBAAuB,EAAE,CAAC;4BACnD,OAAO,IAAI,CAAC,SAAS,CAAC;wBAC1B,CAAC;qBACJ;oBA7BY,kCAAuB,0BA6BnC,CAAA;gBAEL,CAAC,EAjCgB,UAAU,GAAV,mBAAU,KAAV,mBAAU,QAiC1B;YACL,CAAC,EAnCgB,QAAQ,GAAR,qBAAQ,KAAR,qBAAQ,QAmCxB;QACL,CAAC,EArCgB,YAAY,GAAZ,iBAAY,KAAZ,iBAAY,QAqC5B;IACL,CAAC,EAvCgB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAuCpB;AACL,CAAC,EAzCS,OAAO,KAAP,OAAO,QAyChB"}