buli
2023-07-14 36d15f189de2e83ce2576715dac30c3c260388dd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
@isTest
private class LexConInvoicedetailsControllerTest {
    @isTest
<<<<<<< HEAD
    static void all() {
        User myUser_test;
        Account myAccount1;
        Account myAccount2;
        User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()];
        System.runAs(thisUser) {
            Profile prof = [
                SELECT Id
                FROM Profile
                WHERE Name = '901_经销商社区普通权限_2重验证(ET)'
            ];
            List<RecordType> rectCo = [
                SELECT Id
                FROM RecordType
                WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店'
            ];
            if (rectCo.size() == 0) {
                return;
            }
            List<RecordType> rectHos = [
                SELECT Id
                FROM RecordType
                WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '病院'
            ];
            if (rectHos.size() == 0) {
                return;
            }
            myAccount1 = new Account(Name = 'testaccount001', Dealer_discount__c = 10, RecordTypeId = rectCo[0].Id);
            myAccount2 = new Account(Name = 'testaccount002', Dealer_discount__c = 20, RecordTypeId = rectHos[0].Id);
            insert myAccount1;
            insert myAccount2;
            Contact core = new Contact(
                email = 'jplumber@salesforce.com',
                firstname = 'Joe',
                lastname = 'Plumber',
                accountid = myAccount1.id
            );
            insert core;
            myUser_test = new User(
                ContactId = core.id,
                Alias = 'newUser',
                Email = 'newuser@testorg.com',
                EmailEncodingKey = 'UTF-8',
                LastName = 'TestUser',
                LanguageLocaleKey = 'zh_CN',
                LocaleSidKey = 'zh_CN',
                ProfileId = prof.Id,
                TimeZoneSidKey = 'Asia/Shanghai',
                UserName = 'testUser@testorg.com',
                UserPro_Type__c = 'ENG',
                Work_Location__c = '北京'
            );
            insert myUser_test;
        }
        System.runAs(myUser_test) {
            //产品信息
            Product2 prod01 = new Product2(
                Name = 'Test01',
                ProductCode = 'Test01',
                Asset_Model_No__c = 'Test01',
                SFDA_Status__c = '有効',
                Dealer_special_Object__c = true,
                Packing_list_manual__c = 1,
                Manual_Entry__c = false
            );
            Product2 prod02 = new Product2(
                Name = 'Test02',
                ProductCode = 'Test02',
                Asset_Model_No__c = 'Test02',
                SFDA_Status__c = '有効',
                Dealer_special_Object__c = true,
                Packing_list_manual__c = 1,
                Manual_Entry__c = false
            );
            Product2 prod03 = new Product2(
                Name = 'Test03',
                ProductCode = 'Test03',
                Asset_Model_No__c = 'Test03',
                SFDA_Status__c = '有効',
                Dealer_special_Object__c = true,
                Packing_list_manual__c = 1,
                Manual_Entry__c = false
            );
            Product2 prod04 = new Product2(
                Name = 'Test04',
                ProductCode = 'Test04',
                Asset_Model_No__c = 'Test04',
                SFDA_Status__c = '有効',
                Dealer_special_Object__c = true,
                Packing_list_manual__c = 2,
                Manual_Entry__c = false
            );
            Product2 prod05 = new Product2(
                Name = 'Test05',
                ProductCode = 'Test05',
                Asset_Model_No__c = 'Test05',
                SFDA_Status__c = '有効',
                Dealer_special_Object__c = true,
                Packing_list_manual__c = 1,
                Manual_Entry__c = false
            );
            Product2 prod06 = new Product2(
                Name = 'Test06',
                ProductCode = 'Test06',
                Asset_Model_No__c = 'Test06',
                SFDA_Status__c = '有効',
                Dealer_special_Object__c = true,
                Packing_list_manual__c = 1,
                Manual_Entry__c = false
            );
            insert new List<Product2>{ prod01, prod02, prod03, prod04, prod05, prod06 };
            Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id);
            Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id);
            Product2__c pro3 = new Product2__c(Name = 'Pro004', OT_CODE_Text__c = 'Test004', Product2__c = prod03.Id);
            Product2__c pro4 = new Product2__c(Name = 'Pro005', OT_CODE_Text__c = 'Test005', Product2__c = prod04.Id);
            Product2__c pro5 = new Product2__c(Name = 'Pro003', OT_CODE_Text__c = 'Test003', Product2__c = prod05.Id);
            Product2__c pro6 = new Product2__c(Name = 'Pro006', OT_CODE_Text__c = 'Test006', Product2__c = prod06.Id);
            insert new List<Product2__c>{ pro4, pro5, pro6, pro1, pro2, pro3 };
            //发票
            Consumable_order__c invoiceorder = new Consumable_order__c();
            invoiceorder.Name = 'invoice02';
            invoiceorder.Order_type__c = '发票';
            invoiceorder.Invoice_status__c = '已完成';
            invoiceorder.Invoice_Date__c = Date.today();
            invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice;
            invoiceorder.Dealer_info__c = myAccount1.Id;
            // createId.Order_ForHospital__c = myAccount2.Id;
            invoiceorder.SummonsForDirction__c = '直接销售给医院';
            invoiceorder.Order_status__c = '草案中';
            insert invoiceorder;
 
            //出库单信息
            //出库单
            Consumable_order__c testList1 = new Consumable_order__c(
                Name = 'Test1',
                Summons_Sale_Status__c = '出货',
                SummonsStatus_c__c = '已完成',
                SummonsForDirction__c = '直接销售给医院',
                Order_status__c = '草案中',
                Order_type__c = '传票',
                Dealer_info__c = myAccount1.Id,
                ConInvoice_Code__c = invoiceorder.id
            );
            Consumable_order__c testList2 = new Consumable_order__c(
                Name = 'Test2',
                Summons_Sale_Status__c = '出货',
                SummonsStatus_c__c = '已完成',
                SummonsForDirction__c = '直接销售给医院',
                Order_status__c = '已提交',
                Order_type__c = '传票',
                Dealer_info__c = myAccount1.Id,
                ConInvoice_Code__c = invoiceorder.id
            );
            TestList1.Order_date__c = Date.today().addDays(2);
            TestList2.Order_date__c = Date.today().addDays(2);
            TestList1.Order_date__c = Date.today();
            TestList2.Deliver_date__c = Date.today();
            insert new List<Consumable_order__c>{ testList1, testList2 };
