Virtue-Digital-Indonesia / nle_connect

0 stars 0 forks source link

[MERGE] Check bill landing #284

Closed Didikirawanvalid closed 1 year ago

Didikirawanvalid commented 1 year ago

277

Add new column in table booking_detail_unloading

ALTER TABLE `nletes`.`booking_detail_unloading` 
ADD COLUMN `PAYMENT_STATUS` VARCHAR(45) NULL AFTER `CONTAINER_NUMBER`;

UPDATE nlebackend.booking_detail_unloading
SET payment_status = 'PAID'
WHERE booking_header_id IN (
    SELECT id
    FROM nlebackend.booking_header
    WHERE booking_header.BOOKING_STATUS = 'SUCCESS'
);

UPDATE nlebackend.booking_detail_unloading
SET payment_status = 'UNPAID'
WHERE booking_header_id IN (
    SELECT id
    FROM nlebackend.booking_header
    WHERE booking_header.BOOKING_STATUS IN ('WAITING' , 'CANCEL')
);