shareneus 1.7.3 → 1.7.5
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/README.md +1 -0
- package/dist/accounting/invoice/invoice-pdf/invoice-pdf.service.js +18 -45
- package/dist/accounting/invoice/reports/excel/analysis-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/category-wise-item-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/cust-wise-sales-details.js +17 -7
- package/dist/accounting/invoice/reports/excel/cust-wise-sales-summary-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/invoice-wise-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/item-wise-doctor-sale-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/items-wise-sales-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/manf-wise-sales-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/operator-wise-details.js +17 -7
- package/dist/accounting/invoice/reports/excel/operator-wise-summary.js +17 -7
- package/dist/accounting/invoice/reports/excel/sa-wise-labor-sales-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/sa-wise-part-sales-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/sale-summary-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/sales-by-service-summary-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/scheduled-drug-summary-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/scheduled-drugs-excel.service.js +17 -7
- package/dist/accounting/invoice/unified-invoice-pdf.service.d.ts +1 -1
- package/dist/accounting/payment-receive/reports/excel/cust-balance-excel.service.js +17 -7
- package/dist/accounting/payment-receive/reports/excel/payment-receive-excel.service.js +17 -7
- package/dist/common/reports/excel/product-without-owner-excel.service.js +17 -7
- package/dist/gst/excel/GSTR-RO-excel.service.js +17 -7
- package/dist/gst/excel/GSTR1-excel.service.js +17 -7
- package/dist/gst/excel/GSTR2-excel.service.js +17 -7
- package/dist/gst/excel/hsn-summary.js +17 -7
- package/dist/gst/excel/tally-sales-import.service.js +17 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -6
- package/dist/inventory/items/reports/excel/expiring-drugs-excel.service.js +17 -7
- package/dist/inventory/items/reports/excel/item-wise-mout-details.js +17 -7
- package/dist/inventory/items/reports/excel/item-wise-mout-summary.js +17 -7
- package/dist/inventory/items/reports/excel/spares-issue-excel.service.js +17 -7
- package/dist/inventory/items/reports/excel/stock-excel.service.js +17 -7
- package/dist/purchases/payment-made/reports/excel/payments-made-excel.service.js +17 -7
- package/dist/purchases/payment-made/reports/excel/ven-balance-excel.service.js +17 -7
- package/dist/services/reports/excel/insurance-expire-excel.service.js +17 -7
- package/dist/services/reports/excel/next-service-date-excel.service.js +17 -7
- package/dist/services/reports/excel/repair-orders-excel.service.js +17 -7
- package/dist/shared/table-section/pdf-table.header.d.ts +1 -1
- package/dist/shared/table-section/pdf-table.header.js +14 -2
- package/dist/shared/table-section/pdf-table.section.js +6 -13
- package/dist/shared/totals-section/pdf-totals.section.js +1 -1
- package/dist/{accounting/invoice/invoice-pdf.service.js → shared/transactions-pdf.service.js} +14 -14
- package/package.json +1 -1
- package/src/accounting/counter-sales/auto-sales-receipt-pdf.service.ts +569 -0
- package/src/accounting/counter-sales/pos-receipt-pdf.ts +577 -0
- package/src/accounting/counter-sales/sales-receipt-pdf.service.ts +628 -0
- package/src/accounting/counter-sales/sales-receipt-print.service.ts +506 -0
- package/src/accounting/credit-note/cn-print.service.ts +264 -0
- package/src/accounting/credit-note/credit-note-pdf.service.ts +602 -0
- package/src/accounting/credit-note/credit-note-totals.service.ts +424 -0
- package/src/accounting/debit-note/debit-note-pdf.service.ts +681 -0
- package/src/accounting/debit-note/debit-note-print.service.ts +276 -0
- package/src/accounting/debit-note/debit-note-totals.service.ts +361 -0
- package/src/accounting/invoice/hc-inv-pdf.service.ts +880 -0
- package/src/accounting/invoice/inv-pdf.service.ts +812 -0
- package/src/accounting/invoice/inv-print.service.ts +532 -0
- package/src/accounting/invoice/invoice-landscape-pdf.service.ts +947 -0
- package/src/accounting/invoice/invoice-letterhead-pdf.service.ts +813 -0
- package/src/accounting/invoice/invoice-pdf/invoice-pdf.service.ts +359 -0
- package/src/accounting/invoice/invoice-portrait-pdf.ts +972 -0
- package/src/accounting/invoice/invoice-print.service.ts +2906 -0
- package/src/accounting/invoice/invoice-total.service.ts +834 -0
- package/src/accounting/invoice/reports/excel/analysis-excel.service.ts +291 -0
- package/src/accounting/invoice/reports/excel/category-wise-item-excel.service.ts +267 -0
- package/src/accounting/invoice/reports/excel/cust-wise-sales-details.ts +321 -0
- package/src/accounting/invoice/reports/excel/cust-wise-sales-summary-excel.service.ts +300 -0
- package/src/accounting/invoice/reports/excel/invoice-wise-excel.service.ts +859 -0
- package/src/accounting/invoice/reports/excel/item-wise-doctor-sale-excel.service.ts +255 -0
- package/src/accounting/invoice/reports/excel/items-wise-sales-excel.service.ts +312 -0
- package/src/accounting/invoice/reports/excel/manf-wise-sales-excel.service.ts +273 -0
- package/src/accounting/invoice/reports/excel/operator-wise-details.ts +258 -0
- package/src/accounting/invoice/reports/excel/operator-wise-summary.ts +259 -0
- package/src/accounting/invoice/reports/excel/sa-wise-labor-sales-excel.service.ts +230 -0
- package/src/accounting/invoice/reports/excel/sa-wise-part-sales-excel.service.ts +231 -0
- package/src/accounting/invoice/reports/excel/sale-summary-excel.service.ts +326 -0
- package/src/accounting/invoice/reports/excel/sales-by-service-details-excel.service.ts +0 -0
- package/src/accounting/invoice/reports/excel/sales-by-service-summary-excel.service.ts +432 -0
- package/src/accounting/invoice/reports/excel/scheduled-drug-summary-excel.service.ts +373 -0
- package/src/accounting/invoice/reports/excel/scheduled-drugs-excel.service.ts +372 -0
- package/src/accounting/invoice/reports/pdf/analysis-pdf.service.ts +113 -0
- package/src/accounting/invoice/reports/pdf/category-wise-item-pdf.service.ts +107 -0
- package/src/accounting/invoice/reports/pdf/cust-wise-sales-details-pdf.service.ts +125 -0
- package/src/accounting/invoice/reports/pdf/cust-wise-sales-summary-pdf.service.ts +119 -0
- package/src/accounting/invoice/reports/pdf/item-wise-doctor-sale-pdf.service.ts +180 -0
- package/src/accounting/invoice/reports/pdf/item-wise-sales-pdf.service.ts +193 -0
- package/src/accounting/invoice/reports/pdf/manf-wise-sales-pdf.service.ts +188 -0
- package/src/accounting/invoice/reports/pdf/operator-wise-details-pdf.service.ts +118 -0
- package/src/accounting/invoice/reports/pdf/operator-wise-summary-pdf.ts +116 -0
- package/src/accounting/invoice/reports/pdf/sales-by-service-pdf.service.ts +132 -0
- package/src/accounting/invoice/reports/pdf/scheduled-drug-pdf.service.ts +191 -0
- package/src/accounting/invoice/reports/pdf/scheduled-drug-summary-pdf.service.ts +202 -0
- package/src/accounting/invoice/shared-inv-pdf.service.ts +787 -0
- package/src/accounting/invoice/unified-invoice-pdf.service.ts +937 -0
- package/src/accounting/payment-receive/payment-pdf.service.ts +410 -0
- package/src/accounting/payment-receive/payment-receipt-pdf/receipt-pdf.service.ts +470 -0
- package/src/accounting/payment-receive/receipt-print.service.ts +71 -0
- package/src/accounting/payment-receive/reports/excel/cust-balance-excel.service.ts +298 -0
- package/src/accounting/payment-receive/reports/excel/payment-receive-excel.service.ts +221 -0
- package/src/accounting/payment-receive/reports/pdf/customer-balances-pdf.service.ts +182 -0
- package/src/accounting/payment-receive/reports/pdf/payment-report-pdf.service.ts +116 -0
- package/src/aggregation/aggregation.ts +58 -0
- package/src/appointments/appointments/appointment-total.service.ts +298 -0
- package/src/appointments/consultations/consultation-fee-receipt.service.ts +407 -0
- package/src/appointments/consultations/consultation-full-pdf.service.ts +238 -0
- package/src/appointments/consultations/consultation-letterhead-pdf.service.ts +430 -0
- package/src/appointments/consultations/consultation-pdf.service.ts +417 -0
- package/src/common/reports/excel/product-without-owner-excel.service.ts +308 -0
- package/src/common/reports/pdf/product-without-owner-pdf.service.ts +146 -0
- package/src/enums/cache-enums.ts +33 -0
- package/src/enums/code-enums.ts +291 -0
- package/src/enums/country-enums.ts +9 -0
- package/src/enums/enums.ts +364 -0
- package/src/enums/industry-enums.ts +26 -0
- package/src/enums/treatment-enums.ts +9 -0
- package/src/gst/excel/GSTR-RO-excel.service.ts +926 -0
- package/src/gst/excel/GSTR1-excel.service.ts +313 -0
- package/src/gst/excel/GSTR2-excel.service.ts +314 -0
- package/src/gst/excel/hsn-summary.ts +314 -0
- package/src/gst/excel/tally-sales-import.service.ts +767 -0
- package/src/gst/pdf/hsn-summary-pdf.ts +176 -0
- package/src/index.ts +194 -0
- package/src/inventory/items/adjustment-pdf.service.ts +177 -0
- package/src/inventory/items/issue-parts-pdf.service.ts +795 -0
- package/src/inventory/items/item-bar-code-label-pdf.ts +194 -0
- package/src/inventory/items/item-detais-pdf.ts +141 -0
- package/src/inventory/items/item-price-for-pricelist.ts +368 -0
- package/src/inventory/items/reports/excel/expiring-drugs-excel.service.ts +290 -0
- package/src/inventory/items/reports/excel/item-wise-mout-details.ts +284 -0
- package/src/inventory/items/reports/excel/item-wise-mout-summary.ts +279 -0
- package/src/inventory/items/reports/excel/spares-issue-excel.service.ts +494 -0
- package/src/inventory/items/reports/excel/stock-excel.service.ts +319 -0
- package/src/inventory/items/reports/pdf/expiring-drugs-pdf.service.ts +172 -0
- package/src/inventory/items/reports/pdf/item-wise-mout-details-pdf.ts +122 -0
- package/src/inventory/items/reports/pdf/item-wise-mout-summary-pdf.ts +115 -0
- package/src/inventory/items/reports/pdf/reorder-point-pdf.service.ts +163 -0
- package/src/inventory/material-out/mout-pdf.service.ts +545 -0
- package/src/inventory/transfer-order/transfer-order-pdf.service.ts +154 -0
- package/src/purchases/bills/bill-pdf/bill-pdf.service.ts +211 -0
- package/src/purchases/bills/bill-pdf.service.ts +21 -0
- package/src/purchases/payment-made/reports/excel/payments-made-excel.service.ts +313 -0
- package/src/purchases/payment-made/reports/excel/ven-balance-excel.service.ts +307 -0
- package/src/purchases/payment-made/reports/pdf/vendor-balances-pdf.service.ts +114 -0
- package/src/purchases/purchase-order/po-totals.service.ts +343 -0
- package/src/purchases/purchase-order/purchase-order-pdf.service.ts +1016 -0
- package/src/purchases/purchase-order/purchase-order-print.service.ts +279 -0
- package/src/purchases/purchase-order/purchase-order-totals.service.ts +637 -0
- package/src/purchases/vendor-credit-note/vendor-credit-note-pdf.service.ts +1055 -0
- package/src/purchases/vendor-credit-note/vendor-credit-note-print.service.ts +145 -0
- package/src/purchases/vendor-credit-note/vendor-credit-note-totals.service.ts +399 -0
- package/src/purchases/vendor-debit-note/vendor-debit-note-pdf.service.ts +582 -0
- package/src/purchases/vendor-debit-note/vendor-debit-note-print.service.ts +295 -0
- package/src/purchases/vendor-debit-note/vendor-debit-note-totals.service.ts +377 -0
- package/src/sales/delivery-challan/dc-landscape-pdf.service.ts +922 -0
- package/src/sales/delivery-challan/dc-landscape-without-price-pdf.service.ts +869 -0
- package/src/sales/delivery-challan/dc-without-price-pdf.service.ts +505 -0
- package/src/sales/delivery-challan/delivery-challan-pdf.service.ts +461 -0
- package/src/sales/delivery-challan/delivery-challan-print.service.ts +229 -0
- package/src/sales/delivery-challan/delivery-challan-totals.ts +466 -0
- package/src/sales/sales/equipment-design-pdf.service.ts +153 -0
- package/src/sales/sales/pack-ship-pdf.service.ts +128 -0
- package/src/sales/sales/pack-ship-print.service.ts +198 -0
- package/src/sales/sales/sales-pdf.service.ts +658 -0
- package/src/sales/sales/sales-print.service.ts +376 -0
- package/src/sales/sales/sales-totals.service.ts +500 -0
- package/src/sales-receive/sales-receive-pdf.service.ts +602 -0
- package/src/sales-receive/sales-receive-print.service.ts +242 -0
- package/src/sales-receive/sales-receive-totals.service.ts +651 -0
- package/src/services/checklist-pdf.ts +151 -0
- package/src/services/checklists-pdf.ts +133 -0
- package/src/services/est.print-service.ts +1155 -0
- package/src/services/reports/excel/insurance-expire-excel.service.ts +292 -0
- package/src/services/reports/excel/next-service-date-excel.service.ts +317 -0
- package/src/services/reports/excel/repair-orders-excel.service.ts +249 -0
- package/src/services/reports/pdf/insurance-expire-pdf.service.ts +115 -0
- package/src/services/reports/pdf/next-service-date-pdf.service.ts +198 -0
- package/src/services/reports/pdf/repair-orders-pdf.service.ts +184 -0
- package/src/services/ro-pdf.service.ts +1917 -0
- package/src/services/ro-print-service.ts +881 -0
- package/src/services/ro-totals.service.ts +1314 -0
- package/src/services/separate-wo-print.service.ts +396 -0
- package/src/services/service-history-pdf.service.ts +145 -0
- package/src/services/service-price-for-pricelist.ts +649 -0
- package/src/services/technician-pdf.service.ts +234 -0
- package/src/services/technician-print.service.ts +95 -0
- package/src/shared/header-footer-section/pdf-header-footer.section.ts +519 -0
- package/src/shared/header-footer-section/pdf-shared.utils.ts +46 -0
- package/src/shared/math-operations.ts +208 -0
- package/src/shared/party-details-section/pdf-party-details.section.ts +602 -0
- package/src/shared/shared-pdf.service.ts +3042 -0
- package/src/shared/shared-print.service.ts +879 -0
- package/src/shared/table-section/pdf-table.config.ts +8 -0
- package/src/shared/table-section/pdf-table.header.ts +396 -0
- package/src/shared/table-section/pdf-table.row.ts +248 -0
- package/src/shared/table-section/pdf-table.section.ts +447 -0
- package/src/shared/totals-section/pdf-totals.section.ts +921 -0
- package/src/shared/transactions-pdf.service.ts +191 -0
- package/src/shared/util.ts +101 -0
- package/src/tasks/meetings/meeting-pdf.ts +410 -0
- package/src/tasks/tasks/task-pdf.service.ts +238 -0
- package/src/tasks/tasks/task-reports-pdf.service.ts +313 -0
- package/src/tax/index.ts +86 -0
- package/src/tax/tax-calculator.ts +1025 -0
- package/src/tax/tax.types.ts +535 -0
- package/src/transaction-calculations/discounts-distribution.ts +343 -0
- package/src/transaction-calculations/index.ts +3 -0
- package/src/transaction-calculations/total-calculation.ts +443 -0
- package/src/transaction-calculations/transaction-calculation-engine.ts +903 -0
- package/src/utils/my-date.ts +111 -0
- package/src/utils/tr-utils.ts +104 -0
- package/tsconfig.json +2 -2
- /package/dist/{accounting/invoice/invoice-pdf.service.d.ts → shared/transactions-pdf.service.d.ts} +0 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
|
|
2
|
+
import { SharedPDFService } from '../../../../shared/shared-pdf.service';
|
|
3
|
+
import { MyDate } from '../../../../utils/my-date';
|
|
4
|
+
import { TrUtils } from '../../../../utils/tr-utils';
|
|
5
|
+
declare var pdfMake: any;
|
|
6
|
+
|
|
7
|
+
export class CustWiseSalesDetailsService {
|
|
8
|
+
|
|
9
|
+
static GetCustWiseSalesDetailsPrint(InvoicesData: any, EntityData: any, isPhar: boolean, isHC: boolean, isSale:boolean,searchValue:any) {
|
|
10
|
+
var dd = {
|
|
11
|
+
info: {
|
|
12
|
+
title: isSale?'CustomerWiseSales':'VendorWisePurchases',
|
|
13
|
+
},
|
|
14
|
+
header: function (currentPage: any, pageCount: any) {
|
|
15
|
+
return { text: currentPage.toString() + ' of ' + pageCount, alignment: 'right', marginRight: 7, fontSize: 8, marginTop: 2 };
|
|
16
|
+
},
|
|
17
|
+
pageMargins: [10, 15, 10, 15],
|
|
18
|
+
content: [
|
|
19
|
+
{ text: '' + EntityData.DName + '', style: ['header'] },
|
|
20
|
+
{ text: isSale?'Customer Wise Sales Details':'Vendor Wise Purchases Details', alignment: 'center', fontSize: 15, bold: true },
|
|
21
|
+
SharedPDFService.GetSearchValueDetails(searchValue),
|
|
22
|
+
this.GetInvoiceDataTable(InvoicesData, isPhar, isHC, isSale, EntityData.Settings?.DecimalsNumber),
|
|
23
|
+
|
|
24
|
+
],
|
|
25
|
+
styles: SharedPDFService.GetStyles()
|
|
26
|
+
};
|
|
27
|
+
return dd;
|
|
28
|
+
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
static GetInvoiceDataTable(InvoicesData: any, isPhar: boolean, isHC: boolean, isSale:boolean, DecimalsNumber: number) {
|
|
32
|
+
let Data: any = []
|
|
33
|
+
// InvoicesData.forEach((invoice: any) => {
|
|
34
|
+
Data.push(this.GetItemsTable(InvoicesData, isPhar, isHC,isSale, DecimalsNumber));
|
|
35
|
+
// });
|
|
36
|
+
|
|
37
|
+
return Data;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
static getTableWidths(isHC: any) {
|
|
41
|
+
// if (isHC) {
|
|
42
|
+
// return [25, '*', '*', '*', '*'];
|
|
43
|
+
// } else {
|
|
44
|
+
return [20, 50, 50, '*', 40, 40, 40, 45, 37, 40];
|
|
45
|
+
// }
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
static GetItemsTable(InvoiceData: any, isPhar: boolean, isHC: boolean, isSale:boolean, DecimalsNumber: number) {
|
|
49
|
+
// InvoicesData.forEach((InvoiceData: any) => {
|
|
50
|
+
return {
|
|
51
|
+
style: 'tableExample',
|
|
52
|
+
marginTop: 3,
|
|
53
|
+
marginBottom: 5,
|
|
54
|
+
table: {
|
|
55
|
+
widths: this.getTableWidths(isHC),
|
|
56
|
+
headerRows: 1,
|
|
57
|
+
body: this.BuildTableBodyForLaborAndParts(InvoiceData, isPhar, isHC, isSale, DecimalsNumber)
|
|
58
|
+
// body:[['fsdfsdf','asfafdas','asdasdas','asdasdasd','asddass']]
|
|
59
|
+
},
|
|
60
|
+
layout: {
|
|
61
|
+
hLineWidth: function (i:any, node:any) {
|
|
62
|
+
|
|
63
|
+
return (i === 0 || i === 1 || i === node.table.body.length) ? 1 : 0.5;
|
|
64
|
+
},
|
|
65
|
+
vLineWidth: function (i:any, node:any) {
|
|
66
|
+
return (i === 0 || i === node.table.widths.length) ? 1 : 0.5;
|
|
67
|
+
},
|
|
68
|
+
// hLineStyle: function (i, node) {
|
|
69
|
+
// return (i === 0 || i === 1) ? { dash: { length: 5, space: 5 } } : null;
|
|
70
|
+
// },
|
|
71
|
+
hLineColor: function (i: any, node: any) {
|
|
72
|
+
return (i === 0 || i === 1 || i === node.table.body.length) ? 'gray' : 'lightgrey';
|
|
73
|
+
|
|
74
|
+
},
|
|
75
|
+
vLineColor: function (i: any, node: any) {
|
|
76
|
+
return 'gray';
|
|
77
|
+
},
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
// });
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
static BuildTableBodyForLaborAndParts(InvoiceData: any, isPhar: boolean, isHC: boolean, isSale:boolean, DecimalsNumber: number) {
|
|
84
|
+
let body: any = this.GetHeaderNames(isPhar, isHC, isSale);
|
|
85
|
+
InvoiceData.forEach((invoice: any, index: any) => {
|
|
86
|
+
let dataRow: any = [];
|
|
87
|
+
dataRow.push({ text: index + 1 });
|
|
88
|
+
if(isSale){
|
|
89
|
+
dataRow.push({ text: invoice.Code });
|
|
90
|
+
}else{
|
|
91
|
+
dataRow.push({ text: invoice.BNo});
|
|
92
|
+
}
|
|
93
|
+
dataRow.push({ text: MyDate.ConvertUTCDateToReadable(invoice.CrDate), style: ['headerstyle'], });
|
|
94
|
+
if(isSale){
|
|
95
|
+
dataRow.push({ text: invoice.CustName});
|
|
96
|
+
}else{
|
|
97
|
+
dataRow.push({ text: invoice.VendName});
|
|
98
|
+
}
|
|
99
|
+
dataRow.push({ text: TrUtils.FixPriceValue(invoice.SubTotal, DecimalsNumber), alignment: 'right' });
|
|
100
|
+
dataRow.push({ text: TrUtils.FixPriceValue(invoice.Disc, DecimalsNumber), alignment: 'right' });
|
|
101
|
+
dataRow.push({ text: TrUtils.FixPriceValue(invoice.Tax, DecimalsNumber), alignment: 'right' });
|
|
102
|
+
dataRow.push({ text: TrUtils.FixPriceValue(invoice.Adjust, DecimalsNumber), alignment: 'right' });
|
|
103
|
+
dataRow.push({ text: TrUtils.FixPriceValue(invoice.Round, DecimalsNumber), alignment: 'right' });
|
|
104
|
+
dataRow.push({ text: TrUtils.FixPriceValue(invoice.Total, DecimalsNumber), alignment: 'right' });
|
|
105
|
+
body.push(dataRow);
|
|
106
|
+
});
|
|
107
|
+
return body;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
static GetHeaderNames(isPhar: boolean, isHC: boolean, isSale:boolean) {
|
|
111
|
+
let HeadingNames: any;
|
|
112
|
+
HeadingNames = [[{ text: 'S.No', style: 'tableheader1', Field: 'SNo', alignment: 'left', line: true },
|
|
113
|
+
{ text: 'Transaction #', style: 'tableheader1', Field: 'Code' },
|
|
114
|
+
{ text: 'Created Date', style: 'tableheader1', Field: 'CrDate' },
|
|
115
|
+
{ text: isSale? 'Customer Name' :'Vendor Name', style: 'tableheader1', Field: 'Name' },
|
|
116
|
+
{ text: 'SubTotal', style: 'tableheader1', Field: 'SubTotal', alignment: 'right' },
|
|
117
|
+
{ text: 'Discount', style: 'tableheader1', Field: 'Disc', alignment: 'right' },
|
|
118
|
+
{ text: 'Tax', style: 'tableheader1', Field: 'Tax', alignment: 'right' },
|
|
119
|
+
{ text: 'Adjustment', style: 'tableheader1', Field: 'Adjust', alignment: 'right' },
|
|
120
|
+
{ text: 'Round off', style: 'tableheader1', Field: 'Round', alignment: 'right' },
|
|
121
|
+
{ text: 'Total', style: 'tableheader1', Field: 'Total', alignment: 'right' }]];
|
|
122
|
+
return HeadingNames;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { SharedPDFService } from "../../../../shared/shared-pdf.service";
|
|
2
|
+
import { TrUtils } from "../../../../utils/tr-utils";
|
|
3
|
+
|
|
4
|
+
// import { MyDate } from '../utils/my-date';
|
|
5
|
+
declare var pdfMake: any;
|
|
6
|
+
|
|
7
|
+
export class SalesByCustomerPDFService {
|
|
8
|
+
|
|
9
|
+
static GetSaleByCustPrint(InvoicesData: any, EntityData: any, isPhar: boolean, isHC: boolean, IsSales:boolean, HeaerName:any, searchValue:any) {
|
|
10
|
+
var dd = {
|
|
11
|
+
info: {
|
|
12
|
+
title: 'CustomerWiseSalesSummary',
|
|
13
|
+
},
|
|
14
|
+
header: function (currentPage: any, pageCount: any) {
|
|
15
|
+
return { text: currentPage.toString() + ' of ' + pageCount, alignment: 'right', marginRight: 7, fontSize: 8, marginTop: 2 };
|
|
16
|
+
},
|
|
17
|
+
pageMargins: [10, 15, 10, 15],
|
|
18
|
+
content: [
|
|
19
|
+
{ text: '' + EntityData.DName + '', style: ['header'] },
|
|
20
|
+
{ text: HeaerName, alignment: 'center', fontSize: 15, bold: true },
|
|
21
|
+
SharedPDFService.GetSearchValueDetails(searchValue),
|
|
22
|
+
this.GetInvoiceDataTable(InvoicesData, isPhar, isHC, IsSales, EntityData.Settings?.DecimalsNumber),
|
|
23
|
+
|
|
24
|
+
],
|
|
25
|
+
styles: SharedPDFService.GetStyles()
|
|
26
|
+
};
|
|
27
|
+
return dd;
|
|
28
|
+
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
static GetInvoiceDataTable(InvoicesData: any, isPhar: boolean, isHC: boolean, IsSales:boolean, DecimalsNumber: number) {
|
|
32
|
+
let Data: any = []
|
|
33
|
+
// InvoicesData.forEach((invoice: any) => {
|
|
34
|
+
Data.push(this.GetItemsTable(InvoicesData, isPhar, isHC, IsSales, DecimalsNumber));
|
|
35
|
+
// });
|
|
36
|
+
|
|
37
|
+
return Data;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
static getTableWidths(isHC: any) {
|
|
41
|
+
// if (isHC) {
|
|
42
|
+
return [22, '*', 25, 50, 40, 40, 40, 30, 50];
|
|
43
|
+
// } else {
|
|
44
|
+
// return [25, '*', 40, 40, 80];
|
|
45
|
+
// }
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
static GetItemsTable(InvoiceData: any, isPhar: boolean, isHC: boolean, IsSales:boolean, DecimalsNumber: number) {
|
|
49
|
+
// InvoicesData.forEach((InvoiceData: any) => {
|
|
50
|
+
return {
|
|
51
|
+
style: 'tableExample',
|
|
52
|
+
marginTop: 3,
|
|
53
|
+
marginBottom: 5,
|
|
54
|
+
table: {
|
|
55
|
+
widths: this.getTableWidths(isHC),
|
|
56
|
+
headerRows: 1,
|
|
57
|
+
body: this.BuildTableBodyForLaborAndParts(InvoiceData, isPhar, isHC, IsSales, DecimalsNumber)
|
|
58
|
+
// body:[['fsdfsdf','asfafdas','asdasdas','asdasdasd','asddass']]
|
|
59
|
+
},
|
|
60
|
+
layout: {
|
|
61
|
+
hLineWidth: function (i:any, node:any) {
|
|
62
|
+
|
|
63
|
+
return (i === 0 || i === 1 || i === node.table.body.length) ? 1 : 0.5;
|
|
64
|
+
},
|
|
65
|
+
vLineWidth: function (i:any, node:any) {
|
|
66
|
+
return (i === 0 || i === node.table.widths.length) ? 1 : 0.5;
|
|
67
|
+
},
|
|
68
|
+
// hLineStyle: function (i, node) {
|
|
69
|
+
// return (i === 0 || i === 1) ? { dash: { length: 5, space: 5 } } : null;
|
|
70
|
+
// },
|
|
71
|
+
hLineColor: function (i: any, node: any) {
|
|
72
|
+
return (i === 0 || i === 1 || i === node.table.body.length) ? 'gray' : 'lightgrey';
|
|
73
|
+
|
|
74
|
+
},
|
|
75
|
+
vLineColor: function (i: any, node: any) {
|
|
76
|
+
return 'gray';
|
|
77
|
+
},
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
// });
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
static BuildTableBodyForLaborAndParts(InvoiceData: any, isPhar: boolean, isHC: boolean, IsSales:boolean, DecimalsNumber: number) {
|
|
84
|
+
let body: any = this.GetHeaderNames(isPhar, isHC);
|
|
85
|
+
InvoiceData.forEach((invoice: any, index: any) => {
|
|
86
|
+
let dataRow: any = [];
|
|
87
|
+
dataRow.push({ text: index + 1 });
|
|
88
|
+
if(IsSales){
|
|
89
|
+
dataRow.push({ text:invoice.CustName, style: ['headerstyle'], });
|
|
90
|
+
}else{
|
|
91
|
+
dataRow.push({ text:invoice.VendName, style: ['headerstyle'], });
|
|
92
|
+
}
|
|
93
|
+
dataRow.push({ text: invoice.Count, alignment: 'right' });
|
|
94
|
+
dataRow.push({ text: TrUtils.FixPriceValue(invoice.SubTotal, DecimalsNumber), alignment: 'right' });
|
|
95
|
+
dataRow.push({ text: TrUtils.FixPriceValue(invoice.Disc, DecimalsNumber), alignment: 'right' });
|
|
96
|
+
dataRow.push({ text: TrUtils.FixPriceValue(invoice.Tax, DecimalsNumber), alignment: 'right' });
|
|
97
|
+
dataRow.push({ text: TrUtils.FixPriceValue(invoice.Adjust, DecimalsNumber), alignment: 'right' });
|
|
98
|
+
dataRow.push({ text: TrUtils.FixPriceValue(invoice.Round, DecimalsNumber), alignment: 'right' });
|
|
99
|
+
dataRow.push({ text: TrUtils.FixPriceValue(invoice.Total, DecimalsNumber), alignment: 'right', style: ['headerstyle'], });
|
|
100
|
+
body.push(dataRow);
|
|
101
|
+
});
|
|
102
|
+
return body;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
static GetHeaderNames(isPhar: boolean, isHC: boolean) {
|
|
106
|
+
let HeadingNames: any;
|
|
107
|
+
HeadingNames = [[{ text: 'S.No', style: 'tableheader1', Field: 'SNo', alignment: 'left', line: true },
|
|
108
|
+
{ text: 'Name', style: 'tableheader1', Field: 'Name' },
|
|
109
|
+
{ text: 'Count', style: 'tableheader1', Field: 'Count', alignment: 'right' },
|
|
110
|
+
{ text: 'SubTotal', style: 'tableheader1', Field: 'SubTotal', alignment: 'right' },
|
|
111
|
+
{ text: 'Discount', style: 'tableheader1', Field: 'Disc', alignment: 'right' },
|
|
112
|
+
{ text: 'Tax', style: 'tableheader1', Field: 'Tax', alignment: 'right' },
|
|
113
|
+
{ text: 'Adjust', style: 'tableheader1', Field: 'Adjust', alignment: 'right' },
|
|
114
|
+
{ text: 'Round', style: 'tableheader1', Field: 'Round', alignment: 'right' },
|
|
115
|
+
{ text: 'Total', style: 'tableheader1', Field: 'Total', alignment: 'right' }]];
|
|
116
|
+
return HeadingNames;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { SharedPDFService } from "../../../../shared/shared-pdf.service";
|
|
2
|
+
import { TrUtils } from "../../../../utils/tr-utils";
|
|
3
|
+
|
|
4
|
+
declare var pdfMake: any;
|
|
5
|
+
|
|
6
|
+
export class ItemWiseDoctorSalePDFService {
|
|
7
|
+
|
|
8
|
+
static GetItemWiseDoctorSalePrint(InvoicesData: any, EntityData: any, searchValue:any) {
|
|
9
|
+
var dd = {
|
|
10
|
+
info: {
|
|
11
|
+
title: 'ItemWiseDoctorSale',
|
|
12
|
+
},
|
|
13
|
+
header: function (currentPage: any, pageCount: any) {
|
|
14
|
+
return { text: currentPage.toString() + ' of ' + pageCount, alignment: 'right', marginRight: 7, fontSize: 8, marginTop: 2 };
|
|
15
|
+
},
|
|
16
|
+
pageMargins: [10, 15, 10, 15],
|
|
17
|
+
content: [
|
|
18
|
+
{ text: '' + EntityData.DName + '', style: ['header'] },
|
|
19
|
+
{ text: 'Item Wise Doctor Sale', alignment: 'center', fontSize: 15, bold: true },
|
|
20
|
+
SharedPDFService.GetSearchValueDetails(searchValue),
|
|
21
|
+
this.GetInvoiceDataTable(InvoicesData, EntityData.Settings.DecimalsNumber),
|
|
22
|
+
|
|
23
|
+
],
|
|
24
|
+
styles: SharedPDFService.GetStyles()
|
|
25
|
+
};
|
|
26
|
+
return dd;
|
|
27
|
+
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
static GetInvoiceDataTable(InvoicesData: any, DecimalsNumber: number) {
|
|
31
|
+
let Data: any = []
|
|
32
|
+
// InvoicesData.forEach((invoice: any) => {
|
|
33
|
+
Data.push(this.GetItemsTable(InvoicesData, DecimalsNumber));
|
|
34
|
+
// });
|
|
35
|
+
|
|
36
|
+
return Data;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
static getTableWidths() {
|
|
40
|
+
// if (isHC) {
|
|
41
|
+
// return [25, '*', '*', '*', '*'];
|
|
42
|
+
// } else {
|
|
43
|
+
return [25, '*', '*', '*', '*'];
|
|
44
|
+
// }
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
static GetItemsTable(InvoiceData: any, DecimalsNumber: number) {
|
|
48
|
+
// InvoicesData.forEach((InvoiceData: any) => {
|
|
49
|
+
return {
|
|
50
|
+
style: 'tableExample',
|
|
51
|
+
marginTop: 3,
|
|
52
|
+
marginBottom: 5,
|
|
53
|
+
table: {
|
|
54
|
+
widths: this.getTableWidths(),
|
|
55
|
+
headerRows: 1,
|
|
56
|
+
body: this.BuildTableBodyForLaborAndParts(InvoiceData, DecimalsNumber)
|
|
57
|
+
// body:[['fsdfsdf','asfafdas','asdasdas','asdasdasd','asddass']]
|
|
58
|
+
},
|
|
59
|
+
layout: {
|
|
60
|
+
hLineWidth: function (i:any, node:any) {
|
|
61
|
+
|
|
62
|
+
return (i === 0 || i === 1 || i === node.table.body.length) ? 1 : 0.5;
|
|
63
|
+
},
|
|
64
|
+
vLineWidth: function (i:any, node:any) {
|
|
65
|
+
return (i === 0 || i === node.table.widths.length) ? 1 : 0.5;
|
|
66
|
+
},
|
|
67
|
+
// hLineStyle: function (i, node) {
|
|
68
|
+
// return (i === 0 || i === 1) ? { dash: { length: 5, space: 5 } } : null;
|
|
69
|
+
// },
|
|
70
|
+
hLineColor: function (i: any, node: any) {
|
|
71
|
+
return (i === 0 || i === 1 || i === node.table.body.length) ? 'gray' : 'lightgrey';
|
|
72
|
+
|
|
73
|
+
},
|
|
74
|
+
vLineColor: function (i: any, node: any) {
|
|
75
|
+
return 'gray';
|
|
76
|
+
},
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
// });
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
static BuildTableBodyForLaborAndParts(InvoiceData: any, DecimalsNumber: number) {
|
|
83
|
+
let body: any = this.GetHeaderNames();
|
|
84
|
+
// let Row: any = [{ text: InvoiceData.Name, alignment: 'left', colSpan: isHC ? 5 : 8, bold: true, fontSize: 12 }, {}, {}, {}, {}];
|
|
85
|
+
// if (!isHC) {
|
|
86
|
+
// Row.push({});
|
|
87
|
+
// Row.push({});
|
|
88
|
+
// Row.push({});
|
|
89
|
+
// }
|
|
90
|
+
// body.unshift(Row);
|
|
91
|
+
// InvoicesData.forEach((InvoiceData: any) => {
|
|
92
|
+
InvoiceData.forEach((invoice: any, index: any) => {
|
|
93
|
+
let dataRow: any = [];
|
|
94
|
+
// if (isHC) {
|
|
95
|
+
// dataRow.push({ text: index + 1 });
|
|
96
|
+
// dataRow.push({ text: invoice.Code });
|
|
97
|
+
// if (!isHC) {
|
|
98
|
+
// dataRow.push({ text: invoice.Prod?.RegNo });
|
|
99
|
+
// dataRow.push({ text: TrUtils.IsNull(invoice.Prod) ? '' : invoice.Prod?.Model + ' ' + invoice.Prod?.Var });
|
|
100
|
+
// }
|
|
101
|
+
// // dataRow.push({ text: invoice.BFrom.Name, alignment: 'left', style: ['headerstyle'], });
|
|
102
|
+
// dataRow.push({ text: MyDate.ConvertUTCDateToReadable(invoice.CrDate), alignment: 'center', style: ['headerstyle'], });
|
|
103
|
+
// dataRow.push({ text: TrUtils.FixPriceValue(invoice.Total), alignment: 'right', style: ['headerstyle'], });
|
|
104
|
+
// dataRow.push({ text: TrUtils.FixPriceValue(invoice.Due), alignment: 'right', style: ['headerstyle'], });
|
|
105
|
+
|
|
106
|
+
// body.push(dataRow);
|
|
107
|
+
// if (InvoiceData.Invoices.length === (index + 1)) {
|
|
108
|
+
// let Row: any = [{ text: 'Total Due ', alignment: 'right', colSpan: isHC ? 4 : 6, bold: true, fontSize: 9 }, {}, {}, {}, { text: TrUtils.FixPriceValue(InvoiceData.Balance), fontSize: 9, alignment: 'right', bold: true }];
|
|
109
|
+
// if (!isHC) {
|
|
110
|
+
// Row.splice(2, 0, {}, {});
|
|
111
|
+
// // Row.push({});
|
|
112
|
+
// }
|
|
113
|
+
// body.push(Row);
|
|
114
|
+
// }
|
|
115
|
+
// } else {
|
|
116
|
+
dataRow.push({ text: index + 1 });
|
|
117
|
+
|
|
118
|
+
dataRow.push({ text: invoice.Name });
|
|
119
|
+
dataRow.push({ text: invoice.Count });
|
|
120
|
+
|
|
121
|
+
// if(!isHC){
|
|
122
|
+
dataRow.push({ text: TrUtils.FixPriceValue(invoice.Qty, DecimalsNumber), alignment: 'right' });
|
|
123
|
+
dataRow.push({ text: TrUtils.FixPriceValue(invoice.AvgPr, DecimalsNumber), alignment: 'right' });
|
|
124
|
+
// dataRow.push({ text: TrUtils.FixPriceValue(invoice.Total), alignment: 'right' });
|
|
125
|
+
// dataRow.push({ text: TrUtils.IsNull(invoice.Prod) ? '' : invoice.Prod?.Model + ' ' + invoice.Prod?.Var });
|
|
126
|
+
// }
|
|
127
|
+
// dataRow.push({ text: invoice.BFrom.Name, alignment: 'left', style: ['headerstyle'], });
|
|
128
|
+
// dataRow.push({ text: TrUtils.FixPriceValue(invoice.UnAmt + invoice.Tax), alignment: 'right', style: ['headerstyle'], });
|
|
129
|
+
// dataRow.push({ text: TrUtils.FixPriceValue(invoice.Due), alignment: 'right', style: ['headerstyle'], });
|
|
130
|
+
|
|
131
|
+
body.push(dataRow);
|
|
132
|
+
// if (InvoiceData.Invoices.length === (index + 1)) {
|
|
133
|
+
// let Row: any = [{ text: 'Total Due ', alignment: 'right', colSpan: isHC?4:6, bold: true, fontSize: 9 }, {}, {}, {}, { text: TrUtils.FixPriceValue(InvoiceData.Balance), fontSize: 9, alignment: 'right', bold: true }];
|
|
134
|
+
// if(!isHC){
|
|
135
|
+
// Row.splice(2, 0,{},{});
|
|
136
|
+
// // Row.push({});
|
|
137
|
+
// }
|
|
138
|
+
// body.push(Row);
|
|
139
|
+
// }
|
|
140
|
+
// }
|
|
141
|
+
|
|
142
|
+
});
|
|
143
|
+
// });
|
|
144
|
+
return body;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
static GetHeaderNames() {
|
|
148
|
+
let HeadingNames: any;
|
|
149
|
+
// if (isHC) {
|
|
150
|
+
// HeadingNames = [[{ text: 'S.No', style: 'tableheader1', Field: 'SNo', alignment: 'left', line: true },
|
|
151
|
+
// { text: isPhar ? 'Counter Sale Number' : 'Invoice Number', style: 'tableheader1', Field: 'BNo', alignment: 'left' },
|
|
152
|
+
// { text: 'Create Date', style: 'tableheader1', Field: 'CrDate' },
|
|
153
|
+
// { text: 'Total', style: 'tableheader1', Field: 'Total', alignment: 'right' },
|
|
154
|
+
// { text: 'Due', style: 'tableheader1', Field: 'Due', alignment: 'right' }]];
|
|
155
|
+
// if (!isHC) {
|
|
156
|
+
// HeadingNames[0].splice(2, 0, { text: 'Reg No', style: 'tableheader1', Field: 'Reg No', alignment: 'left' }
|
|
157
|
+
// , { text: 'Vehicle', style: 'tableheader1', Field: 'Vehicle', alignment: 'left' });
|
|
158
|
+
// // HeadingNames.splice(3, 0, { text: 'Vehicle', style: 'tableheader1', Field: 'Vehicle', alignment: 'left' });
|
|
159
|
+
// }
|
|
160
|
+
// } else {
|
|
161
|
+
HeadingNames = [[{ text: 'S.No', style: 'tableheader1', Field: 'SNo', alignment: 'left', line: true },
|
|
162
|
+
{ text: 'Item Name', style: 'tableheader1', Field: 'Desc' },
|
|
163
|
+
{ text: 'No. of Transactions', style: 'tableheader1', Field: 'Batch' },
|
|
164
|
+
{ text: 'Quantity', style: 'tableheader1', Field: 'Round', alignment: 'right' },
|
|
165
|
+
{ text: 'Average Price', style: 'tableheader1', Field: 'Total', alignment: 'right' },
|
|
166
|
+
]
|
|
167
|
+
];
|
|
168
|
+
// { text: 'Due', style: 'tableheader1', Field: 'Due', alignment: 'right' }]];
|
|
169
|
+
// if (!isHC) {
|
|
170
|
+
// HeadingNames[0].splice(2, 0, { text: 'Reg No', style: 'tableheader1', Field: 'Reg No', alignment: 'left' }
|
|
171
|
+
// , { text: 'Vehicle', style: 'tableheader1', Field: 'Vehicle', alignment: 'left' });
|
|
172
|
+
// // HeadingNames.splice(3, 0, { text: 'Vehicle', style: 'tableheader1', Field: 'Vehicle', alignment: 'left' });
|
|
173
|
+
// }
|
|
174
|
+
// }
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
return HeadingNames;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { Add } from "../../../../shared/math-operations";
|
|
2
|
+
import { SharedPDFService } from "../../../../shared/shared-pdf.service";
|
|
3
|
+
import { TrUtils } from "../../../../utils/tr-utils";
|
|
4
|
+
|
|
5
|
+
// import { MyDate } from '../utils/my-date';
|
|
6
|
+
declare var pdfMake: any;
|
|
7
|
+
|
|
8
|
+
export class ItemWiseSalesPDFService {
|
|
9
|
+
|
|
10
|
+
static GetItemWiseSalesPrint(InvoicesData: any, EntityData: any, HeaderName:any, searchValue:any) {
|
|
11
|
+
var dd = {
|
|
12
|
+
info: {
|
|
13
|
+
title: 'ItemsWiseSale',
|
|
14
|
+
},
|
|
15
|
+
header: function (currentPage: any, pageCount: any) {
|
|
16
|
+
return { text: currentPage.toString() + ' of ' + pageCount, alignment: 'right', marginRight: 7, fontSize: 8, marginTop: 2 };
|
|
17
|
+
},
|
|
18
|
+
pageMargins: [10, 15, 10, 15],
|
|
19
|
+
content: [
|
|
20
|
+
{ text: '' + EntityData.DName + '', style: ['header'] },
|
|
21
|
+
{ text: HeaderName, alignment: 'center', fontSize: 15, bold: true },
|
|
22
|
+
SharedPDFService.GetSearchValueDetails(searchValue),
|
|
23
|
+
this.GetInvoiceDataTable(InvoicesData, EntityData.Settings.DecimalsNumber),
|
|
24
|
+
|
|
25
|
+
],
|
|
26
|
+
styles: SharedPDFService.GetStyles()
|
|
27
|
+
};
|
|
28
|
+
return dd;
|
|
29
|
+
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
static GetInvoiceDataTable(InvoicesData: any, DecimalsNumber: number) {
|
|
33
|
+
let Data: any = []
|
|
34
|
+
// InvoicesData.forEach((invoice: any) => {
|
|
35
|
+
Data.push(this.GetItemsTable(InvoicesData, DecimalsNumber));
|
|
36
|
+
// });
|
|
37
|
+
|
|
38
|
+
return Data;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
static getTableWidths() {
|
|
42
|
+
// if (isHC) {
|
|
43
|
+
return [25, '*', 40, 60, 55, 60, 70, 70];
|
|
44
|
+
// } else {
|
|
45
|
+
// return [25, '*', 40, 40, 80];
|
|
46
|
+
// }
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
static GetItemsTable(InvoiceData: any, DecimalsNumber: number) {
|
|
50
|
+
// InvoicesData.forEach((InvoiceData: any) => {
|
|
51
|
+
return {
|
|
52
|
+
style: 'tableExample',
|
|
53
|
+
marginTop: 3,
|
|
54
|
+
marginBottom: 5,
|
|
55
|
+
table: {
|
|
56
|
+
widths: this.getTableWidths(),
|
|
57
|
+
headerRows: 1,
|
|
58
|
+
body: this.BuildTableBodyForLaborAndParts(InvoiceData, DecimalsNumber)
|
|
59
|
+
// body:[['fsdfsdf','asfafdas','asdasdas','asdasdasd','asddass']]
|
|
60
|
+
},
|
|
61
|
+
layout: {
|
|
62
|
+
hLineWidth: function (i:any, node:any) {
|
|
63
|
+
|
|
64
|
+
return (i === 0 || i === 1 || i === node.table.body.length) ? 1 : 0.5;
|
|
65
|
+
},
|
|
66
|
+
vLineWidth: function (i:any, node:any) {
|
|
67
|
+
return (i === 0 || i === node.table.widths.length) ? 1 : 0.5;
|
|
68
|
+
},
|
|
69
|
+
// hLineStyle: function (i, node) {
|
|
70
|
+
// return (i === 0 || i === 1) ? { dash: { length: 5, space: 5 } } : null;
|
|
71
|
+
// },
|
|
72
|
+
hLineColor: function (i: any, node: any) {
|
|
73
|
+
return (i === 0 || i === 1 || i === node.table.body.length) ? 'gray' : 'lightgrey';
|
|
74
|
+
|
|
75
|
+
},
|
|
76
|
+
vLineColor: function (i: any, node: any) {
|
|
77
|
+
return 'gray';
|
|
78
|
+
},
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
// });
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
static BuildTableBodyForLaborAndParts(InvoiceData: any, DecimalsNumber: number) {
|
|
85
|
+
let body: any = this.GetHeaderNames();
|
|
86
|
+
// let Row: any = [{ text: InvoiceData.Name, alignment: 'left', colSpan: isHC ? 5 : 8, bold: true, fontSize: 12 }, {}, {}, {}, {}];
|
|
87
|
+
// if (!isHC) {
|
|
88
|
+
// Row.push({});
|
|
89
|
+
// Row.push({});
|
|
90
|
+
// Row.push({});
|
|
91
|
+
// }
|
|
92
|
+
// body.unshift(Row);
|
|
93
|
+
// InvoicesData.forEach((InvoiceData: any) => {
|
|
94
|
+
InvoiceData.forEach((invoice: any, index: any) => {
|
|
95
|
+
let dataRow: any = [];
|
|
96
|
+
// if (isHC) {
|
|
97
|
+
// dataRow.push({ text: index + 1 });
|
|
98
|
+
// dataRow.push({ text: invoice.Code });
|
|
99
|
+
// if (!isHC) {
|
|
100
|
+
// dataRow.push({ text: invoice.Prod?.RegNo });
|
|
101
|
+
// dataRow.push({ text: TrUtils.IsNull(invoice.Prod) ? '' : invoice.Prod?.Model + ' ' + invoice.Prod?.Var });
|
|
102
|
+
// }
|
|
103
|
+
// // dataRow.push({ text: invoice.BFrom.Name, alignment: 'left', style: ['headerstyle'], });
|
|
104
|
+
// dataRow.push({ text: MyDate.ConvertUTCDateToReadable(invoice.CrDate), alignment: 'center', style: ['headerstyle'], });
|
|
105
|
+
// dataRow.push({ text: TrUtils.FixPriceValue(invoice.Total), alignment: 'right', style: ['headerstyle'], });
|
|
106
|
+
// dataRow.push({ text: TrUtils.FixPriceValue(invoice.Due), alignment: 'right', style: ['headerstyle'], });
|
|
107
|
+
|
|
108
|
+
// body.push(dataRow);
|
|
109
|
+
// if (InvoiceData.Invoices.length === (index + 1)) {
|
|
110
|
+
// let Row: any = [{ text: 'Total Due ', alignment: 'right', colSpan: isHC ? 4 : 6, bold: true, fontSize: 9 }, {}, {}, {}, { text: TrUtils.FixPriceValue(InvoiceData.Balance), fontSize: 9, alignment: 'right', bold: true }];
|
|
111
|
+
// if (!isHC) {
|
|
112
|
+
// Row.splice(2, 0, {}, {});
|
|
113
|
+
// // Row.push({});
|
|
114
|
+
// }
|
|
115
|
+
// body.push(Row);
|
|
116
|
+
// }
|
|
117
|
+
// } else {
|
|
118
|
+
dataRow.push({ text: index + 1 });
|
|
119
|
+
// if(IsSales){
|
|
120
|
+
dataRow.push({ text:invoice.Name, style: ['headerstyle'], });
|
|
121
|
+
// }else{
|
|
122
|
+
// dataRow.push({ text:invoice.VendName, style: ['headerstyle'], });
|
|
123
|
+
// }
|
|
124
|
+
dataRow.push({ text: invoice.Qty, alignment: 'right' });
|
|
125
|
+
// dataRow.push({ text: invoice.SubTotal, alignment: 'right' });
|
|
126
|
+
// // if(!isHC){
|
|
127
|
+
// dataRow.push({ text: invoice.OfQty, alignment: 'right' });
|
|
128
|
+
dataRow.push({ text: TrUtils.FixPriceValue(invoice.UnAmt, DecimalsNumber), alignment: 'right' });
|
|
129
|
+
dataRow.push({ text: TrUtils.FixPriceValue(invoice.Disc, DecimalsNumber), alignment: 'right' });
|
|
130
|
+
dataRow.push({ text: TrUtils.FixPriceValue(invoice.Tax, DecimalsNumber), alignment: 'right' });
|
|
131
|
+
dataRow.push({ text: TrUtils.FixPriceValue(Add(invoice.NetAmt, invoice.Tax), DecimalsNumber), alignment: 'right' });
|
|
132
|
+
dataRow.push({ text: TrUtils.FixPriceValue(invoice.AvgPr, DecimalsNumber), alignment: 'right' });
|
|
133
|
+
// dataRow.push({ text: TrUtils.IsNull(invoice.Prod) ? '' : invoice.Prod?.Model + ' ' + invoice.Prod?.Var });
|
|
134
|
+
// }
|
|
135
|
+
// dataRow.push({ text: invoice.BFrom.Name, alignment: 'left', style: ['headerstyle'], });
|
|
136
|
+
// dataRow.push({ text: TrUtils.FixPriceValue(invoice.Total ), alignment: 'right', style: ['headerstyle'], });
|
|
137
|
+
// dataRow.push({ text: TrUtils.FixPriceValue(invoice.Due), alignment: 'right', style: ['headerstyle'], });
|
|
138
|
+
|
|
139
|
+
body.push(dataRow);
|
|
140
|
+
// if (InvoiceData.Invoices.length === (index + 1)) {
|
|
141
|
+
// let Row: any = [{ text: 'Total Due ', alignment: 'right', colSpan: isHC?4:6, bold: true, fontSize: 9 }, {}, {}, {}, { text: TrUtils.FixPriceValue(InvoiceData.Balance), fontSize: 9, alignment: 'right', bold: true }];
|
|
142
|
+
// if(!isHC){
|
|
143
|
+
// Row.splice(2, 0,{},{});
|
|
144
|
+
// // Row.push({});
|
|
145
|
+
// }
|
|
146
|
+
// body.push(Row);
|
|
147
|
+
// }
|
|
148
|
+
// }
|
|
149
|
+
|
|
150
|
+
});
|
|
151
|
+
// });
|
|
152
|
+
return body;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
static GetHeaderNames() {
|
|
156
|
+
let HeadingNames: any;
|
|
157
|
+
// if (isHC) {
|
|
158
|
+
// HeadingNames = [[{ text: 'S.No', style: 'tableheader1', Field: 'SNo', alignment: 'left', line: true },
|
|
159
|
+
// { text: isPhar ? 'Counter Sale Number' : 'Invoice Number', style: 'tableheader1', Field: 'BNo', alignment: 'left' },
|
|
160
|
+
// { text: 'Create Date', style: 'tableheader1', Field: 'CrDate' },
|
|
161
|
+
// { text: 'Total', style: 'tableheader1', Field: 'Total', alignment: 'right' },
|
|
162
|
+
// { text: 'Due', style: 'tableheader1', Field: 'Due', alignment: 'right' }]];
|
|
163
|
+
// if (!isHC) {
|
|
164
|
+
// HeadingNames[0].splice(2, 0, { text: 'Reg No', style: 'tableheader1', Field: 'Reg No', alignment: 'left' }
|
|
165
|
+
// , { text: 'Vehicle', style: 'tableheader1', Field: 'Vehicle', alignment: 'left' });
|
|
166
|
+
// // HeadingNames.splice(3, 0, { text: 'Vehicle', style: 'tableheader1', Field: 'Vehicle', alignment: 'left' });
|
|
167
|
+
// }
|
|
168
|
+
// } else {
|
|
169
|
+
HeadingNames = [[{ text: 'S.No', style: 'tableheader1', Field: 'SNo', alignment: 'left', line: true },
|
|
170
|
+
{ text: 'Item Name', style: 'tableheader1', Field: 'Name' },
|
|
171
|
+
{ text: 'Qty', style: 'tableheader1', Field: 'Count', alignment: 'right' },
|
|
172
|
+
{ text: 'Amount', style: 'tableheader1', Field: 'SubTotal', alignment: 'right' },
|
|
173
|
+
// { text: 'Offer Qty', style: 'tableheader1', Field: 'OfQty', alignment: 'right' },
|
|
174
|
+
// { text: 'Amount', style: 'tableheader1', Field: 'UnAmt', alignment: 'right' },
|
|
175
|
+
{ text: 'Discount', style: 'tableheader1', Field: 'Disc', alignment: 'right' },
|
|
176
|
+
{ text: 'Tax', style: 'tableheader1', Field: 'Tax', alignment: 'right' },
|
|
177
|
+
{ text: 'Amount With Tax', style: 'tableheader1', Field: 'Adjust', alignment: 'right' },
|
|
178
|
+
{ text: 'Average Price', style: 'tableheader1', Field: 'Round', alignment: 'right' },
|
|
179
|
+
// { text: 'Total', style: 'tableheader1', Field: 'Total', alignment: 'right' }
|
|
180
|
+
]];
|
|
181
|
+
// { text: 'Due', style: 'tableheader1', Field: 'Due', alignment: 'right' }]];
|
|
182
|
+
// if (!isHC) {
|
|
183
|
+
// HeadingNames[0].splice(2, 0, { text: 'Reg No', style: 'tableheader1', Field: 'Reg No', alignment: 'left' }
|
|
184
|
+
// , { text: 'Vehicle', style: 'tableheader1', Field: 'Vehicle', alignment: 'left' });
|
|
185
|
+
// // HeadingNames.splice(3, 0, { text: 'Vehicle', style: 'tableheader1', Field: 'Vehicle', alignment: 'left' });
|
|
186
|
+
// }
|
|
187
|
+
// }
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
return HeadingNames;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
}
|