=======
    static void all() {
        User myUser_test;
        Account myAccount1;
        Account myAccount2;
        User thisUser = [ select Id from User where Id = :UserInfo.getUserId()];
        System.runAs(thisUser){
            Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)'];
            List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店'];
            if (rectCo.size() == 0) {
                return;
            }
            List<RecordType> rectHos = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院'];
            if (rectHos.size() == 0) {
                return;
            }
            myAccount1 = new Account(Name='testaccount001',Dealer_discount__c =10,RecordTypeId = rectCo[0].Id );
            myAccount2 = new Account(Name='testaccount002',Dealer_discount__c =20,RecordTypeId = rectHos[0].Id );
            insert myAccount1;
            insert myAccount2; 
            Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id);
            insert core;
            myUser_test = New User(ContactId = core.id, Alias = 'newUser', Email='newuser@testorg.com', EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN', LocaleSidKey='zh_CN', ProfileId = prof.Id, TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com', UserPro_Type__c='ENG', Work_Location__c='北京');
            insert myUser_test;
        }
        System.runAs(myUser_test){
            //产品信息
            Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Packing_list_manual__c=1,Manual_Entry__c = false);
            Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Packing_list_manual__c=1,Manual_Entry__c = false);
            Product2 prod03 = new Product2(Name='Test03',ProductCode='Test03',Asset_Model_No__c = 'Test03',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Packing_list_manual__c=1,Manual_Entry__c = false);
            Product2 prod04 = new Product2(Name='Test04',ProductCode='Test04',Asset_Model_No__c = 'Test04',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Packing_list_manual__c=2,Manual_Entry__c = false);
            Product2 prod05 = new Product2(Name='Test05',ProductCode='Test05',Asset_Model_No__c = 'Test05',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Packing_list_manual__c=1,Manual_Entry__c = false);
            Product2 prod06 = new Product2(Name='Test06',ProductCode='Test06',Asset_Model_No__c = 'Test06',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Packing_list_manual__c=1,Manual_Entry__c = false);
            insert new Product2[] {prod01, prod02,prod03,prod04, prod05, prod06};
            Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id);
            Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id);
            Product2__c pro3 = new Product2__c(Name='Pro004',OT_CODE_Text__c='Test004',Product2__c = prod03.Id);
            Product2__c pro4 = new Product2__c(Name='Pro005',OT_CODE_Text__c='Test005',Product2__c = prod04.Id);
            Product2__c pro5 = new Product2__c(Name='Pro003',OT_CODE_Text__c='Test003',Product2__c = prod05.Id);
            Product2__c pro6 = new Product2__c(Name='Pro006',OT_CODE_Text__c='Test006',Product2__c = prod06.Id);
            insert new Product2__c[] {pro4, pro5,pro6,pro1, pro2, pro3};
            //发票
            Consumable_order__c invoiceorder = new Consumable_order__c();
            invoiceorder.Name='invoice02';
            invoiceorder.Order_type__c = '发票';
            invoiceorder.Invoice_status__c='已完成';
            invoiceorder.Invoice_Date__c = Date.today();
            invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice;
            invoiceorder.Dealer_info__c= myAccount1.Id;
            // createId.Order_ForHospital__c = myAccount2.Id;
            invoiceorder.SummonsForDirction__c='直接销售给医院';
            invoiceorder.Order_status__c='草案中';
            insert invoiceorder;
 
            //出库单信息
              //出库单
            Consumable_order__c testList1 = new Consumable_order__c(Name='Test1',Summons_Sale_Status__c='出货',SummonsStatus_c__c='已完成',SummonsForDirction__c='直接销售给医院',Order_status__c='草案中',Order_type__c='传票',Dealer_info__c=myAccount1.Id,ConInvoice_Code__c = invoiceorder.id);
            Consumable_order__c testList2 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='出货',SummonsStatus_c__c='已完成',SummonsForDirction__c='直接销售给医院',Order_status__c='已提交',Order_type__c='传票',Dealer_info__c=myAccount1.Id,ConInvoice_Code__c = invoiceorder.id);
            TestList1.Order_date__c = Date.today().addDays(2);
            TestList2.Order_date__c = Date.today().addDays(2);
            TestList1.Order_date__c = Date.today();
            TestList2.Deliver_date__c=Date.today();
            insert new Consumable_order__c[]{testList1,testList2};
