biz9-logic 4.9.9 → 4.9.11
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/biz9_config +1 -1
- package/index.js +5 -5
- package/package.json +1 -1
- package/test.js +4 -4
package/biz9_config
CHANGED
package/index.js
CHANGED
|
@@ -483,7 +483,7 @@ class Order_Logic {
|
|
|
483
483
|
order.order_item_list.push(order_item);
|
|
484
484
|
|
|
485
485
|
});
|
|
486
|
-
order
|
|
486
|
+
order = Order_Logic.caculate_total(order);
|
|
487
487
|
return order;
|
|
488
488
|
};
|
|
489
489
|
static get_new_order_payment = (order_number,payment_method_type,payment_amount) => {
|
|
@@ -495,23 +495,23 @@ class Order_Logic {
|
|
|
495
495
|
transaction_id:Order_Logic.TRANSACTION_ID + Num.get_id(99999)
|
|
496
496
|
});
|
|
497
497
|
};
|
|
498
|
-
static
|
|
498
|
+
static caculate_total = (order) => {
|
|
499
499
|
let grand_total = 0;
|
|
500
500
|
order.order_item_list.forEach(order_item => {
|
|
501
501
|
order_item.sub_total = 0;
|
|
502
502
|
if(!isNaN(order_item.cost)){
|
|
503
503
|
order_item.sub_total = (order_item.sub_total + order_item.cost) * order_item.quanity;
|
|
504
|
-
grand_total = grand_total + order_item.sub_total;
|
|
504
|
+
order.grand_total = order.grand_total + order_item.sub_total;
|
|
505
505
|
}
|
|
506
506
|
order_item.order_sub_item_list.forEach(order_sub_item => {
|
|
507
507
|
order_sub_item.sub_total = 0;
|
|
508
508
|
if(!isNaN(order_sub_item.cost)){
|
|
509
509
|
order_sub_item.sub_total = (order_sub_item.sub_total + order_sub_item.cost) * order_sub_item.quanity;
|
|
510
|
-
grand_total = grand_total + order_sub_item.sub_total;
|
|
510
|
+
order.grand_total = order.grand_total + order_sub_item.sub_total;
|
|
511
511
|
}
|
|
512
512
|
});
|
|
513
513
|
});
|
|
514
|
-
return
|
|
514
|
+
return order;
|
|
515
515
|
};
|
|
516
516
|
}
|
|
517
517
|
class Cart_Logic {
|
package/package.json
CHANGED
package/test.js
CHANGED
|
@@ -33,7 +33,6 @@ describe("connect", () => {
|
|
|
33
33
|
console.log('CONNECT-START');
|
|
34
34
|
console.log(Cart_Logic.get_new(DataType.PRODUCT,123));
|
|
35
35
|
|
|
36
|
-
/*
|
|
37
36
|
let post_type_list = [
|
|
38
37
|
Demo_Logic.get_new_type('Computer 1',{
|
|
39
38
|
get_category:true,category_count:12,category_data_type:DataType.PRODUCT,categorys:'',
|
|
@@ -44,6 +43,7 @@ describe("connect", () => {
|
|
|
44
43
|
];
|
|
45
44
|
|
|
46
45
|
Log.w('post_type_list',post_type_list);
|
|
46
|
+
|
|
47
47
|
let post_item_count = 0;
|
|
48
48
|
let post_category_count = 0;
|
|
49
49
|
for(const item_type of post_type_list){
|
|
@@ -59,11 +59,11 @@ describe("connect", () => {
|
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
Log.w('post_type_list',post_type_list);
|
|
62
|
-
Log.w('
|
|
62
|
+
Log.w('post_type_list',post_type_list[0].categorys);
|
|
63
|
+
//Log.w('post_item_count',post_item_count);
|
|
63
64
|
|
|
64
|
-
*/
|
|
65
65
|
console.log('CONNECT-END');
|
|
66
|
-
call();
|
|
66
|
+
//call();
|
|
67
67
|
},
|
|
68
68
|
function(call) {
|
|
69
69
|
console.log('GET_START_DATE_TIME_BY_LIST-START');
|