@things-factory/worksheet-base 4.3.579 → 4.3.581
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.
|
@@ -91,7 +91,8 @@ async function renderInvoices({ req, timezoneOffSet }, context) {
|
|
|
91
91
|
});
|
|
92
92
|
const sumProductTotalPaidPrice = product_list.reduce((total, item) => total + item.product_total_paid_price, 0);
|
|
93
93
|
let date = datetime_util_1.DateTimeConverter.date(new Date((record.iv_issued_on || record.iv_created_at) - timezoneOffSet));
|
|
94
|
-
let shipping_discount = Math.abs(parseFloat(record.mos_actual_shipping_fee ||
|
|
94
|
+
let shipping_discount = Math.abs(parseFloat(record.mos_actual_shipping_fee || record.iv_actual_shipping_fee || 0) -
|
|
95
|
+
parseFloat(record.mos_shipping_fee || record.iv_shipping_fee || 0));
|
|
95
96
|
const data = {
|
|
96
97
|
order_no: record.rg_name,
|
|
97
98
|
ref_no: record.rg_ref_no,
|
|
@@ -139,19 +140,19 @@ async function renderInvoices({ req, timezoneOffSet }, context) {
|
|
|
139
140
|
.join(' '),
|
|
140
141
|
fulfillment_center: record.fc_name,
|
|
141
142
|
voucher_amount: getRoundedValue(parseFloat(record.mo_voucher_amount || 0)),
|
|
142
|
-
actual_shipping_fee: getRoundedValue(parseFloat(record.mos_shipping_fee || 0)),
|
|
143
|
+
actual_shipping_fee: getRoundedValue(parseFloat(record.mos_shipping_fee || record.iv_shipping_fee || 0)),
|
|
143
144
|
shipping_discount: getRoundedValue(shipping_discount),
|
|
144
|
-
seller_voucher_amount: getRoundedValue(parseFloat(record.mo_seller_voucher_amount || 0)),
|
|
145
|
-
platform_voucher_amount: getRoundedValue(parseFloat(record.mo_platform_voucher_amount || 0)),
|
|
146
|
-
seller_discount: getRoundedValue(parseFloat(record.mo_seller_discount || 0)),
|
|
147
|
-
platform_coins: getRoundedValue(parseFloat(record.mo_platform_coins || 0)),
|
|
145
|
+
seller_voucher_amount: getRoundedValue(parseFloat(record.mo_seller_voucher_amount || record.iv_seller_voucher_amount || 0)),
|
|
146
|
+
platform_voucher_amount: getRoundedValue(parseFloat(record.mo_platform_voucher_amount || record.iv_platform_voucher_amount || 0)),
|
|
147
|
+
seller_discount: getRoundedValue(parseFloat(record.mo_seller_discount || record.iv_seller_discount || 0)),
|
|
148
|
+
platform_coins: getRoundedValue(parseFloat(record.mo_platform_coins || record.iv_platform_coins || 0)),
|
|
148
149
|
sub_total: sumProductTotalPaidPrice,
|
|
149
150
|
grand_total: getRoundedValue(sumProductTotalPaidPrice -
|
|
150
|
-
parseFloat(record.mo_seller_voucher_amount || 0) -
|
|
151
|
-
parseFloat(record.mo_platform_voucher_amount || 0) -
|
|
152
|
-
parseFloat(record.mo_seller_discount || 0) -
|
|
153
|
-
parseFloat(record.mo_platform_coins || 0) +
|
|
154
|
-
parseFloat(record.mos_shipping_fee || 0) -
|
|
151
|
+
parseFloat(record.mo_seller_voucher_amount || record.iv_seller_voucher_amount || 0) -
|
|
152
|
+
parseFloat(record.mo_platform_voucher_amount || record.mo_platform_voucher_amount || 0) -
|
|
153
|
+
parseFloat(record.mo_seller_discount || record.mo_seller_discount || 0) -
|
|
154
|
+
parseFloat(record.mo_platform_coins || record.mo_platform_coins || 0) +
|
|
155
|
+
parseFloat(record.mos_shipping_fee || record.iv_shipping_fee || 0) -
|
|
155
156
|
shipping_discount || 0),
|
|
156
157
|
product_list
|
|
157
158
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-invoices.js","sourceRoot":"","sources":["../../server/controllers/render-invoices.ts"],"names":[],"mappings":";;;;;;AAAA,0DAAgC;AAChC,4DAA8B;AAC9B,qCAA2D;AAE3D,qEAAqE;AAErE,6CAA4C;AAC5C,2DAAwE;AACxE,iDAA8C;AAE9C,4CAA4C;AAC5C,0DAA0D;AAE1D,MAAM,cAAc,GAAG,YAAM,CAAC,GAAG,CAAC,cAAc,EAAE,6CAA6C,CAAC,CAAA;AAEzF,KAAK,UAAU,cAAc,CAAC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S,eAAe,CAAC,KAAK,GAAG,CAAC;IAChC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAA;AACzD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/worksheet-base",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.581",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -23,27 +23,27 @@
|
|
|
23
23
|
"migration:create": "node ../../node_modules/typeorm/cli.js migration:create -d ./server/migrations"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@things-factory/auth-base": "^4.3.
|
|
27
|
-
"@things-factory/biz-base": "^4.3.
|
|
26
|
+
"@things-factory/auth-base": "^4.3.581",
|
|
27
|
+
"@things-factory/biz-base": "^4.3.581",
|
|
28
28
|
"@things-factory/document-template-base": "^4.3.535",
|
|
29
|
-
"@things-factory/id-rule-base": "^4.3.
|
|
30
|
-
"@things-factory/integration-accounting": "^4.3.
|
|
31
|
-
"@things-factory/integration-base": "^4.3.
|
|
32
|
-
"@things-factory/integration-lmd": "^4.3.
|
|
33
|
-
"@things-factory/integration-marketplace": "^4.3.
|
|
34
|
-
"@things-factory/integration-powrup": "^4.3.
|
|
35
|
-
"@things-factory/integration-sellercraft": "^4.3.
|
|
36
|
-
"@things-factory/integration-sftp": "^4.3.
|
|
37
|
-
"@things-factory/marketplace-base": "^4.3.
|
|
38
|
-
"@things-factory/notification": "^4.3.
|
|
39
|
-
"@things-factory/sales-base": "^4.3.
|
|
40
|
-
"@things-factory/setting-base": "^4.3.
|
|
29
|
+
"@things-factory/id-rule-base": "^4.3.581",
|
|
30
|
+
"@things-factory/integration-accounting": "^4.3.581",
|
|
31
|
+
"@things-factory/integration-base": "^4.3.581",
|
|
32
|
+
"@things-factory/integration-lmd": "^4.3.581",
|
|
33
|
+
"@things-factory/integration-marketplace": "^4.3.581",
|
|
34
|
+
"@things-factory/integration-powrup": "^4.3.581",
|
|
35
|
+
"@things-factory/integration-sellercraft": "^4.3.581",
|
|
36
|
+
"@things-factory/integration-sftp": "^4.3.581",
|
|
37
|
+
"@things-factory/marketplace-base": "^4.3.581",
|
|
38
|
+
"@things-factory/notification": "^4.3.581",
|
|
39
|
+
"@things-factory/sales-base": "^4.3.581",
|
|
40
|
+
"@things-factory/setting-base": "^4.3.581",
|
|
41
41
|
"@things-factory/shell": "^4.3.535",
|
|
42
|
-
"@things-factory/transport-base": "^4.3.
|
|
43
|
-
"@things-factory/warehouse-base": "^4.3.
|
|
42
|
+
"@things-factory/transport-base": "^4.3.581",
|
|
43
|
+
"@things-factory/warehouse-base": "^4.3.581",
|
|
44
44
|
"jspdf": "2.5.1",
|
|
45
45
|
"puppeteer": "21.0.3",
|
|
46
46
|
"uuid": "^9.0.0"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "6e051a996f46ff64a22b0237b746c16a1629409e"
|
|
49
49
|
}
|
|
@@ -110,7 +110,8 @@ export async function renderInvoices({ req, timezoneOffSet }, context: any) {
|
|
|
110
110
|
|
|
111
111
|
let date = DateTimeConverter.date(new Date((record.iv_issued_on || record.iv_created_at) - timezoneOffSet))
|
|
112
112
|
let shipping_discount = Math.abs(
|
|
113
|
-
parseFloat(record.mos_actual_shipping_fee ||
|
|
113
|
+
parseFloat(record.mos_actual_shipping_fee || record.iv_actual_shipping_fee || 0) -
|
|
114
|
+
parseFloat(record.mos_shipping_fee || record.iv_shipping_fee || 0)
|
|
114
115
|
)
|
|
115
116
|
const data = {
|
|
116
117
|
order_no: record.rg_name,
|
|
@@ -161,20 +162,24 @@ export async function renderInvoices({ req, timezoneOffSet }, context: any) {
|
|
|
161
162
|
.join(' '),
|
|
162
163
|
fulfillment_center: record.fc_name,
|
|
163
164
|
voucher_amount: getRoundedValue(parseFloat(record.mo_voucher_amount || 0)),
|
|
164
|
-
actual_shipping_fee: getRoundedValue(parseFloat(record.mos_shipping_fee || 0)),
|
|
165
|
+
actual_shipping_fee: getRoundedValue(parseFloat(record.mos_shipping_fee || record.iv_shipping_fee || 0)),
|
|
165
166
|
shipping_discount: getRoundedValue(shipping_discount),
|
|
166
|
-
seller_voucher_amount: getRoundedValue(
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
167
|
+
seller_voucher_amount: getRoundedValue(
|
|
168
|
+
parseFloat(record.mo_seller_voucher_amount || record.iv_seller_voucher_amount || 0)
|
|
169
|
+
),
|
|
170
|
+
platform_voucher_amount: getRoundedValue(
|
|
171
|
+
parseFloat(record.mo_platform_voucher_amount || record.iv_platform_voucher_amount || 0)
|
|
172
|
+
),
|
|
173
|
+
seller_discount: getRoundedValue(parseFloat(record.mo_seller_discount || record.iv_seller_discount || 0)),
|
|
174
|
+
platform_coins: getRoundedValue(parseFloat(record.mo_platform_coins || record.iv_platform_coins || 0)),
|
|
170
175
|
sub_total: sumProductTotalPaidPrice,
|
|
171
176
|
grand_total: getRoundedValue(
|
|
172
177
|
sumProductTotalPaidPrice -
|
|
173
|
-
parseFloat(record.mo_seller_voucher_amount || 0) -
|
|
174
|
-
parseFloat(record.mo_platform_voucher_amount || 0) -
|
|
175
|
-
parseFloat(record.mo_seller_discount || 0) -
|
|
176
|
-
parseFloat(record.mo_platform_coins || 0) +
|
|
177
|
-
parseFloat(record.mos_shipping_fee || 0) -
|
|
178
|
+
parseFloat(record.mo_seller_voucher_amount || record.iv_seller_voucher_amount || 0) -
|
|
179
|
+
parseFloat(record.mo_platform_voucher_amount || record.mo_platform_voucher_amount || 0) -
|
|
180
|
+
parseFloat(record.mo_seller_discount || record.mo_seller_discount || 0) -
|
|
181
|
+
parseFloat(record.mo_platform_coins || record.mo_platform_coins || 0) +
|
|
182
|
+
parseFloat(record.mos_shipping_fee || record.iv_shipping_fee || 0) -
|
|
178
183
|
shipping_discount || 0
|
|
179
184
|
),
|
|
180
185
|
product_list
|