shareneus 1.6.99 → 1.7.1
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.
|
@@ -95,6 +95,7 @@ function negateNumericLikeValue(value) {
|
|
|
95
95
|
return String(normalized === 0 ? 0 : -Math.abs(normalized));
|
|
96
96
|
}
|
|
97
97
|
function getFirstFieldValue(item, dbFields = []) {
|
|
98
|
+
console.log('Getting first field value from item', item, 'using dbFields', dbFields);
|
|
98
99
|
for (const field of dbFields) {
|
|
99
100
|
const value = readValue(item, field);
|
|
100
101
|
if (value !== undefined && value !== null && value !== '') {
|
|
@@ -104,6 +105,8 @@ function getFirstFieldValue(item, dbFields = []) {
|
|
|
104
105
|
return '';
|
|
105
106
|
}
|
|
106
107
|
function readValue(item, field) {
|
|
108
|
+
console.log('Reading value for field', field, 'from item', item);
|
|
109
|
+
console.log('Direct value', item[field]);
|
|
107
110
|
if (!item || !field) {
|
|
108
111
|
return undefined;
|
|
109
112
|
}
|
|
@@ -111,11 +114,13 @@ function readValue(item, field) {
|
|
|
111
114
|
return item[field];
|
|
112
115
|
}
|
|
113
116
|
const dottedPathValue = field.split('.').reduce((current, key) => {
|
|
117
|
+
console.log('Current value for key', key, 'is', current);
|
|
114
118
|
if (current && current[key] !== undefined) {
|
|
115
119
|
return current[key];
|
|
116
120
|
}
|
|
117
121
|
return undefined;
|
|
118
122
|
}, item);
|
|
123
|
+
console.log('Value for field', field, 'is', dottedPathValue);
|
|
119
124
|
if (dottedPathValue !== undefined) {
|
|
120
125
|
return dottedPathValue;
|
|
121
126
|
}
|
|
@@ -1,17 +1,6 @@
|
|
|
1
|
-
export declare function buildInvoiceTotalsAndNotesSection(invoiceData: any, availableWidth: number, PrintConfigData?: any):
|
|
2
|
-
canvas: {
|
|
3
|
-
type: string;
|
|
4
|
-
x1: number;
|
|
5
|
-
y1: number;
|
|
6
|
-
x2: number;
|
|
7
|
-
y2: number;
|
|
8
|
-
lineWidth: number;
|
|
9
|
-
lineColor: string;
|
|
10
|
-
}[];
|
|
11
|
-
margin: number[];
|
|
12
|
-
} | {
|
|
1
|
+
export declare function buildInvoiceTotalsAndNotesSection(invoiceData: any, availableWidth: number, PrintConfigData?: any): {
|
|
13
2
|
columns: any[];
|
|
14
3
|
columnGap: number;
|
|
15
4
|
margin: number[];
|
|
16
|
-
}
|
|
5
|
+
}[];
|
|
17
6
|
export declare function buildSignatureSection(PrintConfig: any, invoiceData: any, availableWidth: number): any[];
|
|
@@ -30,16 +30,16 @@ function buildInvoiceTotalsAndNotesSection(invoiceData, availableWidth, PrintCon
|
|
|
30
30
|
if (!hasTopSection && !hasBottomSection) {
|
|
31
31
|
return [];
|
|
32
32
|
}
|
|
33
|
-
const dividerLine = {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
};
|
|
33
|
+
// const dividerLine = {
|
|
34
|
+
// canvas: [
|
|
35
|
+
// { type: 'line', x1: 0, y1: 0, x2: Math.max(1, availableWidth), y2: 0, lineWidth: 1, lineColor: '#1f2937' }
|
|
36
|
+
// ],
|
|
37
|
+
// margin: [0, 5, 0, 5]
|
|
38
|
+
// };
|
|
39
39
|
const topColumns = {
|
|
40
40
|
columns: buildTopSectionColumns(taxSummary, sType, showBankDetails, bankDetails, totals, totalInWords),
|
|
41
41
|
columnGap: 20,
|
|
42
|
-
margin: [0,
|
|
42
|
+
margin: [0, 2, 0, 8]
|
|
43
43
|
};
|
|
44
44
|
const bottomColumns = buildPostTotalsInfoSection({
|
|
45
45
|
totalInWords,
|
|
@@ -55,12 +55,12 @@ function buildInvoiceTotalsAndNotesSection(invoiceData, availableWidth, PrintCon
|
|
|
55
55
|
isPoSPrint
|
|
56
56
|
});
|
|
57
57
|
if (hasTopSection && hasBottomSection) {
|
|
58
|
-
return [
|
|
58
|
+
return [topColumns, bottomColumns];
|
|
59
59
|
}
|
|
60
60
|
if (hasTopSection) {
|
|
61
|
-
return [
|
|
61
|
+
return [topColumns];
|
|
62
62
|
}
|
|
63
|
-
return [
|
|
63
|
+
return [bottomColumns];
|
|
64
64
|
}
|
|
65
65
|
function buildTopSectionColumns(taxSummary, sType, showBankDetails, bankDetails, totals, totalInWords) {
|
|
66
66
|
const inWords = totalInWords || '-';
|
|
@@ -147,7 +147,7 @@ function buildPostTotalsInfoSection(data) {
|
|
|
147
147
|
}
|
|
148
148
|
],
|
|
149
149
|
columnGap: 6,
|
|
150
|
-
margin: [0,
|
|
150
|
+
margin: [0, 2, 0, 0]
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
153
|
if (termsText) {
|