var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var Unibase; (function (Unibase) { let Platform; (function (Platform) { let Series; (function (Series) { let Managers; (function (Managers) { class SeriesManager extends Platform.Core.BaseManager { getseries(appkeyid, installedappid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/apps/seriesautocomplete/appkeyid/' + appkeyid + '/installedappid/' + installedappid; return yield this.dataHelper().getAsync(url).then(function (response) { var result = ""; result = JSON.parse(response.result); return result; }); }); } createSeries(obj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/apps/createseries'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { if (response.result != null) { response.result = JSON.parse(response.result); } return response; }); }); } getSeries(AppKeyId, InstalledAppId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/apps/getserieslist/appKeyid/' + AppKeyId + '/installedappid/' + InstalledAppId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getActiveSeries(appkeyid, installedappId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/apps/getactiveseries/appkeyid/' + appkeyid + '/installedappid/' + installedappId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } changeSeriesStatus(SeriesId, Status) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/apps/changeseriesformatstatus/seriesid/' + SeriesId + '/status/' + Status; return yield this.dataHelper().postAsync(url, null); }); } getSeriesById(seriesid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/apps/getseries/seriesid/' + seriesid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result != null) { response.result = JSON.parse(response.result); } return response; }); }); } updateSeries(obj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/apps/updateseries'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { if (response.result != null) { response.result = JSON.parse(response.result); } return response; }); }); } saveSeriesFormat(obj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/apps/saveseriesformat'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { if (response.result != null) { response.result = JSON.parse(response.result); } return response; }); }); } getSeriesFormats(SeriesId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/apps/getseriesformatlist/seriesid/' + SeriesId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getSeriesFormatBySeriesId(SeriesId, SeriesFormatId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/apps/getseriesformatbyseriesandformatid/seriesid/' + SeriesId + '/seriesformatid/' + SeriesFormatId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result) { response.result = JSON.parse(response.result); } return response; }); }); } getSeriesFormat(SeriesFormatId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/apps/getseriesformat/seriesformatid/' + SeriesFormatId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result) { response.result = JSON.parse(response.result); } return response; }); }); } static Instance() { if (this._instance === undefined) this._instance = new SeriesManager(); return this._instance; } } Managers.SeriesManager = SeriesManager; })(Managers = Series.Managers || (Series.Managers = {})); })(Series = Platform.Series || (Platform.Series = {})); })(Platform = Unibase.Platform || (Unibase.Platform = {})); })(Unibase || (Unibase = {})); var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var Bizgaze; (function (Bizgaze) { let Apps; (function (Apps) { let Transact; (function (Transact) { let Managers; (function (Managers) { class InvoiceManager extends Unibase.Platform.Core.BaseManager { getItemById(itemid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/transact/items/getitem/itemid/' + itemid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getLatestMrpByItemId(itemid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/pricelists/getlatestmrp/itemid/' + itemid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result != "" && response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getMrpById(mrpid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/pricelists/getmrp/mrpid/' + mrpid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getlobsummary() { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/invoices/loboutstandingsummary'; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result != "" && response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } GetMrpandBatchQty(url) { return __awaiter(this, void 0, void 0, function* () { return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getItemDetails(obj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/invoices/getItemDetails'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getItemDetailsList(obj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/invoices/getItemDetailsList/List'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } gettaxpercentages(taxgroupid, branchid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/tax/gettaxpercentages/taxgroupid/' + taxgroupid + '/branchid/' + branchid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getPendingSalesInvoicesByContactId(ContactId, IsOverDue) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/invoices/getpendingsalesinvoicesbycontactid/contactid/' + ContactId + '/isoverdue/' + IsOverDue; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result != "" && response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getCreditNotesByContactId(ContactId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/invoices/getcreditnotesbycontactid/contactid/' + ContactId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result != "" && response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getRecentFiveInvoicesBySpocId(OrgContactId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/invoices/getrecentfiveinvoicesbyspocid/orgcontactid/' + OrgContactId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result != "" && response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getLastFiveClearedInvoices(OrgContactId, OrgId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/invoices/getlastfiveclearedinvoices/orgcontactid/' + OrgContactId + '/orgid/' + OrgId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result != "" && response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getorganization(OrgId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/crm/organization/getorganization/organizationid/' + OrgId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null && response.result != "") response.result = JSON.parse(response.result); return response; }); }); } getorgcontact(orgcontactid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/crm/orgcontacts/getorgcontact/orgcontactid/' + orgcontactid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null && response.result != "") response.result = JSON.parse(response.result); return response; }); }); } getbranche(branchid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/crm/companies/getbranchbybranchid/branchid/' + branchid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getInvoiceDetails(invoiceid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/invoices/getinvoice/invoiceid/' + invoiceid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getInvoiceItems(url) { return __awaiter(this, void 0, void 0, function* () { return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getMrps(itemid, dctypeid, branchid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/pricelist/getmrpslistbyitemid/itemid/' + itemid + '/dctype/' + dctypeid + "/branchid/" + branchid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getBatches(itemid, dctypeid, branchid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/pricelist/getbatchlistbyitemid/itemid/' + itemid + '/dctype/' + dctypeid + "/branchid/" + branchid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getPendingDiscountsForInvoice(dcid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/invoices/getpendingdiscountsforinvoice/dcid/' + dcid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getOrderDcDetails(url) { return __awaiter(this, void 0, void 0, function* () { return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getorderbranchsettings(OrderId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/orders/getordersettings/orderid/' + OrderId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getItemSetting(itemid, branchid, typeid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/items/getitemsetting/itemid/' + itemid + '/branchid/' + branchid + '/type/' + typeid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } GetSampleInvoiceNo(invoiceNo, invidate, seriesid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/invoices/getsampleinvoiceno/invoiceno/' + invoiceNo + "/invoicedate/" + invidate + "/seriesid/" + seriesid; return yield this.dataHelper().getAsync(url).then(function (response) { return response; }); }); } gettemplates(installedappid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/unibase/platform/templates/gettemplatesbyapp/installedappid/' + installedappid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } GetTemplateSetting(installedappid, branchid, lobid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/automationrules/gettemplatesetting/installedappid/' + installedappid + '/branchid/' + branchid + '/lobid/' + lobid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getTempNextNumber(SeriesId, date) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/invoices/getinvoicenextnumber/seriesid/' + SeriesId + '/invoicedate/' + date; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== "" && response.result !== null) { response.result = JSON.parse(response.result); } return response; }); }); } getprintinvoice(invoiceid, isprintpreview, ispos) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/invoices/getprintinvoice/invoiceid/' + invoiceid + '/isprintpreview/' + isprintpreview + '/ispos/' + ispos; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) { response.result = JSON.parse(response.result); } return response; }); }); } updateinvoiceseries(invoiceid, seriesid, invoiceno, templateid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/invoices/updateinvoiceseries/invoiceid/' + invoiceid + '/seriesid/' + seriesid + '/invoiceno/' + invoiceno + '/templateid/' + templateid; return yield this.dataHelper().postAsync(url, null).then(function (response) { if (response.result !== null) { response.result = JSON.parse(response.result); } return response; }); }); } Updateconnecteddc(dcid, invoiceid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/invoices/Updateconnecteddc/dcid/' + dcid + '/invoiceid/' + invoiceid; return yield this.dataHelper().postAsync(url, null).then(function (response) { if (response.result !== null) { response.result = JSON.parse(response.result); } return response; }); }); } UpdateInvoice(InvoiceId, salespersonid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/invoices/updateinvoicesalesperson/invoiceid/' + InvoiceId + '/salespersonid/' + salespersonid; return yield this.dataHelper().postAsync(url, null).then(function (response) { if (response.result !== null) { response.result = JSON.parse(response.result); } return response; }); }); } UpdateInvoiceItemTaxAllocs(obj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/invoices/updateinvoiceitemtaxallocs'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { if (response.result !== null) { response.result = JSON.parse(response.result); } return response; }); }); } getinvoiceitems(invoiceid, itemid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/invoices/getinvoiceitemsbyinvoiceid/invoiceid/' + invoiceid + '/isreturn/false/itemid' + itemid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) { response.result = JSON.parse(response.result); } return response; }); }); } getBatchByBatchId(BatchId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/pricelists/getbatch/batchid/' + BatchId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) { response.result = JSON.parse(response.result); } return response; }); }); } getPlanVolume(ItemId, OrganizationId, InvoiceApplyType) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/offers/getplanvolumebyitem/itemid/' + ItemId + '/organizationid/' + OrganizationId + '/type/' + InvoiceApplyType; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) { response.result = JSON.parse(response.result); } return response; }); }); } getJournalWallets(invoicedate, invoiceid, contactid, invoicetype, lobId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/invoices/getjournalwallets/invoicedate/' + invoicedate + '/invoiceid/' + invoiceid + '/contactid/' + contactid + '/invoicetype/' + invoicetype + '/lobid/' + lobId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null && response.result !== "") { response.result = JSON.parse(response.result); } return response; }); }); } getJournalAllocs(invoiceid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/invoices/getjournalallocs/invoiceid/' + invoiceid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) { response.result = JSON.parse(response.result); } return response; }); }); } getSeries(installedappid, branchid, lobid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/seriessettings/getseriessettings/lobid/' + lobid + '/branchid/' + branchid + '/installedappid/' + installedappid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) { response.result = JSON.parse(response.result); } return response; }); }); } getInvoiceItemDetails(invoiceitemid, taxgroupid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/invoices/getinvoiceitemdetails/invoiceitemid/' + invoiceitemid + '/taxgroupid/' + taxgroupid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) { response.result = JSON.parse(response.result); } return response; }); }); } getCustomerTurnOver(organizationid, excludeinvoiceid, invoicedate, applytype) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/invoices/getcustomerturnover/organizationid/' + organizationid + '/excludeinvoiceid/' + excludeinvoiceid + "/invoicedate/" + invoicedate + "/applytype/" + applytype; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) { response.result = JSON.parse(response.result); } return response; }); }); } getTcsDeclaration(partitionid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/invoices/gettcsdeclarationbypartitionid/partitionid/' + partitionid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null && response.result !== "") { response.result = JSON.parse(response.result); } return response; }); }); } saveTcsDeclaration(obj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/invoices/savetcsdeclaration'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { if (response.result !== null) { response.result = JSON.parse(response.result); } return response; }); }); } GetInvoicePermissions(invoicetypeid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/invoices/getinvoicepermissions/invoicetypeid/' + invoicetypeid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) { response.result = JSON.parse(response.result); } return response; }); }); } GetTenants(tenantid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/invoices/gettenant/tenantid/' + tenantid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) { response.result = JSON.parse(response.result); } return response; }); }); } refreshInvoiceTypes() { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/invoices/refreshinvoicetypes/np'; return yield this.dataHelper().postAsync(url, "{}").then(function (response) { if (response.result !== null) { response.result = JSON.parse(response.result); } return response; }); }); } GetTCSTaxgroupforReturn(invoiceid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/invoices/gettcstaxgroupforreturn/invoiceid/' + invoiceid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) { response.result = JSON.parse(response.result); } return response; }); }); } GetFirstPendingInvoicesBySalesPerson(salespersonid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/invoices/getfirstpendinginvoices/salespersionid/' + salespersonid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) { response.result = JSON.parse(response.result); } return response; }); }); } changeManagers(postdata) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/invoices/changemanagers'; return yield this.dataHelper().postAsync(url, postdata).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } changeManager(obj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/invoices/updatemanagerdetails'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getdcbydcno(dcno) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/dc/getdcbydcno/dcno/' + dcno; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null && response.result !== '') response.result = JSON.parse(response.result); return response; }); }); } getproductsbyLobid(lobid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/items/getproductsbylobid/lobid/' + lobid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getItemsUnitPriceByProductId(productId, contactId, term) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/items/getitemsunitpricebyproductid/productid/' + productId + '/contactid/' + contactId + '/term/' + term; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getpricebyProductId(itemid, lobid, productId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/pricelists/getlatestprices/itemids/' + itemid + '/lobid/' + lobid + '/productid/' + productId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getitemname(searchtext) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/items/getitemsbyterm/term/' + searchtext; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getOffersByItemIdWithPrice(postdata) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/items/getrelatedofferwithprice'; return yield this.dataHelper().postAsync(url, postdata).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getInvoiceByDc(DcId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/invoices/getinvoicebydc/dcid/' + DcId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null && response.result !== "") { response.result = JSON.parse(response.result); } return response; }); }); } loadEbs(url1) { return __awaiter(this, void 0, void 0, function* () { const url = url1; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result != "" && response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getIsEnableSalesPipeline(url) { return __awaiter(this, void 0, void 0, function* () { return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getPendingInvoicesByOrganizationName(OrganizationName) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/invoices/getpendinginvoicesbyorganizationname/organizationname/' + OrganizationName; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result != "" && response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getGSTRReport(gstno) { return __awaiter(this, void 0, void 0, function* () { var fromdate = Unibase.Platform.Helpers.NavigationHelper.commonFilter_FromDate; var todate = Unibase.Platform.Helpers.NavigationHelper.commonFilter_ToDate; var fromdatestring = moment(fromdate, "YYYY/MM/DD").format("YYYY-MM-DD"); var todatestring = moment(todate, "YYYY/MM/DD").format("YYYY-MM-DD"); const url = 'apis/v4/bizgaze/transact/invoices/exportgstr1returndetails/gstno/' + gstno + '/fromdate/' + fromdatestring + '/todate/' + todatestring; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) { response.result = JSON.parse(response.result); } return response; }); }); } refreshTaxclassifications() { return __awaiter(this, void 0, void 0, function* () { var fromdate = Unibase.Platform.Helpers.NavigationHelper.commonFilter_FromDate; var todate = Unibase.Platform.Helpers.NavigationHelper.commonFilter_ToDate; var fromdatestring = moment(fromdate, "YYYY/MM/DD").format("YYYY-MM-DD"); var todatestring = moment(todate, "YYYY/MM/DD").format("YYYY-MM-DD"); const url = 'apis/v4/bizgaze/transact/invoices/refreshtaxclassificaions/fromdate/' + fromdatestring + '/todate/' + todatestring; return yield this.dataHelper().postAsync(url, null).then(function (response) { if (response.result !== null) { response.result = JSON.parse(response.result); } return response; }); }); } RefreshEInvoice(irn) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transactintegrations/einvoice/refresheinvoices/irn/' + irn; return yield this.dataHelper().postAsync(url, null).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getInvoiceByorder(orderid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/invoices/getinvoicesbyorderid/orderid/' + orderid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null && response.result !== "") { response.result = JSON.parse(response.result); } return response; }); }); } getbulkprint(fromdate, todate, salespersonid, organizationid, invoicetype) { return __awaiter(this, void 0, void 0, function* () { debugger; var fromdatestring = moment(fromdate, "YYYY/MM/DD").format("YYYY-MM-DD"); var todatestring = moment(todate, "YYYY/MM/DD").format("YYYY-MM-DD"); const url = 'apis/v4/bizgaze/transact/invoices/getbulkinvoiceprint/organizationid/' + organizationid + '/salespersonid/' + salespersonid + '/fromdate/' + fromdatestring + '/todate/' + todatestring + '/invoicetype/' + invoicetype; return yield this.dataHelper().getAsync(url).then(function (response) { debugger; if (response.result !== null) { response.result = JSON.parse(response.result); } return response; }); }); } static Instance() { if (this._instance === undefined) this._instance = new InvoiceManager(); return this._instance; } } Managers.InvoiceManager = InvoiceManager; })(Managers = Transact.Managers || (Transact.Managers = {})); })(Transact = Apps.Transact || (Apps.Transact = {})); })(Apps = Bizgaze.Apps || (Bizgaze.Apps = {})); })(Bizgaze || (Bizgaze = {}));