﻿-- 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     := 797403760988229;
SET @batch_no      := 'S1S4_UAT_FULL_20260605_V1';
SET @operator_id   := 1300000000111;
SET @operator_name := 'UAT鏁版嵁瀵煎叆';
SET @now           := NOW();
SET @factory_id    := 797403760988229;
SET @id_base       := 9106000500000001;

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
('MPO482024102400001',9106000500000002,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',1),
('MPO482024120200001',9106000500000003,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',0),
('MPO482024120200002',9106000500000004,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',0),
('MPO482024120400002',9106000500000005,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',0),
('MPO482025010700001',9106000500000006,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',1),
('MPO482025010700002',9106000500000007,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',1),
('MPO482025010900001',9106000500000008,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',1),
('MPO482025011000001',9106000500000009,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',1),
('MPO482025011000002',9106000500000010,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',1),
('MPO482025011000003',9106000500000011,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',1),
('MPO482025011300002',9106000500000012,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',1),
('MPO482025011300003',9106000500000013,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',1),
('MPO482025011300005',9106000500000014,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',1),
('MPO482025011300006',9106000500000015,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',1),
('MPO482025011400001',9106000500000016,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',1),
('MPO482025011400002',9106000500000017,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',1),
('MPO482025022100001',9106000500000018,'CUST0005','WKQXGFYXGE','2025-02-26 00:00:00.000','2025-02-26 00:00:00.000',1),
('MPO482025032900001',9106000500000019,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',0),
('MPO482025041300001',9106000500000020,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',0),
('MPO482025042800001',9106000500000021,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',0),
('MPO482025051800001',9106000500000022,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',0),
('MPO482025062100002',9106000500000023,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',0),
('MPO482025062100003',9106000500000024,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',0),
('MPO482025062600003',9106000500000025,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',0),
('MPO482025081500001',9106000500000026,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',0),
('MPO482025081500002',9106000500000027,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',0),
('MPO482025082900002',9106000500000028,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',0),
('MPO482025090400005',9106000500000029,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',0),
('MPO482025091800003',9106000500000030,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',0),
('MPO482025091900001',9106000500000031,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',0),
('MPO482025092200002',9106000500000032,'CUST0005','WKQXGFYXGE','2025-06-01 00:00:00.000','2025-06-15 00:00:00.000',0),
('MPO482026012100001',9106000500000033,'CUST0005','WKQXGFYXGE','2026-01-21 00:00:00.000','2026-01-21 00:00:00.000',0),
('MPO482026020300001',9106000500000034,'10000000','瑞贝德','2026-02-03 00:00:00.000','2026-02-03 00:00:00.000',0),
('SO241020240923001',9106000500000035,'CUST0005','ET0005','2024-09-23 00:00:00.000','2024-09-23 00:00:00.000',0),
('SO241020241014001',9106000500000036,'CUST0005','ET0005','2024-10-14 00:00:00.000','2024-10-14 00:00:00.000',0),
('SO241020241015003',9106000500000037,'CUST0005','ET0005','2024-10-15 00:00:00.000','2024-10-15 00:00:00.000',0),
('SO241020241018001',9106000500000038,'CUST0005','ET0005','2024-10-18 00:00:00.000','2024-10-18 00:00:00.000',0),
('SO241020241019001',9106000500000039,'CUST0005','ET0005','2024-10-19 00:00:00.000','2024-10-19 00:00:00.000',0),
('SO241020241021002',9106000500000040,'CUST0005','ET0005','2024-10-21 00:00:00.000','2024-10-21 00:00:00.000',0),
('SO241020241022001',9106000500000041,'CUST0005','ET0005','2024-10-22 00:00:00.000','2024-10-22 00:00:00.000',0),
('SO241020241102001',9106000500000042,'CUST0005','ET0005','2024-11-02 00:00:00.000','2024-11-02 00:00:00.000',0),
('SO241020241102004',9106000500000043,'CUST0005','ET0005','2024-11-02 00:00:00.000','2024-11-02 00:00:00.000',0),
('SO241020241104001',9106000500000044,'CUST0005','ET0005','2024-11-04 00:00:00.000','2024-11-04 00:00:00.000',0),
('SO241020241219001',9106000500000045,'CUST0005','ET0005','2024-12-19 00:00:00.000','2024-12-19 00:00:00.000',0),
('SO241020250114003',9106000500000046,'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
(9106000500010002,'604438178041925','MPO482024102400001',1,'91DC0292',4500.00000000,'2024-10-31 00:00:00.000'),
(9106000500010003,'604438178041926','MPO482024102400001',2,'1A03D23',3500.00000000,'2024-10-31 00:00:00.000'),
(9106000500010004,'604438178046021','MPO482024102400001',3,'1A0C329',400000.00000000,'2024-10-31 00:00:00.000'),
(9106000500010005,'604438178046022','MPO482024102400001',4,'1A0C655',100000.00000000,'2024-10-31 00:00:00.000'),
(9106000500010006,'604438178046023','MPO482024102400001',5,'A2C7114',250000.00000000,'2024-10-31 00:00:00.000'),
(9106000500010007,'604438178046024','MPO482024102400001',6,'A2C7115',600000.00000000,'2024-10-31 00:00:00.000'),
(9106000500010008,'604438178050117','MPO482024102400001',7,'A2B4199',6000.00000000,'2024-10-31 00:00:00.000'),
(9106000500010009,'604438178050118','MPO482024102400001',8,'1A0C588',10000.00000000,'2024-10-31 00:00:00.000'),
(9106000500010010,'604438178050119','MPO482024102400001',9,'1A03G94',2500.00000000,'2024-10-31 00:00:00.000'),
(9106000500010011,'604438178050120','MPO482024102400001',10,'91CC0286',1500.00000000,'2024-10-31 00:00:00.000'),
(9106000500010012,'604438178054213','MPO482024102400001',11,'91DC0218',800.00000000,'2024-10-31 00:00:00.000'),
(9106000500010013,'618270140751941','MPO482024120200001',1,'91CC0229',60.00000000,'2024-12-06 00:00:00.000'),
(9106000500010014,'618290062549061','MPO482024120200002',1,'91DC0218',2000.00000000,'2024-12-30 00:00:00.000'),
(9106000500010015,'619057595396165','MPO482024120400002',1,'91CC0237',200.00000000,'2024-12-12 00:00:00.000'),
(9106000500010016,'630994145116229','MPO482025010700001',1,'A2C7114',250000.00000000,'2025-01-10 00:00:00.000'),
(9106000500010017,'631069575503941','MPO482025010700002',1,'1A0C329',100000.00000000,'2025-01-15 00:00:00.000'),
(9106000500010018,'631769478479941','MPO482025010900001',1,'91CC0312',500.00000000,'2025-01-24 00:00:00.000'),
(9106000500010019,'631769478479942','MPO482025010900001',2,'1A03D23',600.00000000,'2025-01-14 00:00:00.000'),
(9106000500010020,'631769478484037','MPO482025010900001',3,'91CC0231',100.00000000,'2025-01-23 00:00:00.000'),
(9106000500010021,'631769478484038','MPO482025010900001',4,'91CC0286',800.00000000,'2025-02-06 00:00:00.000'),
(9106000500010022,'632121332793413','MPO482025011000001',1,'91C0D058',400.00000000,'2025-02-05 00:00:00.000'),
(9106000500010023,'632124508205125','MPO482025011000002',1,'A2B8361',1000.00000000,'2025-02-05 00:00:00.000'),
(9106000500010024,'632125640785989','MPO482025011000003',1,'A2B8184',700.00000000,'2025-02-05 00:00:00.000'),
(9106000500010025,'633173731577925','MPO482025011300002',1,'A2B4199',4000.00000000,'2025-02-17 00:00:00.000'),
(9106000500010026,'633178120278085','MPO482025011300003',1,'1A03D23',5000.00000000,'2025-02-27 00:00:00.000'),
(9106000500010027,'633197803688005','MPO482025011300005',1,'ABC431',10000.00000000,'2025-02-27 00:00:00.000'),
(9106000500010028,'633197803688006','MPO482025011300005',2,'1A0C432',10000.00000000,'2025-02-27 00:00:00.000'),
(9106000500010029,'633206945230917','MPO482025011300006',1,'ABC419',35000.00000000,'2025-02-17 00:00:00.000'),
(9106000500010030,'633515239526469','MPO482025011400001',1,'1A0C293',650000.00000000,'2025-02-27 00:00:00.000'),
(9106000500010031,'633515239526470','MPO482025011400001',2,'1A0C329',200000.00000000,'2025-02-26 00:00:00.000'),
(9106000500010032,'633520970641477','MPO482025011400002',1,'91DC0215',1500.00000000,'2025-02-28 00:00:00.000'),
(9106000500010033,'646977501577285','MPO482025022100001',1,'91CC0179',5000.00000000,'2025-02-26 00:00:00.000'),
(9106000500010034,'646977501577286','MPO482025022100001',2,'91CC0287',10000.00000000,'2025-02-26 00:00:00.000'),
(9106000500010035,'646977501581381','MPO482025022100001',3,'91CC0288',10000.00000000,'2025-02-26 00:00:00.000'),
(9106000500010036,'646977501581382','MPO482025022100001',4,'91CC0187',5000.00000000,'2025-02-26 00:00:00.000'),
(9106000500010037,'646977501581383','MPO482025022100001',5,'91CC0233',1500.00000000,'2025-02-26 00:00:00.000'),
(9106000500010038,'646977501581384','MPO482025022100001',6,'91DC0218',3000.00000000,'2025-02-26 00:00:00.000'),
(9106000500010039,'646977501581385','MPO482025022100001',7,'A21C096',10000.00000000,'2025-02-26 00:00:00.000'),
(9106000500010040,'659719952244805','MPO482025032900001',1,'91CC0177',5000.00000000,'2025-04-03 00:00:00.000'),
(9106000500010041,'659719952244806','MPO482025032900001',2,'91CC0179',5000.00000000,'2025-04-03 00:00:00.000'),
(9106000500010042,'659719952248901','MPO482025032900001',3,'91CC0287',4000.00000000,'2025-04-03 00:00:00.000'),
(9106000500010043,'659719952248902','MPO482025032900001',4,'91DC0217',2000.00000000,'2025-04-03 00:00:00.000'),
(9106000500010044,'659719952248903','MPO482025032900001',5,'91DC0219',9000.00000000,'2025-04-03 00:00:00.000'),
(9106000500010045,'659719952248904','MPO482025032900001',6,'91C0D2D',2000.00000000,'2025-04-03 00:00:00.000'),
(9106000500010046,'659719952252997','MPO482025032900001',7,'AB47111',200000.00000000,'2025-04-03 00:00:00.000'),
(9106000500010047,'665010090852421','MPO482025041300001',1,'352AD0A',1.00000000,'2025-04-18 00:00:00.000'),
(9106000500010048,'665010090852422','MPO482025041300001',2,'3521C0014',1.00000000,'2025-04-18 00:00:00.000'),
(9106000500010049,'665010090852423','MPO482025041300001',3,'3151C0033',1.00000000,'2025-04-18 00:00:00.000'),
(9106000500010050,'665010090856517','MPO482025041300001',4,'3151C0034',1.00000000,'2025-04-18 00:00:00.000'),
(9106000500010051,'670272721616965','MPO482025042800001',1,'3221C0031',7000.00000000,'2025-04-30 00:00:00.000'),
(9106000500010052,'677416091480133','MPO482025051800001',1,'3521C0015',1.00000000,'2025-05-23 00:00:00.000'),
(9106000500010053,'677416091480134','MPO482025051800001',2,'3521C0015',1.00000000,'2025-05-23 00:00:00.000'),
(9106000500010054,'677416091480135','MPO482025051800001',3,'3521C0015',1.00000000,'2025-05-23 00:00:00.000'),
(9106000500010055,'677416091480136','MPO482025051800001',4,'3521C0015',1.00000000,'2025-05-23 00:00:00.000'),
(9106000500010056,'677416091480137','MPO482025051800001',5,'3521C0015',1.00000000,'2025-05-28 00:00:00.000'),
(9106000500010057,'677416091484229','MPO482025051800001',6,'3521C0015',1.00000000,'2025-05-28 00:00:00.000'),
(9106000500010058,'677416091484230','MPO482025051800001',7,'3521C0015',1.00000000,'2025-05-28 00:00:00.000'),
(9106000500010059,'677416091484231','MPO482025051800001',8,'3521C0015',1.00000000,'2025-05-28 00:00:00.000'),
(9106000500010060,'677416091484232','MPO482025051800001',9,'3521C0015',1.00000000,'2025-05-28 00:00:00.000'),
(9106000500010061,'677416091484233','MPO482025051800001',10,'3521C0015',1.00000000,'2025-05-28 00:00:00.000'),
(9106000500010062,'689366516133957','MPO482025062100002',1,'3151C0034',1.00000000,'2025-06-27 00:00:00.000'),
(9106000500010063,'689366516133958','MPO482025062100002',2,'3151C0034',1.00000000,'2025-06-27 00:00:00.000'),
(9106000500010064,'689366516133959','MPO482025062100002',3,'3151C0034',1.00000000,'2025-06-27 00:00:00.000'),
(9106000500010065,'689366516138053','MPO482025062100002',4,'3151C0034',1.00000000,'2025-06-27 00:00:00.000'),
(9106000500010066,'689366516138054','MPO482025062100002',5,'3151C0034',1.00000000,'2025-06-27 00:00:00.000'),
(9106000500010067,'689366516138055','MPO482025062100002',6,'3521C0016',1.00000000,'2025-06-27 00:00:00.000'),
(9106000500010068,'689366516138056','MPO482025062100002',7,'3521C0016',1.00000000,'2025-06-27 00:00:00.000'),
(9106000500010069,'689366516142149','MPO482025062100002',8,'3521C0016',1.00000000,'2025-06-27 00:00:00.000'),
(9106000500010070,'689366516142150','MPO482025062100002',9,'3521C0016',1.00000000,'2025-06-27 00:00:00.000'),
(9106000500010071,'689366516142151','MPO482025062100002',10,'3521C0016',1.00000000,'2025-06-27 00:00:00.000'),
(9106000500010072,'689366516142152','MPO482025062100002',11,'3521C0016',1.00000000,'2025-06-27 00:00:00.000'),
(9106000500010073,'689366516142153','MPO482025062100002',12,'3521C0016',1.00000000,'2025-06-27 00:00:00.000'),
(9106000500010074,'689369829818437','MPO482025062100003',1,'3521C0016',1.00000000,'2025-06-27 00:00:00.000'),
(9106000500010075,'689369829818438','MPO482025062100003',2,'3521C0016',1.00000000,'2025-06-27 00:00:00.000'),
(9106000500010076,'689369829818439','MPO482025062100003',3,'3521C0016',1.00000000,'2025-06-27 00:00:00.000'),
(9106000500010077,'689369829818440','MPO482025062100003',4,'352AD0A',1.00000000,'2025-06-27 00:00:00.000'),
(9106000500010078,'689369829822533','MPO482025062100003',5,'352AD0A',1.00000000,'2025-06-27 00:00:00.000'),
(9106000500010079,'689369829822534','MPO482025062100003',6,'352AD0A',1.00000000,'2025-06-27 00:00:00.000'),
(9106000500010080,'689369829822535','MPO482025062100003',7,'352AD0A',1.00000000,'2025-06-27 00:00:00.000'),
(9106000500010081,'689369829822536','MPO482025062100003',8,'352AD0A',1.00000000,'2025-06-27 00:00:00.000'),
(9106000500010082,'689369829826629','MPO482025062100003',9,'352AD0A',1.00000000,'2025-06-27 00:00:00.000'),
(9106000500010083,'689369829826630','MPO482025062100003',10,'352AD0A',1.00000000,'2025-06-27 00:00:00.000'),
(9106000500010084,'689369829826631','MPO482025062100003',11,'352AD0A',1.00000000,'2025-06-27 00:00:00.000'),
(9106000500010085,'689369829826632','MPO482025062100003',12,'352AD0A',1.00000000,'2025-06-27 00:00:00.000'),
(9106000500010086,'689369829826633','MPO482025062100003',13,'352AD0A',1.00000000,'2025-06-27 00:00:00.000'),
(9106000500010087,'691329582436421','MPO482025062600003',1,'91CC0178',4000.00000000,'2025-07-04 00:00:00.000'),
(9106000500010088,'691329582436422','MPO482025062600003',2,'91CC0285',2000.00000000,'2025-07-04 00:00:00.000'),
(9106000500010089,'691329582436423','MPO482025062600003',3,'91CC0286',4000.00000000,'2025-07-04 00:00:00.000'),
(9106000500010090,'691329582440517','MPO482025062600003',4,'A2B8361',4000.00000000,'2025-07-04 00:00:00.000'),
(9106000500010091,'708842858610757','MPO482025081500001',1,'1A0C273',200.00000000,'2025-08-21 00:00:00.000'),
(9106000500010092,'708842858610758','MPO482025081500001',2,'1A0C275',272.00000000,'2025-08-21 00:00:00.000'),
(9106000500010093,'708842858610759','MPO482025081500001',3,'1A004C4',960000.00000000,'2025-08-21 00:00:00.000'),
(9106000500010094,'708842858610760','MPO482025081500001',4,'ABC419',1000.00000000,'2025-08-20 00:00:00.000'),
(9106000500010095,'708842858610761','MPO482025081500001',5,'ABC431',2000.00000000,'2025-08-20 00:00:00.000'),
(9106000500010096,'708842858610762','MPO482025081500001',6,'1A0C432',1000.00000000,'2025-08-26 00:00:00.000'),
(9106000500010097,'708842858610763','MPO482025081500001',7,'1A0C588',29000.00000000,'2025-08-27 00:00:00.000'),
(9106000500010098,'708842858614853','MPO482025081500001',8,'1A0C595',670000.00000000,'2025-08-26 00:00:00.000'),
(9106000500010099,'708842858614854','MPO482025081500001',9,'AB32A4',111.00000000,'2025-08-27 00:00:00.000'),
(9106000500010100,'708853132763205','MPO482025081500002',1,'A21C092',550.00000000,'2025-08-27 00:00:00.000'),
(9106000500010101,'708853132763206','MPO482025081500002',2,'A21C093',60.00000000,'2025-08-28 00:00:00.000'),
(9106000500010102,'708853132763207','MPO482025081500002',3,'91B0D033',38.00000000,'2025-08-28 00:00:00.000'),
(9106000500010103,'708853132767301','MPO482025081500002',4,'91C0D058',558.00000000,'2025-08-22 00:00:00.000'),
(9106000500010104,'708853132767302','MPO482025081500002',5,'91C0D074',2522.00000000,'2025-08-21 00:00:00.000'),
(9106000500010105,'708853132767303','MPO482025081500002',6,'91C0DA8',69.00000000,'2025-08-27 00:00:00.000'),
(9106000500010106,'708853132771397','MPO482025081500002',7,'93B0D1A',185.00000000,'2025-08-28 00:00:00.000'),
(9106000500010107,'708853132771398','MPO482025081500002',8,'91CC0123',2.00000000,'2025-08-28 00:00:00.000'),
(9106000500010108,'708853132771399','MPO482025081500002',9,'91CC0229',862.00000000,'2025-08-28 00:00:00.000'),
(9106000500010109,'708853132771400','MPO482025081500002',10,'91CC0262',200.00000000,'2025-08-28 00:00:00.000'),
(9106000500010110,'708853132771401','MPO482025081500002',11,'91CC0286',3000.00000000,'2025-08-27 00:00:00.000'),
(9106000500010111,'708853132775493','MPO482025081500002',12,'91CC0312',300.00000000,'2025-08-28 00:00:00.000'),
(9106000500010112,'708853132775494','MPO482025081500002',13,'91C0DD4',100.00000000,'2025-08-22 00:00:00.000'),
(9106000500010113,'708853132775495','MPO482025081500002',14,'91CC0412',58.00000000,'2025-08-28 00:00:00.000'),
(9106000500010114,'708853132775496','MPO482025081500002',15,'91C0DE2',400.00000000,'2025-08-28 00:00:00.000'),
(9106000500010115,'708853132775497','MPO482025081500002',16,'91C0DE3',1050.00000000,'2025-08-28 00:00:00.000'),
(9106000500010116,'708853132779589','MPO482025081500002',17,'91C0DE6',400.00000000,'2025-08-28 00:00:00.000'),
(9106000500010117,'708853132779590','MPO482025081500002',18,'91C0DE7',1000.00000000,'2025-08-21 00:00:00.000'),
(9106000500010118,'708853132779591','MPO482025081500002',19,'91C0DE9',350.00000000,'2025-08-28 00:00:00.000'),
(9106000500010119,'708853132779592','MPO482025081500002',20,'91C0D5A',1100.00000000,'2025-08-21 00:00:00.000'),
(9106000500010120,'708853132779593','MPO482025081500002',21,'91CC0518',1250.00000000,'2025-08-27 00:00:00.000'),
(9106000500010121,'708853132783685','MPO482025081500002',22,'91CC0521',3000.00000000,'2025-08-27 00:00:00.000'),
(9106000500010122,'708853132783686','MPO482025081500002',23,'91CC0524',1500.00000000,'2025-08-29 00:00:00.000'),
(9106000500010123,'708853132783687','MPO482025081500002',24,'91CC0525',3000.00000000,'2025-08-27 00:00:00.000'),
(9106000500010124,'708853132783688','MPO482025081500002',25,'91FC0339',600.00000000,'2025-08-27 00:00:00.000'),
(9106000500010125,'708853132783689','MPO482025081500002',26,'1AB9259',5000.00000000,'2025-08-21 00:00:00.000'),
(9106000500010126,'708853132783690','MPO482025081500002',27,'3124C0015',8000.00000000,'2025-08-28 00:00:00.000'),
(9106000500010127,'708853132787781','MPO482025081500002',28,'3151C0032',1.00000000,'2025-08-28 00:00:00.000'),
(9106000500010128,'708853132787782','MPO482025081500002',29,'1A0C452',1000.00000000,'2025-08-28 00:00:00.000'),
(9106000500010129,'708853132787783','MPO482025081500002',30,'1A03G82',3000.00000000,'2025-08-27 00:00:00.000'),
(9106000500010130,'708853132787784','MPO482025081500002',31,'91CC0319',160000.00000000,'2025-08-28 00:00:00.000'),
(9106000500010131,'708853132787785','MPO482025081500002',32,'AB37A2',16000.00000000,'2025-08-27 00:00:00.000'),
(9106000500010132,'708853132791877','MPO482025081500002',33,'91CC0248',500.00000000,'2025-08-27 00:00:00.000'),
(9106000500010133,'708853132791878','MPO482025081500002',34,'91C00EN',60000.00000000,'2025-08-21 00:00:00.000'),
(9106000500010134,'708853132791879','MPO482025081500002',35,'AB37A3',130000.00000000,'2025-08-28 00:00:00.000'),
(9106000500010135,'708853132791880','MPO482025081500002',36,'91CC0517',100.00000000,'2025-08-28 00:00:00.000'),
(9106000500010136,'708853132791881','MPO482025081500002',37,'3151C0034',1.00000000,'2025-08-26 00:00:00.000'),
(9106000500010137,'708853132791882','MPO482025081500002',38,'3151C0034',1.00000000,'2025-08-27 00:00:00.000'),
(9106000500010138,'708853132791883','MPO482025081500002',39,'3151C0034',1.00000000,'2025-08-27 00:00:00.000'),
(9106000500010139,'708853132791884','MPO482025081500002',40,'3151C0034',1.00000000,'2025-08-27 00:00:00.000'),
(9106000500010140,'708853132791885','MPO482025081500002',41,'3151C0034',1.00000000,'2025-08-20 00:00:00.000'),
(9106000500010141,'708853132795973','MPO482025081500002',42,'3151C0033',1.00000000,'2025-08-27 00:00:00.000'),
(9106000500010142,'708853132795974','MPO482025081500002',43,'3151C0033',1.00000000,'2025-08-20 00:00:00.000'),
(9106000500010143,'708853132795975','MPO482025081500002',44,'3151C0033',1.00000000,'2025-08-20 00:00:00.000'),
(9106000500010144,'708853132795976','MPO482025081500002',45,'3151C0033',1.00000000,'2025-08-20 00:00:00.000'),
(9106000500010145,'708853132795977','MPO482025081500002',46,'3151C0033',1.00000000,'2025-08-20 00:00:00.000'),
(9106000500010146,'708853132795978','MPO482025081500002',47,'3151C0033',1.00000000,'2025-08-20 00:00:00.000'),
(9106000500010147,'708853132795979','MPO482025081500002',48,'3151C0033',1.00000000,'2025-08-27 00:00:00.000'),
(9106000500010148,'708853132795980','MPO482025081500002',49,'3151C0033',1.00000000,'2025-08-26 00:00:00.000'),
(9106000500010149,'708853132795981','MPO482025081500002',50,'3521C0015',1.00000000,'2025-08-26 00:00:00.000'),
(9106000500010150,'708853132795982','MPO482025081500002',51,'3521C0015',1.00000000,'2025-08-19 00:00:00.000'),
(9106000500010151,'708853132795983','MPO482025081500002',52,'3521C0015',1.00000000,'2025-08-20 00:00:00.000'),
(9106000500010152,'708853132800069','MPO482025081500002',53,'3521C0015',1.00000000,'2025-08-27 00:00:00.000'),
(9106000500010153,'708853132800070','MPO482025081500002',54,'3521C0015',1.00000000,'2025-08-27 00:00:00.000'),
(9106000500010154,'708853132800071','MPO482025081500002',55,'3521C0015',1.00000000,'2025-08-20 00:00:00.000'),
(9106000500010155,'708853132800072','MPO482025081500002',56,'3521C0015',1.00000000,'2025-08-26 00:00:00.000'),
(9106000500010156,'708853132800073','MPO482025081500002',57,'3521C0015',1.00000000,'2025-08-20 00:00:00.000'),
(9106000500010157,'708853132800074','MPO482025081500002',58,'3521C0015',1.00000000,'2025-08-27 00:00:00.000'),
(9106000500010158,'708853132800075','MPO482025081500002',59,'3521C0015',1.00000000,'2025-08-27 00:00:00.000'),
(9106000500010159,'708853132800076','MPO482025081500002',60,'3521C0015',1.00000000,'2025-08-26 00:00:00.000'),
(9106000500010160,'708853132800077','MPO482025081500002',61,'3521C0015',1.00000000,'2025-08-19 00:00:00.000'),
(9106000500010161,'708853132804165','MPO482025081500002',62,'3521C0015',1.00000000,'2025-08-26 00:00:00.000'),
(9106000500010162,'713850861281349','MPO482025082900002',1,'91C0D2G',5000.00000000,'2025-08-31 00:00:00.000'),
(9106000500010163,'713850861281350','MPO482025082900002',2,'93BC0311',510.00000000,'2025-08-30 00:00:00.000'),
(9106000500010164,'713850861281351','MPO482025082900002',3,'91CC0312',500.00000000,'2025-08-30 00:00:00.000'),
(9106000500010165,'713850861285445','MPO482025082900002',4,'91CC0233',400.00000000,'2025-08-30 00:00:00.000'),
(9106000500010166,'713850861285446','MPO482025082900002',5,'91CC0232',1500.00000000,'2025-08-30 00:00:00.000'),
(9106000500010167,'716009096228933','MPO482025090400005',1,'91CC0312',5000.00000000,'2025-09-30 00:00:00.000'),
(9106000500010168,'716009096228934','MPO482025090400005',2,'93BC0311',5000.00000000,'2025-09-30 00:00:00.000'),
(9106000500010169,'720949568118853','MPO482025091800003',1,'91CC0483',1900.00000000,'2025-09-30 00:00:00.000'),
(9106000500010170,'720949568118854','MPO482025091800003',2,'91CC0312',100.00000000,'2025-09-25 00:00:00.000'),
(9106000500010171,'720949568118855','MPO482025091800003',3,'93BC0311',600.00000000,'2025-09-30 00:00:00.000'),
(9106000500010172,'720949568122949','MPO482025091800003',4,'91CC0313',100.00000000,'2025-09-29 00:00:00.000'),
(9106000500010173,'720949568122950','MPO482025091800003',5,'91CC0229',700.00000000,'2025-09-30 00:00:00.000'),
(9106000500010174,'721256689414213','MPO482025091900001',1,'91CC0182',10000.00000000,'2025-09-30 00:00:00.000'),
(9106000500010175,'721256689414214','MPO482025091900001',2,'312CD009',10000.00000000,'2025-09-30 00:00:00.000'),
(9106000500010176,'721256689414215','MPO482025091900001',3,'3123C0012',10000.00000000,'2025-09-30 00:00:00.000'),
(9106000500010177,'721256689414216','MPO482025091900001',4,'3123C0026',3000.00000000,'2025-09-30 00:00:00.000'),
(9106000500010178,'721256689414217','MPO482025091900001',5,'3123C0027',3000.00000000,'2025-09-30 00:00:00.000'),
(9106000500010179,'721256689418309','MPO482025091900001',6,'3123C0028',3000.00000000,'2025-09-30 00:00:00.000'),
(9106000500010180,'721256689418310','MPO482025091900001',7,'3123C0035',10000.00000000,'2025-09-30 00:00:00.000'),
(9106000500010181,'721256689418311','MPO482025091900001',8,'3123C0046',3000.00000000,'2025-09-30 00:00:00.000'),
(9106000500010182,'721256689422405','MPO482025091900001',9,'3123C0047',3000.00000000,'2025-09-30 00:00:00.000'),
(9106000500010183,'721256689422406','MPO482025091900001',10,'3123C0048',3000.00000000,'2025-09-30 00:00:00.000'),
(9106000500010184,'721256689422407','MPO482025091900001',11,'3521C0015',1.00000000,'2025-09-30 00:00:00.000'),
(9106000500010185,'721256689422408','MPO482025091900001',12,'3521C0015',1.00000000,'2025-09-30 00:00:00.000'),
(9106000500010186,'721256689426501','MPO482025091900001',13,'3521C0015',1.00000000,'2025-09-30 00:00:00.000'),
(9106000500010187,'721256689426502','MPO482025091900001',14,'3521C0015',1.00000000,'2025-09-30 00:00:00.000'),
(9106000500010188,'721256689426503','MPO482025091900001',15,'3521C0016',1.00000000,'2025-09-24 00:00:00.000'),
(9106000500010189,'721256689426504','MPO482025091900001',16,'3521C0016',1.00000000,'2025-09-25 00:00:00.000'),
(9106000500010190,'721256689426505','MPO482025091900001',17,'3521C0016',1.00000000,'2025-09-25 00:00:00.000'),
(9106000500010191,'721256689430597','MPO482025091900001',18,'3521C0016',1.00000000,'2025-09-30 00:00:00.000'),
(9106000500010192,'721256689430598','MPO482025091900001',19,'3521C0016',1.00000000,'2025-09-30 00:00:00.000'),
(9106000500010193,'721256689430599','MPO482025091900001',20,'3521C0016',1.00000000,'2025-09-30 00:00:00.000'),
(9106000500010194,'721256689430600','MPO482025091900001',21,'3521C0015',1.00000000,'2025-09-30 00:00:00.000'),
(9106000500010195,'721256689434693','MPO482025091900001',22,'3521C0015',1.00000000,'2025-09-30 00:00:00.000'),
(9106000500010196,'721256689434694','MPO482025091900001',23,'3521C0015',1.00000000,'2025-09-30 00:00:00.000'),
(9106000500010197,'721256689434695','MPO482025091900001',24,'3521C0015',1.00000000,'2025-09-30 00:00:00.000'),
(9106000500010198,'721256689434696','MPO482025091900001',25,'3521C0015',1.00000000,'2025-09-30 00:00:00.000'),
(9106000500010199,'721256689438789','MPO482025091900001',26,'3521C0015',1.00000000,'2025-09-30 00:00:00.000'),
(9106000500010200,'721256689438790','MPO482025091900001',27,'3521C0015',1.00000000,'2025-09-30 00:00:00.000'),
(9106000500010201,'722351552172101','MPO482025092200002',1,'91CC0283',20000.00000000,'2025-09-30 00:00:00.000'),
(9106000500010202,'765148661813317','MPO482026012100001',1,'1A0044F',1000.00000000,'2026-01-25 00:00:00.000'),
(9106000500010203,'765148661813318','MPO482026012100001',2,'1A0045H',1000.00000000,'2026-01-25 00:00:00.000'),
(9106000500010204,'765148661813319','MPO482026012100001',3,'1A0047E',1000.00000000,'2026-01-25 00:00:00.000'),
(9106000500010205,'769809191923781','MPO482026020300001',1,'1A0044F',100.00000000,'2026-02-09 00:00:00.000'),
(9106000500010206,'1958480382326104095','SO241020240923001',1,'91CC0232',400.00000000,'2024-09-23 17:36:13.000'),
(9106000500010207,'1958480382326104096','SO241020240923001',2,'91CC0287',567.00000000,'2024-09-23 17:36:23.000'),
(9106000500010208,'1958480382326104097','SO241020240923001',3,'91CC0288',256.00000000,'2024-09-23 17:36:38.000'),
(9106000500010209,'1958480382326104098','SO241020240923001',4,'91C0D3A',400.00000000,'2024-09-23 17:36:55.000'),
(9106000500010210,'1958480382326104099','SO241020240923001',5,'91CC0312',590.00000000,'2024-09-23 17:37:10.000'),
(9106000500010211,'1958480382326104100','SO241020240923001',6,'91DC0219',1216.00000000,'2024-09-23 17:37:40.000'),
(9106000500010212,'1958480382326104101','SO241020240923001',7,'91DC0284',1104.00000000,'2024-09-23 17:37:58.000'),
(9106000500010213,'1958480382326104102','SO241020240923001',8,'91DC0292',1415.00000000,'2024-09-23 17:38:21.000'),
(9106000500010214,'1958480382326104103','SO241020240923001',9,'91C0DC8',1200.00000000,'2024-09-23 17:53:47.000'),
(9106000500010215,'1958480382326104104','SO241020240923001',10,'1A03D23',511.00000000,'2024-09-23 17:54:41.000'),
(9106000500010216,'1958480382326104105','SO241020240923001',11,'91CC0228',1695.00000000,'2024-09-23 17:54:51.000'),
(9106000500010217,'1958480382326104106','SO241020240923001',12,'91DC0213',210.00000000,'2024-09-24 09:07:26.000'),
(9106000500010218,'1958480382326104265','SO241020241014001',1,'AB04C1',100.00000000,'2024-10-14 16:24:39.000'),
(9106000500010219,'1958480382326104266','SO241020241014001',2,'1AB2737',66.00000000,'2024-10-14 16:24:52.000'),
(9106000500010220,'1958480382326104267','SO241020241014001',3,'A2B5613',190.00000000,'2024-10-14 16:25:17.000'),
(9106000500010221,'1958480382326104268','SO241020241014001',4,'1A03G94',83.00000000,'2024-10-14 16:25:40.000'),
(9106000500010222,'1958480382326104269','SO241020241014001',5,'1A03G96',4208.00000000,'2024-10-14 16:25:51.000'),
(9106000500010223,'1958480382326104270','SO241020241014001',6,'AB37A2',1000.00000000,'2024-10-14 16:26:17.000'),
(9106000500010224,'1958480382326104271','SO241020241014001',7,'A2C7113',115000.00000000,'2024-10-14 16:26:36.000'),
(9106000500010225,'1958480382326104272','SO241020241014001',8,'A2C7114',120000.00000000,'2024-10-14 16:28:00.000'),
(9106000500010226,'1958480382326104273','SO241020241014001',9,'A2C7115',280000.00000000,'2024-10-14 16:28:17.000'),
(9106000500010227,'1958480382326104274','SO241020241014001',10,'A2C7116',10000.00000000,'2024-10-14 16:28:31.000'),
(9106000500010228,'1958480382326104275','SO241020241014001',11,'A2C7117',30000.00000000,'2024-10-14 16:28:44.000'),
(9106000500010229,'1958480382326104276','SO241020241014001',12,'A2B8361',400.00000000,'2024-10-14 16:29:26.000'),
(9106000500010230,'1958480382326104277','SO241020241014001',13,'1AB9259',418.00000000,'2024-10-14 16:29:43.000'),
(9106000500010231,'1958480382326104278','SO241020241014001',14,'A21C096',1088.00000000,'2024-10-14 16:30:04.000'),
(9106000500010232,'1958480382326104279','SO241020241014001',15,'91C0D058',300.00000000,'2024-10-14 16:30:25.000'),
(9106000500010233,'1958480382326104280','SO241020241014001',16,'91CC0283',1107.00000000,'2024-10-14 16:30:41.000'),
(9106000500010234,'1958480382326104286','SO241020241015003',1,'91CC0229',1000.00000000,'2024-10-15 17:40:11.000'),
(9106000500010235,'1958480382326104287','SO241020241015003',2,'91FC0339',600.00000000,'2024-10-15 17:40:33.000'),
(9106000500010236,'1958480382326104288','SO241020241015003',3,'91CC0319',7000.00000000,'2024-10-15 17:40:45.000'),
(9106000500010237,'1958480382326104289','SO241020241015003',4,'91DC0284',1635.00000000,'2024-10-15 17:40:58.000'),
(9106000500010238,'1958480382326104290','SO241020241015003',5,'91DC0219',975.00000000,'2024-10-15 17:41:16.000'),
(9106000500010239,'1958480382326104291','SO241020241015003',6,'91CC0283',368.00000000,'2024-10-15 17:41:28.000'),
(9106000500010240,'1958480382326104292','SO241020241015003',7,'1A03G96',822.00000000,'2024-10-15 17:41:41.000'),
(9106000500010241,'1958480382326104293','SO241020241015003',8,'91C0D2G',1200.00000000,'2024-10-15 17:41:54.000'),
(9106000500010242,'1958480382326104294','SO241020241015003',9,'1A03G82',10000.00000000,'2024-10-15 17:42:06.000'),
(9106000500010243,'1958480382326104295','SO241020241015003',10,'ABC431',6614.00000000,'2024-10-15 17:42:20.000'),
(9106000500010244,'1958480382326104296','SO241020241015003',11,'1A0C432',7810.00000000,'2024-10-15 17:42:33.000'),
(9106000500010245,'1958480382326104297','SO241020241015003',12,'1A0387B',341.00000000,'2024-10-15 17:42:48.000'),
(9106000500010246,'1958480382326104298','SO241020241015003',13,'91C0DC8',400.00000000,'2024-10-15 17:43:01.000'),
(9106000500010247,'1958480382326104299','SO241020241015003',14,'1A03D23',958.00000000,'2024-10-15 17:43:24.000'),
(9106000500010248,'1958480382326104300','SO241020241015003',15,'91CC0235',200.00000000,'2024-10-15 17:43:37.000'),
(9106000500010249,'1958480382326104301','SO241020241015003',16,'91CC0179',300.00000000,'2024-10-15 17:43:54.000'),
(9106000500010250,'1958902016386269185','SO241020241018001',1,'91C0DC9',280.00000000,'2024-10-18 17:34:58.000'),
(9106000500010251,'1958902016386269186','SO241020241018001',2,'ABC431',4000.00000000,'2024-10-18 17:35:20.000'),
(9106000500010252,'1958902016386269187','SO241020241018001',3,'1A0C432',4200.00000000,'2024-10-18 17:35:29.000'),
(9106000500010253,'1958902016386269188','SO241020241018001',4,'1A0C595',200000.00000000,'2024-10-18 17:35:44.000'),
(9106000500010254,'1958902016386269189','SO241020241018001',5,'1A0C689',400.00000000,'2024-10-18 17:36:00.000'),
(9106000500010255,'1958902016386269190','SO241020241018001',6,'1AB2755',101.00000000,'2024-10-18 17:36:12.000'),
(9106000500010256,'1958902016386269191','SO241020241018001',7,'AB3D14',50000.00000000,'2024-10-18 17:36:23.000'),
(9106000500010257,'1958902016386269192','SO241020241018001',8,'A2B5613',1783.00000000,'2024-10-18 17:36:38.000'),
(9106000500010258,'1958902016386269193','SO241020241018001',9,'1A03G96',1473.00000000,'2024-10-18 17:36:50.000'),
(9106000500010259,'1958902016386269194','SO241020241018001',10,'91DC0214',600.00000000,'2024-10-18 17:37:10.000'),
(9106000500010260,'1958902016386269195','SO241020241018001',11,'91DC0219',202.00000000,'2024-10-18 17:37:23.000'),
(9106000500010261,'1958902016386269196','SO241020241018001',12,'AB3B81',256.00000000,'2024-10-18 17:38:03.000'),
(9106000500010262,'1958902016386269197','SO241020241018001',13,'91CC0177',81.00000000,'2024-10-18 17:38:14.000'),
(9106000500010263,'1958902016386269198','SO241020241018001',14,'91C0D2D',400.00000000,'2024-10-18 17:38:28.000'),
(9106000500010264,'1958902016386269199','SO241020241018001',15,'91CC0283',1044.00000000,'2024-10-18 17:38:38.000'),
(9106000500010265,'1958902016386269200','SO241020241018001',16,'91CC0236',400.00000000,'2024-10-18 17:38:50.000'),
(9106000500010266,'1958902016386269201','SO241020241018001',17,'91DC0284',1082.00000000,'2024-10-18 17:39:00.000'),
(9106000500010267,'1958902016386269202','SO241020241018001',18,'91DC0292',202.00000000,'2024-10-18 17:39:14.000'),
(9106000500010268,'1958956122157088769','SO241020241019001',1,'91CC0187',54.00000000,'2024-10-19 16:25:13.000'),
(9106000500010269,'1958956122157088770','SO241020241019001',2,'91FC0339',11.00000000,'2024-10-19 16:25:29.000'),
(9106000500010270,'1958956122157088771','SO241020241019001',3,'91CC0228',131.00000000,'2024-10-19 16:25:40.000'),
(9106000500010271,'1958956122157088772','SO241020241019001',4,'91C0D051',1.00000000,'2024-10-19 16:25:52.000'),
(9106000500010272,'1958956122157088773','SO241020241019001',5,'A21C092',15.00000000,'2024-10-19 16:25:59.000'),
(9106000500010273,'1959718646913695745','SO241020241021002',1,'1A039D8',350.00000000,'2024-10-21 18:33:52.000'),
(9106000500010274,'1959718646913695746','SO241020241021002',2,'91CC0283',716.00000000,'2024-10-21 18:34:04.000'),
(9106000500010275,'1959718646913695747','SO241020241021002',3,'91DC0292',967.00000000,'2024-10-21 18:34:17.000'),
(9106000500010276,'1959718646917890048','SO241020241021002',4,'91DC0284',640.00000000,'2024-10-21 18:53:13.000'),
(9106000500010277,'1959718646917890049','SO241020241021002',5,'1A03D23',1134.00000000,'2024-10-21 18:53:36.000'),
(9106000500010278,'1959718646917890050','SO241020241021002',6,'91CC0229',1800.00000000,'2024-10-21 18:53:49.000'),
(9106000500010279,'1959718646917890051','SO241020241021002',7,'91CC0241',200.00000000,'2024-10-21 18:54:00.000'),
(9106000500010280,'1959718646917890052','SO241020241021002',8,'91CC0278',70.00000000,'2024-10-21 18:54:18.000'),
(9106000500010281,'1959718646917890053','SO241020241021002',9,'91DC0215',587.00000000,'2024-10-21 19:38:04.000'),
(9106000500010282,'1959729971345752064','SO241020241021002',10,'91DC0215',587.00000000,'2024-10-21 19:38:04.000'),
(9106000500010283,'1960006795304894465','SO241020241022001',1,'91CC0235',600.00000000,'2024-10-22 14:01:07.000'),
(9106000500010284,'1963915047889534977','SO241020241102001',1,'91CC0287',313.00000000,'2024-11-02 08:44:39.000'),
(9106000500010285,'1963915047889534978','SO241020241102001',2,'91CC0288',454.00000000,'2024-11-02 08:44:50.000'),
(9106000500010286,'1963915047889534979','SO241020241102001',3,'91CC0319',340.00000000,'2024-11-02 08:45:03.000'),
(9106000500010287,'1963915047889534980','SO241020241102001',4,'91FC0339',900.00000000,'2024-11-02 08:45:17.000'),
(9106000500010288,'1963915047889534981','SO241020241102001',5,'91DC0284',813.00000000,'2024-11-02 08:45:28.000'),
(9106000500010289,'1963915047889534982','SO241020241102001',6,'91DC0218',180.00000000,'2024-11-02 08:45:41.000'),
(9106000500010290,'1963915047889534983','SO241020241102001',7,'91DC0219',92.00000000,'2024-11-02 08:45:54.000'),
(9106000500010291,'1963915047889534984','SO241020241102001',8,'91CC0234',200.00000000,'2024-11-02 08:46:06.000'),
(9106000500010292,'1963915047889534985','SO241020241102001',9,'AB3B81',218.00000000,'2024-11-02 08:46:33.000'),
(9106000500010293,'1963971671127752705','SO241020241102004',1,'A2B4199',1596.00000000,'2024-11-02 12:32:48.000'),
(9106000500010294,'1963971671127752706','SO241020241102004',2,'1A03G96',489.00000000,'2024-11-02 12:33:02.000'),
(9106000500010295,'1963971671127752707','SO241020241102004',3,'AB37A2',2000.00000000,'2024-11-02 12:33:20.000'),
(9106000500010296,'1963971671127752708','SO241020241102004',4,'AB37A3',5000.00000000,'2024-11-02 12:33:30.000'),
(9106000500010297,'1963971671127752709','SO241020241102004',5,'A2C7116',35000.00000000,'2024-11-02 12:33:45.000'),
(9106000500010298,'1963971671127752710','SO241020241102004',6,'A2C7117',15000.00000000,'2024-11-02 12:33:58.000'),
(9106000500010299,'1963971671131947008','SO241020241102004',7,'1A0387B',130.00000000,'2024-11-02 12:34:15.000'),
(9106000500010300,'1963971671131947009','SO241020241102004',8,'91CC0177',300.00000000,'2024-11-02 12:34:28.000'),
(9106000500010301,'1963971671131947010','SO241020241102004',9,'91CC0178',525.00000000,'2024-11-02 12:34:42.000'),
(9106000500010302,'1963971671131947011','SO241020241102004',10,'91CC0179',1200.00000000,'2024-11-02 12:34:55.000'),
(9106000500010303,'1963971671131947012','SO241020241102004',11,'91CC0228',2367.00000000,'2024-11-02 12:35:09.000'),
(9106000500010304,'1964653664643579905','SO241020241104001',1,'91CC0229',900.00000000,'2024-11-04 09:41:34.000'),
(9106000500010305,'1964653664643579906','SO241020241104001',2,'AB3A76',1815.00000000,'2024-11-04 09:41:49.000'),
(9106000500010306,'1964653664643579907','SO241020241104001',3,'A2B8414',300.00000000,'2024-11-04 09:41:59.000'),
(9106000500010307,'1964653664643579908','SO241020241104001',4,'91DC0284',263.00000000,'2024-11-04 09:43:50.000'),
(9106000500010308,'1964653664643579909','SO241020241104001',5,'91F0D061',121.00000000,'2024-11-04 09:44:13.000'),
(9106000500010309,'1964653664643579910','SO241020241104001',6,'91DC0219',2030.00000000,'2024-11-04 09:44:50.000'),
(9106000500010310,'1964653664643579911','SO241020241104001',7,'91DC0218',318.00000000,'2024-11-04 09:45:09.000'),
(9106000500010311,'1964653664643579912','SO241020241104001',8,'91CC0231',200.00000000,'2024-11-04 09:45:30.000'),
(9106000500010312,'1964653664643579913','SO241020241104001',9,'91CC0233',800.00000000,'2024-11-04 09:45:42.000'),
(9106000500010313,'1981045424231809025','SO241020241219001',1,'91DC0218',400.00000000,'2024-12-19 15:13:21.000'),
(9106000500010314,'1981045424231809026','SO241020241219001',2,'91DC0219',1312.00000000,'2024-12-19 15:13:31.000'),
(9106000500010315,'1981045424231809027','SO241020241219001',3,'1A004C4',436000.00000000,'2024-12-19 15:14:15.000'),
(9106000500010316,'1981045424231809028','SO241020241219001',4,'ABC419',3200.00000000,'2024-12-19 15:14:29.000'),
(9106000500010317,'1981045424231809029','SO241020241219001',5,'ABC431',1600.00000000,'2024-12-19 15:14:42.000'),
(9106000500010318,'1981045424231809030','SO241020241219001',6,'1A0C432',1400.00000000,'2024-12-19 15:14:53.000'),
(9106000500010319,'1981045424231809031','SO241020241219001',7,'1A0044F',1753.00000000,'2024-12-19 15:15:05.000'),
(9106000500010320,'1981045424231809032','SO241020241219001',8,'1A03D23',743.00000000,'2024-12-19 15:15:19.000'),
(9106000500010321,'1981045424231809033','SO241020241219001',9,'A2B4199',1746.00000000,'2024-12-19 15:15:32.000'),
(9106000500010322,'1981045424231809034','SO241020241219001',10,'1A03G96',1960.00000000,'2024-12-19 15:15:46.000'),
(9106000500010323,'1981045424231809035','SO241020241219001',11,'A2B8184',100.00000000,'2024-12-19 15:15:59.000'),
(9106000500010324,'1981045424231809036','SO241020241219001',12,'A2B8361',400.00000000,'2024-12-19 15:16:10.000'),
(9106000500010325,'1981045424231809037','SO241020241219001',13,'91CC0188',1700.00000000,'2024-12-19 15:16:23.000'),
(9106000500010326,'1981045424231809038','SO241020241219001',14,'91CC0228',2315.00000000,'2024-12-19 15:16:34.000'),
(9106000500010327,'1981045424231809039','SO241020241219001',15,'91CC0232',800.00000000,'2024-12-19 15:16:46.000'),
(9106000500010328,'1981045424231809040','SO241020241219001',16,'91CC0233',400.00000000,'2024-12-19 15:16:57.000'),
(9106000500010329,'1981045424231809041','SO241020241219001',17,'91CC0234',100.00000000,'2024-12-19 15:17:08.000'),
(9106000500010330,'1981045424231809042','SO241020241219001',18,'91CC0283',1890.00000000,'2024-12-19 15:17:24.000'),
(9106000500010331,'1981045424231809043','SO241020241219001',19,'91CC0319',3500.00000000,'2024-12-19 15:17:36.000'),
(9106000500010332,'1990491416446369793','SO241020250114003',1,'1A03G94',1686.00000000,'2025-01-14 16:53:10.000'),
(9106000500010333,'1990491416446369794','SO241020250114003',2,'AB37A3',2000.00000000,'2025-01-14 16:53:26.000'),
(9106000500010334,'1990491416446369795','SO241020250114003',3,'A2B8361',400.00000000,'2025-01-14 16:53:37.000'),
(9106000500010335,'1990491416446369796','SO241020250114003',4,'1AB9275',1017.00000000,'2025-01-14 16:53:48.000'),
(9106000500010336,'1990491416446369797','SO241020250114003',5,'A21C092',2063.00000000,'2025-01-14 16:53:59.000'),
(9106000500010337,'1990491416446369798','SO241020250114003',6,'A21C096',1000.00000000,'2025-01-14 16:54:12.000'),
(9106000500010338,'1990491416446369799','SO241020250114003',7,'91C0D051',299.00000000,'2025-01-14 16:54:35.000'),
(9106000500010339,'1990491416446369800','SO241020250114003',8,'91C0D053',300.00000000,'2025-01-14 16:54:50.000'),
(9106000500010340,'1990491416446369801','SO241020250114003',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
(9106000500020002,9106000500040002,'604438178041925','MPO482024102400001','M500029670','94000292',4500.0000000000),
(9106000500020003,9106000500040003,'604438178041926','MPO482024102400001','M500029671','1004023',3500.0000000000),
(9106000500020004,9106000500040004,'604438178046021','MPO482024102400001','M500029672','1000329',400000.0000000000),
(9106000500020005,9106000500040005,'604438178046022','MPO482024102400001','M500029673','1000655',100000.0000000000),
(9106000500020006,9106000500040006,'604438178046023','MPO482024102400001','M500029674','1007114',250000.0000000000),
(9106000500020007,9106000500040007,'604438178046024','MPO482024102400001','M500029675','1007115',600000.0000000000),
(9106000500020008,9106000500040008,'604438178050117','MPO482024102400001','M500029676','1004199',6000.0000000000),
(9106000500020009,9106000500040009,'604438178050118','MPO482024102400001','M500029677','1000588',10000.0000000000),
(9106000500020010,9106000500040010,'604438178050119','MPO482024102400001','M500029678','1007094',2500.0000000000),
(9106000500020011,9106000500040011,'604438178050120','MPO482024102400001','M500029680','32400015',1470.0000000000),
(9106000500020012,9106000500040012,'604438178054213','MPO482024102400001','M500029682','94000218',800.0000000000),
(9106000500020013,9106000500040013,'618270140751941','MPO482024120200001','M500053217','93000229',60.0000000000),
(9106000500020014,9106000500040014,'618290062549061','MPO482024120200002','M500053390','94000218',2000.0000000000),
(9106000500020015,9106000500040015,'619057595396165','MPO482024120400002','M500055223','93000237',200.0000000000),
(9106000500020016,9106000500040016,'630994145116229','MPO482025010700001','M500061078','1007114',250000.0000000000),
(9106000500020017,9106000500040017,'631069575503941','MPO482025010700002','M500061979','1000329',100000.0000000000),
(9106000500020018,9106000500040018,'631769478479941','MPO482025010900001','M500067184','93000312',500.0000000000),
(9106000500020019,9106000500040019,'631769478479942','MPO482025010900001','M500067185','1004023',600.0000000000),
(9106000500020020,9106000500040020,'631769478484037','MPO482025010900001','M500067186','93000231',100.0000000000),
(9106000500020021,9106000500040021,'631769478484038','MPO482025010900001','M500067187','93000286',800.0000000000),
(9106000500020022,9106000500040022,'632121332793413','MPO482025011000001','M500068611','93000058',400.0000000000),
(9106000500020023,9106000500040023,'632124508205125','MPO482025011000002','M500068948','1008361',1000.0000000000),
(9106000500020024,9106000500040024,'632125640785989','MPO482025011000003','M500069117','1008184',700.0000000000),
(9106000500020025,9106000500040025,'633173731577925','MPO482025011300002','M500070459','1004199',4000.0000000000),
(9106000500020026,9106000500040026,'633178120278085','MPO482025011300003','M500070619','1004023',5000.0000000000),
(9106000500020027,9106000500040027,'633197803688005','MPO482025011300005','M500070942','1000431',10000.0000000000),
(9106000500020028,9106000500040028,'633197803688006','MPO482025011300005','M500070943','1000432',10000.0000000000),
(9106000500020029,9106000500040029,'633206945230917','MPO482025011300006','M500070944','1000419',35000.0000000000),
(9106000500020030,9106000500040030,'633515239526469','MPO482025011400001','M500072258','1000293',650000.0000000000),
(9106000500020031,9106000500040031,'633515239526470','MPO482025011400001','M500072259','1000329',200000.0000000000),
(9106000500020032,9106000500040032,'633520970641477','MPO482025011400002','M500072882','94000215',1500.0000000000),
(9106000500020033,9106000500040033,'646977501577285','MPO482025022100001','M500085317','93000179',5000.0000000000),
(9106000500020034,9106000500040034,'646977501577286','MPO482025022100001','M500085321','35100015',1.0000000000),
(9106000500020035,9106000500040035,'646977501581381','MPO482025022100001','M500085326','35100016',1.0000000000),
(9106000500020036,9106000500040036,'646977501581382','MPO482025022100001','M500085328','93000187',5000.0000000000),
(9106000500020037,9106000500040037,'646977501581383','MPO482025022100001','M500085329','93000233',1500.0000000000),
(9106000500020038,9106000500040038,'646977501581384','MPO482025022100001','M500085330','94000218',3000.0000000000),
(9106000500020039,9106000500040039,'646977501581385','MPO482025022100001','M500085331','1010096',10000.0000000000),
(9106000500020040,9106000500040040,'659719952244805','MPO482025032900001','M500089559','93000177',5000.0000000000),
(9106000500020041,9106000500040041,'659719952244806','MPO482025032900001','M500089562','32100034',11000.0000000000),
(9106000500020042,9106000500040042,'659719952248901','MPO482025032900001','M500089566','35100015',1.0000000000),
(9106000500020043,9106000500040043,'659719952248902','MPO482025032900001','M500089568','94000217',2000.0000000000),
(9106000500020044,9106000500040044,'659719952248903','MPO482025032900001','M500089569','94000219',9000.0000000000),
(9106000500020045,9106000500040045,'659719952248904','MPO482025032900001','M500089570','93000240',2000.0000000000),
(9106000500020046,9106000500040046,'659719952252997','MPO482025032900001','M500089573','1007111',200000.0000000000),
(9106000500020047,9106000500040047,'665010090852421','MPO482025041300001','M500090472','35100010',1.0000000000),
(9106000500020048,9106000500040048,'665010090852422','MPO482025041300001','M500090473','35100014',1.0000000000),
(9106000500020049,9106000500040049,'665010090852423','MPO482025041300001','M500090474','35100033',1.0000000000),
(9106000500020050,9106000500040050,'665010090856517','MPO482025041300001','M500090475','35100034',1.0000000000),
(9106000500020051,9106000500040051,'670272721616965','MPO482025042800001','M500093527','32100031',7000.0000000000),
(9106000500020052,9106000500040052,'677416091480133','MPO482025051800001','M500101110','35100015',1.0000000000),
(9106000500020053,9106000500040053,'677416091480134','MPO482025051800001','M500101111','35100015',1.0000000000),
(9106000500020054,9106000500040054,'677416091480135','MPO482025051800001','M500101112','35100015',1.0000000000),
(9106000500020055,9106000500040055,'677416091480136','MPO482025051800001','M500101113','35100015',1.0000000000),
(9106000500020056,9106000500040056,'677416091480137','MPO482025051800001','M500101114','35100015',1.0000000000),
(9106000500020057,9106000500040057,'677416091484229','MPO482025051800001','M500101115','35100015',1.0000000000),
(9106000500020058,9106000500040058,'677416091484230','MPO482025051800001','M500101116','35100015',1.0000000000),
(9106000500020059,9106000500040059,'677416091484231','MPO482025051800001','M500101117','35100015',1.0000000000),
(9106000500020060,9106000500040060,'677416091484232','MPO482025051800001','M500101118','35100015',1.0000000000),
(9106000500020061,9106000500040061,'677416091484233','MPO482025051800001','M500101119','35100015',1.0000000000),
(9106000500020062,9106000500040062,'689366516133957','MPO482025062100002','M500108428','35100034',1.0000000000),
(9106000500020063,9106000500040063,'689366516133958','MPO482025062100002','M500108429','35100034',1.0000000000),
(9106000500020064,9106000500040064,'689366516133959','MPO482025062100002','M500108430','35100034',1.0000000000),
(9106000500020065,9106000500040065,'689366516138053','MPO482025062100002','M500108431','35100034',1.0000000000),
(9106000500020066,9106000500040066,'689366516138054','MPO482025062100002','M500108432','35100034',1.0000000000),
(9106000500020067,9106000500040067,'689366516138055','MPO482025062100002','M500108433','35100016',1.0000000000),
(9106000500020068,9106000500040068,'689366516138056','MPO482025062100002','M500108434','35100016',1.0000000000),
(9106000500020069,9106000500040069,'689366516142149','MPO482025062100002','M500108435','35100016',1.0000000000),
(9106000500020070,9106000500040070,'689366516142150','MPO482025062100002','M500108436','35100016',1.0000000000),
(9106000500020071,9106000500040071,'689366516142151','MPO482025062100002','M500108437','35100016',1.0000000000),
(9106000500020072,9106000500040072,'689366516142152','MPO482025062100002','M500108438','35100016',1.0000000000),
(9106000500020073,9106000500040073,'689366516142153','MPO482025062100002','M500108439','35100016',1.0000000000),
(9106000500020074,9106000500040074,'689369829818437','MPO482025062100003','M500108487','35100016',1.0000000000),
(9106000500020075,9106000500040075,'689369829818438','MPO482025062100003','M500108488','35100016',1.0000000000),
(9106000500020076,9106000500040076,'689369829818439','MPO482025062100003','M500108489','35100016',1.0000000000),
(9106000500020077,9106000500040077,'689369829818440','MPO482025062100003','M500108490','35100010',1.0000000000),
(9106000500020078,9106000500040078,'689369829822533','MPO482025062100003','M500108491','35100010',1.0000000000),
(9106000500020079,9106000500040079,'689369829822534','MPO482025062100003','M500108492','35100010',1.0000000000),
(9106000500020080,9106000500040080,'689369829822535','MPO482025062100003','M500108493','35100010',1.0000000000),
(9106000500020081,9106000500040081,'689369829822536','MPO482025062100003','M500108494','35100010',1.0000000000),
(9106000500020082,9106000500040082,'689369829826629','MPO482025062100003','M500108495','35100010',1.0000000000),
(9106000500020083,9106000500040083,'689369829826630','MPO482025062100003','M500108496','35100010',1.0000000000),
(9106000500020084,9106000500040084,'689369829826631','MPO482025062100003','M500108497','35100010',1.0000000000),
(9106000500020085,9106000500040085,'689369829826632','MPO482025062100003','M500108498','35100010',1.0000000000),
(9106000500020086,9106000500040086,'689369829826633','MPO482025062100003','M500108499','35100010',1.0000000000),
(9106000500020087,9106000500040087,'691329582436421','MPO482025062600003','M500109125','93000178',3000.0000000000),
(9106000500020088,9106000500040088,'691329582436422','MPO482025062600003','M500109128','32400038',3100.0000000000),
(9106000500020089,9106000500040089,'691329582436423','MPO482025062600003','M500109132','32400015',5100.0000000000),
(9106000500020090,9106000500040090,'691329582440517','MPO482025062600003','M500109134','1008361',4000.0000000000),
(9106000500020091,9106000500040091,'708842858610757','MPO482025081500001','M500123310','1000273',200.0000000000),
(9106000500020092,9106000500040092,'708842858610758','MPO482025081500001','M500123311','1000275',272.0000000000),
(9106000500020093,9106000500040093,'708842858610759','MPO482025081500001','M500123312','1000304',360000.0000000000),
(9106000500020094,9106000500040094,'708842858610760','MPO482025081500001','M500123313','1000419',1000.0000000000),
(9106000500020095,9106000500040095,'708842858610761','MPO482025081500001','M500123314','1000431',2000.0000000000),
(9106000500020096,9106000500040096,'708842858610762','MPO482025081500001','M500123315','1000432',-2000.0000000000),
(9106000500020097,9106000500040097,'708842858610763','MPO482025081500001','M500123316','1000588',-29000.0000000000),
(9106000500020098,9106000500040098,'708842858614853','MPO482025081500001','M500123317','1000595',670000.0000000000),
(9106000500020099,9106000500040099,'708842858614854','MPO482025081500001','M500123318','1002104',-113.0000000000),
(9106000500020100,9106000500040100,'708853132763205','MPO482025081500002','M500123386','1010092',550.0000000000),
(9106000500020101,9106000500040101,'708853132763206','MPO482025081500002','M500123387','1010093',1.0000000000),
(9106000500020102,9106000500040102,'708853132763207','MPO482025081500002','M500123388','92000033',38.0000000000),
(9106000500020103,9106000500040103,'708853132767301','MPO482025081500002','M500123389','93000058',558.0000000000),
(9106000500020104,9106000500040104,'708853132767302','MPO482025081500002','M500123390','93000074',2522.0000000000),
(9106000500020105,9106000500040105,'708853132767303','MPO482025081500002','M500123392','35100032',1.0000000000),
(9106000500020106,9106000500040106,'708853132771397','MPO482025081500002','M500123393','93000110',185.0000000000),
(9106000500020107,9106000500040107,'708853132771398','MPO482025081500002','M500123395','93000123',2.0000000000),
(9106000500020108,9106000500040108,'708853132771399','MPO482025081500002','M500123396','93000229',862.0000000000),
(9106000500020109,9106000500040109,'708853132771400','MPO482025081500002','M500123401','32300026',200.0000000000),
(9106000500020110,9106000500040110,'708853132771401','MPO482025081500002','M500123404','32400015',-3015.0000000000),
(9106000500020111,9106000500040111,'708853132775493','MPO482025081500002','M500123405','93000312',300.0000000000),
(9106000500020112,9106000500040112,'708853132775494','MPO482025081500002','M500123407','93000404',500.0000000000),
(9106000500020113,9106000500040113,'708853132775495','MPO482025081500002','M500123408','93000412',800.0000000000),
(9106000500020114,9106000500040114,'708853132775496','MPO482025081500002','M500123409','93000502',400.0000000000),
(9106000500020115,9106000500040115,'708853132775497','MPO482025081500002','M500123411','93000503',1050.0000000000),
(9106000500020116,9106000500040116,'708853132779589','MPO482025081500002','M500123413','93000506',1.0000000000),
(9106000500020117,9106000500040117,'708853132779590','MPO482025081500002','M500123414','93000507',1000.0000000000),
(9106000500020118,9106000500040118,'708853132779591','MPO482025081500002','M500123415','93000509',350.0000000000),
(9106000500020119,9106000500040119,'708853132779592','MPO482025081500002','M500123416','93000510',1100.0000000000),
(9106000500020120,9106000500040120,'708853132779593','MPO482025081500002','M500123417','93000518',1250.0000000000),
(9106000500020121,9106000500040121,'708853132783685','MPO482025081500002','M500123418','93000521',3000.0000000000),
(9106000500020122,9106000500040122,'708853132783686','MPO482025081500002','M500123419','93000524',1500.0000000000),
(9106000500020123,9106000500040123,'708853132783687','MPO482025081500002','M500123420','93000525',3000.0000000000),
(9106000500020124,9106000500040124,'708853132783688','MPO482025081500002','M500123421','96000339',6000.0000000000),
(9106000500020125,9106000500040125,'708853132783689','MPO482025081500002','M500123423','32100042',-20000.0000000000),
(9106000500020126,9106000500040126,'708853132783690','MPO482025081500002','M500123425','32400015',-8000.0000000000),
(9106000500020127,9106000500040127,'708853132787781','MPO482025081500002','M500123426','35100032',1.0000000000),
(9106000500020128,9106000500040128,'708853132787782','MPO482025081500002','M500123427','1000452',1000.0000000000),
(9106000500020129,9106000500040129,'708853132791880','MPO482025081500002','M500123430','93000517',100.0000000000),
(9106000500020130,9106000500040130,'708853132791881','MPO482025081500002','M500123431','35100034',1.0000000000),
(9106000500020131,9106000500040131,'708853132791882','MPO482025081500002','M500123432','35100034',-1.0000000000),
(9106000500020132,9106000500040132,'708853132791883','MPO482025081500002','M500123433','35100034',1.0000000000),
(9106000500020133,9106000500040133,'708853132791884','MPO482025081500002','M500123434','35100034',1.0000000000),
(9106000500020134,9106000500040134,'708853132791885','MPO482025081500002','M500123435','35100034',1.0000000000),
(9106000500020135,9106000500040135,'708853132795973','MPO482025081500002','M500123436','35100033',1.0000000000),
(9106000500020136,9106000500040136,'708853132795974','MPO482025081500002','M500123437','35100033',1.0000000000),
(9106000500020137,9106000500040137,'708853132795975','MPO482025081500002','M500123438','35100033',1.0000000000),
(9106000500020138,9106000500040138,'708853132795976','MPO482025081500002','M500123439','35100033',1.0000000000),
(9106000500020139,9106000500040139,'708853132795977','MPO482025081500002','M500123440','35100033',1.0000000000),
(9106000500020140,9106000500040140,'708853132795978','MPO482025081500002','M500123441','35100033',-1.0000000000),
(9106000500020141,9106000500040141,'708853132795979','MPO482025081500002','M500123442','35100033',1.0000000000),
(9106000500020142,9106000500040142,'708853132795980','MPO482025081500002','M500123443','35100033',1.0000000000),
(9106000500020143,9106000500040143,'708853132795981','MPO482025081500002','M500123444','35100015',1.0000000000),
(9106000500020144,9106000500040144,'708853132795982','MPO482025081500002','M500123445','35100015',1.0000000000),
(9106000500020145,9106000500040145,'708853132795983','MPO482025081500002','M500123446','35100015',1.0000000000),
(9106000500020146,9106000500040146,'708853132800069','MPO482025081500002','M500123447','35100015',1.0000000000),
(9106000500020147,9106000500040147,'708853132800070','MPO482025081500002','M500123448','35100015',1.0000000000),
(9106000500020148,9106000500040148,'708853132800071','MPO482025081500002','M500123449','35100015',1.0000000000),
(9106000500020149,9106000500040149,'708853132800072','MPO482025081500002','M500123450','35100015',1.0000000000),
(9106000500020150,9106000500040150,'708853132800073','MPO482025081500002','M500123451','35100015',1.0000000000),
(9106000500020151,9106000500040151,'708853132800074','MPO482025081500002','M500123452','35100015',1.0000000000),
(9106000500020152,9106000500040152,'708853132800075','MPO482025081500002','M500123453','35100015',1.0000000000),
(9106000500020153,9106000500040153,'708853132800076','MPO482025081500002','M500123454','35100015',1.0000000000),
(9106000500020154,9106000500040154,'708853132800077','MPO482025081500002','M500123455','35100015',1.0000000000),
(9106000500020155,9106000500040155,'708853132804165','MPO482025081500002','M500123456','35100015',1.0000000000),
(9106000500020156,9106000500040156,'713850861281349','MPO482025082900002','M500124855','93000270',5000.0000000000),
(9106000500020157,9106000500040157,'713850861281350','MPO482025082900002','M500124858','93000311',510.0000000000),
(9106000500020158,9106000500040158,'713850861281351','MPO482025082900002','M500124861','93000312',500.0000000000),
(9106000500020159,9106000500040159,'713850861285445','MPO482025082900002','M500124864','93000233',600.0000000000),
(9106000500020160,9106000500040160,'713850861285446','MPO482025082900002','M500124867','93000232',1500.0000000000),
(9106000500020161,9106000500040161,'716009096228933','MPO482025090400005','M500125396','32300021',5000.0000000000),
(9106000500020162,9106000500040162,'716009096228934','MPO482025090400005','M500125401','32300021',5000.0000000000),
(9106000500020163,9106000500040163,'720949568118853','MPO482025091800003','M500130061','32300065',1900.0000000000),
(9106000500020164,9106000500040164,'720949568118854','MPO482025091800003','M500130063','32300021',100.0000000000),
(9106000500020165,9106000500040165,'720949568118855','MPO482025091800003','M500130067','32300021',600.0000000000),
(9106000500020166,9106000500040166,'720949568122949','MPO482025091800003','M500130068','93000313',100.0000000000),
(9106000500020167,9106000500040167,'720949568122950','MPO482025091800003','M500130070','93000229',700.0000000000),
(9106000500020168,9106000500040168,'721256689414213','MPO482025091900001','M500130445','93000182',10000.0000000000),
(9106000500020169,9106000500040169,'721256689414214','MPO482025091900001','M500130446','32300009',10000.0000000000),
(9106000500020170,9106000500040170,'721256689414215','MPO482025091900001','M500130447','32300012',10000.0000000000),
(9106000500020171,9106000500040171,'721256689414216','MPO482025091900001','M500130448','32300026',-2980.0000000000),
(9106000500020172,9106000500040172,'721256689414217','MPO482025091900001','M500130449','32300027',-2968.0000000000),
(9106000500020173,9106000500040173,'721256689418309','MPO482025091900001','M500130450','32300028',3000.0000000000),
(9106000500020174,9106000500040174,'721256689418310','MPO482025091900001','M500130451','32300035',10000.0000000000),
(9106000500020175,9106000500040175,'721256689418311','MPO482025091900001','M500130452','32300046',3000.0000000000),
(9106000500020176,9106000500040176,'721256689422405','MPO482025091900001','M500130453','32300047',2108.0000000000),
(9106000500020177,9106000500040177,'721256689422406','MPO482025091900001','M500130454','32300048',-10000.0000000000),
(9106000500020178,9106000500040178,'721256689422407','MPO482025091900001','M500130455','35100015',1.0000000000),
(9106000500020179,9106000500040179,'721256689422408','MPO482025091900001','M500130456','35100015',1.0000000000),
(9106000500020180,9106000500040180,'721256689426501','MPO482025091900001','M500130457','35100015',1.0000000000),
(9106000500020181,9106000500040181,'721256689426502','MPO482025091900001','M500130458','35100015',1.0000000000),
(9106000500020182,9106000500040182,'721256689426503','MPO482025091900001','M500130459','35100016',1.0000000000),
(9106000500020183,9106000500040183,'721256689426504','MPO482025091900001','M500130460','35100016',1.0000000000),
(9106000500020184,9106000500040184,'721256689426505','MPO482025091900001','M500130461','35100016',1.0000000000),
(9106000500020185,9106000500040185,'721256689430597','MPO482025091900001','M500130462','35100016',1.0000000000),
(9106000500020186,9106000500040186,'721256689430598','MPO482025091900001','M500130463','35100016',1.0000000000),
(9106000500020187,9106000500040187,'721256689430599','MPO482025091900001','M500130464','35100016',1.0000000000),
(9106000500020188,9106000500040188,'721256689430600','MPO482025091900001','M500130465','35100015',1.0000000000),
(9106000500020189,9106000500040189,'721256689434693','MPO482025091900001','M500130466','35100015',1.0000000000),
(9106000500020190,9106000500040190,'721256689434694','MPO482025091900001','M500130467','35100015',1.0000000000),
(9106000500020191,9106000500040191,'721256689434695','MPO482025091900001','M500130468','35100015',1.0000000000),
(9106000500020192,9106000500040192,'721256689434696','MPO482025091900001','M500130469','35100015',1.0000000000),
(9106000500020193,9106000500040193,'721256689438789','MPO482025091900001','M500130470','35100015',1.0000000000),
(9106000500020194,9106000500040194,'721256689438790','MPO482025091900001','M500130471','35100015',1.0000000000),
(9106000500020195,9106000500040195,'722351552172101','MPO482025092200002','M500130840','93000283',20000.0000000000),
(9106000500020196,9106000500040196,'765148661813317','MPO482026012100001','M500103888','3221C0031',1000.0000000000),
(9106000500020197,9106000500040197,'765148661813318','MPO482026012100001','M500103890','3521C0018',2.0000000000),
(9106000500020198,9106000500040198,'765148661813319','MPO482026012100001','M500103891','1A0047E',1000.0000000000),
(9106000500020199,9106000500040199,'769809191923781','MPO482026020300001','M500105946','3221C0031',100.0000000000),
(9106000500020200,9106000500040200,'1958480382326104095','SO241020240923001','UAT-MO-0034','91CC0232',400.00000000),
(9106000500020201,9106000500040201,'1958480382326104272','SO241020241014001','M500028977','1007114',120000.0000000000),
(9106000500020202,9106000500040202,'1958480382326104273','SO241020241014001','M500028978','1007115',30000.0000000000),
(9106000500020203,9106000500040203,'1958480382326104295','SO241020241015003','M500028992','1000431',5000.0000000000),
(9106000500020204,9106000500040204,'1958480382326104296','SO241020241015003','M500028993','1000432',5000.0000000000),
(9106000500020205,9106000500040205,'1958902016386269188','SO241020241018001','M500029021','1000595',92000.0000000000),
(9106000500020206,9106000500040206,'1958902016386269193','SO241020241018001','M500029024','1007096',7000.0000000000),
(9106000500020207,9106000500040207,'1958902016386269196','SO241020241018001','M500029027','1002081',1256.0000000000),
(9106000500020208,9106000500040208,'1958902016386269200','SO241020241018001','M500029034','93000236',140.0000000000),
(9106000500020209,9106000500040209,'1958956122157088771','SO241020241019001','M500029040','93000228',3000.0000000000),
(9106000500020210,9106000500040210,'1959718646913695745','SO241020241021002','UAT-MO-0039','1A039D8',350.00000000),
(9106000500020211,9106000500040211,'1960006795304894465','SO241020241022001','M500029272','93000235',600.0000000000),
(9106000500020212,9106000500040212,'1963915047889534981','SO241020241102001','M500033844','94000284',10000.0000000000),
(9106000500020213,9106000500040213,'1963915047889534985','SO241020241102001','M500033846','1002081',1200.0000000000),
(9106000500020214,9106000500040214,'1963971671131947011','SO241020241102004','M500033849','93000179',2000.0000000000),
(9106000500020215,9106000500040215,'1964653664643579905','SO241020241104001','M500033851','93000229',6000.0000000000),
(9106000500020216,9106000500040216,'1964653664643579907','SO241020241104001','M500033853','1008414',176.0000000000),
(9106000500020217,9106000500040217,'1964653664643579908','SO241020241104001','M500033854','94000284',10000.0000000000),
(9106000500020218,9106000500040218,'1964653664643579910','SO241020241104001','M500033856','94000219',11000.0000000000),
(9106000500020219,9106000500040219,'1964653664643579913','SO241020241104001','M500033857','93000233',1000.0000000000),
(9106000500020220,9106000500040220,'1981045424231809025','SO241020241219001','UAT-MO-0044','91DC0218',400.00000000),
(9106000500020221,9106000500040221,'1990491416446369793','SO241020250114003','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
(9106000500050002,'PR-UAT-FULL-20260605-001','M500029670','MPO482024102400001','94000292',4500.0000000000,9106000500020002),
(9106000500050003,'PR-UAT-FULL-20260605-002','M500029671','MPO482024102400001','1004023',3500.0000000000,9106000500020003),
(9106000500050004,'PR-UAT-FULL-20260605-003','M500029672','MPO482024102400001','1000329',400000.0000000000,9106000500020004),
(9106000500050005,'PR-UAT-FULL-20260605-004','M500029673','MPO482024102400001','1000655',100000.0000000000,9106000500020005),
(9106000500050006,'PR-UAT-FULL-20260605-005','M500029674','MPO482024102400001','1007114',250000.0000000000,9106000500020006),
(9106000500050007,'PR-UAT-FULL-20260605-006','M500029675','MPO482024102400001','1007115',600000.0000000000,9106000500020007),
(9106000500050008,'PR-UAT-FULL-20260605-007','M500029676','MPO482024102400001','1004199',6000.0000000000,9106000500020008),
(9106000500050009,'PR-UAT-FULL-20260605-008','M500029677','MPO482024102400001','1000588',10000.0000000000,9106000500020009),
(9106000500050010,'PR-UAT-FULL-20260605-009','M500029678','MPO482024102400001','1007094',2500.0000000000,9106000500020010),
(9106000500050011,'PR-UAT-FULL-20260605-010','M500029680','MPO482024102400001','32400015',1470.0000000000,9106000500020011),
(9106000500050012,'PR-UAT-FULL-20260605-011','M500029682','MPO482024102400001','94000218',800.0000000000,9106000500020012),
(9106000500050013,'PR-UAT-FULL-20260605-001','M500053217','MPO482024120200001','93000229',60.0000000000,9106000500020013),
(9106000500050014,'PR-UAT-FULL-20260605-001','M500053390','MPO482024120200002','94000218',2000.0000000000,9106000500020014),
(9106000500050015,'PR-UAT-FULL-20260605-001','M500055223','MPO482024120400002','93000237',200.0000000000,9106000500020015),
(9106000500050016,'PR-UAT-FULL-20260605-001','M500061078','MPO482025010700001','1007114',250000.0000000000,9106000500020016),
(9106000500050017,'PR-UAT-FULL-20260605-001','M500061979','MPO482025010700002','1000329',100000.0000000000,9106000500020017),
(9106000500050018,'PR-UAT-FULL-20260605-001','M500067184','MPO482025010900001','93000312',500.0000000000,9106000500020018),
(9106000500050019,'PR-UAT-FULL-20260605-002','M500067185','MPO482025010900001','1004023',600.0000000000,9106000500020019),
(9106000500050020,'PR-UAT-FULL-20260605-003','M500067186','MPO482025010900001','93000231',100.0000000000,9106000500020020),
(9106000500050021,'PR-UAT-FULL-20260605-004','M500067187','MPO482025010900001','93000286',800.0000000000,9106000500020021),
(9106000500050022,'PR-UAT-FULL-20260605-001','M500068611','MPO482025011000001','93000058',400.0000000000,9106000500020022),
(9106000500050023,'PR-UAT-FULL-20260605-001','M500068948','MPO482025011000002','1008361',1000.0000000000,9106000500020023),
(9106000500050024,'PR-UAT-FULL-20260605-001','M500069117','MPO482025011000003','1008184',700.0000000000,9106000500020024),
(9106000500050025,'PR-UAT-FULL-20260605-001','M500070459','MPO482025011300002','1004199',4000.0000000000,9106000500020025),
(9106000500050026,'PR-UAT-FULL-20260605-001','M500070619','MPO482025011300003','1004023',5000.0000000000,9106000500020026),
(9106000500050027,'PR-UAT-FULL-20260605-001','M500070942','MPO482025011300005','1000431',10000.0000000000,9106000500020027),
(9106000500050028,'PR-UAT-FULL-20260605-002','M500070943','MPO482025011300005','1000432',10000.0000000000,9106000500020028),
(9106000500050029,'PR-UAT-FULL-20260605-001','M500070944','MPO482025011300006','1000419',35000.0000000000,9106000500020029),
(9106000500050030,'PR-UAT-FULL-20260605-001','M500072258','MPO482025011400001','1000293',650000.0000000000,9106000500020030),
(9106000500050031,'PR-UAT-FULL-20260605-002','M500072259','MPO482025011400001','1000329',200000.0000000000,9106000500020031),
(9106000500050032,'PR-UAT-FULL-20260605-001','M500072882','MPO482025011400002','94000215',1500.0000000000,9106000500020032),
(9106000500050033,'PR-UAT-FULL-20260605-001','M500085317','MPO482025022100001','93000179',5000.0000000000,9106000500020033),
(9106000500050034,'PR-UAT-FULL-20260605-002','M500085321','MPO482025022100001','35100015',1.0000000000,9106000500020034),
(9106000500050035,'PR-UAT-FULL-20260605-003','M500085326','MPO482025022100001','35100016',1.0000000000,9106000500020035),
(9106000500050036,'PR-UAT-FULL-20260605-004','M500085328','MPO482025022100001','93000187',5000.0000000000,9106000500020036),
(9106000500050037,'PR-UAT-FULL-20260605-005','M500085329','MPO482025022100001','93000233',1500.0000000000,9106000500020037),
(9106000500050038,'PR-UAT-FULL-20260605-006','M500085330','MPO482025022100001','94000218',3000.0000000000,9106000500020038),
(9106000500050039,'PR-UAT-FULL-20260605-007','M500085331','MPO482025022100001','1010096',10000.0000000000,9106000500020039),
(9106000500050040,'PR-UAT-FULL-20260605-001','M500089559','MPO482025032900001','93000177',5000.0000000000,9106000500020040),
(9106000500050041,'PR-UAT-FULL-20260605-002','M500089562','MPO482025032900001','32100034',11000.0000000000,9106000500020041),
(9106000500050042,'PR-UAT-FULL-20260605-003','M500089566','MPO482025032900001','35100015',1.0000000000,9106000500020042),
(9106000500050043,'PR-UAT-FULL-20260605-004','M500089568','MPO482025032900001','94000217',2000.0000000000,9106000500020043),
(9106000500050044,'PR-UAT-FULL-20260605-005','M500089569','MPO482025032900001','94000219',9000.0000000000,9106000500020044),
(9106000500050045,'PR-UAT-FULL-20260605-006','M500089570','MPO482025032900001','93000240',2000.0000000000,9106000500020045),
(9106000500050046,'PR-UAT-FULL-20260605-007','M500089573','MPO482025032900001','1007111',200000.0000000000,9106000500020046),
(9106000500050047,'PR-UAT-FULL-20260605-001','M500090472','MPO482025041300001','35100010',1.0000000000,9106000500020047),
(9106000500050048,'PR-UAT-FULL-20260605-002','M500090473','MPO482025041300001','35100014',1.0000000000,9106000500020048),
(9106000500050049,'PR-UAT-FULL-20260605-003','M500090474','MPO482025041300001','35100033',1.0000000000,9106000500020049),
(9106000500050050,'PR-UAT-FULL-20260605-004','M500090475','MPO482025041300001','35100034',1.0000000000,9106000500020050),
(9106000500050051,'PR-UAT-FULL-20260605-001','M500093527','MPO482025042800001','32100031',7000.0000000000,9106000500020051),
(9106000500050052,'PR-UAT-FULL-20260605-001','M500101110','MPO482025051800001','35100015',1.0000000000,9106000500020052),
(9106000500050053,'PR-UAT-FULL-20260605-002','M500101111','MPO482025051800001','35100015',1.0000000000,9106000500020053),
(9106000500050054,'PR-UAT-FULL-20260605-003','M500101112','MPO482025051800001','35100015',1.0000000000,9106000500020054),
(9106000500050055,'PR-UAT-FULL-20260605-004','M500101113','MPO482025051800001','35100015',1.0000000000,9106000500020055),
(9106000500050056,'PR-UAT-FULL-20260605-005','M500101114','MPO482025051800001','35100015',1.0000000000,9106000500020056),
(9106000500050057,'PR-UAT-FULL-20260605-006','M500101115','MPO482025051800001','35100015',1.0000000000,9106000500020057),
(9106000500050058,'PR-UAT-FULL-20260605-007','M500101116','MPO482025051800001','35100015',1.0000000000,9106000500020058),
(9106000500050059,'PR-UAT-FULL-20260605-008','M500101117','MPO482025051800001','35100015',1.0000000000,9106000500020059),
(9106000500050060,'PR-UAT-FULL-20260605-009','M500101118','MPO482025051800001','35100015',1.0000000000,9106000500020060),
(9106000500050061,'PR-UAT-FULL-20260605-010','M500101119','MPO482025051800001','35100015',1.0000000000,9106000500020061),
(9106000500050062,'PR-UAT-FULL-20260605-001','M500108428','MPO482025062100002','35100034',1.0000000000,9106000500020062),
(9106000500050063,'PR-UAT-FULL-20260605-002','M500108429','MPO482025062100002','35100034',1.0000000000,9106000500020063),
(9106000500050064,'PR-UAT-FULL-20260605-003','M500108430','MPO482025062100002','35100034',1.0000000000,9106000500020064),
(9106000500050065,'PR-UAT-FULL-20260605-004','M500108431','MPO482025062100002','35100034',1.0000000000,9106000500020065),
(9106000500050066,'PR-UAT-FULL-20260605-005','M500108432','MPO482025062100002','35100034',1.0000000000,9106000500020066),
(9106000500050067,'PR-UAT-FULL-20260605-006','M500108433','MPO482025062100002','35100016',1.0000000000,9106000500020067),
(9106000500050068,'PR-UAT-FULL-20260605-007','M500108434','MPO482025062100002','35100016',1.0000000000,9106000500020068),
(9106000500050069,'PR-UAT-FULL-20260605-008','M500108435','MPO482025062100002','35100016',1.0000000000,9106000500020069),
(9106000500050070,'PR-UAT-FULL-20260605-009','M500108436','MPO482025062100002','35100016',1.0000000000,9106000500020070),
(9106000500050071,'PR-UAT-FULL-20260605-010','M500108437','MPO482025062100002','35100016',1.0000000000,9106000500020071),
(9106000500050072,'PR-UAT-FULL-20260605-011','M500108438','MPO482025062100002','35100016',1.0000000000,9106000500020072),
(9106000500050073,'PR-UAT-FULL-20260605-012','M500108439','MPO482025062100002','35100016',1.0000000000,9106000500020073),
(9106000500050074,'PR-UAT-FULL-20260605-001','M500108487','MPO482025062100003','35100016',1.0000000000,9106000500020074),
(9106000500050075,'PR-UAT-FULL-20260605-002','M500108488','MPO482025062100003','35100016',1.0000000000,9106000500020075),
(9106000500050076,'PR-UAT-FULL-20260605-003','M500108489','MPO482025062100003','35100016',1.0000000000,9106000500020076),
(9106000500050077,'PR-UAT-FULL-20260605-004','M500108490','MPO482025062100003','35100010',1.0000000000,9106000500020077),
(9106000500050078,'PR-UAT-FULL-20260605-005','M500108491','MPO482025062100003','35100010',1.0000000000,9106000500020078),
(9106000500050079,'PR-UAT-FULL-20260605-006','M500108492','MPO482025062100003','35100010',1.0000000000,9106000500020079),
(9106000500050080,'PR-UAT-FULL-20260605-007','M500108493','MPO482025062100003','35100010',1.0000000000,9106000500020080),
(9106000500050081,'PR-UAT-FULL-20260605-008','M500108494','MPO482025062100003','35100010',1.0000000000,9106000500020081),
(9106000500050082,'PR-UAT-FULL-20260605-009','M500108495','MPO482025062100003','35100010',1.0000000000,9106000500020082),
(9106000500050083,'PR-UAT-FULL-20260605-010','M500108496','MPO482025062100003','35100010',1.0000000000,9106000500020083),
(9106000500050084,'PR-UAT-FULL-20260605-011','M500108497','MPO482025062100003','35100010',1.0000000000,9106000500020084),
(9106000500050085,'PR-UAT-FULL-20260605-012','M500108498','MPO482025062100003','35100010',1.0000000000,9106000500020085),
(9106000500050086,'PR-UAT-FULL-20260605-013','M500108499','MPO482025062100003','35100010',1.0000000000,9106000500020086),
(9106000500050087,'PR-UAT-FULL-20260605-001','M500109125','MPO482025062600003','93000178',3000.0000000000,9106000500020087),
(9106000500050088,'PR-UAT-FULL-20260605-002','M500109128','MPO482025062600003','32400038',3100.0000000000,9106000500020088),
(9106000500050089,'PR-UAT-FULL-20260605-003','M500109132','MPO482025062600003','32400015',5100.0000000000,9106000500020089),
(9106000500050090,'PR-UAT-FULL-20260605-004','M500109134','MPO482025062600003','1008361',4000.0000000000,9106000500020090),
(9106000500050091,'PR-UAT-FULL-20260605-001','M500123310','MPO482025081500001','1000273',200.0000000000,9106000500020091),
(9106000500050092,'PR-UAT-FULL-20260605-002','M500123311','MPO482025081500001','1000275',272.0000000000,9106000500020092),
(9106000500050093,'PR-UAT-FULL-20260605-003','M500123312','MPO482025081500001','1000304',360000.0000000000,9106000500020093),
(9106000500050094,'PR-UAT-FULL-20260605-004','M500123313','MPO482025081500001','1000419',1000.0000000000,9106000500020094),
(9106000500050095,'PR-UAT-FULL-20260605-005','M500123314','MPO482025081500001','1000431',2000.0000000000,9106000500020095),
(9106000500050096,'PR-UAT-FULL-20260605-006','M500123315','MPO482025081500001','1000432',-2000.0000000000,9106000500020096),
(9106000500050097,'PR-UAT-FULL-20260605-007','M500123316','MPO482025081500001','1000588',-29000.0000000000,9106000500020097),
(9106000500050098,'PR-UAT-FULL-20260605-008','M500123317','MPO482025081500001','1000595',670000.0000000000,9106000500020098),
(9106000500050099,'PR-UAT-FULL-20260605-009','M500123318','MPO482025081500001','1002104',-113.0000000000,9106000500020099),
(9106000500050100,'PR-UAT-FULL-20260605-001','M500123386','MPO482025081500002','1010092',550.0000000000,9106000500020100),
(9106000500050101,'PR-UAT-FULL-20260605-002','M500123387','MPO482025081500002','1010093',1.0000000000,9106000500020101),
(9106000500050102,'PR-UAT-FULL-20260605-003','M500123388','MPO482025081500002','92000033',38.0000000000,9106000500020102),
(9106000500050103,'PR-UAT-FULL-20260605-004','M500123389','MPO482025081500002','93000058',558.0000000000,9106000500020103),
(9106000500050104,'PR-UAT-FULL-20260605-005','M500123390','MPO482025081500002','93000074',2522.0000000000,9106000500020104),
(9106000500050105,'PR-UAT-FULL-20260605-006','M500123392','MPO482025081500002','35100032',1.0000000000,9106000500020105),
(9106000500050106,'PR-UAT-FULL-20260605-007','M500123393','MPO482025081500002','93000110',185.0000000000,9106000500020106),
(9106000500050107,'PR-UAT-FULL-20260605-008','M500123395','MPO482025081500002','93000123',2.0000000000,9106000500020107),
(9106000500050108,'PR-UAT-FULL-20260605-009','M500123396','MPO482025081500002','93000229',862.0000000000,9106000500020108),
(9106000500050109,'PR-UAT-FULL-20260605-010','M500123401','MPO482025081500002','32300026',200.0000000000,9106000500020109),
(9106000500050110,'PR-UAT-FULL-20260605-011','M500123404','MPO482025081500002','32400015',-3015.0000000000,9106000500020110),
(9106000500050111,'PR-UAT-FULL-20260605-012','M500123405','MPO482025081500002','93000312',300.0000000000,9106000500020111),
(9106000500050112,'PR-UAT-FULL-20260605-013','M500123407','MPO482025081500002','93000404',500.0000000000,9106000500020112),
(9106000500050113,'PR-UAT-FULL-20260605-014','M500123408','MPO482025081500002','93000412',800.0000000000,9106000500020113),
(9106000500050114,'PR-UAT-FULL-20260605-015','M500123409','MPO482025081500002','93000502',400.0000000000,9106000500020114),
(9106000500050115,'PR-UAT-FULL-20260605-016','M500123411','MPO482025081500002','93000503',1050.0000000000,9106000500020115),
(9106000500050116,'PR-UAT-FULL-20260605-017','M500123413','MPO482025081500002','93000506',1.0000000000,9106000500020116),
(9106000500050117,'PR-UAT-FULL-20260605-018','M500123414','MPO482025081500002','93000507',1000.0000000000,9106000500020117),
(9106000500050118,'PR-UAT-FULL-20260605-019','M500123415','MPO482025081500002','93000509',350.0000000000,9106000500020118),
(9106000500050119,'PR-UAT-FULL-20260605-020','M500123416','MPO482025081500002','93000510',1100.0000000000,9106000500020119),
(9106000500050120,'PR-UAT-FULL-20260605-021','M500123417','MPO482025081500002','93000518',1250.0000000000,9106000500020120),
(9106000500050121,'PR-UAT-FULL-20260605-022','M500123418','MPO482025081500002','93000521',3000.0000000000,9106000500020121),
(9106000500050122,'PR-UAT-FULL-20260605-023','M500123419','MPO482025081500002','93000524',1500.0000000000,9106000500020122),
(9106000500050123,'PR-UAT-FULL-20260605-024','M500123420','MPO482025081500002','93000525',3000.0000000000,9106000500020123),
(9106000500050124,'PR-UAT-FULL-20260605-025','M500123421','MPO482025081500002','96000339',6000.0000000000,9106000500020124),
(9106000500050125,'PR-UAT-FULL-20260605-026','M500123423','MPO482025081500002','32100042',-20000.0000000000,9106000500020125),
(9106000500050126,'PR-UAT-FULL-20260605-027','M500123425','MPO482025081500002','32400015',-8000.0000000000,9106000500020126),
(9106000500050127,'PR-UAT-FULL-20260605-028','M500123426','MPO482025081500002','35100032',1.0000000000,9106000500020127),
(9106000500050128,'PR-UAT-FULL-20260605-029','M500123427','MPO482025081500002','1000452',1000.0000000000,9106000500020128),
(9106000500050129,'PR-UAT-FULL-20260605-030','M500123430','MPO482025081500002','93000517',100.0000000000,9106000500020129),
(9106000500050130,'PR-UAT-FULL-20260605-031','M500123431','MPO482025081500002','35100034',1.0000000000,9106000500020130),
(9106000500050131,'PR-UAT-FULL-20260605-032','M500123432','MPO482025081500002','35100034',-1.0000000000,9106000500020131),
(9106000500050132,'PR-UAT-FULL-20260605-033','M500123433','MPO482025081500002','35100034',1.0000000000,9106000500020132),
(9106000500050133,'PR-UAT-FULL-20260605-034','M500123434','MPO482025081500002','35100034',1.0000000000,9106000500020133),
(9106000500050134,'PR-UAT-FULL-20260605-035','M500123435','MPO482025081500002','35100034',1.0000000000,9106000500020134),
(9106000500050135,'PR-UAT-FULL-20260605-036','M500123436','MPO482025081500002','35100033',1.0000000000,9106000500020135),
(9106000500050136,'PR-UAT-FULL-20260605-037','M500123437','MPO482025081500002','35100033',1.0000000000,9106000500020136),
(9106000500050137,'PR-UAT-FULL-20260605-038','M500123438','MPO482025081500002','35100033',1.0000000000,9106000500020137),
(9106000500050138,'PR-UAT-FULL-20260605-039','M500123439','MPO482025081500002','35100033',1.0000000000,9106000500020138),
(9106000500050139,'PR-UAT-FULL-20260605-040','M500123440','MPO482025081500002','35100033',1.0000000000,9106000500020139),
(9106000500050140,'PR-UAT-FULL-20260605-041','M500123441','MPO482025081500002','35100033',-1.0000000000,9106000500020140),
(9106000500050141,'PR-UAT-FULL-20260605-042','M500123442','MPO482025081500002','35100033',1.0000000000,9106000500020141),
(9106000500050142,'PR-UAT-FULL-20260605-043','M500123443','MPO482025081500002','35100033',1.0000000000,9106000500020142),
(9106000500050143,'PR-UAT-FULL-20260605-044','M500123444','MPO482025081500002','35100015',1.0000000000,9106000500020143),
(9106000500050144,'PR-UAT-FULL-20260605-045','M500123445','MPO482025081500002','35100015',1.0000000000,9106000500020144),
(9106000500050145,'PR-UAT-FULL-20260605-046','M500123446','MPO482025081500002','35100015',1.0000000000,9106000500020145),
(9106000500050146,'PR-UAT-FULL-20260605-047','M500123447','MPO482025081500002','35100015',1.0000000000,9106000500020146),
(9106000500050147,'PR-UAT-FULL-20260605-048','M500123448','MPO482025081500002','35100015',1.0000000000,9106000500020147),
(9106000500050148,'PR-UAT-FULL-20260605-049','M500123449','MPO482025081500002','35100015',1.0000000000,9106000500020148),
(9106000500050149,'PR-UAT-FULL-20260605-050','M500123450','MPO482025081500002','35100015',1.0000000000,9106000500020149),
(9106000500050150,'PR-UAT-FULL-20260605-051','M500123451','MPO482025081500002','35100015',1.0000000000,9106000500020150),
(9106000500050151,'PR-UAT-FULL-20260605-052','M500123452','MPO482025081500002','35100015',1.0000000000,9106000500020151),
(9106000500050152,'PR-UAT-FULL-20260605-053','M500123453','MPO482025081500002','35100015',1.0000000000,9106000500020152),
(9106000500050153,'PR-UAT-FULL-20260605-054','M500123454','MPO482025081500002','35100015',1.0000000000,9106000500020153),
(9106000500050154,'PR-UAT-FULL-20260605-055','M500123455','MPO482025081500002','35100015',1.0000000000,9106000500020154),
(9106000500050155,'PR-UAT-FULL-20260605-056','M500123456','MPO482025081500002','35100015',1.0000000000,9106000500020155),
(9106000500050156,'PR-UAT-FULL-20260605-001','M500124855','MPO482025082900002','93000270',5000.0000000000,9106000500020156),
(9106000500050157,'PR-UAT-FULL-20260605-002','M500124858','MPO482025082900002','93000311',510.0000000000,9106000500020157),
(9106000500050158,'PR-UAT-FULL-20260605-003','M500124861','MPO482025082900002','93000312',500.0000000000,9106000500020158),
(9106000500050159,'PR-UAT-FULL-20260605-004','M500124864','MPO482025082900002','93000233',600.0000000000,9106000500020159),
(9106000500050160,'PR-UAT-FULL-20260605-005','M500124867','MPO482025082900002','93000232',1500.0000000000,9106000500020160),
(9106000500050161,'PR-UAT-FULL-20260605-001','M500125396','MPO482025090400005','32300021',5000.0000000000,9106000500020161),
(9106000500050162,'PR-UAT-FULL-20260605-002','M500125401','MPO482025090400005','32300021',5000.0000000000,9106000500020162),
(9106000500050163,'PR-UAT-FULL-20260605-001','M500130061','MPO482025091800003','32300065',1900.0000000000,9106000500020163),
(9106000500050164,'PR-UAT-FULL-20260605-002','M500130063','MPO482025091800003','32300021',100.0000000000,9106000500020164),
(9106000500050165,'PR-UAT-FULL-20260605-003','M500130067','MPO482025091800003','32300021',600.0000000000,9106000500020165),
(9106000500050166,'PR-UAT-FULL-20260605-004','M500130068','MPO482025091800003','93000313',100.0000000000,9106000500020166),
(9106000500050167,'PR-UAT-FULL-20260605-005','M500130070','MPO482025091800003','93000229',700.0000000000,9106000500020167),
(9106000500050168,'PR-UAT-FULL-20260605-001','M500130445','MPO482025091900001','93000182',10000.0000000000,9106000500020168),
(9106000500050169,'PR-UAT-FULL-20260605-002','M500130446','MPO482025091900001','32300009',10000.0000000000,9106000500020169),
(9106000500050170,'PR-UAT-FULL-20260605-003','M500130447','MPO482025091900001','32300012',10000.0000000000,9106000500020170),
(9106000500050171,'PR-UAT-FULL-20260605-004','M500130448','MPO482025091900001','32300026',-2980.0000000000,9106000500020171),
(9106000500050172,'PR-UAT-FULL-20260605-005','M500130449','MPO482025091900001','32300027',-2968.0000000000,9106000500020172),
(9106000500050173,'PR-UAT-FULL-20260605-006','M500130450','MPO482025091900001','32300028',3000.0000000000,9106000500020173),
(9106000500050174,'PR-UAT-FULL-20260605-007','M500130451','MPO482025091900001','32300035',10000.0000000000,9106000500020174),
(9106000500050175,'PR-UAT-FULL-20260605-008','M500130452','MPO482025091900001','32300046',3000.0000000000,9106000500020175),
(9106000500050176,'PR-UAT-FULL-20260605-009','M500130453','MPO482025091900001','32300047',2108.0000000000,9106000500020176),
(9106000500050177,'PR-UAT-FULL-20260605-010','M500130454','MPO482025091900001','32300048',-10000.0000000000,9106000500020177),
(9106000500050178,'PR-UAT-FULL-20260605-011','M500130455','MPO482025091900001','35100015',1.0000000000,9106000500020178),
(9106000500050179,'PR-UAT-FULL-20260605-012','M500130456','MPO482025091900001','35100015',1.0000000000,9106000500020179),
(9106000500050180,'PR-UAT-FULL-20260605-013','M500130457','MPO482025091900001','35100015',1.0000000000,9106000500020180),
(9106000500050181,'PR-UAT-FULL-20260605-014','M500130458','MPO482025091900001','35100015',1.0000000000,9106000500020181),
(9106000500050182,'PR-UAT-FULL-20260605-015','M500130459','MPO482025091900001','35100016',1.0000000000,9106000500020182),
(9106000500050183,'PR-UAT-FULL-20260605-016','M500130460','MPO482025091900001','35100016',1.0000000000,9106000500020183),
(9106000500050184,'PR-UAT-FULL-20260605-017','M500130461','MPO482025091900001','35100016',1.0000000000,9106000500020184),
(9106000500050185,'PR-UAT-FULL-20260605-018','M500130462','MPO482025091900001','35100016',1.0000000000,9106000500020185),
(9106000500050186,'PR-UAT-FULL-20260605-019','M500130463','MPO482025091900001','35100016',1.0000000000,9106000500020186),
(9106000500050187,'PR-UAT-FULL-20260605-020','M500130464','MPO482025091900001','35100016',1.0000000000,9106000500020187),
(9106000500050188,'PR-UAT-FULL-20260605-021','M500130465','MPO482025091900001','35100015',1.0000000000,9106000500020188),
(9106000500050189,'PR-UAT-FULL-20260605-022','M500130466','MPO482025091900001','35100015',1.0000000000,9106000500020189),
(9106000500050190,'PR-UAT-FULL-20260605-023','M500130467','MPO482025091900001','35100015',1.0000000000,9106000500020190),
(9106000500050191,'PR-UAT-FULL-20260605-024','M500130468','MPO482025091900001','35100015',1.0000000000,9106000500020191),
(9106000500050192,'PR-UAT-FULL-20260605-025','M500130469','MPO482025091900001','35100015',1.0000000000,9106000500020192),
(9106000500050193,'PR-UAT-FULL-20260605-026','M500130470','MPO482025091900001','35100015',1.0000000000,9106000500020193),
(9106000500050194,'PR-UAT-FULL-20260605-027','M500130471','MPO482025091900001','35100015',1.0000000000,9106000500020194),
(9106000500050195,'PR-UAT-FULL-20260605-001','M500130840','MPO482025092200002','93000283',20000.0000000000,9106000500020195),
(9106000500050196,'PR-UAT-FULL-20260605-001','M500103888','MPO482026012100001','3221C0031',1000.0000000000,9106000500020196),
(9106000500050197,'PR-UAT-FULL-20260605-002','M500103890','MPO482026012100001','3521C0018',2.0000000000,9106000500020197),
(9106000500050198,'PR-UAT-FULL-20260605-003','M500103891','MPO482026012100001','1A0047E',1000.0000000000,9106000500020198),
(9106000500050199,'PR-UAT-FULL-20260605-001','M500105946','MPO482026020300001','3221C0031',100.0000000000,9106000500020199),
(9106000500050200,'PR-UAT-FULL-20260605-001','UAT-MO-0034','SO241020240923001','91CC0232',400.00000000,9106000500020200),
(9106000500050201,'PR-UAT-FULL-20260605-001','M500028977','SO241020241014001','1007114',120000.0000000000,9106000500020201),
(9106000500050202,'PR-UAT-FULL-20260605-002','M500028978','SO241020241014001','1007115',30000.0000000000,9106000500020202),
(9106000500050203,'PR-UAT-FULL-20260605-001','M500028992','SO241020241015003','1000431',5000.0000000000,9106000500020203),
(9106000500050204,'PR-UAT-FULL-20260605-002','M500028993','SO241020241015003','1000432',5000.0000000000,9106000500020204),
(9106000500050205,'PR-UAT-FULL-20260605-001','M500029021','SO241020241018001','1000595',92000.0000000000,9106000500020205),
(9106000500050206,'PR-UAT-FULL-20260605-002','M500029024','SO241020241018001','1007096',7000.0000000000,9106000500020206),
(9106000500050207,'PR-UAT-FULL-20260605-003','M500029027','SO241020241018001','1002081',1256.0000000000,9106000500020207),
(9106000500050208,'PR-UAT-FULL-20260605-004','M500029034','SO241020241018001','93000236',140.0000000000,9106000500020208),
(9106000500050209,'PR-UAT-FULL-20260605-001','M500029040','SO241020241019001','93000228',3000.0000000000,9106000500020209),
(9106000500050210,'PR-UAT-FULL-20260605-001','UAT-MO-0039','SO241020241021002','1A039D8',350.00000000,9106000500020210),
(9106000500050211,'PR-UAT-FULL-20260605-001','M500029272','SO241020241022001','93000235',600.0000000000,9106000500020211),
(9106000500050212,'PR-UAT-FULL-20260605-001','M500033844','SO241020241102001','94000284',10000.0000000000,9106000500020212),
(9106000500050213,'PR-UAT-FULL-20260605-002','M500033846','SO241020241102001','1002081',1200.0000000000,9106000500020213),
(9106000500050214,'PR-UAT-FULL-20260605-001','M500033849','SO241020241102004','93000179',2000.0000000000,9106000500020214),
(9106000500050215,'PR-UAT-FULL-20260605-001','M500033851','SO241020241104001','93000229',6000.0000000000,9106000500020215),
(9106000500050216,'PR-UAT-FULL-20260605-002','M500033853','SO241020241104001','1008414',176.0000000000,9106000500020216),
(9106000500050217,'PR-UAT-FULL-20260605-003','M500033854','SO241020241104001','94000284',10000.0000000000,9106000500020217),
(9106000500050218,'PR-UAT-FULL-20260605-004','M500033856','SO241020241104001','94000219',11000.0000000000,9106000500020218),
(9106000500050219,'PR-UAT-FULL-20260605-005','M500033857','SO241020241104001','93000233',1000.0000000000,9106000500020219),
(9106000500050220,'PR-UAT-FULL-20260605-001','UAT-MO-0044','SO241020241219001','91DC0218',400.00000000,9106000500020220),
(9106000500050221,'PR-UAT-FULL-20260605-001','UAT-MO-0045','SO241020250114003','1A03G94',1686.00000000,9106000500020221);

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
('PO-UAT-FULL-20260605-001',1,'MPO482024102400001','M500029670','91DC0292',4500.00000000),
('PO-UAT-FULL-20260605-001',2,'MPO482024102400001','M500029671','1A03D23',3500.00000000),
('PO-UAT-FULL-20260605-001',3,'MPO482024102400001','M500029672','1A0C329',400000.00000000),
('PO-UAT-FULL-20260605-001',4,'MPO482024102400001','M500029673','1A0C655',100000.00000000),
('PO-UAT-FULL-20260605-001',5,'MPO482024102400001','M500029674','A2C7114',250000.00000000),
('PO-UAT-FULL-20260605-001',6,'MPO482024102400001','M500029675','A2C7115',600000.00000000),
('PO-UAT-FULL-20260605-001',7,'MPO482024102400001','M500029676','A2B4199',6000.00000000),
('PO-UAT-FULL-20260605-001',8,'MPO482024102400001','M500029677','1A0C588',10000.00000000),
('PO-UAT-FULL-20260605-001',9,'MPO482024102400001','M500029678','1A03G94',2500.00000000),
('PO-UAT-FULL-20260605-001',10,'MPO482024102400001','M500029680','91CC0286',1500.00000000),
('PO-UAT-FULL-20260605-001',11,'MPO482024102400001','M500029682','91DC0218',800.00000000),
('PO-UAT-FULL-20260605-002',1,'MPO482024120200001','M500053217','91CC0229',60.00000000),
('PO-UAT-FULL-20260605-003',1,'MPO482024120200002','M500053390','91DC0218',2000.00000000),
('PO-UAT-FULL-20260605-004',1,'MPO482024120400002','M500055223','91CC0237',200.00000000),
('PO-UAT-FULL-20260605-005',1,'MPO482025010700001','M500061078','A2C7114',250000.00000000),
('PO-UAT-FULL-20260605-006',1,'MPO482025010700002','M500061979','1A0C329',100000.00000000),
('PO-UAT-FULL-20260605-007',1,'MPO482025010900001','M500067184','91CC0312',500.00000000),
('PO-UAT-FULL-20260605-007',2,'MPO482025010900001','M500067185','1A03D23',600.00000000),
('PO-UAT-FULL-20260605-007',3,'MPO482025010900001','M500067186','91CC0231',100.00000000),
('PO-UAT-FULL-20260605-007',4,'MPO482025010900001','M500067187','91CC0286',800.00000000),
('PO-UAT-FULL-20260605-008',1,'MPO482025011000001','M500068611','91C0D058',400.00000000),
('PO-UAT-FULL-20260605-009',1,'MPO482025011000002','M500068948','A2B8361',1000.00000000),
('PO-UAT-FULL-20260605-010',1,'MPO482025011000003','M500069117','A2B8184',700.00000000),
('PO-UAT-FULL-20260605-011',1,'MPO482025011300002','M500070459','A2B4199',4000.00000000),
('PO-UAT-FULL-20260605-012',1,'MPO482025011300003','M500070619','1A03D23',5000.00000000),
('PO-UAT-FULL-20260605-013',1,'MPO482025011300005','M500070942','ABC431',10000.00000000),
('PO-UAT-FULL-20260605-013',2,'MPO482025011300005','M500070943','1A0C432',10000.00000000),
('PO-UAT-FULL-20260605-014',1,'MPO482025011300006','M500070944','ABC419',35000.00000000),
('PO-UAT-FULL-20260605-015',1,'MPO482025011400001','M500072258','1A0C293',650000.00000000),
('PO-UAT-FULL-20260605-015',2,'MPO482025011400001','M500072259','1A0C329',200000.00000000),
('PO-UAT-FULL-20260605-016',1,'MPO482025011400002','M500072882','91DC0215',1500.00000000),
('PO-UAT-FULL-20260605-017',1,'MPO482025022100001','M500085317','91CC0179',5000.00000000),
('PO-UAT-FULL-20260605-017',2,'MPO482025022100001','M500085321','91CC0287',10000.00000000),
('PO-UAT-FULL-20260605-017',3,'MPO482025022100001','M500085326','91CC0288',10000.00000000),
('PO-UAT-FULL-20260605-017',4,'MPO482025022100001','M500085328','91CC0187',5000.00000000),
('PO-UAT-FULL-20260605-017',5,'MPO482025022100001','M500085329','91CC0233',1500.00000000),
('PO-UAT-FULL-20260605-017',6,'MPO482025022100001','M500085330','91DC0218',3000.00000000),
('PO-UAT-FULL-20260605-017',7,'MPO482025022100001','M500085331','A21C096',10000.00000000),
('PO-UAT-FULL-20260605-018',1,'MPO482025032900001','M500089559','91CC0177',5000.00000000),
('PO-UAT-FULL-20260605-018',2,'MPO482025032900001','M500089562','91CC0179',5000.00000000),
('PO-UAT-FULL-20260605-018',3,'MPO482025032900001','M500089566','91CC0287',4000.00000000),
('PO-UAT-FULL-20260605-018',4,'MPO482025032900001','M500089568','91DC0217',2000.00000000),
('PO-UAT-FULL-20260605-018',5,'MPO482025032900001','M500089569','91DC0219',9000.00000000),
('PO-UAT-FULL-20260605-018',6,'MPO482025032900001','M500089570','91C0D2D',2000.00000000),
('PO-UAT-FULL-20260605-018',7,'MPO482025032900001','M500089573','AB47111',200000.00000000),
('PO-UAT-FULL-20260605-019',1,'MPO482025041300001','M500090472','352AD0A',1.00000000),
('PO-UAT-FULL-20260605-019',2,'MPO482025041300001','M500090473','3521C0014',1.00000000),
('PO-UAT-FULL-20260605-019',3,'MPO482025041300001','M500090474','3151C0033',1.00000000),
('PO-UAT-FULL-20260605-019',4,'MPO482025041300001','M500090475','3151C0034',1.00000000),
('PO-UAT-FULL-20260605-020',1,'MPO482025042800001','M500093527','3221C0031',7000.00000000),
('PO-UAT-FULL-20260605-021',1,'MPO482025051800001','M500101110','3521C0015',1.00000000),
('PO-UAT-FULL-20260605-021',2,'MPO482025051800001','M500101111','3521C0015',1.00000000),
('PO-UAT-FULL-20260605-021',3,'MPO482025051800001','M500101112','3521C0015',1.00000000),
('PO-UAT-FULL-20260605-021',4,'MPO482025051800001','M500101113','3521C0015',1.00000000),
('PO-UAT-FULL-20260605-021',5,'MPO482025051800001','M500101114','3521C0015',1.00000000),
('PO-UAT-FULL-20260605-021',6,'MPO482025051800001','M500101115','3521C0015',1.00000000),
('PO-UAT-FULL-20260605-021',7,'MPO482025051800001','M500101116','3521C0015',1.00000000),
('PO-UAT-FULL-20260605-021',8,'MPO482025051800001','M500101117','3521C0015',1.00000000),
('PO-UAT-FULL-20260605-021',9,'MPO482025051800001','M500101118','3521C0015',1.00000000),
('PO-UAT-FULL-20260605-021',10,'MPO482025051800001','M500101119','3521C0015',1.00000000),
('PO-UAT-FULL-20260605-022',1,'MPO482025062100002','M500108428','3151C0034',1.00000000),
('PO-UAT-FULL-20260605-022',2,'MPO482025062100002','M500108429','3151C0034',1.00000000),
('PO-UAT-FULL-20260605-022',3,'MPO482025062100002','M500108430','3151C0034',1.00000000),
('PO-UAT-FULL-20260605-022',4,'MPO482025062100002','M500108431','3151C0034',1.00000000),
('PO-UAT-FULL-20260605-022',5,'MPO482025062100002','M500108432','3151C0034',1.00000000),
('PO-UAT-FULL-20260605-022',6,'MPO482025062100002','M500108433','3521C0016',1.00000000),
('PO-UAT-FULL-20260605-022',7,'MPO482025062100002','M500108434','3521C0016',1.00000000),
('PO-UAT-FULL-20260605-022',8,'MPO482025062100002','M500108435','3521C0016',1.00000000),
('PO-UAT-FULL-20260605-022',9,'MPO482025062100002','M500108436','3521C0016',1.00000000),
('PO-UAT-FULL-20260605-022',10,'MPO482025062100002','M500108437','3521C0016',1.00000000),
('PO-UAT-FULL-20260605-022',11,'MPO482025062100002','M500108438','3521C0016',1.00000000),
('PO-UAT-FULL-20260605-022',12,'MPO482025062100002','M500108439','3521C0016',1.00000000),
('PO-UAT-FULL-20260605-023',1,'MPO482025062100003','M500108487','3521C0016',1.00000000),
('PO-UAT-FULL-20260605-023',2,'MPO482025062100003','M500108488','3521C0016',1.00000000),
('PO-UAT-FULL-20260605-023',3,'MPO482025062100003','M500108489','3521C0016',1.00000000),
('PO-UAT-FULL-20260605-023',4,'MPO482025062100003','M500108490','352AD0A',1.00000000),
('PO-UAT-FULL-20260605-023',5,'MPO482025062100003','M500108491','352AD0A',1.00000000),
('PO-UAT-FULL-20260605-023',6,'MPO482025062100003','M500108492','352AD0A',1.00000000),
('PO-UAT-FULL-20260605-023',7,'MPO482025062100003','M500108493','352AD0A',1.00000000),
('PO-UAT-FULL-20260605-023',8,'MPO482025062100003','M500108494','352AD0A',1.00000000),
('PO-UAT-FULL-20260605-023',9,'MPO482025062100003','M500108495','352AD0A',1.00000000),
('PO-UAT-FULL-20260605-023',10,'MPO482025062100003','M500108496','352AD0A',1.00000000),
('PO-UAT-FULL-20260605-023',11,'MPO482025062100003','M500108497','352AD0A',1.00000000),
('PO-UAT-FULL-20260605-023',12,'MPO482025062100003','M500108498','352AD0A',1.00000000),
('PO-UAT-FULL-20260605-023',13,'MPO482025062100003','M500108499','352AD0A',1.00000000),
('PO-UAT-FULL-20260605-024',1,'MPO482025062600003','M500109125','91CC0178',4000.00000000),
('PO-UAT-FULL-20260605-024',2,'MPO482025062600003','M500109128','91CC0285',2000.00000000),
('PO-UAT-FULL-20260605-024',3,'MPO482025062600003','M500109132','91CC0286',4000.00000000),
('PO-UAT-FULL-20260605-024',4,'MPO482025062600003','M500109134','A2B8361',4000.00000000),
('PO-UAT-FULL-20260605-025',1,'MPO482025081500001','M500123310','1A0C273',200.00000000),
('PO-UAT-FULL-20260605-025',2,'MPO482025081500001','M500123311','1A0C275',272.00000000),
('PO-UAT-FULL-20260605-025',3,'MPO482025081500001','M500123312','1A004C4',960000.00000000),
('PO-UAT-FULL-20260605-025',4,'MPO482025081500001','M500123313','ABC419',1000.00000000),
('PO-UAT-FULL-20260605-025',5,'MPO482025081500001','M500123314','ABC431',2000.00000000),
('PO-UAT-FULL-20260605-025',6,'MPO482025081500001','M500123315','1A0C432',1000.00000000),
('PO-UAT-FULL-20260605-025',7,'MPO482025081500001','M500123316','1A0C588',29000.00000000),
('PO-UAT-FULL-20260605-025',8,'MPO482025081500001','M500123317','1A0C595',670000.00000000),
('PO-UAT-FULL-20260605-025',9,'MPO482025081500001','M500123318','AB32A4',111.00000000),
('PO-UAT-FULL-20260605-026',1,'MPO482025081500002','M500123386','A21C092',550.00000000),
('PO-UAT-FULL-20260605-026',2,'MPO482025081500002','M500123387','A21C093',60.00000000),
('PO-UAT-FULL-20260605-026',3,'MPO482025081500002','M500123388','91B0D033',38.00000000),
('PO-UAT-FULL-20260605-026',4,'MPO482025081500002','M500123389','91C0D058',558.00000000),
('PO-UAT-FULL-20260605-026',5,'MPO482025081500002','M500123390','91C0D074',2522.00000000),
('PO-UAT-FULL-20260605-026',6,'MPO482025081500002','M500123392','91C0DA8',69.00000000),
('PO-UAT-FULL-20260605-026',7,'MPO482025081500002','M500123393','93B0D1A',185.00000000),
('PO-UAT-FULL-20260605-026',8,'MPO482025081500002','M500123395','91CC0123',2.00000000),
('PO-UAT-FULL-20260605-026',9,'MPO482025081500002','M500123396','91CC0229',862.00000000),
('PO-UAT-FULL-20260605-026',10,'MPO482025081500002','M500123401','91CC0262',200.00000000),
('PO-UAT-FULL-20260605-026',11,'MPO482025081500002','M500123404','91CC0286',3000.00000000),
('PO-UAT-FULL-20260605-026',12,'MPO482025081500002','M500123405','91CC0312',300.00000000),
('PO-UAT-FULL-20260605-026',13,'MPO482025081500002','M500123407','91C0DD4',100.00000000),
('PO-UAT-FULL-20260605-026',14,'MPO482025081500002','M500123408','91CC0412',58.00000000),
('PO-UAT-FULL-20260605-026',15,'MPO482025081500002','M500123409','91C0DE2',400.00000000),
('PO-UAT-FULL-20260605-026',16,'MPO482025081500002','M500123411','91C0DE3',1050.00000000),
('PO-UAT-FULL-20260605-026',17,'MPO482025081500002','M500123413','91C0DE6',400.00000000),
('PO-UAT-FULL-20260605-026',18,'MPO482025081500002','M500123414','91C0DE7',1000.00000000),
('PO-UAT-FULL-20260605-026',19,'MPO482025081500002','M500123415','91C0DE9',350.00000000),
('PO-UAT-FULL-20260605-026',20,'MPO482025081500002','M500123416','91C0D5A',1100.00000000),
('PO-UAT-FULL-20260605-026',21,'MPO482025081500002','M500123417','91CC0518',1250.00000000),
('PO-UAT-FULL-20260605-026',22,'MPO482025081500002','M500123418','91CC0521',3000.00000000),
('PO-UAT-FULL-20260605-026',23,'MPO482025081500002','M500123419','91CC0524',1500.00000000),
('PO-UAT-FULL-20260605-026',24,'MPO482025081500002','M500123420','91CC0525',3000.00000000),
('PO-UAT-FULL-20260605-026',25,'MPO482025081500002','M500123421','91FC0339',600.00000000),
('PO-UAT-FULL-20260605-026',26,'MPO482025081500002','M500123423','1AB9259',5000.00000000),
('PO-UAT-FULL-20260605-026',27,'MPO482025081500002','M500123425','3124C0015',8000.00000000),
('PO-UAT-FULL-20260605-026',28,'MPO482025081500002','M500123426','3151C0032',1.00000000),
('PO-UAT-FULL-20260605-026',29,'MPO482025081500002','M500123427','1A0C452',1000.00000000),
('PO-UAT-FULL-20260605-026',30,'MPO482025081500002','M500123430','91CC0517',100.00000000),
('PO-UAT-FULL-20260605-026',31,'MPO482025081500002','M500123431','3151C0034',1.00000000),
('PO-UAT-FULL-20260605-026',32,'MPO482025081500002','M500123432','3151C0034',1.00000000),
('PO-UAT-FULL-20260605-026',33,'MPO482025081500002','M500123433','3151C0034',1.00000000),
('PO-UAT-FULL-20260605-026',34,'MPO482025081500002','M500123434','3151C0034',1.00000000),
('PO-UAT-FULL-20260605-026',35,'MPO482025081500002','M500123435','3151C0034',1.00000000),
('PO-UAT-FULL-20260605-026',36,'MPO482025081500002','M500123436','3151C0033',1.00000000),
('PO-UAT-FULL-20260605-026',37,'MPO482025081500002','M500123437','3151C0033',1.00000000),
('PO-UAT-FULL-20260605-026',38,'MPO482025081500002','M500123438','3151C0033',1.00000000),
('PO-UAT-FULL-20260605-026',39,'MPO482025081500002','M500123439','3151C0033',1.00000000),
('PO-UAT-FULL-20260605-026',40,'MPO482025081500002','M500123440','3151C0033',1.00000000),
('PO-UAT-FULL-20260605-026',41,'MPO482025081500002','M500123441','3151C0033',1.00000000),
('PO-UAT-FULL-20260605-026',42,'MPO482025081500002','M500123442','3151C0033',1.00000000),
('PO-UAT-FULL-20260605-026',43,'MPO482025081500002','M500123443','3151C0033',1.00000000),
('PO-UAT-FULL-20260605-026',44,'MPO482025081500002','M500123444','3521C0015',1.00000000),
('PO-UAT-FULL-20260605-026',45,'MPO482025081500002','M500123445','3521C0015',1.00000000),
('PO-UAT-FULL-20260605-026',46,'MPO482025081500002','M500123446','3521C0015',1.00000000),
('PO-UAT-FULL-20260605-026',47,'MPO482025081500002','M500123447','3521C0015',1.00000000),
('PO-UAT-FULL-20260605-026',48,'MPO482025081500002','M500123448','3521C0015',1.00000000),
('PO-UAT-FULL-20260605-026',49,'MPO482025081500002','M500123449','3521C0015',1.00000000),
('PO-UAT-FULL-20260605-026',50,'MPO482025081500002','M500123450','3521C0015',1.00000000),
('PO-UAT-FULL-20260605-026',51,'MPO482025081500002','M500123451','3521C0015',1.00000000),
('PO-UAT-FULL-20260605-026',52,'MPO482025081500002','M500123452','3521C0015',1.00000000),
('PO-UAT-FULL-20260605-026',53,'MPO482025081500002','M500123453','3521C0015',1.00000000),
('PO-UAT-FULL-20260605-026',54,'MPO482025081500002','M500123454','3521C0015',1.00000000),
('PO-UAT-FULL-20260605-026',55,'MPO482025081500002','M500123455','3521C0015',1.00000000),
('PO-UAT-FULL-20260605-026',56,'MPO482025081500002','M500123456','3521C0015',1.00000000),
('PO-UAT-FULL-20260605-027',1,'MPO482025082900002','M500124855','91C0D2G',5000.00000000),
('PO-UAT-FULL-20260605-027',2,'MPO482025082900002','M500124858','93BC0311',510.00000000),
('PO-UAT-FULL-20260605-027',3,'MPO482025082900002','M500124861','91CC0312',500.00000000),
('PO-UAT-FULL-20260605-027',4,'MPO482025082900002','M500124864','91CC0233',400.00000000),
('PO-UAT-FULL-20260605-027',5,'MPO482025082900002','M500124867','91CC0232',1500.00000000),
('PO-UAT-FULL-20260605-028',1,'MPO482025090400005','M500125396','91CC0312',5000.00000000),
('PO-UAT-FULL-20260605-028',2,'MPO482025090400005','M500125401','93BC0311',5000.00000000),
('PO-UAT-FULL-20260605-029',1,'MPO482025091800003','M500130061','91CC0483',1900.00000000),
('PO-UAT-FULL-20260605-029',2,'MPO482025091800003','M500130063','91CC0312',100.00000000),
('PO-UAT-FULL-20260605-029',3,'MPO482025091800003','M500130067','93BC0311',600.00000000),
('PO-UAT-FULL-20260605-029',4,'MPO482025091800003','M500130068','91CC0313',100.00000000),
('PO-UAT-FULL-20260605-029',5,'MPO482025091800003','M500130070','91CC0229',700.00000000),
('PO-UAT-FULL-20260605-030',1,'MPO482025091900001','M500130445','91CC0182',10000.00000000),
('PO-UAT-FULL-20260605-030',2,'MPO482025091900001','M500130446','312CD009',10000.00000000),
('PO-UAT-FULL-20260605-030',3,'MPO482025091900001','M500130447','3123C0012',10000.00000000),
('PO-UAT-FULL-20260605-030',4,'MPO482025091900001','M500130448','3123C0026',3000.00000000),
('PO-UAT-FULL-20260605-030',5,'MPO482025091900001','M500130449','3123C0027',3000.00000000),
('PO-UAT-FULL-20260605-030',6,'MPO482025091900001','M500130450','3123C0028',3000.00000000),
('PO-UAT-FULL-20260605-030',7,'MPO482025091900001','M500130451','3123C0035',10000.00000000),
('PO-UAT-FULL-20260605-030',8,'MPO482025091900001','M500130452','3123C0046',3000.00000000),
('PO-UAT-FULL-20260605-030',9,'MPO482025091900001','M500130453','3123C0047',3000.00000000),
('PO-UAT-FULL-20260605-030',10,'MPO482025091900001','M500130454','3123C0048',3000.00000000),
('PO-UAT-FULL-20260605-030',11,'MPO482025091900001','M500130455','3521C0015',1.00000000),
('PO-UAT-FULL-20260605-030',12,'MPO482025091900001','M500130456','3521C0015',1.00000000),
('PO-UAT-FULL-20260605-030',13,'MPO482025091900001','M500130457','3521C0015',1.00000000),
('PO-UAT-FULL-20260605-030',14,'MPO482025091900001','M500130458','3521C0015',1.00000000),
('PO-UAT-FULL-20260605-030',15,'MPO482025091900001','M500130459','3521C0016',1.00000000),
('PO-UAT-FULL-20260605-030',16,'MPO482025091900001','M500130460','3521C0016',1.00000000),
('PO-UAT-FULL-20260605-030',17,'MPO482025091900001','M500130461','3521C0016',1.00000000),
('PO-UAT-FULL-20260605-030',18,'MPO482025091900001','M500130462','3521C0016',1.00000000),
('PO-UAT-FULL-20260605-030',19,'MPO482025091900001','M500130463','3521C0016',1.00000000),
('PO-UAT-FULL-20260605-030',20,'MPO482025091900001','M500130464','3521C0016',1.00000000),
('PO-UAT-FULL-20260605-030',21,'MPO482025091900001','M500130465','3521C0015',1.00000000),
('PO-UAT-FULL-20260605-030',22,'MPO482025091900001','M500130466','3521C0015',1.00000000),
('PO-UAT-FULL-20260605-030',23,'MPO482025091900001','M500130467','3521C0015',1.00000000),
('PO-UAT-FULL-20260605-030',24,'MPO482025091900001','M500130468','3521C0015',1.00000000),
('PO-UAT-FULL-20260605-030',25,'MPO482025091900001','M500130469','3521C0015',1.00000000),
('PO-UAT-FULL-20260605-030',26,'MPO482025091900001','M500130470','3521C0015',1.00000000),
('PO-UAT-FULL-20260605-030',27,'MPO482025091900001','M500130471','3521C0015',1.00000000),
('PO-UAT-FULL-20260605-031',1,'MPO482025092200002','M500130840','91CC0283',20000.00000000),
('PO-UAT-FULL-20260605-032',1,'MPO482026012100001','M500103888','1A0044F',1000.00000000),
('PO-UAT-FULL-20260605-032',2,'MPO482026012100001','M500103890','1A0045H',1000.00000000),
('PO-UAT-FULL-20260605-032',3,'MPO482026012100001','M500103891','1A0047E',1000.00000000),
('PO-UAT-FULL-20260605-033',1,'MPO482026020300001','M500105946','1A0044F',100.00000000),
('PO-UAT-FULL-20260605-034',1,'SO241020240923001','UAT-MO-0034','91CC0232',400.00000000),
('PO-UAT-FULL-20260605-035',1,'SO241020241014001','M500028977','A2C7114',120000.00000000),
('PO-UAT-FULL-20260605-035',2,'SO241020241014001','M500028978','A2C7115',280000.00000000),
('PO-UAT-FULL-20260605-036',1,'SO241020241015003','M500028992','ABC431',6614.00000000),
('PO-UAT-FULL-20260605-036',2,'SO241020241015003','M500028993','1A0C432',7810.00000000),
('PO-UAT-FULL-20260605-037',1,'SO241020241018001','M500029021','1A0C595',200000.00000000),
('PO-UAT-FULL-20260605-037',2,'SO241020241018001','M500029024','1A03G96',1473.00000000),
('PO-UAT-FULL-20260605-037',3,'SO241020241018001','M500029027','AB3B81',256.00000000),
('PO-UAT-FULL-20260605-037',4,'SO241020241018001','M500029034','91CC0236',400.00000000),
('PO-UAT-FULL-20260605-038',1,'SO241020241019001','M500029040','91CC0228',131.00000000),
('PO-UAT-FULL-20260605-039',1,'SO241020241021002','UAT-MO-0039','1A039D8',350.00000000),
('PO-UAT-FULL-20260605-040',1,'SO241020241022001','M500029272','91CC0235',600.00000000),
('PO-UAT-FULL-20260605-041',1,'SO241020241102001','M500033844','91DC0284',813.00000000),
('PO-UAT-FULL-20260605-041',2,'SO241020241102001','M500033846','AB3B81',218.00000000),
('PO-UAT-FULL-20260605-042',1,'SO241020241102004','M500033849','91CC0179',1200.00000000),
('PO-UAT-FULL-20260605-043',1,'SO241020241104001','M500033851','91CC0229',900.00000000),
('PO-UAT-FULL-20260605-043',2,'SO241020241104001','M500033853','A2B8414',300.00000000),
('PO-UAT-FULL-20260605-043',3,'SO241020241104001','M500033854','91DC0284',263.00000000),
('PO-UAT-FULL-20260605-043',4,'SO241020241104001','M500033856','91DC0219',2030.00000000),
('PO-UAT-FULL-20260605-043',5,'SO241020241104001','M500033857','91CC0233',800.00000000),
('PO-UAT-FULL-20260605-044',1,'SO241020241219001','UAT-MO-0044','91DC0218',400.00000000),
('PO-UAT-FULL-20260605-045',1,'SO241020250114003','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
(9106000500060002,'PO-UAT-FULL-20260605-001','SH-UAT-FULL-20260605-001'),
(9106000500060003,'PO-UAT-FULL-20260605-002','SH-UAT-FULL-20260605-002'),
(9106000500060004,'PO-UAT-FULL-20260605-003','SH-UAT-FULL-20260605-003'),
(9106000500060005,'PO-UAT-FULL-20260605-004','SH-UAT-FULL-20260605-004'),
(9106000500060006,'PO-UAT-FULL-20260605-005','SH-UAT-FULL-20260605-005'),
(9106000500060007,'PO-UAT-FULL-20260605-006','SH-UAT-FULL-20260605-006'),
(9106000500060008,'PO-UAT-FULL-20260605-007','SH-UAT-FULL-20260605-007'),
(9106000500060009,'PO-UAT-FULL-20260605-008','SH-UAT-FULL-20260605-008'),
(9106000500060010,'PO-UAT-FULL-20260605-009','SH-UAT-FULL-20260605-009'),
(9106000500060011,'PO-UAT-FULL-20260605-010','SH-UAT-FULL-20260605-010'),
(9106000500060012,'PO-UAT-FULL-20260605-011','SH-UAT-FULL-20260605-011'),
(9106000500060013,'PO-UAT-FULL-20260605-012','SH-UAT-FULL-20260605-012'),
(9106000500060014,'PO-UAT-FULL-20260605-013','SH-UAT-FULL-20260605-013'),
(9106000500060015,'PO-UAT-FULL-20260605-014','SH-UAT-FULL-20260605-014'),
(9106000500060016,'PO-UAT-FULL-20260605-015','SH-UAT-FULL-20260605-015'),
(9106000500060017,'PO-UAT-FULL-20260605-016','SH-UAT-FULL-20260605-016'),
(9106000500060018,'PO-UAT-FULL-20260605-017','SH-UAT-FULL-20260605-017'),
(9106000500060019,'PO-UAT-FULL-20260605-018','SH-UAT-FULL-20260605-018'),
(9106000500060020,'PO-UAT-FULL-20260605-019','SH-UAT-FULL-20260605-019'),
(9106000500060021,'PO-UAT-FULL-20260605-020','SH-UAT-FULL-20260605-020'),
(9106000500060022,'PO-UAT-FULL-20260605-021','SH-UAT-FULL-20260605-021'),
(9106000500060023,'PO-UAT-FULL-20260605-022','SH-UAT-FULL-20260605-022'),
(9106000500060024,'PO-UAT-FULL-20260605-023','SH-UAT-FULL-20260605-023'),
(9106000500060025,'PO-UAT-FULL-20260605-024','SH-UAT-FULL-20260605-024'),
(9106000500060026,'PO-UAT-FULL-20260605-025','SH-UAT-FULL-20260605-025'),
(9106000500060027,'PO-UAT-FULL-20260605-026','SH-UAT-FULL-20260605-026'),
(9106000500060028,'PO-UAT-FULL-20260605-027','SH-UAT-FULL-20260605-027'),
(9106000500060029,'PO-UAT-FULL-20260605-028','SH-UAT-FULL-20260605-028'),
(9106000500060030,'PO-UAT-FULL-20260605-029','SH-UAT-FULL-20260605-029'),
(9106000500060031,'PO-UAT-FULL-20260605-030','SH-UAT-FULL-20260605-030'),
(9106000500060032,'PO-UAT-FULL-20260605-031','SH-UAT-FULL-20260605-031'),
(9106000500060033,'PO-UAT-FULL-20260605-032','SH-UAT-FULL-20260605-032'),
(9106000500060034,'PO-UAT-FULL-20260605-033','SH-UAT-FULL-20260605-033'),
(9106000500060035,'PO-UAT-FULL-20260605-034','SH-UAT-FULL-20260605-034'),
(9106000500060036,'PO-UAT-FULL-20260605-035','SH-UAT-FULL-20260605-035'),
(9106000500060037,'PO-UAT-FULL-20260605-036','SH-UAT-FULL-20260605-036'),
(9106000500060038,'PO-UAT-FULL-20260605-037','SH-UAT-FULL-20260605-037'),
(9106000500060039,'PO-UAT-FULL-20260605-038','SH-UAT-FULL-20260605-038'),
(9106000500060040,'PO-UAT-FULL-20260605-039','SH-UAT-FULL-20260605-039'),
(9106000500060041,'PO-UAT-FULL-20260605-040','SH-UAT-FULL-20260605-040'),
(9106000500060042,'PO-UAT-FULL-20260605-041','SH-UAT-FULL-20260605-041'),
(9106000500060043,'PO-UAT-FULL-20260605-042','SH-UAT-FULL-20260605-042'),
(9106000500060044,'PO-UAT-FULL-20260605-043','SH-UAT-FULL-20260605-043'),
(9106000500060045,'PO-UAT-FULL-20260605-044','SH-UAT-FULL-20260605-044'),
(9106000500060046,'PO-UAT-FULL-20260605-045','SH-UAT-FULL-20260605-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,
    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,
       @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='PW202605100002' AND tenant_id=@tenant_id 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)
SELECT ship_id, po_billno, shddh, 'VEN00060', DATE_ADD(@now, INTERVAL 7 DAY), @operator_name, DATE_FORMAT(@now,'%Y-%m-%d'), 0
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)
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)
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 'PR-UAT-FULL-20260605-%';
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 'SH-UAT-FULL-20260605-%';

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;

