IDEMPIERE-4774 Fix number sign for Matching Vendor Returns (#669)

This commit is contained in:
igorpojzl 2021-05-04 15:19:53 +02:00 committed by GitHub
parent a22b36b744
commit b002667750
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -361,7 +361,7 @@ public class Match
m_qtyColumn = "lin.MovementQty";
m_sql.append("SELECT hdr.M_InOut_ID,hdr.DocumentNo, hdr.MovementDate, bp.Name,hdr.C_BPartner_ID,"
+ " lin.Line,lin.M_InOutLine_ID, p.Name,lin.M_Product_ID,"
+ " lin.MovementQty,SUM(NVL(m.Qty,0)),org.Name, hdr.AD_Org_ID " //JAVIER
+ " CASE WHEN (dt.DocBaseType='MMS' AND hdr.issotrx='N') THEN lin.MovementQty * -1 ELSE lin.MovementQty END,SUM(NVL(m.Qty,0)),org.Name, hdr.AD_Org_ID " //JAVIER
+ "FROM M_InOut hdr"
+ " INNER JOIN AD_Org org ON (hdr.AD_Org_ID=org.AD_Org_ID)" //JAVIER
+ " INNER JOIN C_BPartner bp ON (hdr.C_BPartner_ID=bp.C_BPartner_ID)"
@ -378,9 +378,9 @@ public class Match
m_sql.append(" AND m.C_OrderLine_ID = ").append(Line_ID);
m_groupBy = " GROUP BY hdr.M_InOut_ID,hdr.DocumentNo,hdr.MovementDate,bp.Name,hdr.C_BPartner_ID,"
+ " lin.Line,lin.M_InOutLine_ID,p.Name,lin.M_Product_ID,lin.MovementQty, org.Name, hdr.AD_Org_ID " //JAVIER
+ " lin.Line,lin.M_InOutLine_ID,p.Name,lin.M_Product_ID,lin.MovementQty, org.Name, hdr.AD_Org_ID, dt.DocBaseType " //JAVIER
+ "HAVING "
+ (matched ? "0" : "lin.MovementQty")
+ (matched ? "0" : "CASE WHEN (dt.DocBaseType='MMS' AND hdr.issotrx='N') THEN lin.MovementQty * -1 ELSE lin.MovementQty END")
+ "<>SUM(NVL(m.Qty,0))";
}
// Log.trace(7, "VMatch.tableInit", m_sql + "\n" + m_groupBy);