From 41d4657556571a7d85a76cfdf3b3f88e817a5534 Mon Sep 17 00:00:00 2001 From: teo_sarca Date: Tue, 2 Sep 2008 06:32:24 +0000 Subject: [PATCH] fix bug introduced in rev. 6305 - the C_Invoice_v is not valid --- db/ddlutils/oracle/views/C_INVOICE_V.sql | 10 +++++----- .../352a-trunk/280_FB_1926882_Fix_C_Invoice_v.sql | 15 ++++++--------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/db/ddlutils/oracle/views/C_INVOICE_V.sql b/db/ddlutils/oracle/views/C_INVOICE_V.sql index 6aa4ebef13..80ba51a5a3 100644 --- a/db/ddlutils/oracle/views/C_INVOICE_V.sql +++ b/db/ddlutils/oracle/views/C_INVOICE_V.sql @@ -20,11 +20,11 @@ SELECT i.C_Invoice_ID, i.AD_Client_ID, i.AD_Org_ID, i.IsActive, i.Created, i.Cre i.C_PaymentTerm_ID, i.C_Charge_ID, i.M_PriceList_ID, i.C_Campaign_ID, i.C_Project_ID, i.C_Activity_ID, i.IsPrinted, i.IsDiscountPrinted, i.IsPaid, i.IsInDispute, i.IsPayScheduleValid, cast(null as number) AS C_InvoicePaySchedule_ID, i.InvoiceCollectionType, - CASE WHEN charAt(d.DocBaseType,3)='C' THEN i.ChargeAmt*-1 ELSE i.ChargeAmt END AS ChargeAmt, - CASE WHEN charAt(d.DocBaseType,3)='C' THEN i.TotalLines*-1 ELSE i.TotalLines END AS TotalLines, - CASE WHEN charAt(d.DocBaseType,3)='C' THEN i.GrandTotal*-1 ELSE i.GrandTotal END AS GrandTotal, - CASE WHEN charAt(d.DocBaseType,3)='C' THEN -1 ELSE 1 END as number) AS Multiplier, - CASE WHEN charAt(d.DocBaseType,2)='P' THEN -1 ELSE 1 END AS number) as MultiplierAP, + (CASE WHEN charAt(d.DocBaseType,3)='C' THEN i.ChargeAmt*-1 ELSE i.ChargeAmt END) AS ChargeAmt, + (CASE WHEN charAt(d.DocBaseType,3)='C' THEN i.TotalLines*-1 ELSE i.TotalLines END) AS TotalLines, + (CASE WHEN charAt(d.DocBaseType,3)='C' THEN i.GrandTotal*-1 ELSE i.GrandTotal END) AS GrandTotal, + (CASE WHEN charAt(d.DocBaseType,3)='C' THEN -1 ELSE 1 END) AS Multiplier, + (CASE WHEN charAt(d.DocBaseType,2)='P' THEN -1 ELSE 1 END) AS MultiplierAP, d.DocBaseType , paymentTermDueDate(i.C_PaymentTerm_ID, i.DateInvoiced) as DueDate FROM C_Invoice i diff --git a/migration/352a-trunk/280_FB_1926882_Fix_C_Invoice_v.sql b/migration/352a-trunk/280_FB_1926882_Fix_C_Invoice_v.sql index 29b8262ef9..133d9c6887 100644 --- a/migration/352a-trunk/280_FB_1926882_Fix_C_Invoice_v.sql +++ b/migration/352a-trunk/280_FB_1926882_Fix_C_Invoice_v.sql @@ -1,4 +1,3 @@ -DROP VIEW C_INVOICE_V; CREATE OR REPLACE VIEW C_INVOICE_V (C_INVOICE_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, ISSOTRX, DOCUMENTNO, @@ -21,11 +20,11 @@ SELECT i.C_Invoice_ID, i.AD_Client_ID, i.AD_Org_ID, i.IsActive, i.Created, i.Cre i.C_PaymentTerm_ID, i.C_Charge_ID, i.M_PriceList_ID, i.C_Campaign_ID, i.C_Project_ID, i.C_Activity_ID, i.IsPrinted, i.IsDiscountPrinted, i.IsPaid, i.IsInDispute, i.IsPayScheduleValid, cast(null as number) AS C_InvoicePaySchedule_ID, i.InvoiceCollectionType, - CASE WHEN charAt(d.DocBaseType,3)='C' THEN i.ChargeAmt*-1 ELSE i.ChargeAmt END AS ChargeAmt, - CASE WHEN charAt(d.DocBaseType,3)='C' THEN i.TotalLines*-1 ELSE i.TotalLines END AS TotalLines, - CASE WHEN charAt(d.DocBaseType,3)='C' THEN i.GrandTotal*-1 ELSE i.GrandTotal END AS GrandTotal, - CASE WHEN charAt(d.DocBaseType,3)='C' THEN -1 ELSE 1 END as number) AS Multiplier, - CASE WHEN charAt(d.DocBaseType,2)='P' THEN -1 ELSE 1 END AS number) as MultiplierAP, + (CASE WHEN charAt(d.DocBaseType,3)='C' THEN i.ChargeAmt*-1 ELSE i.ChargeAmt END) AS ChargeAmt, + (CASE WHEN charAt(d.DocBaseType,3)='C' THEN i.TotalLines*-1 ELSE i.TotalLines END) AS TotalLines, + (CASE WHEN charAt(d.DocBaseType,3)='C' THEN i.GrandTotal*-1 ELSE i.GrandTotal END) AS GrandTotal, + (CASE WHEN charAt(d.DocBaseType,3)='C' THEN -1 ELSE 1 END) AS Multiplier, + (CASE WHEN charAt(d.DocBaseType,2)='P' THEN -1 ELSE 1 END) AS MultiplierAP, d.DocBaseType , paymentTermDueDate(i.C_PaymentTerm_ID, i.DateInvoiced) as DueDate FROM C_Invoice i @@ -52,6 +51,4 @@ FROM C_Invoice i INNER JOIN C_InvoicePaySchedule ips ON (i.C_Invoice_ID=ips.C_Invoice_ID) WHERE i.IsPayScheduleValid='Y' AND ips.IsValid='Y'; - - - +/