>>>>>>> LEXCommunityLiJun
 
            List<Consumable_Orderdetails__c> invoiceList = new List<Consumable_Orderdetails__c>();
            //发票明细1
            Consumable_orderdetails__c invoicedet1 = new Consumable_orderdetails__c();
            invoicedet1.Name = 'invoicetest1_001001';
            invoicedet1.Consumable_order__c = invoiceorder.id;
            invoicedet1.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
            invoicedet1.Consumable_count__c = 1;
            invoicedet1.Consumable_product__c = pro1.Id;
            invoicedet1.Invoicedet1_OD_link__c = testList1.Id;
            invoicedet1.Box_Piece__c = '盒';
            invoicedet1.Shipment_Count__c = 1;
            invoicedet1.Invoice_Unitprice__c = 1;
            invoicedet1.Delivery_List_RMB__c = 1;
<<<<<<< HEAD
            invoicedet1.InvoicedProCost_RMB__c = 1;
            invoicedet1.Invoice_Unit__c = '个';
            invoicedet1.Invoiced_Procount__c = 3;
            invoicedet1.RrturnPro_count__c = 3;
=======
            invoicedet1.InvoicedProCost_RMB__c =1;
            invoicedet1.Invoice_Unit__c = '个';
            invoicedet1.Invoiced_Procount__c  = 3;
            invoicedet1.RrturnPro_count__c =3;
