123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- var Bizgaze;
- (function (Bizgaze) {
- let Apps;
- (function (Apps) {
- let Transact;
- (function (Transact) {
- let Components;
- (function (Components) {
- let Invoices;
- (function (Invoices) {
- class InvoiceItemDetails extends Unibase.Platform.Core.BaseComponent {
- jsFiles() {
- return ['apps/transact/managers/invoicemanager.js', 'tenants/themes/compact/components/details/details.js', 'platform/core/helpers/numberhelper/numberhelper.js'];
- }
- cssFiles() {
- return [];
- }
- html() {
- let html = '<form id="frm_Bizgazetransact_Invoice_InvoiceItemDetails" method="post" data-validate="parsley"><header class="b-b bg-white modal-header row"><div class="row col-sm-12 ml-5"><strong class="titlename InvoiceItemName"></strong><div class="btn-group ml-auto"><a class="btn btn-sm"><i class="ti-help-alt" title="help" href="" target="_blank"></i></a></div></div></header><div style="overflow-x:hidden; height: 830px;" class="scrollable d"><div class="card"><div class="card-body"><div class="row" style="overflow-x:hidden;border-bottom: 2px solid grey;"><input type="hidden" id="hf_ItemId" /><div class="col-sm-4 min-padding pl-20"><strong class="EnabledType ml-20"> MRP</strong></div> <div class="col-sm-2 text-center min-padding"><strong class="ml-15">Qty</strong></div><div class="col-sm-2 text-center min-padding"><strong>Unit Price</strong></div><div class="col-sm-2 text-center min-padding"><strong>Disc.</strong></div><div class="col-sm-2 text-right min-padding"><strong class="mr-15">Total</strong></div></div><div class=""><div class="div_InvoiceItem_Details item added-row hidden"></div></div></div></div></div><footer class="bg-white modal-footer"><a href="javascript:;" id="btn_InvoiceItemDetails_Close" class="btn btn-light btn-sm mr-auto" onclick=""> Close</a></footer></form>';
- return html;
- }
- load(id, container) {
- $("#btn_InvoiceItemDetails_Close").click(function () {
- InvoiceItemDetails.Instance().navigationHelper.closePopUp();
- });
- }
- InvoiceItemDetails(InvoiceId, ItemId) {
- Bizgaze.Apps.Transact.Managers.InvoiceManager.Instance().getinvoiceitems(InvoiceId, ItemId).then(function (response) {
- if (response.result != null) {
- $(".InvoiceItemName").text(response.result[0].ItemName + " - " + response.result[0].ItemSKU);
- for (var i = 0; i < response.result.length; i++) {
- var row = response.result[i];
- var activeDiscText = "";
- var discValue = 0;
- var activeDiscPercent = "";
- var activeDiscVal = "";
- if (row.DiscountPercent > 0) {
- discValue = row.DiscountPercent;
- activeDiscPercent = "active";
- activeDiscText = "%";
- }
- else {
- discValue = row.DiscountAmount;
- activeDiscVal = "active";
- activeDiscText = "Val";
- }
- var html = '<div class="row div_InvoiceItem_Details">' +
- '<div class="row col-sm-12 ml-5 mt-10">' +
- '<div class="col-sm-4">' +
- '<div class=" min-padding">' +
- '<div class="input-group">' +
- '<input type="text" class="form-control txt_Mrp" value="0" readonly>' +
- '</div></div></div>' +
- '<div class="col-sm-2">' +
- '<div class="floating-label-form-group min-padding">' +
- '<input type="text" class="Quantity text-center form-control" placeholder="0.00" value="' + row.Quantity + '" readonly/>' +
- '</div></div>' +
- '<div class="col-sm-2">' +
- '<div class="floating-label-form-group min-padding">' +
- '<input type="text" class="Price text-center form-control" placeholder="0.00" value="' + row.UnitPrice + '" readonly/>' +
- '</div></div>' +
- '<div class="col-sm-2">' +
- '<div class="floating-label-form-group">' +
- '<div class="input-group">' +
- '<input type="text" id="txt_discount" placeholder="0.00" class="form-control txt_addldiscount text-center d-none d-md-block" value="' + discValue + '" readonly>' +
- '<input type="text" id="txt_discount" placeholder="0.00" class="form-control txt_addldiscount text-center ml-40 d-md-none" value="' + discValue + '" readonly>' +
- '<div class="input-group-btn">' +
- '<select class="btn_item_DiscType mt-10 border-blue" disabled><option value="Val">Val</option><option value="%">%</option></select>' +
- '</div>' +
- '</div></div></div>' +
- '<div class="col-sm-2">' +
- '<p class="pull-right mt-10 mr-10"><strong><span class="TotalPrice">' + Unibase.Core.Helpers.NumberHelper.Instance().roundNumber(row.RowTotal, 2) + '</span></strong></p></div></div></div>';
- $(".div_InvoiceItem_Details:last").after(html);
- let element = $(".div_InvoiceItem_Details:last");
- element.find(".btn_item_DiscType option[value='" + activeDiscText + "']").prop("selected", true);
- if (row.BatchId != 0) {
- Bizgaze.Apps.Transact.Managers.InvoiceManager.Instance().getBatchByBatchId(row.BatchId).then(function (res) {
- if (res.result != null) {
- element.find('.txt_Mrp').val(res.result.Mrp);
- }
- });
- }
- else if (row.MrpId != 0) {
- Bizgaze.Apps.Transact.Managers.InvoiceManager.Instance().getMrpById(row.MrpId).then(function (res) {
- if (res.result != null) {
- element.find('.txt_Mrp').val(res.result.Mrp);
- }
- });
- }
- }
- }
- });
- }
- static Instance() {
- if (this.instance === undefined) {
- this.instance = new Bizgaze.Apps.Transact.Components.Invoices.InvoiceItemDetails();
- }
- return this.instance;
- }
- }
- Invoices.InvoiceItemDetails = InvoiceItemDetails;
- })(Invoices = Components.Invoices || (Components.Invoices = {}));
- })(Components = Transact.Components || (Transact.Components = {}));
- })(Transact = Apps.Transact || (Apps.Transact = {}));
- })(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
- })(Bizgaze || (Bizgaze = {}));
|