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.

invoiceitemdetails.js 8.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. var Bizgaze;
  2. (function (Bizgaze) {
  3. let Apps;
  4. (function (Apps) {
  5. let Transact;
  6. (function (Transact) {
  7. let Components;
  8. (function (Components) {
  9. let Invoices;
  10. (function (Invoices) {
  11. class InvoiceItemDetails extends Unibase.Platform.Core.BaseComponent {
  12. jsFiles() {
  13. return ['apps/transact/managers/invoicemanager.js', 'tenants/themes/compact/components/details/details.js', 'platform/core/helpers/numberhelper/numberhelper.js'];
  14. }
  15. cssFiles() {
  16. return [];
  17. }
  18. html() {
  19. 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>';
  20. return html;
  21. }
  22. load(id, container) {
  23. $("#btn_InvoiceItemDetails_Close").click(function () {
  24. InvoiceItemDetails.Instance().navigationHelper.closePopUp();
  25. });
  26. }
  27. InvoiceItemDetails(InvoiceId, ItemId) {
  28. Bizgaze.Apps.Transact.Managers.InvoiceManager.Instance().getinvoiceitems(InvoiceId, ItemId).then(function (response) {
  29. if (response.result != null) {
  30. $(".InvoiceItemName").text(response.result[0].ItemName + " - " + response.result[0].ItemSKU);
  31. for (var i = 0; i < response.result.length; i++) {
  32. var row = response.result[i];
  33. var activeDiscText = "";
  34. var discValue = 0;
  35. var activeDiscPercent = "";
  36. var activeDiscVal = "";
  37. if (row.DiscountPercent > 0) {
  38. discValue = row.DiscountPercent;
  39. activeDiscPercent = "active";
  40. activeDiscText = "%";
  41. }
  42. else {
  43. discValue = row.DiscountAmount;
  44. activeDiscVal = "active";
  45. activeDiscText = "Val";
  46. }
  47. var html = '<div class="row div_InvoiceItem_Details">' +
  48. '<div class="row col-sm-12 ml-5 mt-10">' +
  49. '<div class="col-sm-4">' +
  50. '<div class=" min-padding">' +
  51. '<div class="input-group">' +
  52. '<input type="text" class="form-control txt_Mrp" value="0" readonly>' +
  53. '</div></div></div>' +
  54. '<div class="col-sm-2">' +
  55. '<div class="floating-label-form-group min-padding">' +
  56. '<input type="text" class="Quantity text-center form-control" placeholder="0.00" value="' + row.Quantity + '" readonly/>' +
  57. '</div></div>' +
  58. '<div class="col-sm-2">' +
  59. '<div class="floating-label-form-group min-padding">' +
  60. '<input type="text" class="Price text-center form-control" placeholder="0.00" value="' + row.UnitPrice + '" readonly/>' +
  61. '</div></div>' +
  62. '<div class="col-sm-2">' +
  63. '<div class="floating-label-form-group">' +
  64. '<div class="input-group">' +
  65. '<input type="text" id="txt_discount" placeholder="0.00" class="form-control txt_addldiscount text-center d-none d-md-block" value="' + discValue + '" readonly>' +
  66. '<input type="text" id="txt_discount" placeholder="0.00" class="form-control txt_addldiscount text-center ml-40 d-md-none" value="' + discValue + '" readonly>' +
  67. '<div class="input-group-btn">' +
  68. '<select class="btn_item_DiscType mt-10 border-blue" disabled><option value="Val">Val</option><option value="%">%</option></select>' +
  69. '</div>' +
  70. '</div></div></div>' +
  71. '<div class="col-sm-2">' +
  72. '<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>';
  73. $(".div_InvoiceItem_Details:last").after(html);
  74. let element = $(".div_InvoiceItem_Details:last");
  75. element.find(".btn_item_DiscType option[value='" + activeDiscText + "']").prop("selected", true);
  76. if (row.BatchId != 0) {
  77. Bizgaze.Apps.Transact.Managers.InvoiceManager.Instance().getBatchByBatchId(row.BatchId).then(function (res) {
  78. if (res.result != null) {
  79. element.find('.txt_Mrp').val(res.result.Mrp);
  80. }
  81. });
  82. }
  83. else if (row.MrpId != 0) {
  84. Bizgaze.Apps.Transact.Managers.InvoiceManager.Instance().getMrpById(row.MrpId).then(function (res) {
  85. if (res.result != null) {
  86. element.find('.txt_Mrp').val(res.result.Mrp);
  87. }
  88. });
  89. }
  90. }
  91. }
  92. });
  93. }
  94. static Instance() {
  95. if (this.instance === undefined) {
  96. this.instance = new Bizgaze.Apps.Transact.Components.Invoices.InvoiceItemDetails();
  97. }
  98. return this.instance;
  99. }
  100. }
  101. Invoices.InvoiceItemDetails = InvoiceItemDetails;
  102. })(Invoices = Components.Invoices || (Components.Invoices = {}));
  103. })(Components = Transact.Components || (Transact.Components = {}));
  104. })(Transact = Apps.Transact || (Apps.Transact = {}));
  105. })(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
  106. })(Bizgaze || (Bizgaze = {}));