biz9-logic 4.9.9 → 4.9.12
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 +7 -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.get_total(order);
|
|
487
487
|
return order;
|
|
488
488
|
};
|
|
489
489
|
static get_new_order_payment = (order_number,payment_method_type,payment_amount) => {
|
|
@@ -495,7 +495,7 @@ class Order_Logic {
|
|
|
495
495
|
transaction_id:Order_Logic.TRANSACTION_ID + Num.get_id(99999)
|
|
496
496
|
});
|
|
497
497
|
};
|
|
498
|
-
static
|
|
498
|
+
static get_total = (order) => {
|
|
499
499
|
let grand_total = 0;
|
|
500
500
|
order.order_item_list.forEach(order_item => {
|
|
501
501
|
order_item.sub_total = 0;
|
|
@@ -511,7 +511,8 @@ class Order_Logic {
|
|
|
511
511
|
}
|
|
512
512
|
});
|
|
513
513
|
});
|
|
514
|
-
|
|
514
|
+
order.grand_total = grand_total;
|
|
515
|
+
return order;
|
|
515
516
|
};
|
|
516
517
|
}
|
|
517
518
|
class Cart_Logic {
|
|
@@ -524,7 +525,7 @@ class Cart_Logic {
|
|
|
524
525
|
static get_new_cart_sub_item = (parent_data_type,parent_id,cart_number,quanity,cost) =>{
|
|
525
526
|
return DataItem.get_new(DataType.CART_SUB_ITEM,0,{parent_data_type:parent_data_type,parent_id:parent_id,cart_number:cart_number,quanity:quanity,cost:cost?cost:0});
|
|
526
527
|
};
|
|
527
|
-
static
|
|
528
|
+
static get_total = (cart) => {
|
|
528
529
|
let grand_total = 0;
|
|
529
530
|
cart.cart_item_list.forEach(cart_item => {
|
|
530
531
|
cart_item.sub_total = 0;
|
|
@@ -540,7 +541,8 @@ class Cart_Logic {
|
|
|
540
541
|
}
|
|
541
542
|
});
|
|
542
543
|
});
|
|
543
|
-
|
|
544
|
+
cart.grand_total = grand_total;
|
|
545
|
+
return cart;
|
|
544
546
|
};
|
|
545
547
|
}
|
|
546
548
|
class Product_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');
|