>>>>>>> LEXCommunityLiJun
            invoiceList.add(invoicedet1);
 
            Consumable_orderdetails__c invoicedet2 = new Consumable_orderdetails__c();
            invoicedet2.Name = 'invoiceTest1_001002';
            invoicedet2.Consumable_order__c = invoiceorder.Id;
            invoicedet2.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
            invoicedet2.Consumable_count__c = 1;
            invoicedet2.Consumable_product__c = pro2.Id;
            invoicedet2.Invoicedet1_OD_link__c = testList2.Id;
            invoicedet2.Box_Piece__c = '盒';
            invoicedet2.Shipment_Count__c = 1;
            invoicedet2.Invoice_Unitprice__c = 1;
            invoicedet2.Delivery_List_RMB__c = 1;
<<<<<<< HEAD
            invoicedet2.InvoicedProCost_RMB__c = 1;
            invoicedet2.Invoice_Unit__c = '个';
            invoicedet2.Invoiced_Procount__c = 3;
            invoicedet2.RrturnPro_count__c = 3;
=======
            invoicedet2.InvoicedProCost_RMB__c =1;
            invoicedet2.Invoice_Unit__c = '个';
            invoicedet2.Invoiced_Procount__c  = 3;
            invoicedet2.RrturnPro_count__c =3;
>>>>>>> LEXCommunityLiJun
            invoiceList.add(invoicedet2);
 
            Consumable_orderdetails__c invoicedet3 = new Consumable_orderdetails__c();
            invoicedet3.Name = 'invoiceTest1_001003';
            invoicedet3.Consumable_order__c = invoiceorder.Id;
            invoicedet3.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
            invoicedet3.Consumable_count__c = 1;
            invoicedet3.Consumable_product__c = pro2.Id;
            invoicedet3.Invoicedet1_OD_link__c = testList2.Id;
            invoicedet3.Box_Piece__c = '个';
            invoicedet3.Shipment_Count__c = 1;
            invoicedet3.Invoice_Unit__c = '盒';
            invoicedet3.Delivery_List_RMB__c = 2.0;
            invoicedet3.Invoice_Unitprice__c = 1;
            invoicedet3.InvoicedProCost_RMB__c = 1;
<<<<<<< HEAD
            invoicedet3.Invoiced_Procount__c = 3;
            invoicedet3.RrturnPro_count__c = 3;
=======
            invoicedet3.Invoiced_Procount__c  = 3;
            invoicedet3.RrturnPro_count__c =3;
>>>>>>> LEXCommunityLiJun
            invoiceList.add(invoicedet3);
            insert invoiceList;
 
            List<Consumable_Orderdetails__c> codList = new List<Consumable_Orderdetails__c>();
            //出库单明细1
            Consumable_orderdetails__c orderdet1 = new Consumable_orderdetails__c();
            orderdet1.Name = 'Test1_001001';
            //orderdet1.Consumable_principal__c = testList1.Id;
            orderdet1.Consumable_order__c = testList1.Id;
            orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
            orderdet1.Consumable_count__c = 1;
            orderdet1.Consumable_product__c = pro1.Id;
            orderdet1.Box_Piece__c = '盒';
            orderdet1.Shipment_Count__c = 11;
            orderdet1.Delivery_List_RMB__c = 2.0;
            orderdet1.Invoice_Unitprice__c = 1;
            orderdet1.InvoicedProCost_RMB__c = 1;
<<<<<<< HEAD
            orderdet1.Invoiced_Procount__c = 3;
            orderdet1.RrturnPro_count__c = 3;
=======
            orderdet1.Invoiced_Procount__c  = 3;
            orderdet1.RrturnPro_count__c =3;
>>>>>>> LEXCommunityLiJun
            orderdet1.Invoice_Unit__c = '个';
            codList.add(orderdet1);
 
            Consumable_orderdetails__c orderdet2 = new Consumable_orderdetails__c();
            orderdet2.Name = 'Test1_0010011';
            orderdet2.Consumable_order__c = testList1.Id;
            orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
            orderdet2.Consumable_count__c = 1;
            orderdet2.Consumable_product__c = pro2.Id;
            orderdet2.Box_Piece__c = '个';
            orderdet2.Shipment_Count__c = 11;
            orderdet2.Delivery_List_RMB__c = 2.0;
            orderdet2.Invoice_Unitprice__c = 1;
            orderdet2.InvoicedProCost_RMB__c = 1;
