* fixed datatype issue
This commit is contained in:
parent
b620db2b08
commit
de147cbc69
|
@ -18,12 +18,12 @@ SELECT i.C_Invoice_ID, i.AD_Client_ID, i.AD_Org_ID, i.IsActive, i.Created, i.Cre
|
|||
i.AD_User_ID, i.POReference, i.DateOrdered, i.C_Currency_ID, i.C_ConversionType_ID, i.PaymentRule,
|
||||
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, null 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 Multiplier,
|
||||
CASE WHEN charAt(d.DocBaseType,2)='P' THEN -1 ELSE 1 END AS MultiplierAP,
|
||||
i.IsPayScheduleValid, cast(null as integer) AS C_InvoicePaySchedule_ID, i.InvoiceCollectionType,
|
||||
cast(CASE WHEN charAt(d.DocBaseType,3)='C' THEN i.ChargeAmt*-1 ELSE i.ChargeAmt END as numeric) AS ChargeAmt,
|
||||
cast(CASE WHEN charAt(d.DocBaseType,3)='C' THEN i.TotalLines*-1 ELSE i.TotalLines END as numeric) AS TotalLines,
|
||||
cast(CASE WHEN charAt(d.DocBaseType,3)='C' THEN i.GrandTotal*-1 ELSE i.GrandTotal END as numeric) AS GrandTotal,
|
||||
cast(CASE WHEN charAt(d.DocBaseType,3)='C' THEN -1 ELSE 1 END as numeric) AS Multiplier,
|
||||
cast(CASE WHEN charAt(d.DocBaseType,2)='P' THEN -1 ELSE 1 END AS numeric) as MultiplierAP,
|
||||
d.DocBaseType
|
||||
FROM C_Invoice i
|
||||
INNER JOIN C_DocType d ON (i.C_DocType_ID=d.C_DocType_ID)
|
||||
|
|
|
@ -18,7 +18,7 @@ SELECT i.C_Invoice_ID, i.AD_Client_ID, i.AD_Org_ID, i.IsActive, i.Created, i.Cre
|
|||
i.AD_User_ID, i.POReference, i.DateOrdered, i.C_Currency_ID, i.C_ConversionType_ID, i.PaymentRule,
|
||||
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 numeric(10)) AS C_InvoicePaySchedule_ID, i.InvoiceCollectionType,
|
||||
i.IsPayScheduleValid, cast(null as integer) 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,
|
||||
|
|
|
@ -19,7 +19,7 @@ SELECT i.AD_Org_ID, i.AD_Client_ID,
|
|||
invoiceOpen(i.C_Invoice_ID,0) AS OpenAmt,
|
||||
i.C_Currency_ID, i.C_ConversionType_ID,
|
||||
i.C_PaymentTerm_ID,
|
||||
i.IsPayScheduleValid, null AS C_InvoicePaySchedule_ID, i.InvoiceCollectionType,
|
||||
i.IsPayScheduleValid, cast(null as integer) AS C_InvoicePaySchedule_ID, i.InvoiceCollectionType,
|
||||
i.C_Campaign_ID, i.C_Project_ID, i.C_Activity_ID
|
||||
FROM RV_C_Invoice i
|
||||
INNER JOIN C_PaymentTerm p ON (i.C_PaymentTerm_ID=p.C_PaymentTerm_ID)
|
||||
|
|
Loading…
Reference in New Issue