biz9-logic 4.9.33 → 4.9.39

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.
Files changed (4) hide show
  1. package/biz9_config +1 -1
  2. package/index.js +12 -11
  3. package/package.json +1 -1
  4. package/test.js +8 -33
package/biz9_config CHANGED
@@ -1,4 +1,4 @@
1
- VERSION='9.0.3'
1
+ VERSION='9.0.9'
2
2
  TITLE='BiZ9-Logic';
3
3
  REPO='git@github.com:biz9framework/biz9-logic.git';
4
4
  BRANCH='main';
package/index.js CHANGED
@@ -141,6 +141,8 @@ class Demo_Logic {
141
141
  });
142
142
  }
143
143
  if(option.get_item){
144
+ let full_item_list = [];
145
+
144
146
  let item_title_list = [];
145
147
  if(option.items){
146
148
  item_title_list = option.items.split(',');
@@ -150,13 +152,12 @@ class Demo_Logic {
150
152
  item_title_list.push(title+" " +Type.get_title(item.categorys[Num.get_id(option.category_count)].category)+" "+ b);
151
153
  }
152
154
  }
153
- for(let a = 0;a < option.item_count; a++){
154
- const cat_item = item.categorys[Num.get_id(option.category_count)];
155
- if(!cat_item.items){
156
- cat_item.items = [];
157
- }
158
- for(const item of item_title_list){
159
- let child_item = Item_Logic.get_new(item,option.item_data_type);
155
+ for(const child_item_title of item_title_list){
156
+ const cat_item = item.categorys[Num.get_id(option.category_count)];
157
+ if(!cat_item.items){
158
+ cat_item.items = [];
159
+ }
160
+ let child_item = Item_Logic.get_new(child_item_title,option.item_data_type);
160
161
  if(option.item_data_type == DataType.PRODUCT){
161
162
  child_item.cost = Num.get_id(9000);
162
163
  child_item.old_cost = Num.get_id(90000);
@@ -167,8 +168,8 @@ class Demo_Logic {
167
168
  child_item.description = "Description "+String(Num.get_id());
168
169
  child_item.note = Field_Logic.get_test_note(),
169
170
  cat_item.items.push(child_item);
171
+ full_item_list.push(child_item);
170
172
  }
171
- }
172
173
  }
173
174
  return item;
174
175
  };
@@ -428,9 +429,9 @@ class Stat_Logic {
428
429
  stat.parent_cart_id = item.cart_id;
429
430
  stat.parent_cart_number = item.cart_number;
430
431
  }
431
- if(item.data_type==DataType.ORDER){
432
- stat.parent_data_type=item.data_type;
433
- stat.parent_id=item.id;
432
+ if(item.data_type==DataType.ORDER_ITEM){
433
+ stat.parent_data_type=item.parent_data_type;
434
+ stat.parent_id=item.parent_id;
434
435
  stat.parent_order_id = item.order_id;
435
436
  stat.parent_order_number = item.order_number;
436
437
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biz9-logic",
3
- "version": "4.9.33",
3
+ "version": "4.9.39",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/test.js CHANGED
@@ -44,43 +44,18 @@ describe("connect", () => {
44
44
  let option = {get_category:true,category_count:category_count,category_data_type:category_type,categorys:val_category_title?val_category_title:null,
45
45
  get_item:true,item_count:item_count,item_data_type:category_type,items:null}
46
46
 
47
- if(category_title_list.length >0){
48
- cat_max = category_title_list.length;
49
- }else{
50
- if(category_count.length){
51
- cat_max = category_count;
52
- }else{
53
- cat_max = 0;
54
- }
55
- }
56
- option.item_count = item_count / cat_max;
57
- for(const item of category_type_title_list){
47
+ for(const item of category_type_title_list){
58
48
  post_type_list.push(
59
49
  Demo_Logic.get_new_type(item,option));
60
50
  }
61
51
 
62
- Log.w('post_type_list',post_type_list);
63
- //Log.w('category_type_title_list',category_type_title_list);
64
- //Log.w('category_title_list',category_title_list);
65
- //Log.w('option',option);
66
-
67
- /*
68
- let post_category_count = 0;
69
- let post_item_count = 0;
70
- for(const item_type of post_type_list){
71
- for(const item_cat of item_type.categorys){
72
- post_category_count = post_category_count+1;
73
- if(!item_cat.items){
74
- item_cat.items = [];
75
- }
76
- for(const item_item of item_cat.items){
77
- post_item_count = post_item_count+1;
78
- }
79
- }
80
- };
81
- let data = await App_User_Data.post(Url.CMS_DEMO_POST,{data_type:category_type,type_list:post_type_list,option:option});
82
- alert_prop.current.showValidation("Demo OK. "+ post_type_list.length + " Types "+ category_count+" Categorys "+" "+item_count+" " +" Items");
83
- */
52
+ Log.w('44-post_type_list',post_type_list);
53
+ Log.w('55-post_type_list-a',post_type_list.length);
54
+ Log.w('55-post_type_list-b',post_type_list[0].categorys[0].items.length);
55
+ Log.w('55-post_type_list-b',post_type_list[0].categorys[1].items.length);
56
+ Log.w('55-post_type_list-b',post_type_list[0].categorys[2].items.length);
57
+ Log.w('55-post_type_list-b',post_type_list[0].categorys[3].items.length);
58
+ Log.w('55-post_type_list-b',post_type_list[0].categorys[4].items.length);
84
59
  console.log('CONNECT-CMS-DEMO-SUCCESS');
85
60
 
86
61
  },