<<<<<<< HEAD
            orderdet2.Invoiced_Procount__c = 3;
            orderdet2.RrturnPro_count__c = 3;
=======
            orderdet2.Invoiced_Procount__c  = 3;
            orderdet2.RrturnPro_count__c =3;
>>>>>>> LEXCommunityLiJun
            orderdet2.Invoice_Unit__c = '盒';
            codList.add(orderdet2);
 
            Consumable_orderdetails__c orderdet3 = new Consumable_orderdetails__c();
            orderdet3.Name = 'Test1_0010012';
            orderdet3.Consumable_order__c = testList1.Id;
            orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
            orderdet3.Consumable_count__c = 1;
            orderdet3.Consumable_product__c = pro2.Id;
            orderdet3.Box_Piece__c = '盒';
            orderdet3.Shipment_Count__c = 10;
            orderdet3.Delivery_List_RMB__c = 2.0;
            orderdet3.Invoice_Unitprice__c = 1;
            orderdet3.InvoicedProCost_RMB__c = 1;
<<<<<<< HEAD
            orderdet3.Invoiced_Procount__c = 3;
            orderdet3.RrturnPro_count__c = 3;
            orderdet3.Invoice_Unit__c = '个';
            orderdet3.Invoiced_Count__c = 3;
            codList.add(orderdet3);
 
=======
            orderdet3.Invoiced_Procount__c  = 3;
            orderdet3.RrturnPro_count__c =3;
            orderdet3.Invoice_Unit__c = '个';
            orderdet3.Invoiced_Count__c= 3;
            codList.add(orderdet3);
 
 
>>>>>>> LEXCommunityLiJun
            Consumable_orderdetails__c orderdet4 = new Consumable_orderdetails__c();
            orderdet4.Name = 'Test1_0010031';
            orderdet4.Consumable_order__c = testList1.Id;
            orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
            orderdet4.Consumable_count__c = 1;
            orderdet4.Consumable_product__c = pro1.Id;
            orderdet4.Box_Piece__c = '个';
            orderdet4.Shipment_Count__c = 10;
            orderdet4.Delivery_List_RMB__c = 2.0;
            orderdet4.Invoice_Unitprice__c = 1;
            orderdet4.InvoicedProCost_RMB__c = 1;
<<<<<<< HEAD
            orderdet4.Invoiced_Procount__c = 3;
            orderdet4.RrturnPro_count__c = 3;
            orderdet4.Invoice_Unit__c = '盒';
            orderdet4.Invoiced_Count__c = 3;
=======
            orderdet4.Invoiced_Procount__c  = 3;
            orderdet4.RrturnPro_count__c =3;
            orderdet4.Invoice_Unit__c = '盒';
            orderdet4.Invoiced_Count__c= 3;
>>>>>>> LEXCommunityLiJun
            codList.add(orderdet4);
 
            Consumable_orderdetails__c orderdet5 = new Consumable_orderdetails__c();
            orderdet5.Name = 'Test1_001002';
            orderdet5.Consumable_order__c = testList1.Id;
            orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
            orderdet5.Consumable_count__c = 1;
            orderdet5.Box_Piece__c = '盒';
            orderdet5.Consumable_product__c = pro2.Id;
            orderdet5.Invoice_Unit__c = '个';
            orderdet5.Shipment_Count__c = 11;
            orderdet5.Delivery_List_RMB__c = 2.0;
<<<<<<< HEAD
            orderdet5.Invoiced_Procount__c = 3;
            orderdet5.RrturnPro_count__c = 3;
            orderdet5.Invoiced_Count__c = 3;
=======
            orderdet5.Invoiced_Procount__c  = 3;
            orderdet5.RrturnPro_count__c =3;
            orderdet5.Invoiced_Count__c= 3;
>>>>>>> LEXCommunityLiJun
            codList.add(orderdet5);
 
            Consumable_orderdetails__c orderdet6 = new Consumable_orderdetails__c();
            orderdet6.Name = 'Test1_001003';
            orderdet6.Consumable_order__c = testList1.Id;
            orderdet6.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
            orderdet6.Consumable_count__c = 1;
            orderdet6.Box_Piece__c = '盒';
            orderdet6.Consumable_product__c = pro1.Id;
            orderdet6.Invoice_Unit__c = '盒';
            orderdet6.Shipment_Count__c = 11;
            orderdet6.Delivery_List_RMB__c = 2.0;
