shareneus 1.4.34 → 1.4.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aggregation/aggregation.js +13 -13
- package/dist/excel-files/GSTR-RO-excel.service.js +3 -3
- package/dist/excel-files/GSTR1-excel.service.js +7 -7
- package/dist/excel-files/GSTR2-excel.service.js +6 -6
- package/dist/excel-files/analysis-excel.service.js +4 -4
- package/dist/excel-files/category-wise-item-excel.service.js +10 -10
- package/dist/excel-files/cust-balance-excel.service.js +5 -5
- package/dist/excel-files/cust-wise-sales-details.js +5 -5
- package/dist/excel-files/cust-wise-sales-summary-excel.service.js +5 -5
- package/dist/excel-files/expiring-drugs-excel.service.js +7 -7
- package/dist/excel-files/insurance-expire-excel.service.js +4 -4
- package/dist/excel-files/invoice-wise-excel.service.js +3 -3
- package/dist/excel-files/item-wise-doctor-sale-excel.service.js +7 -7
- package/dist/excel-files/item-wise-mout-details.js +4 -4
- package/dist/excel-files/item-wise-mout-summary.js +4 -4
- package/dist/excel-files/items-wise-sales-excel.service.js +10 -10
- package/dist/excel-files/manf-wise-sales-excel.service.js +4 -4
- package/dist/excel-files/next-service-date-excel.service.js +5 -5
- package/dist/excel-files/operator-wise-details.js +4 -4
- package/dist/excel-files/operator-wise-summary.js +4 -4
- package/dist/excel-files/payment-receive-excel.service.js +6 -6
- package/dist/excel-files/payments-made-excel.service.js +6 -6
- package/dist/excel-files/repair-orders-excel.service.js +10 -10
- package/dist/excel-files/sa-wise-labor-sales-excel.service.js +6 -6
- package/dist/excel-files/sa-wise-part-sales-excel.service.js +6 -6
- package/dist/excel-files/sale-summary-excel.service.js +3 -3
- package/dist/excel-files/sales-by-service-summary-excel.service.js +14 -14
- package/dist/excel-files/scheduled-drug-summary-excel.service.js +8 -8
- package/dist/excel-files/scheduled-drugs-excel.service.js +10 -10
- package/dist/excel-files/spares-issue-excel.service.js +14 -14
- package/dist/excel-files/stock-excel.service.js +3 -3
- package/dist/excel-files/tally-sales-import.service.js +3 -3
- package/dist/excel-files/ven-balance-excel.service.js +3 -3
- package/dist/index.js +9 -9
- package/dist/services/analysis-pdf.service.js +8 -8
- package/dist/services/appointment-total.service.js +37 -37
- package/dist/services/auto-sales-receipt-pdf.service.js +24 -24
- package/dist/services/category-wise-item-pdf.service.js +6 -6
- package/dist/services/checklist-pdf.js +3 -3
- package/dist/services/cn-print.service.js +33 -33
- package/dist/services/consultation-fee-receipt.service.js +16 -16
- package/dist/services/consultation-full-pdf.service.js +10 -10
- package/dist/services/consultation-letterhead-pdf.service.js +15 -15
- package/dist/services/consultation-pdf.service.js +15 -15
- package/dist/services/credit-note-pdf.service.js +16 -16
- package/dist/services/credit-note-totals.service.js +31 -31
- package/dist/services/cust-wise-sales-details-pdf.service.js +8 -8
- package/dist/services/cust-wise-sales-summary-pdf.service.js +7 -7
- package/dist/services/customer-balances-pdf.service.js +7 -7
- package/dist/services/dc-landscape-pdf.service.js +28 -28
- package/dist/services/dc-landscape-without-price-pdf.service.js +24 -24
- package/dist/services/dc-without-price-pdf.service.js +15 -15
- package/dist/services/debit-note-pdf.service.js +14 -14
- package/dist/services/debit-note-print.service.js +33 -33
- package/dist/services/debit-note-totals.service.js +28 -28
- package/dist/services/delivery-challan-pdf.service.js +16 -16
- package/dist/services/delivery-challan-print.service.js +26 -26
- package/dist/services/delivery-challan-totals.js +32 -32
- package/dist/services/equipment-design-pdf.service.js +10 -10
- package/dist/services/est.print-service.js +150 -150
- package/dist/services/expiring-drugs-pdf.service.js +6 -6
- package/dist/services/hc-inv-pdf.service.js +42 -42
- package/dist/services/insurance-expire-pdf.service.js +1 -1
- package/dist/services/inv-pdf.service.js +54 -54
- package/dist/services/inv-print.service.js +59 -59
- package/dist/services/invoice-landscape-pdf.service.js +29 -29
- package/dist/services/invoice-letterhead-pdf.service.js +54 -54
- package/dist/services/invoice-portrait-pdf.js +51 -51
- package/dist/services/invoice-total.service.js +78 -78
- package/dist/services/issue-parts-pdf.service.js +43 -43
- package/dist/services/item-bar-code-label-pdf.js +2 -2
- package/dist/services/item-price-for-pricelist.js +178 -0
- package/dist/services/item-wise-doctor-sale-pdf.service.js +3 -3
- package/dist/services/item-wise-mout-details-pdf.js +3 -3
- package/dist/services/item-wise-mout-summary-pdf.js +2 -2
- package/dist/services/item-wise-sales-pdf.service.js +6 -6
- package/dist/services/manf-wise-sales-pdf.service.js +5 -5
- package/dist/services/meeting-pdf.js +14 -14
- package/dist/services/mout-pdf.service.js +17 -17
- package/dist/services/next-service-date-pdf.service.js +1 -1
- package/dist/services/operator-wise-details-pdf.service.js +8 -8
- package/dist/services/operator-wise-summary-pdf.js +7 -7
- package/dist/services/pack-ship-pdf.service.js +3 -3
- package/dist/services/pack-ship-print.service.js +26 -26
- package/dist/services/payment-pdf.service.js +4 -4
- package/dist/services/payment-report-pdf.service.js +3 -3
- package/dist/services/po-totals.service.js +28 -28
- package/dist/services/pos-receipt-pdf.js +19 -19
- package/dist/services/purchase-order-pdf.service.js +40 -40
- package/dist/services/purchase-order-print.service.js +43 -43
- package/dist/services/purchase-order-totals.service.js +53 -53
- package/dist/services/receipt-print.service.js +5 -5
- package/dist/services/reorder-point-pdf.service.js +3 -3
- package/dist/services/repair-orders-pdf.service.js +3 -3
- package/dist/services/ro-pdf.service.js +80 -80
- package/dist/services/ro-print-service.js +87 -87
- package/dist/services/ro-totals.service.js +123 -123
- package/dist/services/sales-by-service-pdf.service.js +6 -6
- package/dist/services/sales-pdf.service.js +23 -23
- package/dist/services/sales-print.service.js +54 -54
- package/dist/services/sales-receipt-pdf.service.js +25 -25
- package/dist/services/sales-receipt-print.service.js +62 -62
- package/dist/services/sales-totals.service.js +33 -33
- package/dist/services/scheduled-drug-pdf.service.js +7 -7
- package/dist/services/scheduled-drug-summary-pdf.service.js +4 -4
- package/dist/services/separate-wo-print.service.js +9 -9
- package/dist/services/shared-inv-pdf.service.js +44 -44
- package/dist/services/shared-pdf.service.js +119 -119
- package/dist/services/shared-print.service.js +68 -68
- package/dist/services/task-pdf.service.js +10 -10
- package/dist/services/task-reports-pdf.service.js +9 -9
- package/dist/services/technician-pdf.service.js +10 -10
- package/dist/services/technician-print.service.js +9 -9
- package/dist/services/vendor-balances-pdf.service.js +6 -6
- package/dist/services/vendor-credit-note-pdf.service.js +27 -27
- package/dist/services/vendor-credit-note-print.service.js +29 -29
- package/dist/services/vendor-credit-note-totals.service.js +37 -37
- package/dist/services/vendor-debit-note-pdf.service.js +16 -16
- package/dist/services/vendor-debit-note-print.service.js +29 -29
- package/dist/services/vendor-debit-note-totals.service.js +30 -30
- package/dist/{utils → shared}/my-date.js +31 -31
- package/package.json +1 -1
- package/dist/services/pricelist-item-final-price.service.js +0 -177
- /package/dist/{utils/tr-utils.js → shared/utils.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.VendorDebitNotePdfService = void 0;
|
|
4
|
-
const
|
|
4
|
+
const utils_1 = require("../shared/utils");
|
|
5
5
|
const shared_pdf_service_1 = require("./shared-pdf.service");
|
|
6
6
|
const shared_print_service_1 = require("./shared-print.service");
|
|
7
7
|
class VendorDebitNotePdfService {
|
|
@@ -31,7 +31,7 @@ class VendorDebitNotePdfService {
|
|
|
31
31
|
}
|
|
32
32
|
static GetFileName(ROPrintData) {
|
|
33
33
|
let fileName = ROPrintData.HeaderName;
|
|
34
|
-
if (!
|
|
34
|
+
if (!utils_1.TrUtils.IsNull(ROPrintData.Product) && !utils_1.TrUtils.IsEmpty(ROPrintData.Product.RegNo)) {
|
|
35
35
|
fileName = fileName + '-' + ROPrintData.Product.RegNo;
|
|
36
36
|
}
|
|
37
37
|
return fileName;
|
|
@@ -57,7 +57,7 @@ class VendorDebitNotePdfService {
|
|
|
57
57
|
let List = [];
|
|
58
58
|
if (ROPrintData.Entity.Body === 1) {
|
|
59
59
|
for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
|
|
60
|
-
if (
|
|
60
|
+
if (utils_1.TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
|
|
61
61
|
ROPrintData.PrintInfo[i].Text = '';
|
|
62
62
|
}
|
|
63
63
|
// List.push(ROPrintData.PrintInfo[i].Text,
|
|
@@ -68,10 +68,10 @@ class VendorDebitNotePdfService {
|
|
|
68
68
|
else {
|
|
69
69
|
if (ROPrintData.Entity.Body === 2) {
|
|
70
70
|
for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
|
|
71
|
-
if (
|
|
71
|
+
if (utils_1.TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
|
|
72
72
|
ROPrintData.PrintInfo[i].Text = '';
|
|
73
73
|
}
|
|
74
|
-
List.push(ROPrintData.PrintInfo[i].Text, this.WithOutDiscountFieldTable(
|
|
74
|
+
List.push(ROPrintData.PrintInfo[i].Text, this.WithOutDiscountFieldTable(utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Items), ROPrintData.ShowTaxColumn, ROPrintData.Entity.MPN, ROPrintData.Entity.Body, ROPrintData.ShowIGST, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn));
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
else {
|
|
@@ -82,10 +82,10 @@ class VendorDebitNotePdfService {
|
|
|
82
82
|
}
|
|
83
83
|
else {
|
|
84
84
|
for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
|
|
85
|
-
if (
|
|
85
|
+
if (utils_1.TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
|
|
86
86
|
ROPrintData.PrintInfo[i].Text = '';
|
|
87
87
|
}
|
|
88
|
-
List.push(ROPrintData.PrintInfo[i].Text, this.GetWithOutDiscAndTaxFieldHeader(
|
|
88
|
+
List.push(ROPrintData.PrintInfo[i].Text, this.GetWithOutDiscAndTaxFieldHeader(utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Items), ROPrintData.ShowTaxColumn, ROPrintData.Entity.MPN, ROPrintData.Entity.Body, ROPrintData.ShowIGST, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn));
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
}
|
|
@@ -149,14 +149,14 @@ class VendorDebitNotePdfService {
|
|
|
149
149
|
Parts.forEach((part) => {
|
|
150
150
|
var dataRow = [];
|
|
151
151
|
columns.forEach((column) => {
|
|
152
|
-
if ((!
|
|
152
|
+
if ((!utils_1.TrUtils.IsFixedZero(part[column.Field]) && !utils_1.TrUtils.IsNull(part[column.Field]))
|
|
153
153
|
|| (column.text === 'Line Total')) {
|
|
154
154
|
if (part[column.Field] === 'Spare Parts') {
|
|
155
155
|
dataRow.push({ text: part[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' });
|
|
156
156
|
}
|
|
157
157
|
else {
|
|
158
158
|
if (((column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt' || column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc')
|
|
159
|
-
&&
|
|
159
|
+
&& utils_1.TrUtils.CheckInvalidSelect(part.TCode))) {
|
|
160
160
|
part[column.Field] = '';
|
|
161
161
|
dataRow.push({ text: part[column.Field].toString(), alignment: 'center' });
|
|
162
162
|
}
|
|
@@ -166,7 +166,7 @@ class VendorDebitNotePdfService {
|
|
|
166
166
|
|| column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc') {
|
|
167
167
|
if (column.Field === 'Disc') {
|
|
168
168
|
if (column.type === 'percentage') {
|
|
169
|
-
if (!
|
|
169
|
+
if (!utils_1.TrUtils.IsEmpty(part[column.Field])) {
|
|
170
170
|
dataRow.push({ text: part[column.Field].toString(), noWrap: true });
|
|
171
171
|
}
|
|
172
172
|
else {
|
|
@@ -174,7 +174,7 @@ class VendorDebitNotePdfService {
|
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
else {
|
|
177
|
-
if (!
|
|
177
|
+
if (!utils_1.TrUtils.IsZero(part[column.Field])) {
|
|
178
178
|
dataRow.push({ text: part[column.Field].toString(), noWrap: true });
|
|
179
179
|
}
|
|
180
180
|
else {
|
|
@@ -183,7 +183,7 @@ class VendorDebitNotePdfService {
|
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
else {
|
|
186
|
-
if (!
|
|
186
|
+
if (!utils_1.TrUtils.IsZero(part[column.Field])) {
|
|
187
187
|
dataRow.push({ text: part[column.Field].toString(), alignment: 'right', nowrap: true });
|
|
188
188
|
}
|
|
189
189
|
else {
|
|
@@ -196,7 +196,7 @@ class VendorDebitNotePdfService {
|
|
|
196
196
|
if (column.Field === 'Desc') {
|
|
197
197
|
let DescData = [];
|
|
198
198
|
DescData.push(part[column.Field].toString());
|
|
199
|
-
if (!
|
|
199
|
+
if (!utils_1.TrUtils.IsEmpty(part['EDesc'])) {
|
|
200
200
|
DescData.push({ text: part['EDesc'].toString(), color: 'grey' });
|
|
201
201
|
}
|
|
202
202
|
dataRow.push({ stack: DescData });
|
|
@@ -432,7 +432,7 @@ class VendorDebitNotePdfService {
|
|
|
432
432
|
Parts.forEach((part) => {
|
|
433
433
|
var dataRow = [];
|
|
434
434
|
columns.forEach((column) => {
|
|
435
|
-
if (!
|
|
435
|
+
if (!utils_1.TrUtils.IsFixedZero(part[column.Field]) && !utils_1.TrUtils.IsNull(part[column.Field])
|
|
436
436
|
|| column.text === 'Line Total') {
|
|
437
437
|
if (part[column.Field] === 'Spare Parts') {
|
|
438
438
|
dataRow.push({ text: part[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' });
|
|
@@ -453,7 +453,7 @@ class VendorDebitNotePdfService {
|
|
|
453
453
|
if (column.Field === 'Desc') {
|
|
454
454
|
let DescData = [];
|
|
455
455
|
DescData.push(part[column.Field].toString());
|
|
456
|
-
if (!
|
|
456
|
+
if (!utils_1.TrUtils.IsEmpty(part['EDesc'])) {
|
|
457
457
|
DescData.push({ text: part['EDesc'].toString(), color: 'grey' });
|
|
458
458
|
}
|
|
459
459
|
dataRow.push({ stack: DescData });
|
|
@@ -546,7 +546,7 @@ class VendorDebitNotePdfService {
|
|
|
546
546
|
}
|
|
547
547
|
static CommonTotalDetails(ROPrintData, moreDiscDetails) {
|
|
548
548
|
let CommonDetails = [
|
|
549
|
-
shared_pdf_service_1.SharedPDFService.GetDebitTotalDetails(ROPrintData, ROPrintData.CustLaborTotalBeforeDisc, ROPrintData.CustLaborDiscTotal, ROPrintData.CustLaborCGST, ROPrintData.CustLaborSGST, ROPrintData.CustLaborIGST, ROPrintData.CustPartIGST, ROPrintData.ShowIGST, ROPrintData.ShowTaxColumn, ROPrintData.CustPartsTotalBeforeDisc, ROPrintData.CustPartsDiscTotal, ROPrintData.CustPartCGST, ROPrintData.CustPartSGST, ROPrintData.CustTaxGroupData, ROPrintData.ShowAccParts, ROPrintData.CustLaborAfterTax, ROPrintData.CustPartAfterTax, ROPrintData.FixedDisc, ROPrintData.For, ROPrintData.FixedTotal, ROPrintData.CustTotalRoundedBy, ROPrintData.CustRoundedTotal, ROPrintData.ShowTaxColumn, ROPrintData.ShowTaxColumn,
|
|
549
|
+
shared_pdf_service_1.SharedPDFService.GetDebitTotalDetails(ROPrintData, ROPrintData.CustLaborTotalBeforeDisc, ROPrintData.CustLaborDiscTotal, ROPrintData.CustLaborCGST, ROPrintData.CustLaborSGST, ROPrintData.CustLaborIGST, ROPrintData.CustPartIGST, ROPrintData.ShowIGST, ROPrintData.ShowTaxColumn, ROPrintData.CustPartsTotalBeforeDisc, ROPrintData.CustPartsDiscTotal, ROPrintData.CustPartCGST, ROPrintData.CustPartSGST, ROPrintData.CustTaxGroupData, ROPrintData.ShowAccParts, ROPrintData.CustLaborAfterTax, ROPrintData.CustPartAfterTax, ROPrintData.FixedDisc, ROPrintData.For, ROPrintData.FixedTotal, ROPrintData.CustTotalRoundedBy, ROPrintData.CustRoundedTotal, ROPrintData.ShowTaxColumn, ROPrintData.ShowTaxColumn, utils_1.TrUtils.isTaxable(ROPrintData.Settings.Tax), ROPrintData.CustLaborITax, ROPrintData.CustPartITax, ROPrintData.Consolidate, ROPrintData.From, moreDiscDetails),
|
|
550
550
|
shared_pdf_service_1.SharedPDFService.InvoiceDueStatus(ROPrintData.Type, ROPrintData.Paid, ROPrintData.Due, ROPrintData.Sts, false),
|
|
551
551
|
shared_pdf_service_1.SharedPDFService.GetTemsAndConditions(ROPrintData.Entity.Terms),
|
|
552
552
|
shared_pdf_service_1.SharedPDFService.GetUnderLine(),
|
|
@@ -3,37 +3,37 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.VendorDebitNotePrintService = void 0;
|
|
4
4
|
const shared_print_service_1 = require("./shared-print.service");
|
|
5
5
|
const debit_note_totals_service_1 = require("./debit-note-totals.service");
|
|
6
|
-
const my_date_1 = require("../
|
|
7
|
-
const
|
|
6
|
+
const my_date_1 = require("../shared/my-date");
|
|
7
|
+
const utils_1 = require("../shared/utils");
|
|
8
8
|
const enums_1 = require("../enums/enums");
|
|
9
9
|
const code_enums_1 = require("../enums/code-enums");
|
|
10
10
|
const aggregation_1 = require("../aggregation/aggregation");
|
|
11
11
|
class VendorDebitNotePrintService {
|
|
12
12
|
static GetDebitNotePrintInfo(OriginalInvoiceData, OriginalEntityData, image, IncludeGST, ConsolidateGST, TaxCodes, IsProforma) {
|
|
13
13
|
var _a, _b;
|
|
14
|
-
let ForInsurance = !
|
|
14
|
+
let ForInsurance = !utils_1.TrUtils.IsNull(OriginalInvoiceData.BFrom.InsId);
|
|
15
15
|
let InvoicePrintData = {};
|
|
16
|
-
let argInvoiceData =
|
|
16
|
+
let argInvoiceData = utils_1.TrUtils.Stringify(OriginalInvoiceData);
|
|
17
17
|
if (!IncludeGST) {
|
|
18
18
|
argInvoiceData.Settings.Tax = 'NO';
|
|
19
19
|
}
|
|
20
20
|
InvoicePrintData.IsProforma = IsProforma;
|
|
21
|
-
InvoicePrintData.Settings =
|
|
21
|
+
InvoicePrintData.Settings = utils_1.TrUtils.Stringify(argInvoiceData.Settings);
|
|
22
22
|
let SType;
|
|
23
|
-
if (!
|
|
23
|
+
if (!utils_1.TrUtils.IsNull(OriginalInvoiceData.SType)) {
|
|
24
24
|
SType = OriginalInvoiceData.SType;
|
|
25
25
|
}
|
|
26
26
|
InvoicePrintData = this.GetPrintConditionsBasedOnInput(InvoicePrintData, IncludeGST, ConsolidateGST, ForInsurance, SType, argInvoiceData, IsProforma);
|
|
27
27
|
InvoicePrintData.Entity = shared_print_service_1.PrintSharedService.GetFormattedEntityDataForPrint(OriginalEntityData, "Invoice", OriginalInvoiceData);
|
|
28
28
|
InvoicePrintData = shared_print_service_1.PrintSharedService.GetEntityHeaderStyles(InvoicePrintData, OriginalEntityData, image);
|
|
29
29
|
InvoicePrintData = this.GetInvoiceOtherDetailsForPrint(InvoicePrintData, argInvoiceData);
|
|
30
|
-
let IsTaxable = (IncludeGST &&
|
|
30
|
+
let IsTaxable = (IncludeGST && utils_1.TrUtils.isTaxable(argInvoiceData.Settings.Tax)) ? true : false;
|
|
31
31
|
let finalTotalsData = debit_note_totals_service_1.DebitNoteTotalsService.GetTotalsValue(argInvoiceData.Items, IsTaxable, true, argInvoiceData.Disc, argInvoiceData.Perc, TaxCodes, true, argInvoiceData.Settings);
|
|
32
32
|
if (ConsolidateGST) {
|
|
33
33
|
finalTotalsData.CustLaborTotalBeforeDisc = finalTotalsData.CustLaborAfterTax;
|
|
34
34
|
finalTotalsData.CustPartsTotalBeforeDisc = finalTotalsData.CustPartAfterTax;
|
|
35
35
|
}
|
|
36
|
-
InvoicePrintData =
|
|
36
|
+
InvoicePrintData = utils_1.TrUtils.ConcatObjects(InvoicePrintData, finalTotalsData);
|
|
37
37
|
InvoicePrintData.Items = this.GetItemsPrintInfo(InvoicePrintData.Items, ConsolidateGST, TaxCodes, (_b = (_a = OriginalEntityData.Entity.Settings) === null || _a === void 0 ? void 0 : _a.Acc) === null || _b === void 0 ? void 0 : _b.LTot);
|
|
38
38
|
argInvoiceData = this.ReverseItemsForInvoicePrint(argInvoiceData);
|
|
39
39
|
InvoicePrintData.PrintInfo = this.PrepareFormatForInvoicePrint(InvoicePrintData, code_enums_1.ROTypeEnum.Invoice, argInvoiceData.Sts);
|
|
@@ -65,11 +65,11 @@ class VendorDebitNotePrintService {
|
|
|
65
65
|
InvoicePrintData.IncludeGST = IncludeGST;
|
|
66
66
|
InvoicePrintData.ConsolidateGST = ConsolidateGST;
|
|
67
67
|
InvoicePrintData.ShowAccParts = false;
|
|
68
|
-
InvoicePrintData.ShowIGST = (
|
|
68
|
+
InvoicePrintData.ShowIGST = (utils_1.TrUtils.IsNull(SType) || (SType === 'Intra')) ? false : true;
|
|
69
69
|
InvoicePrintData.ShowTaxColumn = (IncludeGST && !ConsolidateGST) ? true : false;
|
|
70
70
|
// InvoicePrintData.ShowDiscountColumn = (!ForInsurance && !ConsolidateGST) ? true : false;
|
|
71
71
|
InvoicePrintData = this.GetInvoiceTypeHeading(InvoicePrintData, OriginalInvoiceData, IncludeGST, ConsolidateGST, IsProforma);
|
|
72
|
-
InvoicePrintData.PrDate =
|
|
72
|
+
InvoicePrintData.PrDate = utils_1.TrUtils.IsNull(OriginalInvoiceData.PrDate) ? '' : my_date_1.MyDate.ConvertUTCDateToReadable(OriginalInvoiceData.PrDate);
|
|
73
73
|
return InvoicePrintData;
|
|
74
74
|
}
|
|
75
75
|
static GetInvoiceTypeHeading(InvoicePrintData, OriginalInvoiceData, IncludeGST, ConsolidateGST, IsProforma) {
|
|
@@ -109,24 +109,24 @@ class VendorDebitNotePrintService {
|
|
|
109
109
|
let CTaxAmtPerItem = (0, aggregation_1.division)(Item.CGST, Item.Qty);
|
|
110
110
|
let STaxAmtPerItem = (0, aggregation_1.division)(Item.SGST, Item.Qty);
|
|
111
111
|
let ITaxAmtPerItem = (0, aggregation_1.division)(Item.IGST, Item.Qty);
|
|
112
|
-
Item.UnPr =
|
|
112
|
+
Item.UnPr = utils_1.TrUtils.FixedTo((0, aggregation_1.addition)(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem));
|
|
113
113
|
}
|
|
114
114
|
else {
|
|
115
|
-
Item.UnPr =
|
|
115
|
+
Item.UnPr = utils_1.TrUtils.FixPriceValue(Item.UnPr);
|
|
116
116
|
}
|
|
117
|
-
Item.CGSTAmt =
|
|
118
|
-
Item.SGSTAmt =
|
|
119
|
-
Item.IGSTAmt =
|
|
117
|
+
Item.CGSTAmt = utils_1.TrUtils.FixPriceValue(Item.CGST);
|
|
118
|
+
Item.SGSTAmt = utils_1.TrUtils.FixPriceValue(Item.SGST);
|
|
119
|
+
Item.IGSTAmt = utils_1.TrUtils.FixPriceValue(Item.IGST);
|
|
120
120
|
Item.CGSTPerc = shared_print_service_1.PrintSharedService.GetCGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
121
121
|
Item.SGSTPerc = shared_print_service_1.PrintSharedService.GetSGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
122
122
|
Item.IGSTPerc = shared_print_service_1.PrintSharedService.GetIGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
123
123
|
if (LineTotal === 'AT') {
|
|
124
|
-
Item.LineTotal =
|
|
124
|
+
Item.LineTotal = utils_1.TrUtils.FixPriceValue(Item.AfterPartTax);
|
|
125
125
|
}
|
|
126
126
|
else {
|
|
127
|
-
Item.LineTotal =
|
|
127
|
+
Item.LineTotal = utils_1.TrUtils.FixPriceValue((0, aggregation_1.subtraction)(Item.UnAmt, Item.Disc));
|
|
128
128
|
}
|
|
129
|
-
if (!
|
|
129
|
+
if (!utils_1.TrUtils.IsZero(Item.Qty) && !utils_1.TrUtils.CheckInvalidSelect(Item.UoM)) {
|
|
130
130
|
Item.QtyAndUoM = Item.Qty + ' ' + Item.UoM;
|
|
131
131
|
}
|
|
132
132
|
});
|
|
@@ -146,15 +146,15 @@ class VendorDebitNotePrintService {
|
|
|
146
146
|
return PrintInfo;
|
|
147
147
|
}
|
|
148
148
|
static GetFormattedProductDataForPrint(OriginalInvoiceData, InvoicePrintData) {
|
|
149
|
-
if (!
|
|
149
|
+
if (!utils_1.TrUtils.IsNull(OriginalInvoiceData.Prod)) {
|
|
150
150
|
InvoicePrintData.Product = OriginalInvoiceData.Prod;
|
|
151
|
-
if (
|
|
151
|
+
if (utils_1.TrUtils.IsNull(InvoicePrintData.Product.VIN)) {
|
|
152
152
|
InvoicePrintData.Product.VIN = '';
|
|
153
153
|
}
|
|
154
|
-
if (
|
|
154
|
+
if (utils_1.TrUtils.IsNull(InvoicePrintData.Product.RegNo)) {
|
|
155
155
|
InvoicePrintData.Product.RegNo = '';
|
|
156
156
|
}
|
|
157
|
-
if (
|
|
157
|
+
if (utils_1.TrUtils.IsNull(InvoicePrintData.Product.EngNo)) {
|
|
158
158
|
InvoicePrintData.Product.EngNo = '';
|
|
159
159
|
}
|
|
160
160
|
InvoicePrintData.MIn = OriginalInvoiceData.Prod.MIn;
|
|
@@ -186,7 +186,7 @@ class VendorDebitNotePrintService {
|
|
|
186
186
|
// ];
|
|
187
187
|
// }
|
|
188
188
|
InvoicePrintData.Customer = Customer;
|
|
189
|
-
if (!
|
|
189
|
+
if (!utils_1.TrUtils.IsNull(OriginalInvoiceData.BFrom.InsId)) {
|
|
190
190
|
InvoicePrintData.Cust = this.GetCustomerDetails(OriginalInvoiceData);
|
|
191
191
|
}
|
|
192
192
|
return InvoicePrintData;
|
|
@@ -195,7 +195,7 @@ class VendorDebitNotePrintService {
|
|
|
195
195
|
let Customer = {};
|
|
196
196
|
Customer.Name = this.GetBillToName(OriginalInvoiceData.Cust.Title, OriginalInvoiceData.Cust.Name);
|
|
197
197
|
Customer.Cons = [];
|
|
198
|
-
if (!
|
|
198
|
+
if (!utils_1.TrUtils.IsEmpty(OriginalInvoiceData.Cust.Ph)) {
|
|
199
199
|
Customer.Cons = [
|
|
200
200
|
{
|
|
201
201
|
Type: 'M',
|
|
@@ -205,9 +205,9 @@ class VendorDebitNotePrintService {
|
|
|
205
205
|
}
|
|
206
206
|
Customer.GSTIN = OriginalInvoiceData.Cust.GSTIN;
|
|
207
207
|
Customer.Adrs = [];
|
|
208
|
-
if (!
|
|
208
|
+
if (!utils_1.TrUtils.IsNull(OriginalInvoiceData.Cust.Adrs)) {
|
|
209
209
|
Customer.Adrs.push(OriginalInvoiceData.Cust.Adrs.A1);
|
|
210
|
-
if (!
|
|
210
|
+
if (!utils_1.TrUtils.IsEmpty(OriginalInvoiceData.Cust.Adrs.A2)) {
|
|
211
211
|
Customer.Adrs.push(OriginalInvoiceData.Cust.Adrs.A2);
|
|
212
212
|
}
|
|
213
213
|
Customer.Adrs.push(OriginalInvoiceData.Cust.Adrs.Ct);
|
|
@@ -217,7 +217,7 @@ class VendorDebitNotePrintService {
|
|
|
217
217
|
return Customer;
|
|
218
218
|
}
|
|
219
219
|
static GetBillToName(Title, Name) {
|
|
220
|
-
return
|
|
220
|
+
return utils_1.TrUtils.IsEmpty(Title) ? Name : Title + ' ' + Name;
|
|
221
221
|
}
|
|
222
222
|
static GetPaymentsTotal(InvoicePayments, Total, InvoiceStatus) {
|
|
223
223
|
var i = 0;
|
|
@@ -230,7 +230,7 @@ class VendorDebitNotePrintService {
|
|
|
230
230
|
Data.Due = 0;
|
|
231
231
|
}
|
|
232
232
|
else {
|
|
233
|
-
Data.Due =
|
|
233
|
+
Data.Due = utils_1.TrUtils.FixedTo(Total - PaidTotal);
|
|
234
234
|
}
|
|
235
235
|
if (Data.Due < 0) {
|
|
236
236
|
Data.Due = 0;
|
|
@@ -238,7 +238,7 @@ class VendorDebitNotePrintService {
|
|
|
238
238
|
if (Data.Due === 0) {
|
|
239
239
|
Data.Sts = enums_1.InvoiceStatusEnum.Closed;
|
|
240
240
|
}
|
|
241
|
-
Data.Paid =
|
|
241
|
+
Data.Paid = utils_1.TrUtils.FixedTo(PaidTotal);
|
|
242
242
|
return Data;
|
|
243
243
|
}
|
|
244
244
|
}
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.VendorDebitNoteTotalsService = void 0;
|
|
4
4
|
const aggregation_1 = require("../aggregation/aggregation");
|
|
5
|
-
const
|
|
5
|
+
const utils_1 = require("../shared/utils");
|
|
6
6
|
class VendorDebitNoteTotalsService {
|
|
7
7
|
static GetTotalsValue(ItemsList, IsIndependentTax, DetailedInfo, Disc, Perc, TaxCodes, WithItems, Settings) {
|
|
8
8
|
// LPerc = TrUtils.SetPercToStringIfNull(LPerc);
|
|
9
9
|
// PPerc = TrUtils.SetPercToStringIfNull(PPerc);
|
|
10
|
-
Perc =
|
|
10
|
+
Perc = utils_1.TrUtils.SetPercToStringIfNull(Perc);
|
|
11
11
|
// LDisc = TrUtils.SetValueToZeroIfNull(LDisc);
|
|
12
12
|
// PDisc = TrUtils.SetValueToZeroIfNull(PDisc);
|
|
13
|
-
Disc =
|
|
13
|
+
Disc = utils_1.TrUtils.SetValueToZeroIfNull(Disc);
|
|
14
14
|
// opCodesList = this.CalculateLaborValues(opCodesList, IsIndependentTax);
|
|
15
15
|
ItemsList = this.CalculateLaborItemValues(ItemsList, IsIndependentTax);
|
|
16
16
|
let finalTotalsData = this.GetFinalRODataForSave(ItemsList, IsIndependentTax, Disc, Perc, DetailedInfo, Settings);
|
|
@@ -33,7 +33,7 @@ class VendorDebitNoteTotalsService {
|
|
|
33
33
|
static ResetLaborItemValues(ItemsList, IsIndependentTax) {
|
|
34
34
|
ItemsList.forEach((Item) => {
|
|
35
35
|
Item = this.ResetLaborItemValueIfInvalid(Item);
|
|
36
|
-
if (
|
|
36
|
+
if (utils_1.TrUtils.IsZero(Item.Qty)) {
|
|
37
37
|
Item.Qty = 1;
|
|
38
38
|
}
|
|
39
39
|
Item.DiscountedPrice = (0, aggregation_1.addition)(Item.Disc, Item.RecDisc);
|
|
@@ -48,12 +48,12 @@ class VendorDebitNoteTotalsService {
|
|
|
48
48
|
return ItemsList;
|
|
49
49
|
}
|
|
50
50
|
static ResetLaborItemValueIfInvalid(Item) {
|
|
51
|
-
Item.UnPr =
|
|
52
|
-
Item.Disc =
|
|
53
|
-
Item.RecDisc =
|
|
54
|
-
Item.CGST =
|
|
55
|
-
Item.SGST =
|
|
56
|
-
Item.IGST =
|
|
51
|
+
Item.UnPr = utils_1.TrUtils.SetValueToZeroIfNull(Item.UnPr);
|
|
52
|
+
Item.Disc = utils_1.TrUtils.SetValueToZeroIfNull(Item.Disc);
|
|
53
|
+
Item.RecDisc = utils_1.TrUtils.SetValueToZeroIfNull(Item.RecDisc);
|
|
54
|
+
Item.CGST = utils_1.TrUtils.SetValueToZeroIfNull(Item.CGST);
|
|
55
|
+
Item.SGST = utils_1.TrUtils.SetValueToZeroIfNull(Item.SGST);
|
|
56
|
+
Item.IGST = utils_1.TrUtils.SetValueToZeroIfNull(Item.IGST);
|
|
57
57
|
return Item;
|
|
58
58
|
}
|
|
59
59
|
static GetFinalRODataForSave(ItemsList, IsIndependentTax, Disc, Perc, DetailedInfo, Settings) {
|
|
@@ -81,7 +81,7 @@ class VendorDebitNoteTotalsService {
|
|
|
81
81
|
let CustomerAfterDiscTotals = this.GetSubTotalFor(ItemsList);
|
|
82
82
|
// let CustLaborTaxTotal = this.GetLaborTaxTotalFor(IsIndependentTax);
|
|
83
83
|
let CustItemTaxTotal = this.GetItemsTaxTotalFor(ItemsList, IsIndependentTax);
|
|
84
|
-
finalTotalsData.SubTotal =
|
|
84
|
+
finalTotalsData.SubTotal = utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals);
|
|
85
85
|
// let CustLaborDiscTotal = this.GetLaborDiscountedTotal(LaborList, IsIndependentTax, finalTotalsData);
|
|
86
86
|
let CustItemsDiscTotal = this.GetItemDiscountedTotal(ItemsList, IsIndependentTax, finalTotalsData);
|
|
87
87
|
// let CustLaborTotalAfterDisc = this.GetLaborTotalAfterDiscount(LaborList);
|
|
@@ -91,8 +91,8 @@ class VendorDebitNoteTotalsService {
|
|
|
91
91
|
finalTotalsData.Round = (0, aggregation_1.subtraction)(Math.round(CustTotal), CustTotal);
|
|
92
92
|
finalTotalsData.Total = Math.round(CustTotal);
|
|
93
93
|
if (DetailedInfo) {
|
|
94
|
-
finalTotalsData.FixedSubTotal =
|
|
95
|
-
finalTotalsData.FixedTotal =
|
|
94
|
+
finalTotalsData.FixedSubTotal = utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals);
|
|
95
|
+
finalTotalsData.FixedTotal = utils_1.TrUtils.FixedTo(CustTotal);
|
|
96
96
|
}
|
|
97
97
|
return finalTotalsData;
|
|
98
98
|
}
|
|
@@ -121,10 +121,10 @@ class VendorDebitNoteTotalsService {
|
|
|
121
121
|
// finalTotalsData.CustLaborCGST = this.GetLaborCGSTTaxTotal(opCodesList, IsIndependentTax);
|
|
122
122
|
// finalTotalsData.CustLaborIGST = this.GetLaborIGSTTaxTotal(opCodesList, IsIndependentTax);
|
|
123
123
|
let TaxInfo = this.GetItemGSTTaxTotal(ItemsList, IsIndependentTax);
|
|
124
|
-
finalTotalsData.CustItemITax =
|
|
125
|
-
finalTotalsData.CustItemCGST =
|
|
126
|
-
finalTotalsData.CustItemIGST =
|
|
127
|
-
finalTotalsData.CustItemSGST =
|
|
124
|
+
finalTotalsData.CustItemITax = utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[3]);
|
|
125
|
+
finalTotalsData.CustItemCGST = utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[0]);
|
|
126
|
+
finalTotalsData.CustItemIGST = utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[2]);
|
|
127
|
+
finalTotalsData.CustItemSGST = utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[1]);
|
|
128
128
|
// finalTotalsData.CustItemITax = this.GetItemsTaxTotalFor(ItemsList, IsIndependentTax);
|
|
129
129
|
// finalTotalsData.CustItemCGST = this.GetItemCGSTTaxTotal(ItemsList, IsIndependentTax);
|
|
130
130
|
// finalTotalsData.CustItemIGST = this.GetItemIGSTTaxTotal(ItemsList, IsIndependentTax);
|
|
@@ -132,14 +132,14 @@ class VendorDebitNoteTotalsService {
|
|
|
132
132
|
// finalTotalsData.CustLaborAfterTax = addition(finalTotalsData.CustLaborITax , finalTotalsData.CustLaborTotalAfterDisc);
|
|
133
133
|
finalTotalsData.CustItemAfterTax = (0, aggregation_1.addition)(finalTotalsData.CustItemITax, finalTotalsData.CustItemsTotalAfterDisc);
|
|
134
134
|
finalTotalsData.CustTaxGroupData = this.GetTaxGroupingForItemsByHSN(ItemsList, TaxCodes);
|
|
135
|
-
finalTotalsData.CustTotalRoundedBy =
|
|
136
|
-
finalTotalsData.CustRoundedTotal =
|
|
135
|
+
finalTotalsData.CustTotalRoundedBy = utils_1.TrUtils.FixedTo(finalTotalsData.Round);
|
|
136
|
+
finalTotalsData.CustRoundedTotal = utils_1.TrUtils.FixedTo(finalTotalsData.Total);
|
|
137
137
|
for (var key in finalTotalsData) {
|
|
138
138
|
if (key !== 'Total' && key !== 'SubTotal' &&
|
|
139
139
|
key !== 'LDisc' && key !== 'LPerc' && key !== 'PDisc' &&
|
|
140
140
|
key !== 'PPerc' && key !== 'Disc' && key !== 'Perc' && key !== 'Tax'
|
|
141
141
|
&& typeof finalTotalsData[key] === 'number') {
|
|
142
|
-
finalTotalsData[key] =
|
|
142
|
+
finalTotalsData[key] = utils_1.TrUtils.FixPriceValue(finalTotalsData[key]);
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
return finalTotalsData;
|
|
@@ -148,7 +148,7 @@ class VendorDebitNoteTotalsService {
|
|
|
148
148
|
let ItemsDiscountedTotal = 0;
|
|
149
149
|
let overallItemDisc = 0;
|
|
150
150
|
if (!isTaxable) {
|
|
151
|
-
overallItemDisc =
|
|
151
|
+
overallItemDisc = utils_1.TrUtils.SetValueToZeroIfNull(finalTotalsData.PDisc);
|
|
152
152
|
}
|
|
153
153
|
ItemsList.forEach((Item) => {
|
|
154
154
|
ItemsDiscountedTotal = (0, aggregation_1.addition)(ItemsDiscountedTotal, Item.DiscountedPrice);
|
|
@@ -176,8 +176,8 @@ class VendorDebitNoteTotalsService {
|
|
|
176
176
|
}
|
|
177
177
|
static ItemsTotalAfterDiscount(ItemsTotalAfterDisc, ItemsTaxAmount, MainPDisc, PDiscInPerc) {
|
|
178
178
|
let ItemsTotal = (0, aggregation_1.addition)(ItemsTotalAfterDisc, ItemsTaxAmount);
|
|
179
|
-
if (!
|
|
180
|
-
if (!
|
|
179
|
+
if (!utils_1.TrUtils.IsZero(MainPDisc)) {
|
|
180
|
+
if (!utils_1.TrUtils.IsEmpty(PDiscInPerc)) {
|
|
181
181
|
ItemsTotal = (0, aggregation_1.subtraction)(ItemsTotal, (0, aggregation_1.division)((0, aggregation_1.multiply)(ItemsTotal, Number(PDiscInPerc)), 100));
|
|
182
182
|
}
|
|
183
183
|
else {
|
|
@@ -209,13 +209,13 @@ class VendorDebitNoteTotalsService {
|
|
|
209
209
|
}
|
|
210
210
|
static GetCombinedTaxPercentage(Items, TaxCodes) {
|
|
211
211
|
Items.forEach((Item) => {
|
|
212
|
-
if (
|
|
212
|
+
if (utils_1.TrUtils.IsNull(Item.HSN)) {
|
|
213
213
|
Item.HSN = '';
|
|
214
214
|
}
|
|
215
215
|
let TaxInfo = this.GetGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
216
|
-
Item.CGSTAmt =
|
|
217
|
-
Item.SGSTAmt =
|
|
218
|
-
Item.IGSTAmt =
|
|
216
|
+
Item.CGSTAmt = utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[0]);
|
|
217
|
+
Item.SGSTAmt = utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[1]);
|
|
218
|
+
Item.IGSTAmt = utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[2]);
|
|
219
219
|
Item.CombinedTaxPercentage = (0, aggregation_1.addition)(Item.CGSTAmt, Item.SGSTAmt, Item.IGSTAmt);
|
|
220
220
|
});
|
|
221
221
|
return Items;
|
|
@@ -266,8 +266,8 @@ class VendorDebitNoteTotalsService {
|
|
|
266
266
|
TaxAmount = (0, aggregation_1.addition)(TaxAmount, argMatchedGSTItem.SGST);
|
|
267
267
|
});
|
|
268
268
|
TaxInfo.HSN = HSN;
|
|
269
|
-
TaxInfo.TotalTaxableAmount =
|
|
270
|
-
TaxInfo.TotalTaxAmount =
|
|
269
|
+
TaxInfo.TotalTaxableAmount = utils_1.TrUtils.FixPriceValue(TaxOnAmount);
|
|
270
|
+
TaxInfo.TotalTaxAmount = utils_1.TrUtils.FixPriceValue(TaxAmount);
|
|
271
271
|
TaxInfo.ItemsCount = MatchedItem.length;
|
|
272
272
|
// let GSTValues: any[] = this.GetGSTValueBasedOnTaxCode(MatchedItem[0].TCode, TaxCodes);
|
|
273
273
|
// TaxInfo.CGST = GSTValues[0];
|
|
@@ -286,7 +286,7 @@ class VendorDebitNoteTotalsService {
|
|
|
286
286
|
let CGST = 0;
|
|
287
287
|
let SGST = 0;
|
|
288
288
|
let IGST = 0;
|
|
289
|
-
if (
|
|
289
|
+
if (utils_1.TrUtils.IsNull(TCode)) {
|
|
290
290
|
return [CGST, SGST, IGST];
|
|
291
291
|
}
|
|
292
292
|
let TCodeIndex = TaxCodes.findIndex((TaxCode) => {
|