/** 对公报销单 **/
UPDATE T_ER_PUBREIMINVOICEITEM ITEM SET FINVOICEITEMSERIALNO = (select BILL.FSERIALNO FROM T_ER_PUBREIMINVOICEINFO BILL WHERE ITEM.FID = BILL.FID AND ITEM.FINVOICEHEADENTRYID = BILL.FENTRYID) WHERE EXISTS (SELECT BILL.FSERIALNO FROM T_ER_PUBREIMINVOICEINFO BILL WHERE ITEM.FID = BILL.FID AND ITEM.FINVOICEHEADENTRYID = BILL.FENTRYID);
UPDATE T_ER_PUBINVOICEANDEXPENSE ITEM SET FINVOICEEXPSERIALNO = (select BILL.FSERIALNO FROM T_ER_PUBREIMINVOICEINFO BILL WHERE ITEM.FID = BILL.FID AND ITEM.FINVOICEENTRYID = BILL.FENTRYID) WHERE EXISTS (SELECT BILL.FSERIALNO FROM T_ER_PUBREIMINVOICEINFO BILL WHERE ITEM.FID = BILL.FID AND ITEM.FINVOICEENTRYID = BILL.FENTRYID);
/** 费用报销单 **/
UPDATE T_ER_INVOICEITEM ITEM SET FINVOICEITEMSERIALNO = (select BILL.FSERIALNO FROM T_ER_INVOICEINFO BILL WHERE ITEM.FID = BILL.FID AND ITEM.FINVOICEHEADENTRYID = BILL.FENTRYID) WHERE EXISTS (SELECT BILL.FSERIALNO FROM T_ER_INVOICEINFO BILL WHERE ITEM.FID = BILL.FID AND ITEM.FINVOICEHEADENTRYID = BILL.FENTRYID);
UPDATE T_ER_INVOICEANDEXPENSE ITEM SET FINVOICEEXPSERIALNO = (select BILL.FSERIALNO FROM T_ER_INVOICEINFO BILL WHERE ITEM.FID = BILL.FID AND ITEM.FINVOICEENTRYID = BILL.FENTRYID) WHERE EXISTS (SELECT BILL.FSERIALNO FROM T_ER_INVOICEINFO BILL WHERE ITEM.FID = BILL.FID AND ITEM.FINVOICEENTRYID = BILL.FENTRYID);
/** 商旅付款申请单 **/
UPDATE T_ER_INVOICEITEMCP ITEM SET FINVOICEITEMSERIALNO = (select BILL.FSERIALNO FROM T_ER_INVOICEINFOCP BILL WHERE ITEM.FID = BILL.FID AND ITEM.FINVOICEHEADENTRYID = BILL.FENTRYID) WHERE EXISTS (SELECT BILL.FSERIALNO FROM T_ER_INVOICEINFOCP BILL WHERE ITEM.FID = BILL.FID AND ITEM.FINVOICEHEADENTRYID = BILL.FENTRYID);
UPDATE T_ER_TRIPINVOICEANDITEM ITEM SET FINVOICEEXPSERIALNO = (select BILL.FSERIALNO FROM T_ER_INVOICEINFOCP BILL WHERE ITEM.FID = BILL.FID AND ITEM.FINVOICEENTRYID = BILL.FENTRYID) WHERE EXISTS (SELECT BILL.FSERIALNO FROM T_ER_INVOICEINFOCP BILL WHERE ITEM.FID = BILL.FID AND ITEM.FINVOICEENTRYID = BILL.FENTRYID);
