Bug 24450 CM not negative in AP Select payments
authormalfredo32 <alfredo@solucionesopen.com.mx>
Sat, 30 Aug 2014 18:05:20 +0000 (13:05 -0500)
committermalfredo32 <alfredo@solucionesopen.com.mx>
Sat, 30 Aug 2014 18:05:20 +0000 (13:05 -0500)
foundation-database/public/tables/metasql/apOpenItems-selectedpayments.mql
foundation-database/public/tables/metasql/apOpenItems-selectpayments.mql

index 01e632f..69461dd 100644 (file)
@@ -1,8 +1,8 @@
 -- Group: apOpenItems
 -- Name:  selectedpayments
--- Notes:
--- Copyright (c) 1999-2014 by OpenMFG LLC, d/b/a xTuple.
--- See www.xtuple.com/CPAL for the full text of the software license.
+-- Notes: 
+--        Copyright (c) 1999-2014 by OpenMFG LLC, d/b/a xTuple.
+--        See www.xtuple.com/CPAL for the full text of the software license.
 
 SELECT *,
        CASE WHEN (apopen_doctype='V') THEN <? value("voucher") ?>
@@ -48,9 +48,9 @@ UNION
 SELECT apopen_id, apselect_id,
        (bankaccnt_name || '-' || bankaccnt_descrip) AS f_bank,
        (vend_number || '-' || vend_name) AS f_vendor,
-       apopen_docnumber, apopen_ponumber, apselect_amount,
+       apopen_docnumber, apopen_ponumber, -apselect_amount,
        apopen_invcnumber, apopen_doctype,
-       currToBase(apselect_curr_id, apselect_amount, CURRENT_DATE) AS apselect_amount_base,
+       currToBase(apselect_curr_id, apselect_amount, CURRENT_DATE) * -1.0 AS apselect_amount_base,
        currToBase(apselect_curr_id, apselect_amount, CURRENT_DATE) * -1.0 AS apselect_running_base,
        currConcat(apselect_curr_id) AS currAbbr
 FROM apopen, apselect, vendinfo, bankaccnt
index de92dbb..fa18e8e 100644 (file)
@@ -1,8 +1,8 @@
 -- Group: apOpenItems
 -- Name:  selectpayments
--- Notes:
--- Copyright (c) 1999-2014 by OpenMFG LLC, d/b/a xTuple.
--- See www.xtuple.com/CPAL for the full text of the software license.
+-- Notes: 
+--        Copyright (c) 1999-2014 by OpenMFG LLC, d/b/a xTuple.
+--        See www.xtuple.com/CPAL for the full text of the software license.
 
 SELECT *,
        CASE WHEN (apopen_doctype='V') THEN <? value("voucher") ?>
@@ -73,11 +73,11 @@ SELECT apopen_id, COALESCE(apselect_id, -1) AS apselectid,
        (vend_number || '-' || vend_name) AS vendor,
        apopen_doctype, apopen_docnumber, apopen_ponumber, apopen_invcnumber,
        apopen_duedate, apopen_terms_id, apopen_docdate, apopen_status,
-       (apopen_amount - apopen_paid - apCheckPending(apopen_id)) AS amount,
-       ((apopen_amount - apopen_paid - apCheckPending(apopen_id)) / apopen_curr_rate) AS base_amount,
+       (apopen_amount - apopen_paid - apCheckPending(apopen_id))  * -1.0 AS amount,
+       ((apopen_amount - apopen_paid - apCheckPending(apopen_id)) / apopen_curr_rate) * -1.0 AS base_amount,
        ((apopen_amount - apopen_paid - apCheckPending(apopen_id)) / apopen_curr_rate) * -1.0 AS running_amount,
-       COALESCE(apselect_amount, 0.0) AS selected,
-       (COALESCE(apselect_amount, 0.0) / apopen_curr_rate) AS base_selected,
+       COALESCE(apselect_amount, 0.0) * -1.0 AS selected,
+       (COALESCE(apselect_amount, 0.0) / apopen_curr_rate) * -1.0 AS base_selected,
        (COALESCE(apselect_amount, 0.0) / apopen_curr_rate) * -1.0 AS running_selected,
        COALESCE(apselect_discount,0.0) AS discount,
        (COALESCE(apselect_discount,0.0) / apopen_curr_rate)AS base_discount,