<<<<<<< HEAD
            orderdet6.Invoiced_Procount__c = 3;
            orderdet6.RrturnPro_count__c = 3;
            orderdet6.Invoiced_Count__c = 3;
=======
            orderdet6.Invoiced_Procount__c  = 3;
            orderdet6.RrturnPro_count__c =3;
            orderdet6.Invoiced_Count__c= 3;
>>>>>>> LEXCommunityLiJun
            codList.add(orderdet6);
 
            Consumable_orderdetails__c orderdet7 = new Consumable_orderdetails__c();
            orderdet7.Name = 'Test1_001004';
            //orderdet2.Consumable_principal__c = testList2.Id;
            orderdet7.Consumable_order__c = testList1.Id;
            orderdet7.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice;
            orderdet7.Consumable_count__c = 1;
            orderdet7.Box_Piece__c = '盒';
            orderdet7.Consumable_product__c = pro2.Id;
            orderdet7.Invoice_Unit__c = '个';
            orderdet7.Shipment_Count__c = 11;
            orderdet7.Delivery_List_RMB__c = 2.0;
<<<<<<< HEAD
            orderdet7.Invoiced_Procount__c = 3;
            orderdet7.Invoiced_Count__c = 3;
            orderdet7.RrturnPro_count__c = 3;
            codList.add(orderdet7);
            insert codList;
 
            LexConInvoicedetailsController.init(testList1.Id, invoiceorder.Id);
            //序列化Json
 
            System.Test.startTest();
            System.debug('===>数据' + LexConInvoicedetailsController.consumableorderdetails1Records);
            List<LexConInvoicedetailsController.ConsumableorderdetailsInfo> inList = LexConInvoicedetailsController.consumableorderdetails1Records;
            LexConInvoicedetailsController.save(
                JSON.serialize(LexConInvoicedetailsController.consumableorderdetails1Records),
                invoiceorder.Id,
                testList1.Id
            );
 
            List<LexConInvoicedetailsController.ConsumableorderdetailsInfo> inList1 = new List<LexConInvoicedetailsController.ConsumableorderdetailsInfo>();
            for (LexConInvoicedetailsController.ConsumableorderdetailsInfo ass : inList) {
                ass.check = true;
                ass.invoiceCount = 1;
                ass.esd.Invoice_Unit__c = '个';
                inList1.add(ass);
            }
            LexConInvoicedetailsController.save(JSON.serialize(inList1), invoiceorder.Id, testList1.Id);
            System.Test.stopTest();
        }
    }
}
=======
            orderdet7.Invoiced_Procount__c  = 3;
            orderdet7.Invoiced_Count__c= 3;
            orderdet7.RrturnPro_count__c =3;
            codList.add(orderdet7);
            insert codList;
 
            LexConInvoicedetailsController.init(testList1.Id,invoiceorder.Id);
            //序列化Json
  
 
            System.Test.startTest();
            System.debug('===>数据'+LexConInvoicedetailsController.consumableorderdetails1Records);
            List<LexConInvoicedetailsController.ConsumableorderdetailsInfo> inList = LexConInvoicedetailsController.consumableorderdetails1Records;
            LexConInvoicedetailsController.save(JSON.serialize(LexConInvoicedetailsController.consumableorderdetails1Records),invoiceorder.Id,testList1.Id);
 
            List<LexConInvoicedetailsController.ConsumableorderdetailsInfo> inList1 = new List<LexConInvoicedetailsController.ConsumableorderdetailsInfo>(); 
            for(LexConInvoicedetailsController.ConsumableorderdetailsInfo ass:inList){
                ass.check= true;
                ass.invoiceCount= 1;
                ass.esd.Invoice_Unit__c = '个';
                inList1.add(ass);
            }
            LexConInvoicedetailsController.save(JSON.serialize(inList1),invoiceorder.Id,testList1.Id);
            System.Test.stopTest();
 
        }
    }
}
>>>>>>> LEXCommunityLiJun