-- S1-S4 FULL UAT write (AIDOP tenant 797403760988229)
-- Batch: S1S4_UAT_FULL_20260605_V1
-- Generated: 2026-06-05 00:47:27
-- Orders: 45

SET @tenant_id := 838257237606469;
SET @batch_no := 'UAT_WP1_DEMO_20260817_V1';
SET @operator_id := 838257238302789;
SET @operator_name := 'UAT-DEMO-Migration';
SET @now           := NOW();
SET @factory_id := 1;
SET @id_base := 9206081900000001;

DROP TEMPORARY TABLE IF EXISTS tmp_s1_uat_so;
CREATE TEMPORARY TABLE tmp_s1_uat_so (
    bill_no VARCHAR(64) NOT NULL PRIMARY KEY,
    target_id BIGINT NOT NULL,
    custom_no VARCHAR(64) NULL,
    custom_name VARCHAR(128) NULL,
    order_date DATETIME NULL,
    delivery_date DATETIME NULL,
    urgent INT DEFAULT 0
);
INSERT INTO tmp_s1_uat_so VALUES
('DEMO-SO-001',9206081900000002,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',1),
('DEMO-SO-002',9206081900000003,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',0),
('DEMO-SO-003',9206081900000004,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',0),
('DEMO-SO-004',9206081900000005,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',0),
('DEMO-SO-005',9206081900000006,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',1),
('DEMO-SO-006',9206081900000007,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',1),
('DEMO-SO-007',9206081900000008,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',1),
('DEMO-SO-008',9206081900000009,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',1),
('DEMO-SO-009',9206081900000010,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',1),
('DEMO-SO-010',9206081900000011,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',1),
('DEMO-SO-011',9206081900000012,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',1),
('DEMO-SO-012',9206081900000013,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',1),
('DEMO-SO-013',9206081900000014,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',1),
('DEMO-SO-014',9206081900000015,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',1),
('DEMO-SO-015',9206081900000016,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',1),
('DEMO-SO-016',9206081900000017,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',1),
('DEMO-SO-017',9206081900000018,'CUST0005','WKQXGFYXGE','2025-02-26 00:00:00.000','2025-02-26 00:00:00.000',1),
('DEMO-SO-018',9206081900000019,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',0),
('DEMO-SO-019',9206081900000020,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',0),
('DEMO-SO-020',9206081900000021,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',0),
('DEMO-SO-021',9206081900000022,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',0),
('DEMO-SO-022',9206081900000023,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',0),
('DEMO-SO-023',9206081900000024,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',0),
('DEMO-SO-024',9206081900000025,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',0),
('DEMO-SO-025',9206081900000026,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',0),
('DEMO-SO-026',9206081900000027,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',0),
('DEMO-SO-027',9206081900000028,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',0),
('DEMO-SO-028',9206081900000029,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',0),
('DEMO-SO-029',9206081900000030,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',0),
('DEMO-SO-030',9206081900000031,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',0),
('DEMO-SO-031',9206081900000032,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',0),
('DEMO-SO-032',9206081900000033,'CUST0005','WKQXGFYXGE','2026-01-21 00:00:00.000','2026-01-21 00:00:00.000',0),
('DEMO-SO-033',9206081900000034,'10000000','瑞贝德','2026-02-03 00:00:00.000','2026-02-03 00:00:00.000',0),
('DEMO-SO-034',9206081900000035,'CUST0005','ET0005','2024-09-23 00:00:00.000','2024-09-23 00:00:00.000',0),
('DEMO-SO-035',9206081900000036,'CUST0005','ET0005','2024-10-14 00:00:00.000','2024-10-14 00:00:00.000',0),
('DEMO-SO-036',9206081900000037,'CUST0005','ET0005','2024-10-15 00:00:00.000','2024-10-15 00:00:00.000',0),
('DEMO-SO-037',9206081900000038,'CUST0005','ET0005','2024-10-18 00:00:00.000','2024-10-18 00:00:00.000',0),
('DEMO-SO-038',9206081900000039,'CUST0005','ET0005','2024-10-19 00:00:00.000','2024-10-19 00:00:00.000',0),
('DEMO-SO-039',9206081900000040,'CUST0005','ET0005','2024-10-21 00:00:00.000','2024-10-21 00:00:00.000',0),
('DEMO-SO-040',9206081900000041,'CUST0005','ET0005','2024-10-22 00:00:00.000','2024-10-22 00:00:00.000',0),
('DEMO-SO-041',9206081900000042,'CUST0005','ET0005','2024-11-02 00:00:00.000','2024-11-02 00:00:00.000',0),
('DEMO-SO-042',9206081900000043,'CUST0005','ET0005','2024-11-02 00:00:00.000','2024-11-02 00:00:00.000',0),
('DEMO-SO-043',9206081900000044,'CUST0005','ET0005','2024-11-04 00:00:00.000','2024-11-04 00:00:00.000',0),
('DEMO-SO-044',9206081900000045,'CUST0005','ET0005','2024-12-19 00:00:00.000','2024-12-19 00:00:00.000',0),
('DEMO-SO-045',9206081900000046,'CUST0005','ET0005','2025-01-14 00:00:00.000','2025-01-14 00:00:00.000',0);

DROP TEMPORARY TABLE IF EXISTS tmp_s1_uat_so_line;
CREATE TEMPORARY TABLE tmp_s1_uat_so_line (
    target_id BIGINT NOT NULL PRIMARY KEY,
    source_entry VARCHAR(32) NOT NULL,
    bill_no VARCHAR(64) NOT NULL,
    entry_seq INT NOT NULL,
    item_number VARCHAR(64) NULL,
    qty DECIMAL(18,4) NULL,
    plan_date DATETIME NULL
);
INSERT INTO tmp_s1_uat_so_line VALUES
(9206081900010002,'604438178041925','DEMO-SO-001',1,'91DC0292',4500.00000000,'2024-10-31 00:00:00.000'),
(9206081900010003,'604438178041926','DEMO-SO-001',2,'1A03D23',3500.00000000,'2024-10-31 00:00:00.000'),
(9206081900010004,'604438178046021','DEMO-SO-001',3,'1A0C329',400000.00000000,'2024-10-31 00:00:00.000'),
(9206081900010005,'604438178046022','DEMO-SO-001',4,'1A0C655',100000.00000000,'2024-10-31 00:00:00.000'),
(9206081900010006,'604438178046023','DEMO-SO-001',5,'A2C7114',250000.00000000,'2024-10-31 00:00:00.000'),
(9206081900010007,'604438178046024','DEMO-SO-001',6,'A2C7115',600000.00000000,'2024-10-31 00:00:00.000'),
(9206081900010008,'604438178050117','DEMO-SO-001',7,'A2B4199',6000.00000000,'2024-10-31 00:00:00.000'),
(9206081900010009,'604438178050118','DEMO-SO-001',8,'1A0C588',10000.00000000,'2024-10-31 00:00:00.000'),
(9206081900010010,'604438178050119','DEMO-SO-001',9,'1A03G94',2500.00000000,'2024-10-31 00:00:00.000'),
(9206081900010011,'604438178050120','DEMO-SO-001',10,'91CC0286',1500.00000000,'2024-10-31 00:00:00.000'),
(9206081900010012,'604438178054213','DEMO-SO-001',11,'91DC0218',800.00000000,'2024-10-31 00:00:00.000'),
(9206081900010013,'618270140751941','DEMO-SO-002',1,'91CC0229',60.00000000,'2024-12-06 00:00:00.000'),
(9206081900010014,'618290062549061','DEMO-SO-003',1,'91DC0218',2000.00000000,'2024-12-30 00:00:00.000'),
(9206081900010015,'619057595396165','DEMO-SO-004',1,'91CC0237',200.00000000,'2024-12-12 00:00:00.000'),
(9206081900010016,'630994145116229','DEMO-SO-005',1,'A2C7114',250000.00000000,'2025-01-10 00:00:00.000'),
(9206081900010017,'631069575503941','DEMO-SO-006',1,'1A0C329',100000.00000000,'2025-01-15 00:00:00.000'),
(9206081900010018,'631769478479941','DEMO-SO-007',1,'91CC0312',500.00000000,'2025-01-24 00:00:00.000'),
(9206081900010019,'631769478479942','DEMO-SO-007',2,'1A03D23',600.00000000,'2025-01-14 00:00:00.000'),
(9206081900010020,'631769478484037','DEMO-SO-007',3,'91CC0231',100.00000000,'2025-01-23 00:00:00.000'),
(9206081900010021,'631769478484038','DEMO-SO-007',4,'91CC0286',800.00000000,'2025-02-06 00:00:00.000'),
(9206081900010022,'632121332793413','DEMO-SO-008',1,'91C0D058',400.00000000,'2025-02-05 00:00:00.000'),
(9206081900010023,'632124508205125','DEMO-SO-009',1,'A2B8361',1000.00000000,'2025-02-05 00:00:00.000'),
(9206081900010024,'632125640785989','DEMO-SO-010',1,'A2B8184',700.00000000,'2025-02-05 00:00:00.000'),
(9206081900010025,'633173731577925','DEMO-SO-011',1,'A2B4199',4000.00000000,'2025-02-17 00:00:00.000'),
(9206081900010026,'633178120278085','DEMO-SO-012',1,'1A03D23',5000.00000000,'2025-02-27 00:00:00.000'),
(9206081900010027,'633197803688005','DEMO-SO-013',1,'ABC431',10000.00000000,'2025-02-27 00:00:00.000'),
(9206081900010028,'633197803688006','DEMO-SO-013',2,'1A0C432',10000.00000000,'2025-02-27 00:00:00.000'),
(9206081900010029,'633206945230917','DEMO-SO-014',1,'ABC419',35000.00000000,'2025-02-17 00:00:00.000'),
(9206081900010030,'633515239526469','DEMO-SO-015',1,'1A0C293',650000.00000000,'2025-02-27 00:00:00.000'),
(9206081900010031,'633515239526470','DEMO-SO-015',2,'1A0C329',200000.00000000,'2025-02-26 00:00:00.000'),
(9206081900010032,'633520970641477','DEMO-SO-016',1,'91DC0215',1500.00000000,'2025-02-28 00:00:00.000'),
(9206081900010033,'646977501577285','DEMO-SO-017',1,'91CC0179',5000.00000000,'2025-02-26 00:00:00.000'),
(9206081900010034,'646977501577286','DEMO-SO-017',2,'91CC0287',10000.00000000,'2025-02-26 00:00:00.000'),
(9206081900010035,'646977501581381','DEMO-SO-017',3,'91CC0288',10000.00000000,'2025-02-26 00:00:00.000'),
(9206081900010036,'646977501581382','DEMO-SO-017',4,'91CC0187',5000.00000000,'2025-02-26 00:00:00.000'),
(9206081900010037,'646977501581383','DEMO-SO-017',5,'91CC0233',1500.00000000,'2025-02-26 00:00:00.000'),
(9206081900010038,'646977501581384','DEMO-SO-017',6,'91DC0218',3000.00000000,'2025-02-26 00:00:00.000'),
(9206081900010039,'646977501581385','DEMO-SO-017',7,'A21C096',10000.00000000,'2025-02-26 00:00:00.000'),
(9206081900010040,'659719952244805','DEMO-SO-018',1,'91CC0177',5000.00000000,'2025-04-03 00:00:00.000'),
(9206081900010041,'659719952244806','DEMO-SO-018',2,'91CC0179',5000.00000000,'2025-04-03 00:00:00.000'),
(9206081900010042,'659719952248901','DEMO-SO-018',3,'91CC0287',4000.00000000,'2025-04-03 00:00:00.000'),
(9206081900010043,'659719952248902','DEMO-SO-018',4,'91DC0217',2000.00000000,'2025-04-03 00:00:00.000'),
(9206081900010044,'659719952248903','DEMO-SO-018',5,'91DC0219',9000.00000000,'2025-04-03 00:00:00.000'),
(9206081900010045,'659719952248904','DEMO-SO-018',6,'91C0D2D',2000.00000000,'2025-04-03 00:00:00.000'),
(9206081900010046,'659719952252997','DEMO-SO-018',7,'AB47111',200000.00000000,'2025-04-03 00:00:00.000'),
(9206081900010047,'665010090852421','DEMO-SO-019',1,'352AD0A',1.00000000,'2025-04-18 00:00:00.000'),
(9206081900010048,'665010090852422','DEMO-SO-019',2,'3521C0014',1.00000000,'2025-04-18 00:00:00.000'),
(9206081900010049,'665010090852423','DEMO-SO-019',3,'3151C0033',1.00000000,'2025-04-18 00:00:00.000'),
(9206081900010050,'665010090856517','DEMO-SO-019',4,'3151C0034',1.00000000,'2025-04-18 00:00:00.000'),
(9206081900010051,'670272721616965','DEMO-SO-020',1,'3221C0031',7000.00000000,'2025-04-30 00:00:00.000'),
(9206081900010052,'677416091480133','DEMO-SO-021',1,'3521C0015',1.00000000,'2025-05-23 00:00:00.000'),
(9206081900010053,'677416091480134','DEMO-SO-021',2,'3521C0015',1.00000000,'2025-05-23 00:00:00.000'),
(9206081900010054,'677416091480135','DEMO-SO-021',3,'3521C0015',1.00000000,'2025-05-23 00:00:00.000'),
(9206081900010055,'677416091480136','DEMO-SO-021',4,'3521C0015',1.00000000,'2025-05-23 00:00:00.000'),
(9206081900010056,'677416091480137','DEMO-SO-021',5,'3521C0015',1.00000000,'2025-05-28 00:00:00.000'),
(9206081900010057,'677416091484229','DEMO-SO-021',6,'3521C0015',1.00000000,'2025-05-28 00:00:00.000'),
(9206081900010058,'677416091484230','DEMO-SO-021',7,'3521C0015',1.00000000,'2025-05-28 00:00:00.000'),
(9206081900010059,'677416091484231','DEMO-SO-021',8,'3521C0015',1.00000000,'2025-05-28 00:00:00.000'),
(9206081900010060,'677416091484232','DEMO-SO-021',9,'3521C0015',1.00000000,'2025-05-28 00:00:00.000'),
(9206081900010061,'677416091484233','DEMO-SO-021',10,'3521C0015',1.00000000,'2025-05-28 00:00:00.000'),
(9206081900010062,'689366516133957','DEMO-SO-022',1,'3151C0034',1.00000000,'2025-06-27 00:00:00.000'),
(9206081900010063,'689366516133958','DEMO-SO-022',2,'3151C0034',1.00000000,'2025-06-27 00:00:00.000'),
(9206081900010064,'689366516133959','DEMO-SO-022',3,'3151C0034',1.00000000,'2025-06-27 00:00:00.000'),
(9206081900010065,'689366516138053','DEMO-SO-022',4,'3151C0034',1.00000000,'2025-06-27 00:00:00.000'),
(9206081900010066,'689366516138054','DEMO-SO-022',5,'3151C0034',1.00000000,'2025-06-27 00:00:00.000'),
(9206081900010067,'689366516138055','DEMO-SO-022',6,'3521C0016',1.00000000,'2025-06-27 00:00:00.000'),
(9206081900010068,'689366516138056','DEMO-SO-022',7,'3521C0016',1.00000000,'2025-06-27 00:00:00.000'),
(9206081900010069,'689366516142149','DEMO-SO-022',8,'3521C0016',1.00000000,'2025-06-27 00:00:00.000'),
(9206081900010070,'689366516142150','DEMO-SO-022',9,'3521C0016',1.00000000,'2025-06-27 00:00:00.000'),
(9206081900010071,'689366516142151','DEMO-SO-022',10,'3521C0016',1.00000000,'2025-06-27 00:00:00.000'),
(9206081900010072,'689366516142152','DEMO-SO-022',11,'3521C0016',1.00000000,'2025-06-27 00:00:00.000'),
(9206081900010073,'689366516142153','DEMO-SO-022',12,'3521C0016',1.00000000,'2025-06-27 00:00:00.000'),
(9206081900010074,'689369829818437','DEMO-SO-023',1,'3521C0016',1.00000000,'2025-06-27 00:00:00.000'),
(9206081900010075,'689369829818438','DEMO-SO-023',2,'3521C0016',1.00000000,'2025-06-27 00:00:00.000'),
(9206081900010076,'689369829818439','DEMO-SO-023',3,'3521C0016',1.00000000,'2025-06-27 00:00:00.000'),
(9206081900010077,'689369829818440','DEMO-SO-023',4,'352AD0A',1.00000000,'2025-06-27 00:00:00.000'),
(9206081900010078,'689369829822533','DEMO-SO-023',5,'352AD0A',1.00000000,'2025-06-27 00:00:00.000'),
(9206081900010079,'689369829822534','DEMO-SO-023',6,'352AD0A',1.00000000,'2025-06-27 00:00:00.000'),
(9206081900010080,'689369829822535','DEMO-SO-023',7,'352AD0A',1.00000000,'2025-06-27 00:00:00.000'),
(9206081900010081,'689369829822536','DEMO-SO-023',8,'352AD0A',1.00000000,'2025-06-27 00:00:00.000'),
(9206081900010082,'689369829826629','DEMO-SO-023',9,'352AD0A',1.00000000,'2025-06-27 00:00:00.000'),
(9206081900010083,'689369829826630','DEMO-SO-023',10,'352AD0A',1.00000000,'2025-06-27 00:00:00.000'),
(9206081900010084,'689369829826631','DEMO-SO-023',11,'352AD0A',1.00000000,'2025-06-27 00:00:00.000'),
(9206081900010085,'689369829826632','DEMO-SO-023',12,'352AD0A',1.00000000,'2025-06-27 00:00:00.000'),
(9206081900010086,'689369829826633','DEMO-SO-023',13,'352AD0A',1.00000000,'2025-06-27 00:00:00.000'),
(9206081900010087,'691329582436421','DEMO-SO-024',1,'91CC0178',4000.00000000,'2025-07-04 00:00:00.000'),
(9206081900010088,'691329582436422','DEMO-SO-024',2,'91CC0285',2000.00000000,'2025-07-04 00:00:00.000'),
(9206081900010089,'691329582436423','DEMO-SO-024',3,'91CC0286',4000.00000000,'2025-07-04 00:00:00.000'),
(9206081900010090,'691329582440517','DEMO-SO-024',4,'A2B8361',4000.00000000,'2025-07-04 00:00:00.000'),
(9206081900010091,'708842858610757','DEMO-SO-025',1,'1A0C273',200.00000000,'2025-08-21 00:00:00.000'),
(9206081900010092,'708842858610758','DEMO-SO-025',2,'1A0C275',272.00000000,'2025-08-21 00:00:00.000'),
(9206081900010093,'708842858610759','DEMO-SO-025',3,'1A004C4',960000.00000000,'2025-08-21 00:00:00.000'),
(9206081900010094,'708842858610760','DEMO-SO-025',4,'ABC419',1000.00000000,'2025-08-20 00:00:00.000'),
(9206081900010095,'708842858610761','DEMO-SO-025',5,'ABC431',2000.00000000,'2025-08-20 00:00:00.000'),
(9206081900010096,'708842858610762','DEMO-SO-025',6,'1A0C432',1000.00000000,'2025-08-26 00:00:00.000'),
(9206081900010097,'708842858610763','DEMO-SO-025',7,'1A0C588',29000.00000000,'2025-08-27 00:00:00.000'),
(9206081900010098,'708842858614853','DEMO-SO-025',8,'1A0C595',670000.00000000,'2025-08-26 00:00:00.000'),
(9206081900010099,'708842858614854','DEMO-SO-025',9,'AB32A4',111.00000000,'2025-08-27 00:00:00.000'),
(9206081900010100,'708853132763205','DEMO-SO-026',1,'A21C092',550.00000000,'2025-08-27 00:00:00.000'),
(9206081900010101,'708853132763206','DEMO-SO-026',2,'A21C093',60.00000000,'2025-08-28 00:00:00.000'),
(9206081900010102,'708853132763207','DEMO-SO-026',3,'91B0D033',38.00000000,'2025-08-28 00:00:00.000'),
(9206081900010103,'708853132767301','DEMO-SO-026',4,'91C0D058',558.00000000,'2025-08-22 00:00:00.000'),
(9206081900010104,'708853132767302','DEMO-SO-026',5,'91C0D074',2522.00000000,'2025-08-21 00:00:00.000'),
(9206081900010105,'708853132767303','DEMO-SO-026',6,'91C0DA8',69.00000000,'2025-08-27 00:00:00.000'),
(9206081900010106,'708853132771397','DEMO-SO-026',7,'93B0D1A',185.00000000,'2025-08-28 00:00:00.000'),
(9206081900010107,'708853132771398','DEMO-SO-026',8,'91CC0123',2.00000000,'2025-08-28 00:00:00.000'),
(9206081900010108,'708853132771399','DEMO-SO-026',9,'91CC0229',862.00000000,'2025-08-28 00:00:00.000'),
(9206081900010109,'708853132771400','DEMO-SO-026',10,'91CC0262',200.00000000,'2025-08-28 00:00:00.000'),
(9206081900010110,'708853132771401','DEMO-SO-026',11,'91CC0286',3000.00000000,'2025-08-27 00:00:00.000'),
(9206081900010111,'708853132775493','DEMO-SO-026',12,'91CC0312',300.00000000,'2025-08-28 00:00:00.000'),
(9206081900010112,'708853132775494','DEMO-SO-026',13,'91C0DD4',100.00000000,'2025-08-22 00:00:00.000'),
(9206081900010113,'708853132775495','DEMO-SO-026',14,'91CC0412',58.00000000,'2025-08-28 00:00:00.000'),
(9206081900010114,'708853132775496','DEMO-SO-026',15,'91C0DE2',400.00000000,'2025-08-28 00:00:00.000'),
(9206081900010115,'708853132775497','DEMO-SO-026',16,'91C0DE3',1050.00000000,'2025-08-28 00:00:00.000'),
(9206081900010116,'708853132779589','DEMO-SO-026',17,'91C0DE6',400.00000000,'2025-08-28 00:00:00.000'),
(9206081900010117,'708853132779590','DEMO-SO-026',18,'91C0DE7',1000.00000000,'2025-08-21 00:00:00.000'),
(9206081900010118,'708853132779591','DEMO-SO-026',19,'91C0DE9',350.00000000,'2025-08-28 00:00:00.000'),
(9206081900010119,'708853132779592','DEMO-SO-026',20,'91C0D5A',1100.00000000,'2025-08-21 00:00:00.000'),
(9206081900010120,'708853132779593','DEMO-SO-026',21,'91CC0518',1250.00000000,'2025-08-27 00:00:00.000'),
(9206081900010121,'708853132783685','DEMO-SO-026',22,'91CC0521',3000.00000000,'2025-08-27 00:00:00.000'),
(9206081900010122,'708853132783686','DEMO-SO-026',23,'91CC0524',1500.00000000,'2025-08-29 00:00:00.000'),
(9206081900010123,'708853132783687','DEMO-SO-026',24,'91CC0525',3000.00000000,'2025-08-27 00:00:00.000'),
(9206081900010124,'708853132783688','DEMO-SO-026',25,'91FC0339',600.00000000,'2025-08-27 00:00:00.000'),
(9206081900010125,'708853132783689','DEMO-SO-026',26,'1AB9259',5000.00000000,'2025-08-21 00:00:00.000'),
(9206081900010126,'708853132783690','DEMO-SO-026',27,'3124C0015',8000.00000000,'2025-08-28 00:00:00.000'),
(9206081900010127,'708853132787781','DEMO-SO-026',28,'3151C0032',1.00000000,'2025-08-28 00:00:00.000'),
(9206081900010128,'708853132787782','DEMO-SO-026',29,'1A0C452',1000.00000000,'2025-08-28 00:00:00.000'),
(9206081900010129,'708853132787783','DEMO-SO-026',30,'1A03G82',3000.00000000,'2025-08-27 00:00:00.000'),
(9206081900010130,'708853132787784','DEMO-SO-026',31,'91CC0319',160000.00000000,'2025-08-28 00:00:00.000'),
(9206081900010131,'708853132787785','DEMO-SO-026',32,'AB37A2',16000.00000000,'2025-08-27 00:00:00.000'),
(9206081900010132,'708853132791877','DEMO-SO-026',33,'91CC0248',500.00000000,'2025-08-27 00:00:00.000'),
(9206081900010133,'708853132791878','DEMO-SO-026',34,'91C00EN',60000.00000000,'2025-08-21 00:00:00.000'),
(9206081900010134,'708853132791879','DEMO-SO-026',35,'AB37A3',130000.00000000,'2025-08-28 00:00:00.000'),
(9206081900010135,'708853132791880','DEMO-SO-026',36,'91CC0517',100.00000000,'2025-08-28 00:00:00.000'),
(9206081900010136,'708853132791881','DEMO-SO-026',37,'3151C0034',1.00000000,'2025-08-26 00:00:00.000'),
(9206081900010137,'708853132791882','DEMO-SO-026',38,'3151C0034',1.00000000,'2025-08-27 00:00:00.000'),
(9206081900010138,'708853132791883','DEMO-SO-026',39,'3151C0034',1.00000000,'2025-08-27 00:00:00.000'),
(9206081900010139,'708853132791884','DEMO-SO-026',40,'3151C0034',1.00000000,'2025-08-27 00:00:00.000'),
(9206081900010140,'708853132791885','DEMO-SO-026',41,'3151C0034',1.00000000,'2025-08-20 00:00:00.000'),
(9206081900010141,'708853132795973','DEMO-SO-026',42,'3151C0033',1.00000000,'2025-08-27 00:00:00.000'),
(9206081900010142,'708853132795974','DEMO-SO-026',43,'3151C0033',1.00000000,'2025-08-20 00:00:00.000'),
(9206081900010143,'708853132795975','DEMO-SO-026',44,'3151C0033',1.00000000,'2025-08-20 00:00:00.000'),
(9206081900010144,'708853132795976','DEMO-SO-026',45,'3151C0033',1.00000000,'2025-08-20 00:00:00.000'),
(9206081900010145,'708853132795977','DEMO-SO-026',46,'3151C0033',1.00000000,'2025-08-20 00:00:00.000'),
(9206081900010146,'708853132795978','DEMO-SO-026',47,'3151C0033',1.00000000,'2025-08-20 00:00:00.000'),
(9206081900010147,'708853132795979','DEMO-SO-026',48,'3151C0033',1.00000000,'2025-08-27 00:00:00.000'),
(9206081900010148,'708853132795980','DEMO-SO-026',49,'3151C0033',1.00000000,'2025-08-26 00:00:00.000'),
(9206081900010149,'708853132795981','DEMO-SO-026',50,'3521C0015',1.00000000,'2025-08-26 00:00:00.000'),
(9206081900010150,'708853132795982','DEMO-SO-026',51,'3521C0015',1.00000000,'2025-08-19 00:00:00.000'),
(9206081900010151,'708853132795983','DEMO-SO-026',52,'3521C0015',1.00000000,'2025-08-20 00:00:00.000'),
(9206081900010152,'708853132800069','DEMO-SO-026',53,'3521C0015',1.00000000,'2025-08-27 00:00:00.000'),
(9206081900010153,'708853132800070','DEMO-SO-026',54,'3521C0015',1.00000000,'2025-08-27 00:00:00.000'),
(9206081900010154,'708853132800071','DEMO-SO-026',55,'3521C0015',1.00000000,'2025-08-20 00:00:00.000'),
(9206081900010155,'708853132800072','DEMO-SO-026',56,'3521C0015',1.00000000,'2025-08-26 00:00:00.000'),
(9206081900010156,'708853132800073','DEMO-SO-026',57,'3521C0015',1.00000000,'2025-08-20 00:00:00.000'),
(9206081900010157,'708853132800074','DEMO-SO-026',58,'3521C0015',1.00000000,'2025-08-27 00:00:00.000'),
(9206081900010158,'708853132800075','DEMO-SO-026',59,'3521C0015',1.00000000,'2025-08-27 00:00:00.000'),
(9206081900010159,'708853132800076','DEMO-SO-026',60,'3521C0015',1.00000000,'2025-08-26 00:00:00.000'),
(9206081900010160,'708853132800077','DEMO-SO-026',61,'3521C0015',1.00000000,'2025-08-19 00:00:00.000'),
(9206081900010161,'708853132804165','DEMO-SO-026',62,'3521C0015',1.00000000,'2025-08-26 00:00:00.000'),
(9206081900010162,'713850861281349','DEMO-SO-027',1,'91C0D2G',5000.00000000,'2025-08-31 00:00:00.000'),
(9206081900010163,'713850861281350','DEMO-SO-027',2,'93BC0311',510.00000000,'2025-08-30 00:00:00.000'),
(9206081900010164,'713850861281351','DEMO-SO-027',3,'91CC0312',500.00000000,'2025-08-30 00:00:00.000'),
(9206081900010165,'713850861285445','DEMO-SO-027',4,'91CC0233',400.00000000,'2025-08-30 00:00:00.000'),
(9206081900010166,'713850861285446','DEMO-SO-027',5,'91CC0232',1500.00000000,'2025-08-30 00:00:00.000'),
(9206081900010167,'716009096228933','DEMO-SO-028',1,'91CC0312',5000.00000000,'2025-09-30 00:00:00.000'),
(9206081900010168,'716009096228934','DEMO-SO-028',2,'93BC0311',5000.00000000,'2025-09-30 00:00:00.000'),
(9206081900010169,'720949568118853','DEMO-SO-029',1,'91CC0483',1900.00000000,'2025-09-30 00:00:00.000'),
(9206081900010170,'720949568118854','DEMO-SO-029',2,'91CC0312',100.00000000,'2025-09-25 00:00:00.000'),
(9206081900010171,'720949568118855','DEMO-SO-029',3,'93BC0311',600.00000000,'2025-09-30 00:00:00.000'),
(9206081900010172,'720949568122949','DEMO-SO-029',4,'91CC0313',100.00000000,'2025-09-29 00:00:00.000'),
(9206081900010173,'720949568122950','DEMO-SO-029',5,'91CC0229',700.00000000,'2025-09-30 00:00:00.000'),
(9206081900010174,'721256689414213','DEMO-SO-030',1,'91CC0182',10000.00000000,'2025-09-30 00:00:00.000'),
(9206081900010175,'721256689414214','DEMO-SO-030',2,'312CD009',10000.00000000,'2025-09-30 00:00:00.000'),
(9206081900010176,'721256689414215','DEMO-SO-030',3,'3123C0012',10000.00000000,'2025-09-30 00:00:00.000'),
(9206081900010177,'721256689414216','DEMO-SO-030',4,'3123C0026',3000.00000000,'2025-09-30 00:00:00.000'),
(9206081900010178,'721256689414217','DEMO-SO-030',5,'3123C0027',3000.00000000,'2025-09-30 00:00:00.000'),
(9206081900010179,'721256689418309','DEMO-SO-030',6,'3123C0028',3000.00000000,'2025-09-30 00:00:00.000'),
(9206081900010180,'721256689418310','DEMO-SO-030',7,'3123C0035',10000.00000000,'2025-09-30 00:00:00.000'),
(9206081900010181,'721256689418311','DEMO-SO-030',8,'3123C0046',3000.00000000,'2025-09-30 00:00:00.000'),
(9206081900010182,'721256689422405','DEMO-SO-030',9,'3123C0047',3000.00000000,'2025-09-30 00:00:00.000'),
(9206081900010183,'721256689422406','DEMO-SO-030',10,'3123C0048',3000.00000000,'2025-09-30 00:00:00.000'),
(9206081900010184,'721256689422407','DEMO-SO-030',11,'3521C0015',1.00000000,'2025-09-30 00:00:00.000'),
(9206081900010185,'721256689422408','DEMO-SO-030',12,'3521C0015',1.00000000,'2025-09-30 00:00:00.000'),
(9206081900010186,'721256689426501','DEMO-SO-030',13,'3521C0015',1.00000000,'2025-09-30 00:00:00.000'),
(9206081900010187,'721256689426502','DEMO-SO-030',14,'3521C0015',1.00000000,'2025-09-30 00:00:00.000'),
(9206081900010188,'721256689426503','DEMO-SO-030',15,'3521C0016',1.00000000,'2025-09-24 00:00:00.000'),
(9206081900010189,'721256689426504','DEMO-SO-030',16,'3521C0016',1.00000000,'2025-09-25 00:00:00.000'),
(9206081900010190,'721256689426505','DEMO-SO-030',17,'3521C0016',1.00000000,'2025-09-25 00:00:00.000'),
(9206081900010191,'721256689430597','DEMO-SO-030',18,'3521C0016',1.00000000,'2025-09-30 00:00:00.000'),
(9206081900010192,'721256689430598','DEMO-SO-030',19,'3521C0016',1.00000000,'2025-09-30 00:00:00.000'),
(9206081900010193,'721256689430599','DEMO-SO-030',20,'3521C0016',1.00000000,'2025-09-30 00:00:00.000'),
(9206081900010194,'721256689430600','DEMO-SO-030',21,'3521C0015',1.00000000,'2025-09-30 00:00:00.000'),
(9206081900010195,'721256689434693','DEMO-SO-030',22,'3521C0015',1.00000000,'2025-09-30 00:00:00.000'),
(9206081900010196,'721256689434694','DEMO-SO-030',23,'3521C0015',1.00000000,'2025-09-30 00:00:00.000'),
(9206081900010197,'721256689434695','DEMO-SO-030',24,'3521C0015',1.00000000,'2025-09-30 00:00:00.000'),
(9206081900010198,'721256689434696','DEMO-SO-030',25,'3521C0015',1.00000000,'2025-09-30 00:00:00.000'),
(9206081900010199,'721256689438789','DEMO-SO-030',26,'3521C0015',1.00000000,'2025-09-30 00:00:00.000'),
(9206081900010200,'721256689438790','DEMO-SO-030',27,'3521C0015',1.00000000,'2025-09-30 00:00:00.000'),
(9206081900010201,'722351552172101','DEMO-SO-031',1,'91CC0283',20000.00000000,'2025-09-30 00:00:00.000'),
(9206081900010202,'765148661813317','DEMO-SO-032',1,'1A0044F',1000.00000000,'2026-01-25 00:00:00.000'),
(9206081900010203,'765148661813318','DEMO-SO-032',2,'1A0045H',1000.00000000,'2026-01-25 00:00:00.000'),
(9206081900010204,'765148661813319','DEMO-SO-032',3,'1A0047E',1000.00000000,'2026-01-25 00:00:00.000'),
(9206081900010205,'769809191923781','DEMO-SO-033',1,'1A0044F',100.00000000,'2026-02-09 00:00:00.000'),
(9206081900010206,'1958480382326104095','DEMO-SO-034',1,'91CC0232',400.00000000,'2024-09-23 17:36:13.000'),
(9206081900010207,'1958480382326104096','DEMO-SO-034',2,'91CC0287',567.00000000,'2024-09-23 17:36:23.000'),
(9206081900010208,'1958480382326104097','DEMO-SO-034',3,'91CC0288',256.00000000,'2024-09-23 17:36:38.000'),
(9206081900010209,'1958480382326104098','DEMO-SO-034',4,'91C0D3A',400.00000000,'2024-09-23 17:36:55.000'),
(9206081900010210,'1958480382326104099','DEMO-SO-034',5,'91CC0312',590.00000000,'2024-09-23 17:37:10.000'),
(9206081900010211,'1958480382326104100','DEMO-SO-034',6,'91DC0219',1216.00000000,'2024-09-23 17:37:40.000'),
(9206081900010212,'1958480382326104101','DEMO-SO-034',7,'91DC0284',1104.00000000,'2024-09-23 17:37:58.000'),
(9206081900010213,'1958480382326104102','DEMO-SO-034',8,'91DC0292',1415.00000000,'2024-09-23 17:38:21.000'),
(9206081900010214,'1958480382326104103','DEMO-SO-034',9,'91C0DC8',1200.00000000,'2024-09-23 17:53:47.000'),
(9206081900010215,'1958480382326104104','DEMO-SO-034',10,'1A03D23',511.00000000,'2024-09-23 17:54:41.000'),
(9206081900010216,'1958480382326104105','DEMO-SO-034',11,'91CC0228',1695.00000000,'2024-09-23 17:54:51.000'),
(9206081900010217,'1958480382326104106','DEMO-SO-034',12,'91DC0213',210.00000000,'2024-09-24 09:07:26.000'),
(9206081900010218,'1958480382326104265','DEMO-SO-035',1,'AB04C1',100.00000000,'2024-10-14 16:24:39.000'),
(9206081900010219,'1958480382326104266','DEMO-SO-035',2,'1AB2737',66.00000000,'2024-10-14 16:24:52.000'),
(9206081900010220,'1958480382326104267','DEMO-SO-035',3,'A2B5613',190.00000000,'2024-10-14 16:25:17.000'),
(9206081900010221,'1958480382326104268','DEMO-SO-035',4,'1A03G94',83.00000000,'2024-10-14 16:25:40.000'),
(9206081900010222,'1958480382326104269','DEMO-SO-035',5,'1A03G96',4208.00000000,'2024-10-14 16:25:51.000'),
(9206081900010223,'1958480382326104270','DEMO-SO-035',6,'AB37A2',1000.00000000,'2024-10-14 16:26:17.000'),
(9206081900010224,'1958480382326104271','DEMO-SO-035',7,'A2C7113',115000.00000000,'2024-10-14 16:26:36.000'),
(9206081900010225,'1958480382326104272','DEMO-SO-035',8,'A2C7114',120000.00000000,'2024-10-14 16:28:00.000'),
(9206081900010226,'1958480382326104273','DEMO-SO-035',9,'A2C7115',280000.00000000,'2024-10-14 16:28:17.000'),
(9206081900010227,'1958480382326104274','DEMO-SO-035',10,'A2C7116',10000.00000000,'2024-10-14 16:28:31.000'),
(9206081900010228,'1958480382326104275','DEMO-SO-035',11,'A2C7117',30000.00000000,'2024-10-14 16:28:44.000'),
(9206081900010229,'1958480382326104276','DEMO-SO-035',12,'A2B8361',400.00000000,'2024-10-14 16:29:26.000'),
(9206081900010230,'1958480382326104277','DEMO-SO-035',13,'1AB9259',418.00000000,'2024-10-14 16:29:43.000'),
(9206081900010231,'1958480382326104278','DEMO-SO-035',14,'A21C096',1088.00000000,'2024-10-14 16:30:04.000'),
(9206081900010232,'1958480382326104279','DEMO-SO-035',15,'91C0D058',300.00000000,'2024-10-14 16:30:25.000'),
(9206081900010233,'1958480382326104280','DEMO-SO-035',16,'91CC0283',1107.00000000,'2024-10-14 16:30:41.000'),
(9206081900010234,'1958480382326104286','DEMO-SO-036',1,'91CC0229',1000.00000000,'2024-10-15 17:40:11.000'),
(9206081900010235,'1958480382326104287','DEMO-SO-036',2,'91FC0339',600.00000000,'2024-10-15 17:40:33.000'),
(9206081900010236,'1958480382326104288','DEMO-SO-036',3,'91CC0319',7000.00000000,'2024-10-15 17:40:45.000'),
(9206081900010237,'1958480382326104289','DEMO-SO-036',4,'91DC0284',1635.00000000,'2024-10-15 17:40:58.000'),
(9206081900010238,'1958480382326104290','DEMO-SO-036',5,'91DC0219',975.00000000,'2024-10-15 17:41:16.000'),
(9206081900010239,'1958480382326104291','DEMO-SO-036',6,'91CC0283',368.00000000,'2024-10-15 17:41:28.000'),
(9206081900010240,'1958480382326104292','DEMO-SO-036',7,'1A03G96',822.00000000,'2024-10-15 17:41:41.000'),
(9206081900010241,'1958480382326104293','DEMO-SO-036',8,'91C0D2G',1200.00000000,'2024-10-15 17:41:54.000'),
(9206081900010242,'1958480382326104294','DEMO-SO-036',9,'1A03G82',10000.00000000,'2024-10-15 17:42:06.000'),
(9206081900010243,'1958480382326104295','DEMO-SO-036',10,'ABC431',6614.00000000,'2024-10-15 17:42:20.000'),
(9206081900010244,'1958480382326104296','DEMO-SO-036',11,'1A0C432',7810.00000000,'2024-10-15 17:42:33.000'),
(9206081900010245,'1958480382326104297','DEMO-SO-036',12,'1A0387B',341.00000000,'2024-10-15 17:42:48.000'),
(9206081900010246,'1958480382326104298','DEMO-SO-036',13,'91C0DC8',400.00000000,'2024-10-15 17:43:01.000'),
(9206081900010247,'1958480382326104299','DEMO-SO-036',14,'1A03D23',958.00000000,'2024-10-15 17:43:24.000'),
(9206081900010248,'1958480382326104300','DEMO-SO-036',15,'91CC0235',200.00000000,'2024-10-15 17:43:37.000'),
(9206081900010249,'1958480382326104301','DEMO-SO-036',16,'91CC0179',300.00000000,'2024-10-15 17:43:54.000'),
(9206081900010250,'1958902016386269185','DEMO-SO-037',1,'91C0DC9',280.00000000,'2024-10-18 17:34:58.000'),
(9206081900010251,'1958902016386269186','DEMO-SO-037',2,'ABC431',4000.00000000,'2024-10-18 17:35:20.000'),
(9206081900010252,'1958902016386269187','DEMO-SO-037',3,'1A0C432',4200.00000000,'2024-10-18 17:35:29.000'),
(9206081900010253,'1958902016386269188','DEMO-SO-037',4,'1A0C595',200000.00000000,'2024-10-18 17:35:44.000'),
(9206081900010254,'1958902016386269189','DEMO-SO-037',5,'1A0C689',400.00000000,'2024-10-18 17:36:00.000'),
(9206081900010255,'1958902016386269190','DEMO-SO-037',6,'1AB2755',101.00000000,'2024-10-18 17:36:12.000'),
(9206081900010256,'1958902016386269191','DEMO-SO-037',7,'AB3D14',50000.00000000,'2024-10-18 17:36:23.000'),
(9206081900010257,'1958902016386269192','DEMO-SO-037',8,'A2B5613',1783.00000000,'2024-10-18 17:36:38.000'),
(9206081900010258,'1958902016386269193','DEMO-SO-037',9,'1A03G96',1473.00000000,'2024-10-18 17:36:50.000'),
(9206081900010259,'1958902016386269194','DEMO-SO-037',10,'91DC0214',600.00000000,'2024-10-18 17:37:10.000'),
(9206081900010260,'1958902016386269195','DEMO-SO-037',11,'91DC0219',202.00000000,'2024-10-18 17:37:23.000'),
(9206081900010261,'1958902016386269196','DEMO-SO-037',12,'AB3B81',256.00000000,'2024-10-18 17:38:03.000'),
(9206081900010262,'1958902016386269197','DEMO-SO-037',13,'91CC0177',81.00000000,'2024-10-18 17:38:14.000'),
(9206081900010263,'1958902016386269198','DEMO-SO-037',14,'91C0D2D',400.00000000,'2024-10-18 17:38:28.000'),
(9206081900010264,'1958902016386269199','DEMO-SO-037',15,'91CC0283',1044.00000000,'2024-10-18 17:38:38.000'),
(9206081900010265,'1958902016386269200','DEMO-SO-037',16,'91CC0236',400.00000000,'2024-10-18 17:38:50.000'),
(9206081900010266,'1958902016386269201','DEMO-SO-037',17,'91DC0284',1082.00000000,'2024-10-18 17:39:00.000'),
(9206081900010267,'1958902016386269202','DEMO-SO-037',18,'91DC0292',202.00000000,'2024-10-18 17:39:14.000'),
(9206081900010268,'1958956122157088769','DEMO-SO-038',1,'91CC0187',54.00000000,'2024-10-19 16:25:13.000'),
(9206081900010269,'1958956122157088770','DEMO-SO-038',2,'91FC0339',11.00000000,'2024-10-19 16:25:29.000'),
(9206081900010270,'1958956122157088771','DEMO-SO-038',3,'91CC0228',131.00000000,'2024-10-19 16:25:40.000'),
(9206081900010271,'1958956122157088772','DEMO-SO-038',4,'91C0D051',1.00000000,'2024-10-19 16:25:52.000'),
(9206081900010272,'1958956122157088773','DEMO-SO-038',5,'A21C092',15.00000000,'2024-10-19 16:25:59.000'),
(9206081900010273,'1959718646913695745','DEMO-SO-039',1,'1A039D8',350.00000000,'2024-10-21 18:33:52.000'),
(9206081900010274,'1959718646913695746','DEMO-SO-039',2,'91CC0283',716.00000000,'2024-10-21 18:34:04.000'),
(9206081900010275,'1959718646913695747','DEMO-SO-039',3,'91DC0292',967.00000000,'2024-10-21 18:34:17.000'),
(9206081900010276,'1959718646917890048','DEMO-SO-039',4,'91DC0284',640.00000000,'2024-10-21 18:53:13.000'),
(9206081900010277,'1959718646917890049','DEMO-SO-039',5,'1A03D23',1134.00000000,'2024-10-21 18:53:36.000'),
(9206081900010278,'1959718646917890050','DEMO-SO-039',6,'91CC0229',1800.00000000,'2024-10-21 18:53:49.000'),
(9206081900010279,'1959718646917890051','DEMO-SO-039',7,'91CC0241',200.00000000,'2024-10-21 18:54:00.000'),
(9206081900010280,'1959718646917890052','DEMO-SO-039',8,'91CC0278',70.00000000,'2024-10-21 18:54:18.000'),
(9206081900010281,'1959718646917890053','DEMO-SO-039',9,'91DC0215',587.00000000,'2024-10-21 19:38:04.000'),
(9206081900010282,'1959729971345752064','DEMO-SO-039',10,'91DC0215',587.00000000,'2024-10-21 19:38:04.000'),
(9206081900010283,'1960006795304894465','DEMO-SO-040',1,'91CC0235',600.00000000,'2024-10-22 14:01:07.000'),
(9206081900010284,'1963915047889534977','DEMO-SO-041',1,'91CC0287',313.00000000,'2024-11-02 08:44:39.000'),
(9206081900010285,'1963915047889534978','DEMO-SO-041',2,'91CC0288',454.00000000,'2024-11-02 08:44:50.000'),
(9206081900010286,'1963915047889534979','DEMO-SO-041',3,'91CC0319',340.00000000,'2024-11-02 08:45:03.000'),
(9206081900010287,'1963915047889534980','DEMO-SO-041',4,'91FC0339',900.00000000,'2024-11-02 08:45:17.000'),
(9206081900010288,'1963915047889534981','DEMO-SO-041',5,'91DC0284',813.00000000,'2024-11-02 08:45:28.000'),
(9206081900010289,'1963915047889534982','DEMO-SO-041',6,'91DC0218',180.00000000,'2024-11-02 08:45:41.000'),
(9206081900010290,'1963915047889534983','DEMO-SO-041',7,'91DC0219',92.00000000,'2024-11-02 08:45:54.000'),
(9206081900010291,'1963915047889534984','DEMO-SO-041',8,'91CC0234',200.00000000,'2024-11-02 08:46:06.000'),
(9206081900010292,'1963915047889534985','DEMO-SO-041',9,'AB3B81',218.00000000,'2024-11-02 08:46:33.000'),
(9206081900010293,'1963971671127752705','DEMO-SO-042',1,'A2B4199',1596.00000000,'2024-11-02 12:32:48.000'),
(9206081900010294,'1963971671127752706','DEMO-SO-042',2,'1A03G96',489.00000000,'2024-11-02 12:33:02.000'),
(9206081900010295,'1963971671127752707','DEMO-SO-042',3,'AB37A2',2000.00000000,'2024-11-02 12:33:20.000'),
(9206081900010296,'1963971671127752708','DEMO-SO-042',4,'AB37A3',5000.00000000,'2024-11-02 12:33:30.000'),
(9206081900010297,'1963971671127752709','DEMO-SO-042',5,'A2C7116',35000.00000000,'2024-11-02 12:33:45.000'),
(9206081900010298,'1963971671127752710','DEMO-SO-042',6,'A2C7117',15000.00000000,'2024-11-02 12:33:58.000'),
(9206081900010299,'1963971671131947008','DEMO-SO-042',7,'1A0387B',130.00000000,'2024-11-02 12:34:15.000'),
(9206081900010300,'1963971671131947009','DEMO-SO-042',8,'91CC0177',300.00000000,'2024-11-02 12:34:28.000'),
(9206081900010301,'1963971671131947010','DEMO-SO-042',9,'91CC0178',525.00000000,'2024-11-02 12:34:42.000'),
(9206081900010302,'1963971671131947011','DEMO-SO-042',10,'91CC0179',1200.00000000,'2024-11-02 12:34:55.000'),
(9206081900010303,'1963971671131947012','DEMO-SO-042',11,'91CC0228',2367.00000000,'2024-11-02 12:35:09.000'),
(9206081900010304,'1964653664643579905','DEMO-SO-043',1,'91CC0229',900.00000000,'2024-11-04 09:41:34.000'),
(9206081900010305,'1964653664643579906','DEMO-SO-043',2,'AB3A76',1815.00000000,'2024-11-04 09:41:49.000'),
(9206081900010306,'1964653664643579907','DEMO-SO-043',3,'A2B8414',300.00000000,'2024-11-04 09:41:59.000'),
(9206081900010307,'1964653664643579908','DEMO-SO-043',4,'91DC0284',263.00000000,'2024-11-04 09:43:50.000'),
(9206081900010308,'1964653664643579909','DEMO-SO-043',5,'91F0D061',121.00000000,'2024-11-04 09:44:13.000'),
(9206081900010309,'1964653664643579910','DEMO-SO-043',6,'91DC0219',2030.00000000,'2024-11-04 09:44:50.000'),
(9206081900010310,'1964653664643579911','DEMO-SO-043',7,'91DC0218',318.00000000,'2024-11-04 09:45:09.000'),
(9206081900010311,'1964653664643579912','DEMO-SO-043',8,'91CC0231',200.00000000,'2024-11-04 09:45:30.000'),
(9206081900010312,'1964653664643579913','DEMO-SO-043',9,'91CC0233',800.00000000,'2024-11-04 09:45:42.000'),
(9206081900010313,'1981045424231809025','DEMO-SO-044',1,'91DC0218',400.00000000,'2024-12-19 15:13:21.000'),
(9206081900010314,'1981045424231809026','DEMO-SO-044',2,'91DC0219',1312.00000000,'2024-12-19 15:13:31.000'),
(9206081900010315,'1981045424231809027','DEMO-SO-044',3,'1A004C4',436000.00000000,'2024-12-19 15:14:15.000'),
(9206081900010316,'1981045424231809028','DEMO-SO-044',4,'ABC419',3200.00000000,'2024-12-19 15:14:29.000'),
(9206081900010317,'1981045424231809029','DEMO-SO-044',5,'ABC431',1600.00000000,'2024-12-19 15:14:42.000'),
(9206081900010318,'1981045424231809030','DEMO-SO-044',6,'1A0C432',1400.00000000,'2024-12-19 15:14:53.000'),
(9206081900010319,'1981045424231809031','DEMO-SO-044',7,'1A0044F',1753.00000000,'2024-12-19 15:15:05.000'),
(9206081900010320,'1981045424231809032','DEMO-SO-044',8,'1A03D23',743.00000000,'2024-12-19 15:15:19.000'),
(9206081900010321,'1981045424231809033','DEMO-SO-044',9,'A2B4199',1746.00000000,'2024-12-19 15:15:32.000'),
(9206081900010322,'1981045424231809034','DEMO-SO-044',10,'1A03G96',1960.00000000,'2024-12-19 15:15:46.000'),
(9206081900010323,'1981045424231809035','DEMO-SO-044',11,'A2B8184',100.00000000,'2024-12-19 15:15:59.000'),
(9206081900010324,'1981045424231809036','DEMO-SO-044',12,'A2B8361',400.00000000,'2024-12-19 15:16:10.000'),
(9206081900010325,'1981045424231809037','DEMO-SO-044',13,'91CC0188',1700.00000000,'2024-12-19 15:16:23.000'),
(9206081900010326,'1981045424231809038','DEMO-SO-044',14,'91CC0228',2315.00000000,'2024-12-19 15:16:34.000'),
(9206081900010327,'1981045424231809039','DEMO-SO-044',15,'91CC0232',800.00000000,'2024-12-19 15:16:46.000'),
(9206081900010328,'1981045424231809040','DEMO-SO-044',16,'91CC0233',400.00000000,'2024-12-19 15:16:57.000'),
(9206081900010329,'1981045424231809041','DEMO-SO-044',17,'91CC0234',100.00000000,'2024-12-19 15:17:08.000'),
(9206081900010330,'1981045424231809042','DEMO-SO-044',18,'91CC0283',1890.00000000,'2024-12-19 15:17:24.000'),
(9206081900010331,'1981045424231809043','DEMO-SO-044',19,'91CC0319',3500.00000000,'2024-12-19 15:17:36.000'),
(9206081900010332,'1990491416446369793','DEMO-SO-045',1,'1A03G94',1686.00000000,'2025-01-14 16:53:10.000'),
(9206081900010333,'1990491416446369794','DEMO-SO-045',2,'AB37A3',2000.00000000,'2025-01-14 16:53:26.000'),
(9206081900010334,'1990491416446369795','DEMO-SO-045',3,'A2B8361',400.00000000,'2025-01-14 16:53:37.000'),
(9206081900010335,'1990491416446369796','DEMO-SO-045',4,'1AB9275',1017.00000000,'2025-01-14 16:53:48.000'),
(9206081900010336,'1990491416446369797','DEMO-SO-045',5,'A21C092',2063.00000000,'2025-01-14 16:53:59.000'),
(9206081900010337,'1990491416446369798','DEMO-SO-045',6,'A21C096',1000.00000000,'2025-01-14 16:54:12.000'),
(9206081900010338,'1990491416446369799','DEMO-SO-045',7,'91C0D051',299.00000000,'2025-01-14 16:54:35.000'),
(9206081900010339,'1990491416446369800','DEMO-SO-045',8,'91C0D053',300.00000000,'2025-01-14 16:54:50.000'),
(9206081900010340,'1990491416446369801','DEMO-SO-045',9,'91C0D074',400.00000000,'2025-01-14 16:55:01.000');

DROP TEMPORARY TABLE IF EXISTS tmp_s2_uat_morder;
CREATE TEMPORARY TABLE tmp_s2_uat_morder (
    target_mo_id BIGINT NOT NULL PRIMARY KEY,
    target_me_id BIGINT NOT NULL,
    source_entry VARCHAR(32) NOT NULL,
    bill_no VARCHAR(64) NOT NULL,
    morder_no VARCHAR(128) NOT NULL,
    product_code VARCHAR(128) NULL,
    need_number DECIMAL(23,10) NULL
);
INSERT INTO tmp_s2_uat_morder VALUES
(9206081900020002,9206081900040002,'604438178041925','DEMO-SO-001','DEMO-WO-001','94000292',4500.0000000000),
(9206081900020003,9206081900040003,'604438178041926','DEMO-SO-001','DEMO-WO-002','1004023',3500.0000000000),
(9206081900020004,9206081900040004,'604438178046021','DEMO-SO-001','DEMO-WO-003','1000329',400000.0000000000),
(9206081900020005,9206081900040005,'604438178046022','DEMO-SO-001','DEMO-WO-004','1000655',100000.0000000000),
(9206081900020006,9206081900040006,'604438178046023','DEMO-SO-001','DEMO-WO-005','1007114',250000.0000000000),
(9206081900020007,9206081900040007,'604438178046024','DEMO-SO-001','DEMO-WO-006','1007115',600000.0000000000),
(9206081900020008,9206081900040008,'604438178050117','DEMO-SO-001','DEMO-WO-007','1004199',6000.0000000000),
(9206081900020009,9206081900040009,'604438178050118','DEMO-SO-001','DEMO-WO-008','1000588',10000.0000000000),
(9206081900020010,9206081900040010,'604438178050119','DEMO-SO-001','DEMO-WO-009','1007094',2500.0000000000),
(9206081900020011,9206081900040011,'604438178050120','DEMO-SO-001','DEMO-WO-010','32400015',1470.0000000000),
(9206081900020012,9206081900040012,'604438178054213','DEMO-SO-001','DEMO-WO-011','94000218',800.0000000000),
(9206081900020013,9206081900040013,'618270140751941','DEMO-SO-002','DEMO-WO-012','93000229',60.0000000000),
(9206081900020014,9206081900040014,'618290062549061','DEMO-SO-003','DEMO-WO-013','94000218',2000.0000000000),
(9206081900020015,9206081900040015,'619057595396165','DEMO-SO-004','DEMO-WO-014','93000237',200.0000000000),
(9206081900020016,9206081900040016,'630994145116229','DEMO-SO-005','DEMO-WO-015','1007114',250000.0000000000),
(9206081900020017,9206081900040017,'631069575503941','DEMO-SO-006','DEMO-WO-016','1000329',100000.0000000000),
(9206081900020018,9206081900040018,'631769478479941','DEMO-SO-007','DEMO-WO-017','93000312',500.0000000000),
(9206081900020019,9206081900040019,'631769478479942','DEMO-SO-007','DEMO-WO-018','1004023',600.0000000000),
(9206081900020020,9206081900040020,'631769478484037','DEMO-SO-007','DEMO-WO-019','93000231',100.0000000000),
(9206081900020021,9206081900040021,'631769478484038','DEMO-SO-007','DEMO-WO-020','93000286',800.0000000000),
(9206081900020022,9206081900040022,'632121332793413','DEMO-SO-008','DEMO-WO-021','93000058',400.0000000000),
(9206081900020023,9206081900040023,'632124508205125','DEMO-SO-009','DEMO-WO-022','1008361',1000.0000000000),
(9206081900020024,9206081900040024,'632125640785989','DEMO-SO-010','DEMO-WO-023','1008184',700.0000000000),
(9206081900020025,9206081900040025,'633173731577925','DEMO-SO-011','DEMO-WO-024','1004199',4000.0000000000),
(9206081900020026,9206081900040026,'633178120278085','DEMO-SO-012','DEMO-WO-025','1004023',5000.0000000000),
(9206081900020027,9206081900040027,'633197803688005','DEMO-SO-013','DEMO-WO-026','1000431',10000.0000000000),
(9206081900020028,9206081900040028,'633197803688006','DEMO-SO-013','DEMO-WO-027','1000432',10000.0000000000),
(9206081900020029,9206081900040029,'633206945230917','DEMO-SO-014','DEMO-WO-028','1000419',35000.0000000000),
(9206081900020030,9206081900040030,'633515239526469','DEMO-SO-015','DEMO-WO-029','1000293',650000.0000000000),
(9206081900020031,9206081900040031,'633515239526470','DEMO-SO-015','DEMO-WO-030','1000329',200000.0000000000),
(9206081900020032,9206081900040032,'633520970641477','DEMO-SO-016','DEMO-WO-031','94000215',1500.0000000000),
(9206081900020033,9206081900040033,'646977501577285','DEMO-SO-017','DEMO-WO-032','93000179',5000.0000000000),
(9206081900020034,9206081900040034,'646977501577286','DEMO-SO-017','DEMO-WO-033','35100015',1.0000000000),
(9206081900020035,9206081900040035,'646977501581381','DEMO-SO-017','DEMO-WO-034','35100016',1.0000000000),
(9206081900020036,9206081900040036,'646977501581382','DEMO-SO-017','DEMO-WO-035','93000187',5000.0000000000),
(9206081900020037,9206081900040037,'646977501581383','DEMO-SO-017','DEMO-WO-036','93000233',1500.0000000000),
(9206081900020038,9206081900040038,'646977501581384','DEMO-SO-017','DEMO-WO-037','94000218',3000.0000000000),
(9206081900020039,9206081900040039,'646977501581385','DEMO-SO-017','DEMO-WO-038','1010096',10000.0000000000),
(9206081900020040,9206081900040040,'659719952244805','DEMO-SO-018','DEMO-WO-039','93000177',5000.0000000000),
(9206081900020041,9206081900040041,'659719952244806','DEMO-SO-018','DEMO-WO-040','32100034',11000.0000000000),
(9206081900020042,9206081900040042,'659719952248901','DEMO-SO-018','DEMO-WO-041','35100015',1.0000000000),
(9206081900020043,9206081900040043,'659719952248902','DEMO-SO-018','DEMO-WO-042','94000217',2000.0000000000),
(9206081900020044,9206081900040044,'659719952248903','DEMO-SO-018','DEMO-WO-043','94000219',9000.0000000000),
(9206081900020045,9206081900040045,'659719952248904','DEMO-SO-018','DEMO-WO-044','93000240',2000.0000000000),
(9206081900020046,9206081900040046,'659719952252997','DEMO-SO-018','DEMO-WO-045','1007111',200000.0000000000),
(9206081900020047,9206081900040047,'665010090852421','DEMO-SO-019','DEMO-WO-046','35100010',1.0000000000),
(9206081900020048,9206081900040048,'665010090852422','DEMO-SO-019','DEMO-WO-047','35100014',1.0000000000),
(9206081900020049,9206081900040049,'665010090852423','DEMO-SO-019','DEMO-WO-048','35100033',1.0000000000),
(9206081900020050,9206081900040050,'665010090856517','DEMO-SO-019','DEMO-WO-049','35100034',1.0000000000),
(9206081900020051,9206081900040051,'670272721616965','DEMO-SO-020','DEMO-WO-050','32100031',7000.0000000000),
(9206081900020052,9206081900040052,'677416091480133','DEMO-SO-021','DEMO-WO-051','35100015',1.0000000000),
(9206081900020053,9206081900040053,'677416091480134','DEMO-SO-021','DEMO-WO-052','35100015',1.0000000000),
(9206081900020054,9206081900040054,'677416091480135','DEMO-SO-021','DEMO-WO-053','35100015',1.0000000000),
(9206081900020055,9206081900040055,'677416091480136','DEMO-SO-021','DEMO-WO-054','35100015',1.0000000000),
(9206081900020056,9206081900040056,'677416091480137','DEMO-SO-021','DEMO-WO-055','35100015',1.0000000000),
(9206081900020057,9206081900040057,'677416091484229','DEMO-SO-021','DEMO-WO-056','35100015',1.0000000000),
(9206081900020058,9206081900040058,'677416091484230','DEMO-SO-021','DEMO-WO-057','35100015',1.0000000000),
(9206081900020059,9206081900040059,'677416091484231','DEMO-SO-021','DEMO-WO-058','35100015',1.0000000000),
(9206081900020060,9206081900040060,'677416091484232','DEMO-SO-021','DEMO-WO-059','35100015',1.0000000000),
(9206081900020061,9206081900040061,'677416091484233','DEMO-SO-021','DEMO-WO-060','35100015',1.0000000000),
(9206081900020062,9206081900040062,'689366516133957','DEMO-SO-022','DEMO-WO-061','35100034',1.0000000000),
(9206081900020063,9206081900040063,'689366516133958','DEMO-SO-022','DEMO-WO-062','35100034',1.0000000000),
(9206081900020064,9206081900040064,'689366516133959','DEMO-SO-022','DEMO-WO-063','35100034',1.0000000000),
(9206081900020065,9206081900040065,'689366516138053','DEMO-SO-022','DEMO-WO-064','35100034',1.0000000000),
(9206081900020066,9206081900040066,'689366516138054','DEMO-SO-022','DEMO-WO-065','35100034',1.0000000000),
(9206081900020067,9206081900040067,'689366516138055','DEMO-SO-022','DEMO-WO-066','35100016',1.0000000000),
(9206081900020068,9206081900040068,'689366516138056','DEMO-SO-022','DEMO-WO-067','35100016',1.0000000000),
(9206081900020069,9206081900040069,'689366516142149','DEMO-SO-022','DEMO-WO-068','35100016',1.0000000000),
(9206081900020070,9206081900040070,'689366516142150','DEMO-SO-022','DEMO-WO-069','35100016',1.0000000000),
(9206081900020071,9206081900040071,'689366516142151','DEMO-SO-022','DEMO-WO-070','35100016',1.0000000000),
(9206081900020072,9206081900040072,'689366516142152','DEMO-SO-022','DEMO-WO-071','35100016',1.0000000000),
(9206081900020073,9206081900040073,'689366516142153','DEMO-SO-022','DEMO-WO-072','35100016',1.0000000000),
(9206081900020074,9206081900040074,'689369829818437','DEMO-SO-023','DEMO-WO-073','35100016',1.0000000000),
(9206081900020075,9206081900040075,'689369829818438','DEMO-SO-023','DEMO-WO-074','35100016',1.0000000000),
(9206081900020076,9206081900040076,'689369829818439','DEMO-SO-023','DEMO-WO-075','35100016',1.0000000000),
(9206081900020077,9206081900040077,'689369829818440','DEMO-SO-023','DEMO-WO-076','35100010',1.0000000000),
(9206081900020078,9206081900040078,'689369829822533','DEMO-SO-023','DEMO-WO-077','35100010',1.0000000000),
(9206081900020079,9206081900040079,'689369829822534','DEMO-SO-023','DEMO-WO-078','35100010',1.0000000000),
(9206081900020080,9206081900040080,'689369829822535','DEMO-SO-023','DEMO-WO-079','35100010',1.0000000000),
(9206081900020081,9206081900040081,'689369829822536','DEMO-SO-023','DEMO-WO-080','35100010',1.0000000000),
(9206081900020082,9206081900040082,'689369829826629','DEMO-SO-023','DEMO-WO-081','35100010',1.0000000000),
(9206081900020083,9206081900040083,'689369829826630','DEMO-SO-023','DEMO-WO-082','35100010',1.0000000000),
(9206081900020084,9206081900040084,'689369829826631','DEMO-SO-023','DEMO-WO-083','35100010',1.0000000000),
(9206081900020085,9206081900040085,'689369829826632','DEMO-SO-023','DEMO-WO-084','35100010',1.0000000000),
(9206081900020086,9206081900040086,'689369829826633','DEMO-SO-023','DEMO-WO-085','35100010',1.0000000000),
(9206081900020087,9206081900040087,'691329582436421','DEMO-SO-024','DEMO-WO-086','93000178',3000.0000000000),
(9206081900020088,9206081900040088,'691329582436422','DEMO-SO-024','DEMO-WO-087','32400038',3100.0000000000),
(9206081900020089,9206081900040089,'691329582436423','DEMO-SO-024','DEMO-WO-088','32400015',5100.0000000000),
(9206081900020090,9206081900040090,'691329582440517','DEMO-SO-024','DEMO-WO-089','1008361',4000.0000000000),
(9206081900020091,9206081900040091,'708842858610757','DEMO-SO-025','DEMO-WO-090','1000273',200.0000000000),
(9206081900020092,9206081900040092,'708842858610758','DEMO-SO-025','DEMO-WO-091','1000275',272.0000000000),
(9206081900020093,9206081900040093,'708842858610759','DEMO-SO-025','DEMO-WO-092','1000304',360000.0000000000),
(9206081900020094,9206081900040094,'708842858610760','DEMO-SO-025','DEMO-WO-093','1000419',1000.0000000000),
(9206081900020095,9206081900040095,'708842858610761','DEMO-SO-025','DEMO-WO-094','1000431',2000.0000000000),
(9206081900020096,9206081900040096,'708842858610762','DEMO-SO-025','DEMO-WO-095','1000432',-2000.0000000000),
(9206081900020097,9206081900040097,'708842858610763','DEMO-SO-025','DEMO-WO-096','1000588',-29000.0000000000),
(9206081900020098,9206081900040098,'708842858614853','DEMO-SO-025','DEMO-WO-097','1000595',670000.0000000000),
(9206081900020099,9206081900040099,'708842858614854','DEMO-SO-025','DEMO-WO-098','1002104',-113.0000000000),
(9206081900020100,9206081900040100,'708853132763205','DEMO-SO-026','DEMO-WO-099','1010092',550.0000000000),
(9206081900020101,9206081900040101,'708853132763206','DEMO-SO-026','DEMO-WO-100','1010093',1.0000000000),
(9206081900020102,9206081900040102,'708853132763207','DEMO-SO-026','DEMO-WO-101','92000033',38.0000000000),
(9206081900020103,9206081900040103,'708853132767301','DEMO-SO-026','DEMO-WO-102','93000058',558.0000000000),
(9206081900020104,9206081900040104,'708853132767302','DEMO-SO-026','DEMO-WO-103','93000074',2522.0000000000),
(9206081900020105,9206081900040105,'708853132767303','DEMO-SO-026','DEMO-WO-104','35100032',1.0000000000),
(9206081900020106,9206081900040106,'708853132771397','DEMO-SO-026','DEMO-WO-105','93000110',185.0000000000),
(9206081900020107,9206081900040107,'708853132771398','DEMO-SO-026','DEMO-WO-106','93000123',2.0000000000),
(9206081900020108,9206081900040108,'708853132771399','DEMO-SO-026','DEMO-WO-107','93000229',862.0000000000),
(9206081900020109,9206081900040109,'708853132771400','DEMO-SO-026','DEMO-WO-108','32300026',200.0000000000),
(9206081900020110,9206081900040110,'708853132771401','DEMO-SO-026','DEMO-WO-109','32400015',-3015.0000000000),
(9206081900020111,9206081900040111,'708853132775493','DEMO-SO-026','DEMO-WO-110','93000312',300.0000000000),
(9206081900020112,9206081900040112,'708853132775494','DEMO-SO-026','DEMO-WO-111','93000404',500.0000000000),
(9206081900020113,9206081900040113,'708853132775495','DEMO-SO-026','DEMO-WO-112','93000412',800.0000000000),
(9206081900020114,9206081900040114,'708853132775496','DEMO-SO-026','DEMO-WO-113','93000502',400.0000000000),
(9206081900020115,9206081900040115,'708853132775497','DEMO-SO-026','DEMO-WO-114','93000503',1050.0000000000),
(9206081900020116,9206081900040116,'708853132779589','DEMO-SO-026','DEMO-WO-115','93000506',1.0000000000),
(9206081900020117,9206081900040117,'708853132779590','DEMO-SO-026','DEMO-WO-116','93000507',1000.0000000000),
(9206081900020118,9206081900040118,'708853132779591','DEMO-SO-026','DEMO-WO-117','93000509',350.0000000000),
(9206081900020119,9206081900040119,'708853132779592','DEMO-SO-026','DEMO-WO-118','93000510',1100.0000000000),
(9206081900020120,9206081900040120,'708853132779593','DEMO-SO-026','DEMO-WO-119','93000518',1250.0000000000),
(9206081900020121,9206081900040121,'708853132783685','DEMO-SO-026','DEMO-WO-120','93000521',3000.0000000000),
(9206081900020122,9206081900040122,'708853132783686','DEMO-SO-026','DEMO-WO-121','93000524',1500.0000000000),
(9206081900020123,9206081900040123,'708853132783687','DEMO-SO-026','DEMO-WO-122','93000525',3000.0000000000),
(9206081900020124,9206081900040124,'708853132783688','DEMO-SO-026','DEMO-WO-123','96000339',6000.0000000000),
(9206081900020125,9206081900040125,'708853132783689','DEMO-SO-026','DEMO-WO-124','32100042',-20000.0000000000),
(9206081900020126,9206081900040126,'708853132783690','DEMO-SO-026','DEMO-WO-125','32400015',-8000.0000000000),
(9206081900020127,9206081900040127,'708853132787781','DEMO-SO-026','DEMO-WO-126','35100032',1.0000000000),
(9206081900020128,9206081900040128,'708853132787782','DEMO-SO-026','DEMO-WO-127','1000452',1000.0000000000),
(9206081900020129,9206081900040129,'708853132791880','DEMO-SO-026','DEMO-WO-128','93000517',100.0000000000),
(9206081900020130,9206081900040130,'708853132791881','DEMO-SO-026','DEMO-WO-129','35100034',1.0000000000),
(9206081900020131,9206081900040131,'708853132791882','DEMO-SO-026','DEMO-WO-130','35100034',-1.0000000000),
(9206081900020132,9206081900040132,'708853132791883','DEMO-SO-026','DEMO-WO-131','35100034',1.0000000000),
(9206081900020133,9206081900040133,'708853132791884','DEMO-SO-026','DEMO-WO-132','35100034',1.0000000000),
(9206081900020134,9206081900040134,'708853132791885','DEMO-SO-026','DEMO-WO-133','35100034',1.0000000000),
(9206081900020135,9206081900040135,'708853132795973','DEMO-SO-026','DEMO-WO-134','35100033',1.0000000000),
(9206081900020136,9206081900040136,'708853132795974','DEMO-SO-026','DEMO-WO-135','35100033',1.0000000000),
(9206081900020137,9206081900040137,'708853132795975','DEMO-SO-026','DEMO-WO-136','35100033',1.0000000000),
(9206081900020138,9206081900040138,'708853132795976','DEMO-SO-026','DEMO-WO-137','35100033',1.0000000000),
(9206081900020139,9206081900040139,'708853132795977','DEMO-SO-026','DEMO-WO-138','35100033',1.0000000000),
(9206081900020140,9206081900040140,'708853132795978','DEMO-SO-026','DEMO-WO-139','35100033',-1.0000000000),
(9206081900020141,9206081900040141,'708853132795979','DEMO-SO-026','DEMO-WO-140','35100033',1.0000000000),
(9206081900020142,9206081900040142,'708853132795980','DEMO-SO-026','DEMO-WO-141','35100033',1.0000000000),
(9206081900020143,9206081900040143,'708853132795981','DEMO-SO-026','DEMO-WO-142','35100015',1.0000000000),
(9206081900020144,9206081900040144,'708853132795982','DEMO-SO-026','DEMO-WO-143','35100015',1.0000000000),
(9206081900020145,9206081900040145,'708853132795983','DEMO-SO-026','DEMO-WO-144','35100015',1.0000000000),
(9206081900020146,9206081900040146,'708853132800069','DEMO-SO-026','DEMO-WO-145','35100015',1.0000000000),
(9206081900020147,9206081900040147,'708853132800070','DEMO-SO-026','DEMO-WO-146','35100015',1.0000000000),
(9206081900020148,9206081900040148,'708853132800071','DEMO-SO-026','DEMO-WO-147','35100015',1.0000000000),
(9206081900020149,9206081900040149,'708853132800072','DEMO-SO-026','DEMO-WO-148','35100015',1.0000000000),
(9206081900020150,9206081900040150,'708853132800073','DEMO-SO-026','DEMO-WO-149','35100015',1.0000000000),
(9206081900020151,9206081900040151,'708853132800074','DEMO-SO-026','DEMO-WO-150','35100015',1.0000000000),
(9206081900020152,9206081900040152,'708853132800075','DEMO-SO-026','DEMO-WO-151','35100015',1.0000000000),
(9206081900020153,9206081900040153,'708853132800076','DEMO-SO-026','DEMO-WO-152','35100015',1.0000000000),
(9206081900020154,9206081900040154,'708853132800077','DEMO-SO-026','DEMO-WO-153','35100015',1.0000000000),
(9206081900020155,9206081900040155,'708853132804165','DEMO-SO-026','DEMO-WO-154','35100015',1.0000000000),
(9206081900020156,9206081900040156,'713850861281349','DEMO-SO-027','DEMO-WO-155','93000270',5000.0000000000),
(9206081900020157,9206081900040157,'713850861281350','DEMO-SO-027','DEMO-WO-156','93000311',510.0000000000),
(9206081900020158,9206081900040158,'713850861281351','DEMO-SO-027','DEMO-WO-157','93000312',500.0000000000),
(9206081900020159,9206081900040159,'713850861285445','DEMO-SO-027','DEMO-WO-158','93000233',600.0000000000),
(9206081900020160,9206081900040160,'713850861285446','DEMO-SO-027','DEMO-WO-159','93000232',1500.0000000000),
(9206081900020161,9206081900040161,'716009096228933','DEMO-SO-028','DEMO-WO-160','32300021',5000.0000000000),
(9206081900020162,9206081900040162,'716009096228934','DEMO-SO-028','DEMO-WO-161','32300021',5000.0000000000),
(9206081900020163,9206081900040163,'720949568118853','DEMO-SO-029','DEMO-WO-162','32300065',1900.0000000000),
(9206081900020164,9206081900040164,'720949568118854','DEMO-SO-029','DEMO-WO-163','32300021',100.0000000000),
(9206081900020165,9206081900040165,'720949568118855','DEMO-SO-029','DEMO-WO-164','32300021',600.0000000000),
(9206081900020166,9206081900040166,'720949568122949','DEMO-SO-029','DEMO-WO-165','93000313',100.0000000000),
(9206081900020167,9206081900040167,'720949568122950','DEMO-SO-029','DEMO-WO-166','93000229',700.0000000000),
(9206081900020168,9206081900040168,'721256689414213','DEMO-SO-030','DEMO-WO-167','93000182',10000.0000000000),
(9206081900020169,9206081900040169,'721256689414214','DEMO-SO-030','DEMO-WO-168','32300009',10000.0000000000),
(9206081900020170,9206081900040170,'721256689414215','DEMO-SO-030','DEMO-WO-169','32300012',10000.0000000000),
(9206081900020171,9206081900040171,'721256689414216','DEMO-SO-030','DEMO-WO-170','32300026',-2980.0000000000),
(9206081900020172,9206081900040172,'721256689414217','DEMO-SO-030','DEMO-WO-171','32300027',-2968.0000000000),
(9206081900020173,9206081900040173,'721256689418309','DEMO-SO-030','DEMO-WO-172','32300028',3000.0000000000),
(9206081900020174,9206081900040174,'721256689418310','DEMO-SO-030','DEMO-WO-173','32300035',10000.0000000000),
(9206081900020175,9206081900040175,'721256689418311','DEMO-SO-030','DEMO-WO-174','32300046',3000.0000000000),
(9206081900020176,9206081900040176,'721256689422405','DEMO-SO-030','DEMO-WO-175','32300047',2108.0000000000),
(9206081900020177,9206081900040177,'721256689422406','DEMO-SO-030','DEMO-WO-176','32300048',-10000.0000000000),
(9206081900020178,9206081900040178,'721256689422407','DEMO-SO-030','DEMO-WO-177','35100015',1.0000000000),
(9206081900020179,9206081900040179,'721256689422408','DEMO-SO-030','DEMO-WO-178','35100015',1.0000000000),
(9206081900020180,9206081900040180,'721256689426501','DEMO-SO-030','DEMO-WO-179','35100015',1.0000000000),
(9206081900020181,9206081900040181,'721256689426502','DEMO-SO-030','DEMO-WO-180','35100015',1.0000000000),
(9206081900020182,9206081900040182,'721256689426503','DEMO-SO-030','DEMO-WO-181','35100016',1.0000000000),
(9206081900020183,9206081900040183,'721256689426504','DEMO-SO-030','DEMO-WO-182','35100016',1.0000000000),
(9206081900020184,9206081900040184,'721256689426505','DEMO-SO-030','DEMO-WO-183','35100016',1.0000000000),
(9206081900020185,9206081900040185,'721256689430597','DEMO-SO-030','DEMO-WO-184','35100016',1.0000000000),
(9206081900020186,9206081900040186,'721256689430598','DEMO-SO-030','DEMO-WO-185','35100016',1.0000000000),
(9206081900020187,9206081900040187,'721256689430599','DEMO-SO-030','DEMO-WO-186','35100016',1.0000000000),
(9206081900020188,9206081900040188,'721256689430600','DEMO-SO-030','DEMO-WO-187','35100015',1.0000000000),
(9206081900020189,9206081900040189,'721256689434693','DEMO-SO-030','DEMO-WO-188','35100015',1.0000000000),
(9206081900020190,9206081900040190,'721256689434694','DEMO-SO-030','DEMO-WO-189','35100015',1.0000000000),
(9206081900020191,9206081900040191,'721256689434695','DEMO-SO-030','DEMO-WO-190','35100015',1.0000000000),
(9206081900020192,9206081900040192,'721256689434696','DEMO-SO-030','DEMO-WO-191','35100015',1.0000000000),
(9206081900020193,9206081900040193,'721256689438789','DEMO-SO-030','DEMO-WO-192','35100015',1.0000000000),
(9206081900020194,9206081900040194,'721256689438790','DEMO-SO-030','DEMO-WO-193','35100015',1.0000000000),
(9206081900020195,9206081900040195,'722351552172101','DEMO-SO-031','DEMO-WO-194','93000283',20000.0000000000),
(9206081900020196,9206081900040196,'765148661813317','DEMO-SO-032','DEMO-WO-195','3221C0031',1000.0000000000),
(9206081900020197,9206081900040197,'765148661813318','DEMO-SO-032','DEMO-WO-196','3521C0018',2.0000000000),
(9206081900020198,9206081900040198,'765148661813319','DEMO-SO-032','DEMO-WO-197','1A0047E',1000.0000000000),
(9206081900020199,9206081900040199,'769809191923781','DEMO-SO-033','DEMO-WO-198','3221C0031',100.0000000000),
(9206081900020200,9206081900040200,'1958480382326104095','DEMO-SO-034','UAT-MO-0034','91CC0232',400.00000000),
(9206081900020201,9206081900040201,'1958480382326104272','DEMO-SO-035','DEMO-WO-199','1007114',120000.0000000000),
(9206081900020202,9206081900040202,'1958480382326104273','DEMO-SO-035','DEMO-WO-200','1007115',30000.0000000000),
(9206081900020203,9206081900040203,'1958480382326104295','DEMO-SO-036','DEMO-WO-201','1000431',5000.0000000000),
(9206081900020204,9206081900040204,'1958480382326104296','DEMO-SO-036','DEMO-WO-202','1000432',5000.0000000000),
(9206081900020205,9206081900040205,'1958902016386269188','DEMO-SO-037','DEMO-WO-203','1000595',92000.0000000000),
(9206081900020206,9206081900040206,'1958902016386269193','DEMO-SO-037','DEMO-WO-204','1007096',7000.0000000000),
(9206081900020207,9206081900040207,'1958902016386269196','DEMO-SO-037','DEMO-WO-205','1002081',1256.0000000000),
(9206081900020208,9206081900040208,'1958902016386269200','DEMO-SO-037','DEMO-WO-206','93000236',140.0000000000),
(9206081900020209,9206081900040209,'1958956122157088771','DEMO-SO-038','DEMO-WO-207','93000228',3000.0000000000),
(9206081900020210,9206081900040210,'1959718646913695745','DEMO-SO-039','UAT-MO-0039','1A039D8',350.00000000),
(9206081900020211,9206081900040211,'1960006795304894465','DEMO-SO-040','DEMO-WO-208','93000235',600.0000000000),
(9206081900020212,9206081900040212,'1963915047889534981','DEMO-SO-041','DEMO-WO-209','94000284',10000.0000000000),
(9206081900020213,9206081900040213,'1963915047889534985','DEMO-SO-041','DEMO-WO-210','1002081',1200.0000000000),
(9206081900020214,9206081900040214,'1963971671131947011','DEMO-SO-042','DEMO-WO-211','93000179',2000.0000000000),
(9206081900020215,9206081900040215,'1964653664643579905','DEMO-SO-043','DEMO-WO-212','93000229',6000.0000000000),
(9206081900020216,9206081900040216,'1964653664643579907','DEMO-SO-043','DEMO-WO-213','1008414',176.0000000000),
(9206081900020217,9206081900040217,'1964653664643579908','DEMO-SO-043','DEMO-WO-214','94000284',10000.0000000000),
(9206081900020218,9206081900040218,'1964653664643579910','DEMO-SO-043','DEMO-WO-215','94000219',11000.0000000000),
(9206081900020219,9206081900040219,'1964653664643579913','DEMO-SO-043','DEMO-WO-216','93000233',1000.0000000000),
(9206081900020220,9206081900040220,'1981045424231809025','DEMO-SO-044','UAT-MO-0044','91DC0218',400.00000000),
(9206081900020221,9206081900040221,'1990491416446369793','DEMO-SO-045','UAT-MO-0045','1A03G94',1686.00000000);

DROP TEMPORARY TABLE IF EXISTS tmp_s3_uat_pr;
CREATE TEMPORARY TABLE tmp_s3_uat_pr (
    voucher BIGINT NOT NULL PRIMARY KEY,
    pr_billno VARCHAR(64) NOT NULL,
    morder_no VARCHAR(128) NOT NULL,
    bill_no VARCHAR(64) NOT NULL,
    icitem_code VARCHAR(64) NULL,
    pr_rqty DECIMAL(18,4) NULL,
    mo_id BIGINT NOT NULL
);
INSERT INTO tmp_s3_uat_pr VALUES
(9206081900050002,'DEMO-PR-001','DEMO-WO-001','DEMO-SO-001','94000292',4500.0000000000,9206081900020002),
(9206081900050003,'DEMO-PR-002','DEMO-WO-002','DEMO-SO-001','1004023',3500.0000000000,9206081900020003),
(9206081900050004,'DEMO-PR-003','DEMO-WO-003','DEMO-SO-001','1000329',400000.0000000000,9206081900020004),
(9206081900050005,'DEMO-PR-004','DEMO-WO-004','DEMO-SO-001','1000655',100000.0000000000,9206081900020005),
(9206081900050006,'DEMO-PR-005','DEMO-WO-005','DEMO-SO-001','1007114',250000.0000000000,9206081900020006),
(9206081900050007,'DEMO-PR-006','DEMO-WO-006','DEMO-SO-001','1007115',600000.0000000000,9206081900020007),
(9206081900050008,'DEMO-PR-007','DEMO-WO-007','DEMO-SO-001','1004199',6000.0000000000,9206081900020008),
(9206081900050009,'DEMO-PR-008','DEMO-WO-008','DEMO-SO-001','1000588',10000.0000000000,9206081900020009),
(9206081900050010,'DEMO-PR-009','DEMO-WO-009','DEMO-SO-001','1007094',2500.0000000000,9206081900020010),
(9206081900050011,'DEMO-PR-010','DEMO-WO-010','DEMO-SO-001','32400015',1470.0000000000,9206081900020011),
(9206081900050012,'DEMO-PR-011','DEMO-WO-011','DEMO-SO-001','94000218',800.0000000000,9206081900020012),
(9206081900050013,'DEMO-PR-001','DEMO-WO-012','DEMO-SO-002','93000229',60.0000000000,9206081900020013),
(9206081900050014,'DEMO-PR-001','DEMO-WO-013','DEMO-SO-003','94000218',2000.0000000000,9206081900020014),
(9206081900050015,'DEMO-PR-001','DEMO-WO-014','DEMO-SO-004','93000237',200.0000000000,9206081900020015),
(9206081900050016,'DEMO-PR-001','DEMO-WO-015','DEMO-SO-005','1007114',250000.0000000000,9206081900020016),
(9206081900050017,'DEMO-PR-001','DEMO-WO-016','DEMO-SO-006','1000329',100000.0000000000,9206081900020017),
(9206081900050018,'DEMO-PR-001','DEMO-WO-017','DEMO-SO-007','93000312',500.0000000000,9206081900020018),
(9206081900050019,'DEMO-PR-002','DEMO-WO-018','DEMO-SO-007','1004023',600.0000000000,9206081900020019),
(9206081900050020,'DEMO-PR-003','DEMO-WO-019','DEMO-SO-007','93000231',100.0000000000,9206081900020020),
(9206081900050021,'DEMO-PR-004','DEMO-WO-020','DEMO-SO-007','93000286',800.0000000000,9206081900020021),
(9206081900050022,'DEMO-PR-001','DEMO-WO-021','DEMO-SO-008','93000058',400.0000000000,9206081900020022),
(9206081900050023,'DEMO-PR-001','DEMO-WO-022','DEMO-SO-009','1008361',1000.0000000000,9206081900020023),
(9206081900050024,'DEMO-PR-001','DEMO-WO-023','DEMO-SO-010','1008184',700.0000000000,9206081900020024),
(9206081900050025,'DEMO-PR-001','DEMO-WO-024','DEMO-SO-011','1004199',4000.0000000000,9206081900020025),
(9206081900050026,'DEMO-PR-001','DEMO-WO-025','DEMO-SO-012','1004023',5000.0000000000,9206081900020026),
(9206081900050027,'DEMO-PR-001','DEMO-WO-026','DEMO-SO-013','1000431',10000.0000000000,9206081900020027),
(9206081900050028,'DEMO-PR-002','DEMO-WO-027','DEMO-SO-013','1000432',10000.0000000000,9206081900020028),
(9206081900050029,'DEMO-PR-001','DEMO-WO-028','DEMO-SO-014','1000419',35000.0000000000,9206081900020029),
(9206081900050030,'DEMO-PR-001','DEMO-WO-029','DEMO-SO-015','1000293',650000.0000000000,9206081900020030),
(9206081900050031,'DEMO-PR-002','DEMO-WO-030','DEMO-SO-015','1000329',200000.0000000000,9206081900020031),
(9206081900050032,'DEMO-PR-001','DEMO-WO-031','DEMO-SO-016','94000215',1500.0000000000,9206081900020032),
(9206081900050033,'DEMO-PR-001','DEMO-WO-032','DEMO-SO-017','93000179',5000.0000000000,9206081900020033),
(9206081900050034,'DEMO-PR-002','DEMO-WO-033','DEMO-SO-017','35100015',1.0000000000,9206081900020034),
(9206081900050035,'DEMO-PR-003','DEMO-WO-034','DEMO-SO-017','35100016',1.0000000000,9206081900020035),
(9206081900050036,'DEMO-PR-004','DEMO-WO-035','DEMO-SO-017','93000187',5000.0000000000,9206081900020036),
(9206081900050037,'DEMO-PR-005','DEMO-WO-036','DEMO-SO-017','93000233',1500.0000000000,9206081900020037),
(9206081900050038,'DEMO-PR-006','DEMO-WO-037','DEMO-SO-017','94000218',3000.0000000000,9206081900020038),
(9206081900050039,'DEMO-PR-007','DEMO-WO-038','DEMO-SO-017','1010096',10000.0000000000,9206081900020039),
(9206081900050040,'DEMO-PR-001','DEMO-WO-039','DEMO-SO-018','93000177',5000.0000000000,9206081900020040),
(9206081900050041,'DEMO-PR-002','DEMO-WO-040','DEMO-SO-018','32100034',11000.0000000000,9206081900020041),
(9206081900050042,'DEMO-PR-003','DEMO-WO-041','DEMO-SO-018','35100015',1.0000000000,9206081900020042),
(9206081900050043,'DEMO-PR-004','DEMO-WO-042','DEMO-SO-018','94000217',2000.0000000000,9206081900020043),
(9206081900050044,'DEMO-PR-005','DEMO-WO-043','DEMO-SO-018','94000219',9000.0000000000,9206081900020044),
(9206081900050045,'DEMO-PR-006','DEMO-WO-044','DEMO-SO-018','93000240',2000.0000000000,9206081900020045),
(9206081900050046,'DEMO-PR-007','DEMO-WO-045','DEMO-SO-018','1007111',200000.0000000000,9206081900020046),
(9206081900050047,'DEMO-PR-001','DEMO-WO-046','DEMO-SO-019','35100010',1.0000000000,9206081900020047),
(9206081900050048,'DEMO-PR-002','DEMO-WO-047','DEMO-SO-019','35100014',1.0000000000,9206081900020048),
(9206081900050049,'DEMO-PR-003','DEMO-WO-048','DEMO-SO-019','35100033',1.0000000000,9206081900020049),
(9206081900050050,'DEMO-PR-004','DEMO-WO-049','DEMO-SO-019','35100034',1.0000000000,9206081900020050),
(9206081900050051,'DEMO-PR-001','DEMO-WO-050','DEMO-SO-020','32100031',7000.0000000000,9206081900020051),
(9206081900050052,'DEMO-PR-001','DEMO-WO-051','DEMO-SO-021','35100015',1.0000000000,9206081900020052),
(9206081900050053,'DEMO-PR-002','DEMO-WO-052','DEMO-SO-021','35100015',1.0000000000,9206081900020053),
(9206081900050054,'DEMO-PR-003','DEMO-WO-053','DEMO-SO-021','35100015',1.0000000000,9206081900020054),
(9206081900050055,'DEMO-PR-004','DEMO-WO-054','DEMO-SO-021','35100015',1.0000000000,9206081900020055),
(9206081900050056,'DEMO-PR-005','DEMO-WO-055','DEMO-SO-021','35100015',1.0000000000,9206081900020056),
(9206081900050057,'DEMO-PR-006','DEMO-WO-056','DEMO-SO-021','35100015',1.0000000000,9206081900020057),
(9206081900050058,'DEMO-PR-007','DEMO-WO-057','DEMO-SO-021','35100015',1.0000000000,9206081900020058),
(9206081900050059,'DEMO-PR-008','DEMO-WO-058','DEMO-SO-021','35100015',1.0000000000,9206081900020059),
(9206081900050060,'DEMO-PR-009','DEMO-WO-059','DEMO-SO-021','35100015',1.0000000000,9206081900020060),
(9206081900050061,'DEMO-PR-010','DEMO-WO-060','DEMO-SO-021','35100015',1.0000000000,9206081900020061),
(9206081900050062,'DEMO-PR-001','DEMO-WO-061','DEMO-SO-022','35100034',1.0000000000,9206081900020062),
(9206081900050063,'DEMO-PR-002','DEMO-WO-062','DEMO-SO-022','35100034',1.0000000000,9206081900020063),
(9206081900050064,'DEMO-PR-003','DEMO-WO-063','DEMO-SO-022','35100034',1.0000000000,9206081900020064),
(9206081900050065,'DEMO-PR-004','DEMO-WO-064','DEMO-SO-022','35100034',1.0000000000,9206081900020065),
(9206081900050066,'DEMO-PR-005','DEMO-WO-065','DEMO-SO-022','35100034',1.0000000000,9206081900020066),
(9206081900050067,'DEMO-PR-006','DEMO-WO-066','DEMO-SO-022','35100016',1.0000000000,9206081900020067),
(9206081900050068,'DEMO-PR-007','DEMO-WO-067','DEMO-SO-022','35100016',1.0000000000,9206081900020068),
(9206081900050069,'DEMO-PR-008','DEMO-WO-068','DEMO-SO-022','35100016',1.0000000000,9206081900020069),
(9206081900050070,'DEMO-PR-009','DEMO-WO-069','DEMO-SO-022','35100016',1.0000000000,9206081900020070),
(9206081900050071,'DEMO-PR-010','DEMO-WO-070','DEMO-SO-022','35100016',1.0000000000,9206081900020071),
(9206081900050072,'DEMO-PR-011','DEMO-WO-071','DEMO-SO-022','35100016',1.0000000000,9206081900020072),
(9206081900050073,'DEMO-PR-012','DEMO-WO-072','DEMO-SO-022','35100016',1.0000000000,9206081900020073),
(9206081900050074,'DEMO-PR-001','DEMO-WO-073','DEMO-SO-023','35100016',1.0000000000,9206081900020074),
(9206081900050075,'DEMO-PR-002','DEMO-WO-074','DEMO-SO-023','35100016',1.0000000000,9206081900020075),
(9206081900050076,'DEMO-PR-003','DEMO-WO-075','DEMO-SO-023','35100016',1.0000000000,9206081900020076),
(9206081900050077,'DEMO-PR-004','DEMO-WO-076','DEMO-SO-023','35100010',1.0000000000,9206081900020077),
(9206081900050078,'DEMO-PR-005','DEMO-WO-077','DEMO-SO-023','35100010',1.0000000000,9206081900020078),
(9206081900050079,'DEMO-PR-006','DEMO-WO-078','DEMO-SO-023','35100010',1.0000000000,9206081900020079),
(9206081900050080,'DEMO-PR-007','DEMO-WO-079','DEMO-SO-023','35100010',1.0000000000,9206081900020080),
(9206081900050081,'DEMO-PR-008','DEMO-WO-080','DEMO-SO-023','35100010',1.0000000000,9206081900020081),
(9206081900050082,'DEMO-PR-009','DEMO-WO-081','DEMO-SO-023','35100010',1.0000000000,9206081900020082),
(9206081900050083,'DEMO-PR-010','DEMO-WO-082','DEMO-SO-023','35100010',1.0000000000,9206081900020083),
(9206081900050084,'DEMO-PR-011','DEMO-WO-083','DEMO-SO-023','35100010',1.0000000000,9206081900020084),
(9206081900050085,'DEMO-PR-012','DEMO-WO-084','DEMO-SO-023','35100010',1.0000000000,9206081900020085),
(9206081900050086,'DEMO-PR-013','DEMO-WO-085','DEMO-SO-023','35100010',1.0000000000,9206081900020086),
(9206081900050087,'DEMO-PR-001','DEMO-WO-086','DEMO-SO-024','93000178',3000.0000000000,9206081900020087),
(9206081900050088,'DEMO-PR-002','DEMO-WO-087','DEMO-SO-024','32400038',3100.0000000000,9206081900020088),
(9206081900050089,'DEMO-PR-003','DEMO-WO-088','DEMO-SO-024','32400015',5100.0000000000,9206081900020089),
(9206081900050090,'DEMO-PR-004','DEMO-WO-089','DEMO-SO-024','1008361',4000.0000000000,9206081900020090),
(9206081900050091,'DEMO-PR-001','DEMO-WO-090','DEMO-SO-025','1000273',200.0000000000,9206081900020091),
(9206081900050092,'DEMO-PR-002','DEMO-WO-091','DEMO-SO-025','1000275',272.0000000000,9206081900020092),
(9206081900050093,'DEMO-PR-003','DEMO-WO-092','DEMO-SO-025','1000304',360000.0000000000,9206081900020093),
(9206081900050094,'DEMO-PR-004','DEMO-WO-093','DEMO-SO-025','1000419',1000.0000000000,9206081900020094),
(9206081900050095,'DEMO-PR-005','DEMO-WO-094','DEMO-SO-025','1000431',2000.0000000000,9206081900020095),
(9206081900050096,'DEMO-PR-006','DEMO-WO-095','DEMO-SO-025','1000432',-2000.0000000000,9206081900020096),
(9206081900050097,'DEMO-PR-007','DEMO-WO-096','DEMO-SO-025','1000588',-29000.0000000000,9206081900020097),
(9206081900050098,'DEMO-PR-008','DEMO-WO-097','DEMO-SO-025','1000595',670000.0000000000,9206081900020098),
(9206081900050099,'DEMO-PR-009','DEMO-WO-098','DEMO-SO-025','1002104',-113.0000000000,9206081900020099),
(9206081900050100,'DEMO-PR-001','DEMO-WO-099','DEMO-SO-026','1010092',550.0000000000,9206081900020100),
(9206081900050101,'DEMO-PR-002','DEMO-WO-100','DEMO-SO-026','1010093',1.0000000000,9206081900020101),
(9206081900050102,'DEMO-PR-003','DEMO-WO-101','DEMO-SO-026','92000033',38.0000000000,9206081900020102),
(9206081900050103,'DEMO-PR-004','DEMO-WO-102','DEMO-SO-026','93000058',558.0000000000,9206081900020103),
(9206081900050104,'DEMO-PR-005','DEMO-WO-103','DEMO-SO-026','93000074',2522.0000000000,9206081900020104),
(9206081900050105,'DEMO-PR-006','DEMO-WO-104','DEMO-SO-026','35100032',1.0000000000,9206081900020105),
(9206081900050106,'DEMO-PR-007','DEMO-WO-105','DEMO-SO-026','93000110',185.0000000000,9206081900020106),
(9206081900050107,'DEMO-PR-008','DEMO-WO-106','DEMO-SO-026','93000123',2.0000000000,9206081900020107),
(9206081900050108,'DEMO-PR-009','DEMO-WO-107','DEMO-SO-026','93000229',862.0000000000,9206081900020108),
(9206081900050109,'DEMO-PR-010','DEMO-WO-108','DEMO-SO-026','32300026',200.0000000000,9206081900020109),
(9206081900050110,'DEMO-PR-011','DEMO-WO-109','DEMO-SO-026','32400015',-3015.0000000000,9206081900020110),
(9206081900050111,'DEMO-PR-012','DEMO-WO-110','DEMO-SO-026','93000312',300.0000000000,9206081900020111),
(9206081900050112,'DEMO-PR-013','DEMO-WO-111','DEMO-SO-026','93000404',500.0000000000,9206081900020112),
(9206081900050113,'DEMO-PR-014','DEMO-WO-112','DEMO-SO-026','93000412',800.0000000000,9206081900020113),
(9206081900050114,'DEMO-PR-015','DEMO-WO-113','DEMO-SO-026','93000502',400.0000000000,9206081900020114),
(9206081900050115,'DEMO-PR-016','DEMO-WO-114','DEMO-SO-026','93000503',1050.0000000000,9206081900020115),
(9206081900050116,'DEMO-PR-017','DEMO-WO-115','DEMO-SO-026','93000506',1.0000000000,9206081900020116),
(9206081900050117,'DEMO-PR-018','DEMO-WO-116','DEMO-SO-026','93000507',1000.0000000000,9206081900020117),
(9206081900050118,'DEMO-PR-019','DEMO-WO-117','DEMO-SO-026','93000509',350.0000000000,9206081900020118),
(9206081900050119,'DEMO-PR-020','DEMO-WO-118','DEMO-SO-026','93000510',1100.0000000000,9206081900020119),
(9206081900050120,'DEMO-PR-021','DEMO-WO-119','DEMO-SO-026','93000518',1250.0000000000,9206081900020120),
(9206081900050121,'DEMO-PR-022','DEMO-WO-120','DEMO-SO-026','93000521',3000.0000000000,9206081900020121),
(9206081900050122,'DEMO-PR-023','DEMO-WO-121','DEMO-SO-026','93000524',1500.0000000000,9206081900020122),
(9206081900050123,'DEMO-PR-024','DEMO-WO-122','DEMO-SO-026','93000525',3000.0000000000,9206081900020123),
(9206081900050124,'DEMO-PR-025','DEMO-WO-123','DEMO-SO-026','96000339',6000.0000000000,9206081900020124),
(9206081900050125,'DEMO-PR-026','DEMO-WO-124','DEMO-SO-026','32100042',-20000.0000000000,9206081900020125),
(9206081900050126,'DEMO-PR-027','DEMO-WO-125','DEMO-SO-026','32400015',-8000.0000000000,9206081900020126),
(9206081900050127,'DEMO-PR-028','DEMO-WO-126','DEMO-SO-026','35100032',1.0000000000,9206081900020127),
(9206081900050128,'DEMO-PR-029','DEMO-WO-127','DEMO-SO-026','1000452',1000.0000000000,9206081900020128),
(9206081900050129,'DEMO-PR-030','DEMO-WO-128','DEMO-SO-026','93000517',100.0000000000,9206081900020129),
(9206081900050130,'DEMO-PR-031','DEMO-WO-129','DEMO-SO-026','35100034',1.0000000000,9206081900020130),
(9206081900050131,'DEMO-PR-032','DEMO-WO-130','DEMO-SO-026','35100034',-1.0000000000,9206081900020131),
(9206081900050132,'DEMO-PR-033','DEMO-WO-131','DEMO-SO-026','35100034',1.0000000000,9206081900020132),
(9206081900050133,'DEMO-PR-034','DEMO-WO-132','DEMO-SO-026','35100034',1.0000000000,9206081900020133),
(9206081900050134,'DEMO-PR-035','DEMO-WO-133','DEMO-SO-026','35100034',1.0000000000,9206081900020134),
(9206081900050135,'DEMO-PR-036','DEMO-WO-134','DEMO-SO-026','35100033',1.0000000000,9206081900020135),
(9206081900050136,'DEMO-PR-037','DEMO-WO-135','DEMO-SO-026','35100033',1.0000000000,9206081900020136),
(9206081900050137,'DEMO-PR-038','DEMO-WO-136','DEMO-SO-026','35100033',1.0000000000,9206081900020137),
(9206081900050138,'DEMO-PR-039','DEMO-WO-137','DEMO-SO-026','35100033',1.0000000000,9206081900020138),
(9206081900050139,'DEMO-PR-040','DEMO-WO-138','DEMO-SO-026','35100033',1.0000000000,9206081900020139),
(9206081900050140,'DEMO-PR-041','DEMO-WO-139','DEMO-SO-026','35100033',-1.0000000000,9206081900020140),
(9206081900050141,'DEMO-PR-042','DEMO-WO-140','DEMO-SO-026','35100033',1.0000000000,9206081900020141),
(9206081900050142,'DEMO-PR-043','DEMO-WO-141','DEMO-SO-026','35100033',1.0000000000,9206081900020142),
(9206081900050143,'DEMO-PR-044','DEMO-WO-142','DEMO-SO-026','35100015',1.0000000000,9206081900020143),
(9206081900050144,'DEMO-PR-045','DEMO-WO-143','DEMO-SO-026','35100015',1.0000000000,9206081900020144),
(9206081900050145,'DEMO-PR-046','DEMO-WO-144','DEMO-SO-026','35100015',1.0000000000,9206081900020145),
(9206081900050146,'DEMO-PR-047','DEMO-WO-145','DEMO-SO-026','35100015',1.0000000000,9206081900020146),
(9206081900050147,'DEMO-PR-048','DEMO-WO-146','DEMO-SO-026','35100015',1.0000000000,9206081900020147),
(9206081900050148,'DEMO-PR-049','DEMO-WO-147','DEMO-SO-026','35100015',1.0000000000,9206081900020148),
(9206081900050149,'DEMO-PR-050','DEMO-WO-148','DEMO-SO-026','35100015',1.0000000000,9206081900020149),
(9206081900050150,'DEMO-PR-051','DEMO-WO-149','DEMO-SO-026','35100015',1.0000000000,9206081900020150),
(9206081900050151,'DEMO-PR-052','DEMO-WO-150','DEMO-SO-026','35100015',1.0000000000,9206081900020151),
(9206081900050152,'DEMO-PR-053','DEMO-WO-151','DEMO-SO-026','35100015',1.0000000000,9206081900020152),
(9206081900050153,'DEMO-PR-054','DEMO-WO-152','DEMO-SO-026','35100015',1.0000000000,9206081900020153),
(9206081900050154,'DEMO-PR-055','DEMO-WO-153','DEMO-SO-026','35100015',1.0000000000,9206081900020154),
(9206081900050155,'DEMO-PR-056','DEMO-WO-154','DEMO-SO-026','35100015',1.0000000000,9206081900020155),
(9206081900050156,'DEMO-PR-001','DEMO-WO-155','DEMO-SO-027','93000270',5000.0000000000,9206081900020156),
(9206081900050157,'DEMO-PR-002','DEMO-WO-156','DEMO-SO-027','93000311',510.0000000000,9206081900020157),
(9206081900050158,'DEMO-PR-003','DEMO-WO-157','DEMO-SO-027','93000312',500.0000000000,9206081900020158),
(9206081900050159,'DEMO-PR-004','DEMO-WO-158','DEMO-SO-027','93000233',600.0000000000,9206081900020159),
(9206081900050160,'DEMO-PR-005','DEMO-WO-159','DEMO-SO-027','93000232',1500.0000000000,9206081900020160),
(9206081900050161,'DEMO-PR-001','DEMO-WO-160','DEMO-SO-028','32300021',5000.0000000000,9206081900020161),
(9206081900050162,'DEMO-PR-002','DEMO-WO-161','DEMO-SO-028','32300021',5000.0000000000,9206081900020162),
(9206081900050163,'DEMO-PR-001','DEMO-WO-162','DEMO-SO-029','32300065',1900.0000000000,9206081900020163),
(9206081900050164,'DEMO-PR-002','DEMO-WO-163','DEMO-SO-029','32300021',100.0000000000,9206081900020164),
(9206081900050165,'DEMO-PR-003','DEMO-WO-164','DEMO-SO-029','32300021',600.0000000000,9206081900020165),
(9206081900050166,'DEMO-PR-004','DEMO-WO-165','DEMO-SO-029','93000313',100.0000000000,9206081900020166),
(9206081900050167,'DEMO-PR-005','DEMO-WO-166','DEMO-SO-029','93000229',700.0000000000,9206081900020167),
(9206081900050168,'DEMO-PR-001','DEMO-WO-167','DEMO-SO-030','93000182',10000.0000000000,9206081900020168),
(9206081900050169,'DEMO-PR-002','DEMO-WO-168','DEMO-SO-030','32300009',10000.0000000000,9206081900020169),
(9206081900050170,'DEMO-PR-003','DEMO-WO-169','DEMO-SO-030','32300012',10000.0000000000,9206081900020170),
(9206081900050171,'DEMO-PR-004','DEMO-WO-170','DEMO-SO-030','32300026',-2980.0000000000,9206081900020171),
(9206081900050172,'DEMO-PR-005','DEMO-WO-171','DEMO-SO-030','32300027',-2968.0000000000,9206081900020172),
(9206081900050173,'DEMO-PR-006','DEMO-WO-172','DEMO-SO-030','32300028',3000.0000000000,9206081900020173),
(9206081900050174,'DEMO-PR-007','DEMO-WO-173','DEMO-SO-030','32300035',10000.0000000000,9206081900020174),
(9206081900050175,'DEMO-PR-008','DEMO-WO-174','DEMO-SO-030','32300046',3000.0000000000,9206081900020175),
(9206081900050176,'DEMO-PR-009','DEMO-WO-175','DEMO-SO-030','32300047',2108.0000000000,9206081900020176),
(9206081900050177,'DEMO-PR-010','DEMO-WO-176','DEMO-SO-030','32300048',-10000.0000000000,9206081900020177),
(9206081900050178,'DEMO-PR-011','DEMO-WO-177','DEMO-SO-030','35100015',1.0000000000,9206081900020178),
(9206081900050179,'DEMO-PR-012','DEMO-WO-178','DEMO-SO-030','35100015',1.0000000000,9206081900020179),
(9206081900050180,'DEMO-PR-013','DEMO-WO-179','DEMO-SO-030','35100015',1.0000000000,9206081900020180),
(9206081900050181,'DEMO-PR-014','DEMO-WO-180','DEMO-SO-030','35100015',1.0000000000,9206081900020181),
(9206081900050182,'DEMO-PR-015','DEMO-WO-181','DEMO-SO-030','35100016',1.0000000000,9206081900020182),
(9206081900050183,'DEMO-PR-016','DEMO-WO-182','DEMO-SO-030','35100016',1.0000000000,9206081900020183),
(9206081900050184,'DEMO-PR-017','DEMO-WO-183','DEMO-SO-030','35100016',1.0000000000,9206081900020184),
(9206081900050185,'DEMO-PR-018','DEMO-WO-184','DEMO-SO-030','35100016',1.0000000000,9206081900020185),
(9206081900050186,'DEMO-PR-019','DEMO-WO-185','DEMO-SO-030','35100016',1.0000000000,9206081900020186),
(9206081900050187,'DEMO-PR-020','DEMO-WO-186','DEMO-SO-030','35100016',1.0000000000,9206081900020187),
(9206081900050188,'DEMO-PR-021','DEMO-WO-187','DEMO-SO-030','35100015',1.0000000000,9206081900020188),
(9206081900050189,'DEMO-PR-022','DEMO-WO-188','DEMO-SO-030','35100015',1.0000000000,9206081900020189),
(9206081900050190,'DEMO-PR-023','DEMO-WO-189','DEMO-SO-030','35100015',1.0000000000,9206081900020190),
(9206081900050191,'DEMO-PR-024','DEMO-WO-190','DEMO-SO-030','35100015',1.0000000000,9206081900020191),
(9206081900050192,'DEMO-PR-025','DEMO-WO-191','DEMO-SO-030','35100015',1.0000000000,9206081900020192),
(9206081900050193,'DEMO-PR-026','DEMO-WO-192','DEMO-SO-030','35100015',1.0000000000,9206081900020193),
(9206081900050194,'DEMO-PR-027','DEMO-WO-193','DEMO-SO-030','35100015',1.0000000000,9206081900020194),
(9206081900050195,'DEMO-PR-001','DEMO-WO-194','DEMO-SO-031','93000283',20000.0000000000,9206081900020195),
(9206081900050196,'DEMO-PR-001','DEMO-WO-195','DEMO-SO-032','3221C0031',1000.0000000000,9206081900020196),
(9206081900050197,'DEMO-PR-002','DEMO-WO-196','DEMO-SO-032','3521C0018',2.0000000000,9206081900020197),
(9206081900050198,'DEMO-PR-003','DEMO-WO-197','DEMO-SO-032','1A0047E',1000.0000000000,9206081900020198),
(9206081900050199,'DEMO-PR-001','DEMO-WO-198','DEMO-SO-033','3221C0031',100.0000000000,9206081900020199),
(9206081900050200,'DEMO-PR-001','UAT-MO-0034','DEMO-SO-034','91CC0232',400.00000000,9206081900020200),
(9206081900050201,'DEMO-PR-001','DEMO-WO-199','DEMO-SO-035','1007114',120000.0000000000,9206081900020201),
(9206081900050202,'DEMO-PR-002','DEMO-WO-200','DEMO-SO-035','1007115',30000.0000000000,9206081900020202),
(9206081900050203,'DEMO-PR-001','DEMO-WO-201','DEMO-SO-036','1000431',5000.0000000000,9206081900020203),
(9206081900050204,'DEMO-PR-002','DEMO-WO-202','DEMO-SO-036','1000432',5000.0000000000,9206081900020204),
(9206081900050205,'DEMO-PR-001','DEMO-WO-203','DEMO-SO-037','1000595',92000.0000000000,9206081900020205),
(9206081900050206,'DEMO-PR-002','DEMO-WO-204','DEMO-SO-037','1007096',7000.0000000000,9206081900020206),
(9206081900050207,'DEMO-PR-003','DEMO-WO-205','DEMO-SO-037','1002081',1256.0000000000,9206081900020207),
(9206081900050208,'DEMO-PR-004','DEMO-WO-206','DEMO-SO-037','93000236',140.0000000000,9206081900020208),
(9206081900050209,'DEMO-PR-001','DEMO-WO-207','DEMO-SO-038','93000228',3000.0000000000,9206081900020209),
(9206081900050210,'DEMO-PR-001','UAT-MO-0039','DEMO-SO-039','1A039D8',350.00000000,9206081900020210),
(9206081900050211,'DEMO-PR-001','DEMO-WO-208','DEMO-SO-040','93000235',600.0000000000,9206081900020211),
(9206081900050212,'DEMO-PR-001','DEMO-WO-209','DEMO-SO-041','94000284',10000.0000000000,9206081900020212),
(9206081900050213,'DEMO-PR-002','DEMO-WO-210','DEMO-SO-041','1002081',1200.0000000000,9206081900020213),
(9206081900050214,'DEMO-PR-001','DEMO-WO-211','DEMO-SO-042','93000179',2000.0000000000,9206081900020214),
(9206081900050215,'DEMO-PR-001','DEMO-WO-212','DEMO-SO-043','93000229',6000.0000000000,9206081900020215),
(9206081900050216,'DEMO-PR-002','DEMO-WO-213','DEMO-SO-043','1008414',176.0000000000,9206081900020216),
(9206081900050217,'DEMO-PR-003','DEMO-WO-214','DEMO-SO-043','94000284',10000.0000000000,9206081900020217),
(9206081900050218,'DEMO-PR-004','DEMO-WO-215','DEMO-SO-043','94000219',11000.0000000000,9206081900020218),
(9206081900050219,'DEMO-PR-005','DEMO-WO-216','DEMO-SO-043','93000233',1000.0000000000,9206081900020219),
(9206081900050220,'DEMO-PR-001','UAT-MO-0044','DEMO-SO-044','91DC0218',400.00000000,9206081900020220),
(9206081900050221,'DEMO-PR-001','UAT-MO-0045','DEMO-SO-045','1A03G94',1686.00000000,9206081900020221);

DROP TEMPORARY TABLE IF EXISTS tmp_s3_uat_po_line;
CREATE TEMPORARY TABLE tmp_s3_uat_po_line (
    pur_ord VARCHAR(48) NOT NULL,
    line_no INT NOT NULL,
    sales_ord VARCHAR(64) NOT NULL,
    work_ord VARCHAR(128) NULL,
    item_num VARCHAR(60) NOT NULL,
    qty DECIMAL(15,5) NOT NULL,
    PRIMARY KEY (pur_ord, line_no)
);
INSERT INTO tmp_s3_uat_po_line VALUES
('DEMO-PO-001',1,'DEMO-SO-001','DEMO-WO-001','91DC0292',4500.00000000),
('DEMO-PO-001',2,'DEMO-SO-001','DEMO-WO-002','1A03D23',3500.00000000),
('DEMO-PO-001',3,'DEMO-SO-001','DEMO-WO-003','1A0C329',400000.00000000),
('DEMO-PO-001',4,'DEMO-SO-001','DEMO-WO-004','1A0C655',100000.00000000),
('DEMO-PO-001',5,'DEMO-SO-001','DEMO-WO-005','A2C7114',250000.00000000),
('DEMO-PO-001',6,'DEMO-SO-001','DEMO-WO-006','A2C7115',600000.00000000),
('DEMO-PO-001',7,'DEMO-SO-001','DEMO-WO-007','A2B4199',6000.00000000),
('DEMO-PO-001',8,'DEMO-SO-001','DEMO-WO-008','1A0C588',10000.00000000),
('DEMO-PO-001',9,'DEMO-SO-001','DEMO-WO-009','1A03G94',2500.00000000),
('DEMO-PO-001',10,'DEMO-SO-001','DEMO-WO-010','91CC0286',1500.00000000),
('DEMO-PO-001',11,'DEMO-SO-001','DEMO-WO-011','91DC0218',800.00000000),
('DEMO-PO-002',1,'DEMO-SO-002','DEMO-WO-012','91CC0229',60.00000000),
('DEMO-PO-003',1,'DEMO-SO-003','DEMO-WO-013','91DC0218',2000.00000000),
('DEMO-PO-004',1,'DEMO-SO-004','DEMO-WO-014','91CC0237',200.00000000),
('DEMO-PO-005',1,'DEMO-SO-005','DEMO-WO-015','A2C7114',250000.00000000),
('DEMO-PO-006',1,'DEMO-SO-006','DEMO-WO-016','1A0C329',100000.00000000),
('DEMO-PO-007',1,'DEMO-SO-007','DEMO-WO-017','91CC0312',500.00000000),
('DEMO-PO-007',2,'DEMO-SO-007','DEMO-WO-018','1A03D23',600.00000000),
('DEMO-PO-007',3,'DEMO-SO-007','DEMO-WO-019','91CC0231',100.00000000),
('DEMO-PO-007',4,'DEMO-SO-007','DEMO-WO-020','91CC0286',800.00000000),
('DEMO-PO-008',1,'DEMO-SO-008','DEMO-WO-021','91C0D058',400.00000000),
('DEMO-PO-009',1,'DEMO-SO-009','DEMO-WO-022','A2B8361',1000.00000000),
('DEMO-PO-010',1,'DEMO-SO-010','DEMO-WO-023','A2B8184',700.00000000),
('DEMO-PO-011',1,'DEMO-SO-011','DEMO-WO-024','A2B4199',4000.00000000),
('DEMO-PO-012',1,'DEMO-SO-012','DEMO-WO-025','1A03D23',5000.00000000),
('DEMO-PO-013',1,'DEMO-SO-013','DEMO-WO-026','ABC431',10000.00000000),
('DEMO-PO-013',2,'DEMO-SO-013','DEMO-WO-027','1A0C432',10000.00000000),
('DEMO-PO-014',1,'DEMO-SO-014','DEMO-WO-028','ABC419',35000.00000000),
('DEMO-PO-015',1,'DEMO-SO-015','DEMO-WO-029','1A0C293',650000.00000000),
('DEMO-PO-015',2,'DEMO-SO-015','DEMO-WO-030','1A0C329',200000.00000000),
('DEMO-PO-016',1,'DEMO-SO-016','DEMO-WO-031','91DC0215',1500.00000000),
('DEMO-PO-017',1,'DEMO-SO-017','DEMO-WO-032','91CC0179',5000.00000000),
('DEMO-PO-017',2,'DEMO-SO-017','DEMO-WO-033','91CC0287',10000.00000000),
('DEMO-PO-017',3,'DEMO-SO-017','DEMO-WO-034','91CC0288',10000.00000000),
('DEMO-PO-017',4,'DEMO-SO-017','DEMO-WO-035','91CC0187',5000.00000000),
('DEMO-PO-017',5,'DEMO-SO-017','DEMO-WO-036','91CC0233',1500.00000000),
('DEMO-PO-017',6,'DEMO-SO-017','DEMO-WO-037','91DC0218',3000.00000000),
('DEMO-PO-017',7,'DEMO-SO-017','DEMO-WO-038','A21C096',10000.00000000),
('DEMO-PO-018',1,'DEMO-SO-018','DEMO-WO-039','91CC0177',5000.00000000),
('DEMO-PO-018',2,'DEMO-SO-018','DEMO-WO-040','91CC0179',5000.00000000),
('DEMO-PO-018',3,'DEMO-SO-018','DEMO-WO-041','91CC0287',4000.00000000),
('DEMO-PO-018',4,'DEMO-SO-018','DEMO-WO-042','91DC0217',2000.00000000),
('DEMO-PO-018',5,'DEMO-SO-018','DEMO-WO-043','91DC0219',9000.00000000),
('DEMO-PO-018',6,'DEMO-SO-018','DEMO-WO-044','91C0D2D',2000.00000000),
('DEMO-PO-018',7,'DEMO-SO-018','DEMO-WO-045','AB47111',200000.00000000),
('DEMO-PO-019',1,'DEMO-SO-019','DEMO-WO-046','352AD0A',1.00000000),
('DEMO-PO-019',2,'DEMO-SO-019','DEMO-WO-047','3521C0014',1.00000000),
('DEMO-PO-019',3,'DEMO-SO-019','DEMO-WO-048','3151C0033',1.00000000),
('DEMO-PO-019',4,'DEMO-SO-019','DEMO-WO-049','3151C0034',1.00000000),
('DEMO-PO-020',1,'DEMO-SO-020','DEMO-WO-050','3221C0031',7000.00000000),
('DEMO-PO-021',1,'DEMO-SO-021','DEMO-WO-051','3521C0015',1.00000000),
('DEMO-PO-021',2,'DEMO-SO-021','DEMO-WO-052','3521C0015',1.00000000),
('DEMO-PO-021',3,'DEMO-SO-021','DEMO-WO-053','3521C0015',1.00000000),
('DEMO-PO-021',4,'DEMO-SO-021','DEMO-WO-054','3521C0015',1.00000000),
('DEMO-PO-021',5,'DEMO-SO-021','DEMO-WO-055','3521C0015',1.00000000),
('DEMO-PO-021',6,'DEMO-SO-021','DEMO-WO-056','3521C0015',1.00000000),
('DEMO-PO-021',7,'DEMO-SO-021','DEMO-WO-057','3521C0015',1.00000000),
('DEMO-PO-021',8,'DEMO-SO-021','DEMO-WO-058','3521C0015',1.00000000),
('DEMO-PO-021',9,'DEMO-SO-021','DEMO-WO-059','3521C0015',1.00000000),
('DEMO-PO-021',10,'DEMO-SO-021','DEMO-WO-060','3521C0015',1.00000000),
('DEMO-PO-022',1,'DEMO-SO-022','DEMO-WO-061','3151C0034',1.00000000),
('DEMO-PO-022',2,'DEMO-SO-022','DEMO-WO-062','3151C0034',1.00000000),
('DEMO-PO-022',3,'DEMO-SO-022','DEMO-WO-063','3151C0034',1.00000000),
('DEMO-PO-022',4,'DEMO-SO-022','DEMO-WO-064','3151C0034',1.00000000),
('DEMO-PO-022',5,'DEMO-SO-022','DEMO-WO-065','3151C0034',1.00000000),
('DEMO-PO-022',6,'DEMO-SO-022','DEMO-WO-066','3521C0016',1.00000000),
('DEMO-PO-022',7,'DEMO-SO-022','DEMO-WO-067','3521C0016',1.00000000),
('DEMO-PO-022',8,'DEMO-SO-022','DEMO-WO-068','3521C0016',1.00000000),
('DEMO-PO-022',9,'DEMO-SO-022','DEMO-WO-069','3521C0016',1.00000000),
('DEMO-PO-022',10,'DEMO-SO-022','DEMO-WO-070','3521C0016',1.00000000),
('DEMO-PO-022',11,'DEMO-SO-022','DEMO-WO-071','3521C0016',1.00000000),
('DEMO-PO-022',12,'DEMO-SO-022','DEMO-WO-072','3521C0016',1.00000000),
('DEMO-PO-023',1,'DEMO-SO-023','DEMO-WO-073','3521C0016',1.00000000),
('DEMO-PO-023',2,'DEMO-SO-023','DEMO-WO-074','3521C0016',1.00000000),
('DEMO-PO-023',3,'DEMO-SO-023','DEMO-WO-075','3521C0016',1.00000000),
('DEMO-PO-023',4,'DEMO-SO-023','DEMO-WO-076','352AD0A',1.00000000),
('DEMO-PO-023',5,'DEMO-SO-023','DEMO-WO-077','352AD0A',1.00000000),
('DEMO-PO-023',6,'DEMO-SO-023','DEMO-WO-078','352AD0A',1.00000000),
('DEMO-PO-023',7,'DEMO-SO-023','DEMO-WO-079','352AD0A',1.00000000),
('DEMO-PO-023',8,'DEMO-SO-023','DEMO-WO-080','352AD0A',1.00000000),
('DEMO-PO-023',9,'DEMO-SO-023','DEMO-WO-081','352AD0A',1.00000000),
('DEMO-PO-023',10,'DEMO-SO-023','DEMO-WO-082','352AD0A',1.00000000),
('DEMO-PO-023',11,'DEMO-SO-023','DEMO-WO-083','352AD0A',1.00000000),
('DEMO-PO-023',12,'DEMO-SO-023','DEMO-WO-084','352AD0A',1.00000000),
('DEMO-PO-023',13,'DEMO-SO-023','DEMO-WO-085','352AD0A',1.00000000),
('DEMO-PO-024',1,'DEMO-SO-024','DEMO-WO-086','91CC0178',4000.00000000),
('DEMO-PO-024',2,'DEMO-SO-024','DEMO-WO-087','91CC0285',2000.00000000),
('DEMO-PO-024',3,'DEMO-SO-024','DEMO-WO-088','91CC0286',4000.00000000),
('DEMO-PO-024',4,'DEMO-SO-024','DEMO-WO-089','A2B8361',4000.00000000),
('DEMO-PO-025',1,'DEMO-SO-025','DEMO-WO-090','1A0C273',200.00000000),
('DEMO-PO-025',2,'DEMO-SO-025','DEMO-WO-091','1A0C275',272.00000000),
('DEMO-PO-025',3,'DEMO-SO-025','DEMO-WO-092','1A004C4',960000.00000000),
('DEMO-PO-025',4,'DEMO-SO-025','DEMO-WO-093','ABC419',1000.00000000),
('DEMO-PO-025',5,'DEMO-SO-025','DEMO-WO-094','ABC431',2000.00000000),
('DEMO-PO-025',6,'DEMO-SO-025','DEMO-WO-095','1A0C432',1000.00000000),
('DEMO-PO-025',7,'DEMO-SO-025','DEMO-WO-096','1A0C588',29000.00000000),
('DEMO-PO-025',8,'DEMO-SO-025','DEMO-WO-097','1A0C595',670000.00000000),
('DEMO-PO-025',9,'DEMO-SO-025','DEMO-WO-098','AB32A4',111.00000000),
('DEMO-PO-026',1,'DEMO-SO-026','DEMO-WO-099','A21C092',550.00000000),
('DEMO-PO-026',2,'DEMO-SO-026','DEMO-WO-100','A21C093',60.00000000),
('DEMO-PO-026',3,'DEMO-SO-026','DEMO-WO-101','91B0D033',38.00000000),
('DEMO-PO-026',4,'DEMO-SO-026','DEMO-WO-102','91C0D058',558.00000000),
('DEMO-PO-026',5,'DEMO-SO-026','DEMO-WO-103','91C0D074',2522.00000000),
('DEMO-PO-026',6,'DEMO-SO-026','DEMO-WO-104','91C0DA8',69.00000000),
('DEMO-PO-026',7,'DEMO-SO-026','DEMO-WO-105','93B0D1A',185.00000000),
('DEMO-PO-026',8,'DEMO-SO-026','DEMO-WO-106','91CC0123',2.00000000),
('DEMO-PO-026',9,'DEMO-SO-026','DEMO-WO-107','91CC0229',862.00000000),
('DEMO-PO-026',10,'DEMO-SO-026','DEMO-WO-108','91CC0262',200.00000000),
('DEMO-PO-026',11,'DEMO-SO-026','DEMO-WO-109','91CC0286',3000.00000000),
('DEMO-PO-026',12,'DEMO-SO-026','DEMO-WO-110','91CC0312',300.00000000),
('DEMO-PO-026',13,'DEMO-SO-026','DEMO-WO-111','91C0DD4',100.00000000),
('DEMO-PO-026',14,'DEMO-SO-026','DEMO-WO-112','91CC0412',58.00000000),
('DEMO-PO-026',15,'DEMO-SO-026','DEMO-WO-113','91C0DE2',400.00000000),
('DEMO-PO-026',16,'DEMO-SO-026','DEMO-WO-114','91C0DE3',1050.00000000),
('DEMO-PO-026',17,'DEMO-SO-026','DEMO-WO-115','91C0DE6',400.00000000),
('DEMO-PO-026',18,'DEMO-SO-026','DEMO-WO-116','91C0DE7',1000.00000000),
('DEMO-PO-026',19,'DEMO-SO-026','DEMO-WO-117','91C0DE9',350.00000000),
('DEMO-PO-026',20,'DEMO-SO-026','DEMO-WO-118','91C0D5A',1100.00000000),
('DEMO-PO-026',21,'DEMO-SO-026','DEMO-WO-119','91CC0518',1250.00000000),
('DEMO-PO-026',22,'DEMO-SO-026','DEMO-WO-120','91CC0521',3000.00000000),
('DEMO-PO-026',23,'DEMO-SO-026','DEMO-WO-121','91CC0524',1500.00000000),
('DEMO-PO-026',24,'DEMO-SO-026','DEMO-WO-122','91CC0525',3000.00000000),
('DEMO-PO-026',25,'DEMO-SO-026','DEMO-WO-123','91FC0339',600.00000000),
('DEMO-PO-026',26,'DEMO-SO-026','DEMO-WO-124','1AB9259',5000.00000000),
('DEMO-PO-026',27,'DEMO-SO-026','DEMO-WO-125','3124C0015',8000.00000000),
('DEMO-PO-026',28,'DEMO-SO-026','DEMO-WO-126','3151C0032',1.00000000),
('DEMO-PO-026',29,'DEMO-SO-026','DEMO-WO-127','1A0C452',1000.00000000),
('DEMO-PO-026',30,'DEMO-SO-026','DEMO-WO-128','91CC0517',100.00000000),
('DEMO-PO-026',31,'DEMO-SO-026','DEMO-WO-129','3151C0034',1.00000000),
('DEMO-PO-026',32,'DEMO-SO-026','DEMO-WO-130','3151C0034',1.00000000),
('DEMO-PO-026',33,'DEMO-SO-026','DEMO-WO-131','3151C0034',1.00000000),
('DEMO-PO-026',34,'DEMO-SO-026','DEMO-WO-132','3151C0034',1.00000000),
('DEMO-PO-026',35,'DEMO-SO-026','DEMO-WO-133','3151C0034',1.00000000),
('DEMO-PO-026',36,'DEMO-SO-026','DEMO-WO-134','3151C0033',1.00000000),
('DEMO-PO-026',37,'DEMO-SO-026','DEMO-WO-135','3151C0033',1.00000000),
('DEMO-PO-026',38,'DEMO-SO-026','DEMO-WO-136','3151C0033',1.00000000),
('DEMO-PO-026',39,'DEMO-SO-026','DEMO-WO-137','3151C0033',1.00000000),
('DEMO-PO-026',40,'DEMO-SO-026','DEMO-WO-138','3151C0033',1.00000000),
('DEMO-PO-026',41,'DEMO-SO-026','DEMO-WO-139','3151C0033',1.00000000),
('DEMO-PO-026',42,'DEMO-SO-026','DEMO-WO-140','3151C0033',1.00000000),
('DEMO-PO-026',43,'DEMO-SO-026','DEMO-WO-141','3151C0033',1.00000000),
('DEMO-PO-026',44,'DEMO-SO-026','DEMO-WO-142','3521C0015',1.00000000),
('DEMO-PO-026',45,'DEMO-SO-026','DEMO-WO-143','3521C0015',1.00000000),
('DEMO-PO-026',46,'DEMO-SO-026','DEMO-WO-144','3521C0015',1.00000000),
('DEMO-PO-026',47,'DEMO-SO-026','DEMO-WO-145','3521C0015',1.00000000),
('DEMO-PO-026',48,'DEMO-SO-026','DEMO-WO-146','3521C0015',1.00000000),
('DEMO-PO-026',49,'DEMO-SO-026','DEMO-WO-147','3521C0015',1.00000000),
('DEMO-PO-026',50,'DEMO-SO-026','DEMO-WO-148','3521C0015',1.00000000),
('DEMO-PO-026',51,'DEMO-SO-026','DEMO-WO-149','3521C0015',1.00000000),
('DEMO-PO-026',52,'DEMO-SO-026','DEMO-WO-150','3521C0015',1.00000000),
('DEMO-PO-026',53,'DEMO-SO-026','DEMO-WO-151','3521C0015',1.00000000),
('DEMO-PO-026',54,'DEMO-SO-026','DEMO-WO-152','3521C0015',1.00000000),
('DEMO-PO-026',55,'DEMO-SO-026','DEMO-WO-153','3521C0015',1.00000000),
('DEMO-PO-026',56,'DEMO-SO-026','DEMO-WO-154','3521C0015',1.00000000),
('DEMO-PO-027',1,'DEMO-SO-027','DEMO-WO-155','91C0D2G',5000.00000000),
('DEMO-PO-027',2,'DEMO-SO-027','DEMO-WO-156','93BC0311',510.00000000),
('DEMO-PO-027',3,'DEMO-SO-027','DEMO-WO-157','91CC0312',500.00000000),
('DEMO-PO-027',4,'DEMO-SO-027','DEMO-WO-158','91CC0233',400.00000000),
('DEMO-PO-027',5,'DEMO-SO-027','DEMO-WO-159','91CC0232',1500.00000000),
('DEMO-PO-028',1,'DEMO-SO-028','DEMO-WO-160','91CC0312',5000.00000000),
('DEMO-PO-028',2,'DEMO-SO-028','DEMO-WO-161','93BC0311',5000.00000000),
('DEMO-PO-029',1,'DEMO-SO-029','DEMO-WO-162','91CC0483',1900.00000000),
('DEMO-PO-029',2,'DEMO-SO-029','DEMO-WO-163','91CC0312',100.00000000),
('DEMO-PO-029',3,'DEMO-SO-029','DEMO-WO-164','93BC0311',600.00000000),
('DEMO-PO-029',4,'DEMO-SO-029','DEMO-WO-165','91CC0313',100.00000000),
('DEMO-PO-029',5,'DEMO-SO-029','DEMO-WO-166','91CC0229',700.00000000),
('DEMO-PO-030',1,'DEMO-SO-030','DEMO-WO-167','91CC0182',10000.00000000),
('DEMO-PO-030',2,'DEMO-SO-030','DEMO-WO-168','312CD009',10000.00000000),
('DEMO-PO-030',3,'DEMO-SO-030','DEMO-WO-169','3123C0012',10000.00000000),
('DEMO-PO-030',4,'DEMO-SO-030','DEMO-WO-170','3123C0026',3000.00000000),
('DEMO-PO-030',5,'DEMO-SO-030','DEMO-WO-171','3123C0027',3000.00000000),
('DEMO-PO-030',6,'DEMO-SO-030','DEMO-WO-172','3123C0028',3000.00000000),
('DEMO-PO-030',7,'DEMO-SO-030','DEMO-WO-173','3123C0035',10000.00000000),
('DEMO-PO-030',8,'DEMO-SO-030','DEMO-WO-174','3123C0046',3000.00000000),
('DEMO-PO-030',9,'DEMO-SO-030','DEMO-WO-175','3123C0047',3000.00000000),
('DEMO-PO-030',10,'DEMO-SO-030','DEMO-WO-176','3123C0048',3000.00000000),
('DEMO-PO-030',11,'DEMO-SO-030','DEMO-WO-177','3521C0015',1.00000000),
('DEMO-PO-030',12,'DEMO-SO-030','DEMO-WO-178','3521C0015',1.00000000),
('DEMO-PO-030',13,'DEMO-SO-030','DEMO-WO-179','3521C0015',1.00000000),
('DEMO-PO-030',14,'DEMO-SO-030','DEMO-WO-180','3521C0015',1.00000000),
('DEMO-PO-030',15,'DEMO-SO-030','DEMO-WO-181','3521C0016',1.00000000),
('DEMO-PO-030',16,'DEMO-SO-030','DEMO-WO-182','3521C0016',1.00000000),
('DEMO-PO-030',17,'DEMO-SO-030','DEMO-WO-183','3521C0016',1.00000000),
('DEMO-PO-030',18,'DEMO-SO-030','DEMO-WO-184','3521C0016',1.00000000),
('DEMO-PO-030',19,'DEMO-SO-030','DEMO-WO-185','3521C0016',1.00000000),
('DEMO-PO-030',20,'DEMO-SO-030','DEMO-WO-186','3521C0016',1.00000000),
('DEMO-PO-030',21,'DEMO-SO-030','DEMO-WO-187','3521C0015',1.00000000),
('DEMO-PO-030',22,'DEMO-SO-030','DEMO-WO-188','3521C0015',1.00000000),
('DEMO-PO-030',23,'DEMO-SO-030','DEMO-WO-189','3521C0015',1.00000000),
('DEMO-PO-030',24,'DEMO-SO-030','DEMO-WO-190','3521C0015',1.00000000),
('DEMO-PO-030',25,'DEMO-SO-030','DEMO-WO-191','3521C0015',1.00000000),
('DEMO-PO-030',26,'DEMO-SO-030','DEMO-WO-192','3521C0015',1.00000000),
('DEMO-PO-030',27,'DEMO-SO-030','DEMO-WO-193','3521C0015',1.00000000),
('DEMO-PO-031',1,'DEMO-SO-031','DEMO-WO-194','91CC0283',20000.00000000),
('DEMO-PO-032',1,'DEMO-SO-032','DEMO-WO-195','1A0044F',1000.00000000),
('DEMO-PO-032',2,'DEMO-SO-032','DEMO-WO-196','1A0045H',1000.00000000),
('DEMO-PO-032',3,'DEMO-SO-032','DEMO-WO-197','1A0047E',1000.00000000),
('DEMO-PO-033',1,'DEMO-SO-033','DEMO-WO-198','1A0044F',100.00000000),
('DEMO-PO-034',1,'DEMO-SO-034','UAT-MO-0034','91CC0232',400.00000000),
('DEMO-PO-035',1,'DEMO-SO-035','DEMO-WO-199','A2C7114',120000.00000000),
('DEMO-PO-035',2,'DEMO-SO-035','DEMO-WO-200','A2C7115',280000.00000000),
('DEMO-PO-036',1,'DEMO-SO-036','DEMO-WO-201','ABC431',6614.00000000),
('DEMO-PO-036',2,'DEMO-SO-036','DEMO-WO-202','1A0C432',7810.00000000),
('DEMO-PO-037',1,'DEMO-SO-037','DEMO-WO-203','1A0C595',200000.00000000),
('DEMO-PO-037',2,'DEMO-SO-037','DEMO-WO-204','1A03G96',1473.00000000),
('DEMO-PO-037',3,'DEMO-SO-037','DEMO-WO-205','AB3B81',256.00000000),
('DEMO-PO-037',4,'DEMO-SO-037','DEMO-WO-206','91CC0236',400.00000000),
('DEMO-PO-038',1,'DEMO-SO-038','DEMO-WO-207','91CC0228',131.00000000),
('DEMO-PO-039',1,'DEMO-SO-039','UAT-MO-0039','1A039D8',350.00000000),
('DEMO-PO-040',1,'DEMO-SO-040','DEMO-WO-208','91CC0235',600.00000000),
('DEMO-PO-041',1,'DEMO-SO-041','DEMO-WO-209','91DC0284',813.00000000),
('DEMO-PO-041',2,'DEMO-SO-041','DEMO-WO-210','AB3B81',218.00000000),
('DEMO-PO-042',1,'DEMO-SO-042','DEMO-WO-211','91CC0179',1200.00000000),
('DEMO-PO-043',1,'DEMO-SO-043','DEMO-WO-212','91CC0229',900.00000000),
('DEMO-PO-043',2,'DEMO-SO-043','DEMO-WO-213','A2B8414',300.00000000),
('DEMO-PO-043',3,'DEMO-SO-043','DEMO-WO-214','91DC0284',263.00000000),
('DEMO-PO-043',4,'DEMO-SO-043','DEMO-WO-215','91DC0219',2030.00000000),
('DEMO-PO-043',5,'DEMO-SO-043','DEMO-WO-216','91CC0233',800.00000000),
('DEMO-PO-044',1,'DEMO-SO-044','UAT-MO-0044','91DC0218',400.00000000),
('DEMO-PO-045',1,'DEMO-SO-045','UAT-MO-0045','1A03G94',1686.00000000);

DROP TEMPORARY TABLE IF EXISTS tmp_s3_uat_po_hdr;
CREATE TEMPORARY TABLE tmp_s3_uat_po_hdr (
    pur_ord VARCHAR(48) NOT NULL PRIMARY KEY,
    sales_ord VARCHAR(64) NOT NULL,
    work_ord VARCHAR(128) NULL
);
INSERT INTO tmp_s3_uat_po_hdr
SELECT pur_ord, MIN(sales_ord), MIN(work_ord) FROM tmp_s3_uat_po_line GROUP BY pur_ord;

DROP TEMPORARY TABLE IF EXISTS tmp_s4_uat_ship;
CREATE TEMPORARY TABLE tmp_s4_uat_ship (
    ship_id BIGINT NOT NULL PRIMARY KEY,
    po_billno VARCHAR(48) NOT NULL,
    shddh VARCHAR(64) NOT NULL
);
INSERT INTO tmp_s4_uat_ship VALUES
(9206081900060002,'DEMO-PO-001','DEMO-SH-001'),
(9206081900060003,'DEMO-PO-002','DEMO-SH-002'),
(9206081900060004,'DEMO-PO-003','DEMO-SH-003'),
(9206081900060005,'DEMO-PO-004','DEMO-SH-004'),
(9206081900060006,'DEMO-PO-005','DEMO-SH-005'),
(9206081900060007,'DEMO-PO-006','DEMO-SH-006'),
(9206081900060008,'DEMO-PO-007','DEMO-SH-007'),
(9206081900060009,'DEMO-PO-008','DEMO-SH-008'),
(9206081900060010,'DEMO-PO-009','DEMO-SH-009'),
(9206081900060011,'DEMO-PO-010','DEMO-SH-010'),
(9206081900060012,'DEMO-PO-011','DEMO-SH-011'),
(9206081900060013,'DEMO-PO-012','DEMO-SH-012'),
(9206081900060014,'DEMO-PO-013','DEMO-SH-013'),
(9206081900060015,'DEMO-PO-014','DEMO-SH-014'),
(9206081900060016,'DEMO-PO-015','DEMO-SH-015'),
(9206081900060017,'DEMO-PO-016','DEMO-SH-016'),
(9206081900060018,'DEMO-PO-017','DEMO-SH-017'),
(9206081900060019,'DEMO-PO-018','DEMO-SH-018'),
(9206081900060020,'DEMO-PO-019','DEMO-SH-019'),
(9206081900060021,'DEMO-PO-020','DEMO-SH-020'),
(9206081900060022,'DEMO-PO-021','DEMO-SH-021'),
(9206081900060023,'DEMO-PO-022','DEMO-SH-022'),
(9206081900060024,'DEMO-PO-023','DEMO-SH-023'),
(9206081900060025,'DEMO-PO-024','DEMO-SH-024'),
(9206081900060026,'DEMO-PO-025','DEMO-SH-025'),
(9206081900060027,'DEMO-PO-026','DEMO-SH-026'),
(9206081900060028,'DEMO-PO-027','DEMO-SH-027'),
(9206081900060029,'DEMO-PO-028','DEMO-SH-028'),
(9206081900060030,'DEMO-PO-029','DEMO-SH-029'),
(9206081900060031,'DEMO-PO-030','DEMO-SH-030'),
(9206081900060032,'DEMO-PO-031','DEMO-SH-031'),
(9206081900060033,'DEMO-PO-032','DEMO-SH-032'),
(9206081900060034,'DEMO-PO-033','DEMO-SH-033'),
(9206081900060035,'DEMO-PO-034','DEMO-SH-034'),
(9206081900060036,'DEMO-PO-035','DEMO-SH-035'),
(9206081900060037,'DEMO-PO-036','DEMO-SH-036'),
(9206081900060038,'DEMO-PO-037','DEMO-SH-037'),
(9206081900060039,'DEMO-PO-038','DEMO-SH-038'),
(9206081900060040,'DEMO-PO-039','DEMO-SH-039'),
(9206081900060041,'DEMO-PO-040','DEMO-SH-040'),
(9206081900060042,'DEMO-PO-041','DEMO-SH-041'),
(9206081900060043,'DEMO-PO-042','DEMO-SH-042'),
(9206081900060044,'DEMO-PO-043','DEMO-SH-043'),
(9206081900060045,'DEMO-PO-044','DEMO-SH-044'),
(9206081900060046,'DEMO-PO-045','DEMO-SH-045');
START TRANSACTION;

INSERT INTO crm_seorder (
    Id, bill_no, order_type, custom_no, custom_name,
    date, rdate, urgent, bill_from, closed, IsDeleted,
    create_by_name, create_time, update_by_name, update_time,
    tenant_id, factory_id
)
SELECT target_id, bill_no, 1, custom_no, custom_name,
       order_date, delivery_date, urgent,
       CONCAT('UAT瀵煎叆:', @batch_no), 0, 0,
       @operator_name, @now, @operator_name, @now,
       @tenant_id, @factory_id
FROM tmp_s1_uat_so;

INSERT INTO crm_seorderentry (
    Id, seorder_id, bill_no, entry_seq, item_number,
    qty, plan_date, date, IsDeleted,
    create_by_name, create_time, update_by_name, update_time,
    tenant_id, factory_id, seorderentry_id
)
SELECT l.target_id, s.target_id, l.bill_no, l.entry_seq, l.item_number,
       l.qty, l.plan_date, s.order_date, 0,
       @operator_name, @now, @operator_name, @now,
       @tenant_id, @factory_id, l.target_id
FROM tmp_s1_uat_so_line l
JOIN tmp_s1_uat_so s ON s.bill_no = l.bill_no;

INSERT INTO mes_morder (
    Id, morder_no, morder_date, morder_state, product_code, product_name,
    need_number, morder_production_number, IsDeleted, urgent,
    create_by_name, create_time, update_by_name, update_time,
    tenant_id, factory_id
)
SELECT target_mo_id, morder_no, @now, 'Released', product_code, product_code,
       need_number, need_number, 0, 0,
       @operator_name, @now, @operator_name, @now,
       @tenant_id, @factory_id
FROM tmp_s2_uat_morder;

INSERT INTO mes_moentry (
    Id, moentry_moid, moentry_mono, soentry_id, fbill_no,
    need_number, morder_production_number, IsDeleted,
    create_by_name, create_time, tenant_id, factory_id
)
SELECT m.target_me_id, m.target_mo_id, m.morder_no, l.target_id, m.bill_no,
       m.need_number, m.need_number, 0,
       @operator_name, @now, @tenant_id, @factory_id
FROM tmp_s2_uat_morder m
JOIN tmp_s1_uat_so_line l ON l.source_entry = m.source_entry;

INSERT INTO WorkOrdMaster (
    Domain, WorkOrd, ItemNum, Status, QtyOrded, QtyCompleted, LbrVar,
    OrdDate, DueDate, SalesJob, BusinessID, IsActive, IsConfirm, Priority, Urgent,
    tenant_id, CreateTime, UpdateTime
)
SELECT '8010', morder_no, product_code, 'R',
       need_number, 0, 0, @now, DATE_ADD(@now, INTERVAL 14 DAY), bill_no,
       0, 1, 1, 0, 0, @tenant_id, @now, @now
FROM tmp_s2_uat_morder;

INSERT INTO srm_pr_main (
    Id, pr_billno, pr_purchaseid, pr_purchasenumber, pr_purchasename,
    pr_rqty, pr_aqty, pr_sqty, icitem_id, icitem_name,
    state, pr_type, currencytype,
    create_by, create_by_name, create_time, update_by, update_by_name, update_time,
    tenant_id, factory_id, IsDeleted, IsRequireGoods
)
SELECT p.voucher, p.pr_billno, p.mo_id, p.morder_no, p.morder_no,
       p.pr_rqty, 0, 0, 0, p.icitem_code,
       1, 1, 0,
       @operator_id, @operator_name, @now, @operator_id, @operator_name, @now,
       @tenant_id, @factory_id, 0, 0
FROM tmp_s3_uat_pr p;

INSERT INTO PurOrdMaster (
    OwnerApplication, APAcct, CostCtr, APSubAcct, Bank, BillTo, BlanketOrd, Buyer, CloseDate,
    CommentIndex, Confirming, Consignment, Contact, Contract, CreditTermsInt, CreditTerms, Curr,
    CycleCode, DeliverTo, Disc, Domain, DueDate, DutyType, BlanketStart, BlanketEnd, ExchRate,
    ERSOption, EstVal, Sequence, ExchRate1, ExchRate2, RateType, FixedPrice, FixedRate, FOB, Frt,
    FSMType, FSTID, InvoicesVia, EMTPO, Language, MaxAgingDays, PurOrd, OrdDate, PartialOK,
    AmtPrepaid, LastPriceDt, PricingDate, PrintPO, Project, DiscTbl, PriceTbl, ERSPriceListOption,
    PST, PSTID, Recurr, `Release`, Rel, ReqBy, Revision, Remark, Scheduled, SchedulesVia,
    ServiceCharge, ShipTo, ShipVia, Site, SecondarySOCrHold, PrimarySO, SpecialCharge, Status,
    Taxable, TaxClass, TaxDate, TaxEnvironment, Tax1, Tax2, Tax3, TaxUsage, TermsofTrade,
    TransportDays, Typed, Ufld1, Ufld2, EnteredBy, Supp, Transm, BusinessID, CreateUser,
    UpdateUser, CreateTime, UpdateTime, EffTime, IsActive, IsConfirm, Potype, Department,
    IsChanged, TaxIn, Amt, `Usage`, CustAddress, CustContact, CustPhone, SalesOrd, CustPO,
    IsPriceChanged, CustName, Rev, RoleNo, InvoiceType, PricingMethod, ERPfld1, ERPWorkOrd,
    WorkOrd, tenant_id
)
SELECT
    m.OwnerApplication, m.APAcct, m.CostCtr, m.APSubAcct, m.Bank, m.BillTo, m.BlanketOrd, @operator_name, m.CloseDate,
    m.CommentIndex, m.Confirming, m.Consignment, m.Contact, m.Contract, m.CreditTermsInt, m.CreditTerms, m.Curr,
    m.CycleCode, m.DeliverTo, m.Disc, m.Domain, m.DueDate, m.DutyType, m.BlanketStart, m.BlanketEnd, m.ExchRate,
    m.ERSOption, m.EstVal, m.Sequence, m.ExchRate1, m.ExchRate2, m.RateType, m.FixedPrice, m.FixedRate, m.FOB, m.Frt,
    m.FSMType, m.FSTID, m.InvoicesVia, m.EMTPO, m.Language, m.MaxAgingDays, h.pur_ord, @now, m.PartialOK,
    m.AmtPrepaid, m.LastPriceDt, m.PricingDate, m.PrintPO, m.Project, m.DiscTbl, m.PriceTbl, m.ERSPriceListOption,
    m.PST, m.PSTID, m.Recurr, m.`Release`, m.Rel, m.ReqBy, m.Revision, CONCAT('UAT:', @batch_no), m.Scheduled, m.SchedulesVia,
    m.ServiceCharge, m.ShipTo, m.ShipVia, m.Site, m.SecondarySOCrHold, m.PrimarySO, m.SpecialCharge, m.Status,
    m.Taxable, m.TaxClass, m.TaxDate, m.TaxEnvironment, m.Tax1, m.Tax2, m.Tax3, m.TaxUsage, m.TermsofTrade,
    m.TransportDays, m.Typed, m.Ufld1, m.Ufld2, m.EnteredBy, 'VEN00060', m.Transm, m.BusinessID, @operator_name,
    @operator_name, @now, @now, m.EffTime, m.IsActive, m.IsConfirm, 'PT', m.Department,
    m.IsChanged, m.TaxIn, m.Amt, m.`Usage`, m.CustAddress, m.CustContact, m.CustPhone, h.sales_ord, m.CustPO,
    m.IsPriceChanged, m.CustName, m.Rev, m.RoleNo, m.InvoiceType, m.PricingMethod, m.ERPfld1, m.ERPWorkOrd,
    h.work_ord, @tenant_id
FROM tmp_s3_uat_po_hdr h
CROSS JOIN (SELECT * FROM PurOrdMaster WHERE PurOrd='DO20260711001' AND tenant_id=797403760988229 LIMIT 1) m;

INSERT INTO PurOrdDetail (
    QtyBO, RctCost, CreditTermsInt, UpdateCurrentCost, CumReceived1, CumReceived2, CumReceived3, CumReceived4,
    Disc, FixedPrice, InspectReq, SingleLot, SupplyPer, PurOrd, PST, PackingSlipQty, PayUMConv, PurCost,
    RctQty, QtyOrded, QtyReceived, QtyReturned, Active, QtyReleased, RctUMConversion, Scheduled, ScheduledChanged,
    SchedMRPReq, SafetyDays, SafetyHours, StdCost, Taxable, TaxIn, MaxTaxableAmt, TransportHours, UMConversion, VAT,
    IsActive, IsConfirm, Potype, IsChanged, TaxRate, IsRounding, ReceiptQty, BarCodeQty, IsClosed, QtyReturnedRefund, CumQtyBO,
    Line, ItemNum, UM, DueDate, LotSerial, PurOrdRecID, Status, WorkOrd,
    CreateUser, CreateTime, UpdateUser, UpdateTime, tenant_id
)
SELECT
    0,0,0,0,0,0,0,0,0,0,0,0,0,pl.pur_ord,0,0,1,0,0,pl.qty,0,0,1,0,1,0,0,0,0,0,0,1,1,0,0,1,0,
    1,1,'PT',0,0,0,0,0,0,0,0,
    pl.line_no, pl.item_num, 'EA', DATE_ADD(@now, INTERVAL 14 DAY), '', 0, 'O', pl.work_ord,
    @operator_name, @now, @operator_name, @now, @tenant_id
FROM tmp_s3_uat_po_line pl;

SET @ds_seq := 800;
INSERT INTO srm_polist_ds (
    Id, domain, icdsid, dsnum, status, itemnum, um, purgroup,
    suppliercode, supplier, ponumber, poline, schedqty, needdate, remarks, tenant_id
)
SELECT
    @id_base+(@ds_seq:=@ds_seq+1),
    '8010', @id_base+800, CONCAT('DS-', pl.pur_ord, '-', pl.line_no),
    'P', pl.item_num, 'EA', 'PG01', 'VEN00060', 'VEN00060',
    pl.pur_ord, pl.line_no, pl.qty, DATE_ADD(@now, INTERVAL 14 DAY), '', @tenant_id
FROM tmp_s3_uat_po_line pl
CROSS JOIN (SELECT @ds_seq:=800) init;

INSERT INTO scm_shd (id, po_billno, shddh, sh_purchase_num, estimated_delivery_date, tjrxm, tjrq, state, tenant_id)
SELECT ship_id, po_billno, shddh, 'VEN00060', DATE_ADD(@now, INTERVAL 7 DAY), @operator_name, DATE_FORMAT(@now,'%Y-%m-%d'), 0, @tenant_id
FROM tmp_s4_uat_ship;

SET @zb_seq := 700;
INSERT INTO scm_shdzb (id, glid, sh_material_code, sh_delivery_quantity, po_bill, po_billline, tenant_id)
SELECT @id_base+(@zb_seq:=@zb_seq+1), CAST(s.ship_id AS CHAR), pl.item_num, pl.qty, pl.pur_ord, CAST(pl.line_no AS CHAR), @tenant_id
FROM tmp_s3_uat_po_line pl
JOIN tmp_s4_uat_ship s ON s.po_billno = pl.pur_ord
CROSS JOIN (SELECT @zb_seq:=700) init;

COMMIT;

SELECT 'crm_seorder' AS tbl, COUNT(*) cnt FROM crm_seorder WHERE tenant_id=@tenant_id AND bill_from LIKE CONCAT('UAT瀵煎叆:',@batch_no,'%');
SELECT 'crm_seorderentry' AS tbl, COUNT(*) cnt FROM crm_seorderentry WHERE tenant_id=@tenant_id AND bill_no IN (SELECT bill_no FROM tmp_s1_uat_so);
SELECT 'mes_morder' AS tbl, COUNT(*) cnt FROM mes_morder WHERE tenant_id=@tenant_id AND morder_no LIKE 'M5000%';
SELECT 'srm_pr_main' AS tbl, COUNT(*) cnt FROM srm_pr_main WHERE tenant_id=@tenant_id AND pr_billno LIKE 'DEMO-PR-057';
SELECT 'PurOrdMaster' AS tbl, COUNT(*) cnt FROM PurOrdMaster WHERE tenant_id=@tenant_id AND Remark LIKE CONCAT('%',@batch_no,'%');
SELECT 'scm_shd' AS tbl, COUNT(*) cnt FROM scm_shd WHERE shddh LIKE 'DEMO-SH-046';

SELECT so.bill_no, COUNT(DISTINCT se.Id) line_cnt, COUNT(DISTINCT mo.Id) morder_cnt, COUNT(DISTINCT pom.PurOrd) po_cnt
FROM crm_seorder so
LEFT JOIN crm_seorderentry se ON se.seorder_id=so.Id AND se.tenant_id=@tenant_id
LEFT JOIN mes_moentry me ON me.soentry_id=se.Id AND me.tenant_id=@tenant_id
LEFT JOIN mes_morder mo ON mo.Id=me.moentry_moid AND mo.tenant_id=@tenant_id
LEFT JOIN PurOrdMaster pom ON pom.SalesOrd=so.bill_no AND pom.tenant_id=@tenant_id
LEFT JOIN PurOrdDetail pd ON pd.PurOrd=pom.PurOrd AND pd.tenant_id=@tenant_id
WHERE so.tenant_id=@tenant_id AND so.bill_from LIKE CONCAT('UAT瀵煎叆:',@batch_no,'%')
GROUP BY so.bill_no;

