-- IDEMPIERE-5953 Can not select Order or Material receipt on Create lines from on Vendor Invoice as it do not show any value SELECT register_migration_script('202312081400_IDEMPIERE-5953.sql') FROM dual; SET SQLBLANKLINES ON SET DEFINE OFF -- Dec 8, 2023, 2:00:16 PM CET UPDATE AD_Val_Rule SET Code='C_BPartner_ID=@C_BPartner_ID@ AND IsSOTrx=''@IsSOTrx@'' AND DocStatus IN (''CL'',''CO'') AND C_Order_ID IN (SELECT C_Order_ID FROM C_OrderLine WHERE QtyOrdered-QtyDelivered!=0) AND M_Warehouse_ID = (CASE WHEN @M_Warehouse_ID@>0 THEN @M_Warehouse_ID@ ELSE M_Warehouse_ID END)',Updated=TO_DATE('2023-12-08 14:00:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=200164 ; -- Dec 8, 2023, 2:52:48 PM CET UPDATE AD_InfoWindow SET WhereClause='(CASE WHEN (SELECT COUNT(*) from C_DocType WHERE C_DocType_ID=@C_DocTypeTarget_ID@ AND DocBaseType IN (''APC'',''ARC''))=1 THEN v.CreditQty*v.Multiplier <> 0 ELSE v.Qty*v.Multiplier <> 0 END) AND (v.C_OrderLine_ID IS NULL OR v.C_OrderLine_ID NOT IN (SELECT il.C_OrderLine_ID FROM C_InvoiceLine il, C_Invoice i WHERE il.C_Invoice_ID = i.C_Invoice_ID AND i.DocStatus=''IP'' AND il.C_OrderLine_ID > 0)) AND (v.M_InOutLine_ID IS NULL OR v.M_InOutLine_ID NOT IN (SELECT il.M_InOutLine_ID FROM C_InvoiceLine il, C_Invoice i WHERE il.C_Invoice_ID = i.C_Invoice_ID AND i.DocStatus=''IP'' AND il.M_InOutLine_ID > 0)) AND (v.M_RMALine_ID IS NULL OR v.M_RMALine_ID NOT IN (SELECT il.M_RMALine_ID FROM C_InvoiceLine il, C_Invoice i WHERE il.C_Invoice_ID = i.C_Invoice_ID AND i.DocStatus=''IP'' AND il.M_RMALine_ID > 0))', IsValid='Y',Updated=TO_TIMESTAMP('2023-12-08 14:52:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoWindow_ID=200024 ; -- Dec 8, 2023, 2:53:43 PM CET UPDATE AD_InfoColumn SET SelectClause='(CASE WHEN (SELECT COUNT(*) from C_DocType WHERE C_DocType_ID=@C_DocTypeTarget_ID@ AND DocBaseType IN (''APC'',''ARC''))=1 THEN v.CreditQty*v.Multiplier ELSE v.Qty*v.Multiplier END)',Updated=TO_TIMESTAMP('2023-12-08 14:53:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200269 ; -- Dec 8, 2023, 3:17:46 PM CET UPDATE AD_Val_Rule SET Code='Bill_BPartner_ID=@C_BPartner_ID@ AND IsSOTrx=''@IsSOTrx@'' AND DocStatus IN (''CL'',''CO'') AND ( ( (SELECT COUNT(*) FROM C_DocType WHERE C_DocType_ID=@C_DocTypeTarget_ID@ AND DocBaseType IN (''APC'',''ARC''))=1 AND C_Order_ID IN (SELECT ol.C_Order_ID FROM C_OrderLine ol WHERE ol.QtyInvoiced>0 AND ((ol.QtyDelivered>=ol.QtyOrdered AND ol.QtyDelivered-ol.QtyInvoiced!=0) OR (ol.QtyDelivered