Openbravo Issue Tracking System - Retail Modules
View Issue Details
0027425Retail ModulesWeb POSpublic2014-08-22 18:492014-12-07 21:40
jecharri 
Orekaria 
immediatecriticalalways
closedfixed 
5
 
 
szapata
Production - Confirmed Stable
2014-06-27
RR14Q2.2
https://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/d9851ae39b2cc416f35e3da4765a93aa96b614e5 [^]
Yes
0027425: Cash up invoices are created as not paid since Q2.2
Cash up invoices are created as not paid since Q2.2
-Login to Web POS
-create an order
-do the cash up

Go to ERP and verify that the invoice is as not paid. Payment plan is telling that the received amount is 0 however the payment is related.

The fix must have a modulesscript
No tags attached.
caused by defect 0026444RR14Q3 closed malsasua Invoices with total gross amount of 0 should not have a payment plan 
related to defect 0027695 closed marvintm "Invoice Paid" field at Payment schedule Details level is not properly set by Cash Up process 
related to defect 0027793 closed marvintm Modulescript FixDataIssue27425 fails sometimes in Oracle 
related to defect 0030190 closed Retail Modulescript for issue 27425 has performance problems 
causes defect 0027910RR14Q4 closed Orekaria The modulescript in issue 27425 will mark credit ticket as paid 
png not_paid.png (142,505) 2014-08-22 18:52
https://issues.openbravo.com/file_download.php?file_id=7152&type=bug
png

? 27425_modulescript.sql (4,748) 2014-09-03 13:52
https://issues.openbravo.com/file_download.php?file_id=7204&type=bug
Issue History
2014-08-22 18:49jecharriNew Issue
2014-08-22 18:49jecharriAssigned To => marvintm
2014-08-22 18:49jecharriResolution time => 1409090400
2014-08-22 18:49jecharriRegression level => Production - Confirmed Stable
2014-08-22 18:49jecharriRegression introduced in release => RR14Q2.3
2014-08-22 18:49jecharriTriggers an Emergency Pack => No
2014-08-22 18:52jecharriFile Added: not_paid.png
2014-08-28 10:29OrekariaAssigned Tomarvintm => Orekaria
2014-08-28 12:12gorka_gilIssue Monitored: gorka_gil
2014-09-01 16:04eintelauIssue Monitored: eintelau
2014-09-01 18:51OrekariaRegression introduced in releaseRR14Q2.3 => RR14Q2.2
2014-09-01 19:49OrekariaRegression introduced by commit => https://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/d9851ae39b2cc416f35e3da4765a93aa96b614e5 [^]
2014-09-01 19:49OrekariaRelationship addedcaused by 0026444
2014-09-02 11:07hgbotCheckin
2014-09-02 11:07hgbotNote Added: 0069902
2014-09-02 11:07hgbotStatusnew => resolved
2014-09-02 11:07hgbotResolutionopen => fixed
2014-09-02 11:07hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/1619864e819d75839e90499b5b7f3fd6fc485d70 [^]
2014-09-02 12:35hgbotCheckin
2014-09-02 12:35hgbotNote Added: 0069910
2014-09-02 13:14hgbotCheckin
2014-09-02 13:14hgbotNote Added: 0069913
2014-09-02 14:10ngarciaIssue Monitored: ngarcia
2014-09-03 13:52OrekariaStatusresolved => new
2014-09-03 13:52OrekariaResolutionfixed => open
2014-09-03 13:52OrekariaFile Added: 27425_modulescript.sql
2014-09-03 13:52OrekariaStatusnew => scheduled
2014-09-03 13:52Orekariafix_in_branch => pi
2014-09-03 13:54OrekariaTriggers an Emergency PackNo => Yes
2014-09-03 13:54Orekariafix_in_branchpi =>
2014-09-03 13:54OrekariaStatusscheduled => resolved
2014-09-03 13:54OrekariaFixed in Version => RR14Q4
2014-09-03 13:54OrekariaResolutionopen => fixed
2014-09-03 17:31OrekariaStatusresolved => new
2014-09-03 17:31OrekariaResolutionfixed => open
2014-09-03 17:31OrekariaFixed in VersionRR14Q4 =>
2014-09-03 17:32OrekariaSummaryCash up invoices are created as not paid since Q2 => Cash up invoices are created as not paid since Q2.2
2014-09-03 17:32OrekariaDescription Updatedbug_revision_view_page.php?rev_id=6530#r6530
2014-09-03 22:03hgbotCheckin
2014-09-03 22:03hgbotNote Added: 0069950
2014-09-03 22:03hgbotStatusnew => resolved
2014-09-03 22:03hgbotResolutionopen => fixed
2014-09-03 22:03hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/1619864e819d75839e90499b5b7f3fd6fc485d70 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/b0f48be3005029a24c7d6dce8978bb6e913a6dfd [^]
2014-09-04 10:39hgbotCheckin
2014-09-04 10:39hgbotNote Added: 0069957
2014-09-04 10:39hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/b0f48be3005029a24c7d6dce8978bb6e913a6dfd [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/e1d732f9f524f136529843fe8e926d1215226f15 [^]
2014-09-11 01:41szapataReview Assigned To => szapata
2014-09-11 01:41szapataStatusresolved => closed
2014-09-26 15:08OrekariaRelationship addedrelated to 0027695
2014-10-01 15:42plujanRegression date => 2014-06-27
2014-10-08 12:24mtaalRelationship addedrelated to 0027793
2014-10-17 19:11jecharriRelationship addedcauses 0027910
2014-12-07 21:40mtaalNote Added: 0072318
2015-06-16 15:10marvintmRelationship addedrelated to 0030190

Notes
(0069902)
hgbot   
2014-09-02 11:07   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 1619864e819d75839e90499b5b7f3fd6fc485d70
Author: Rafa Alonso <rafael.alonso <at> openbravo.com>
Date: Tue Sep 02 11:07:16 2014 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/1619864e819d75839e90499b5b7f3fd6fc485d70 [^]

Fixes issue 27425: Cashup invoices are created as paid

---
M src/org/openbravo/retail/posterminal/OrderGroupingProcessor.java
---
(0069910)
hgbot   
2014-09-02 12:35   
Repository: tools/automation/pi-mobile
Changeset: ba366135abe7c26ae9fc5e155a9dde0dcdd02fb3
Author: Rafa Alonso <rafael.alonso <at> openbravo.com>
Date: Tue Sep 02 11:17:26 2014 +0200
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/ba366135abe7c26ae9fc5e155a9dde0dcdd02fb3 [^]

Related to issue 26444 and issue 27425: added regression related tests:
- I26444_InvoicesWithTotalGross0ShouldNotHavePaymentPlan
- I27425_InvoicesWronglyCreatedAsNotPaid

---
M src-test/org/openbravo/retail/integrationtest/tests/issues/RetailIssuesTestSuite.java
A src-test/org/openbravo/retail/integrationtest/tests/issues/I26444_InvoicesWithTotalGross0ShouldNotHavePaymentPlan.java
A src-test/org/openbravo/retail/integrationtest/tests/issues/I27425_InvoicesWronglyCreatedAsNotPaid.java
R src-test/org/openbravo/retail/integrationtest/tests/issues/pending/I26444_InvoicesWithTotalGross0ShouldNotHavePaymentPlan.java
---
(0069913)
hgbot   
2014-09-02 13:14   
Repository: tools/automation/pi-mobile
Changeset: 5ac93a6db640f44593027df2b65729d42c48c400
Author: Rafa Alonso <rafael.alonso <at> openbravo.com>
Date: Tue Sep 02 13:14:23 2014 +0200
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/5ac93a6db640f44593027df2b65729d42c48c400 [^]

Related to issue 27425: added CreateSaleWithInvoice test for regular invoiced sales

---
M src-test/org/openbravo/retail/integrationtest/tests/RetailTestSuite.java
A src-test/org/openbravo/retail/integrationtest/tests/smoke/sales/CreateSaleWithInvoice.java
---
(0069950)
hgbot   
2014-09-03 22:03   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: b0f48be3005029a24c7d6dce8978bb6e913a6dfd
Author: Rafa Alonso <rafael.alonso <at> openbravo.com>
Date: Wed Sep 03 22:02:34 2014 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/b0f48be3005029a24c7d6dce8978bb6e913a6dfd [^]

Fixes issue 27425: Added modulescript to fix WebPOS cashup invoices wrongly created as not paid and with wrong amounts

---
A build/classes/org/openbravo/retail/posterminal/modulescript/FixDataIssue27425.class
A build/classes/org/openbravo/retail/posterminal/modulescript/FixDataIssue27425Data.class
A src-util/modulescript/src/org/openbravo/retail/posterminal/modulescript/FixDataIssue27425.java
A src-util/modulescript/src/org/openbravo/retail/posterminal/modulescript/FixDataIssue27425_Data.xsql
---
(0069957)
hgbot   
2014-09-04 10:39   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: e1d732f9f524f136529843fe8e926d1215226f15
Author: Rafa Alonso <rafael.alonso <at> openbravo.com>
Date: Thu Sep 04 10:37:24 2014 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/e1d732f9f524f136529843fe8e926d1215226f15 [^]

Fixes issue 27425: Added modulescript to fix WebPOS cashup invoices wrongly created as not paid and with wrong amounts.
- Commercial license text
- Compiled for Java 6

---
M build/classes/org/openbravo/retail/posterminal/modulescript/FixDataIssue27425.class
M build/classes/org/openbravo/retail/posterminal/modulescript/FixDataIssue27425Data.class
M src-util/modulescript/src/org/openbravo/retail/posterminal/modulescript/FixDataIssue27425.java
M src-util/modulescript/src/org/openbravo/retail/posterminal/modulescript/FixDataIssue27425_Data.xsql
---
(0072318)
mtaal   
2014-12-07 21:40   
There can be a situation that the grandtotal is only slightly different from the payment plan total. Like one or 2 cents difference. This can occur when the POS precision has not been set. Therefore below 2 queries which can be used in that case:
UPDATE fin_payment_schedule a
        SET paidamt = amount
        WHERE exists (
        SELECT c_invoice.c_invoice_id
        FROM c_invoice
        INNER JOIN c_invoiceline ON c_invoice.c_invoice_id = c_invoiceline.c_invoice_id
        LEFT JOIN fin_payment_schedule ON c_invoice.c_invoice_id = fin_payment_schedule.c_invoice_id
        INNER JOIN fin_payment_scheduledetail on fin_payment_schedule.fin_payment_schedule_id=fin_payment_scheduledetail.fin_payment_schedule_invoice
        INNER JOIN fin_payment_detail det on fin_payment_scheduledetail.fin_payment_detail_id=det.fin_payment_detail_id
        INNER JOIN c_orderline ON c_invoiceline.c_orderline_id = c_orderline.c_orderline_id
        INNER JOIN c_order ON c_orderline.c_order_id = c_order.c_order_id
        WHERE c_order.em_obpos_app_cashup_id IS NOT null AND c_invoice.c_invoice_id=a.c_invoice_id AND fin_payment_schedule.fin_payment_schedule_id IS NOT NULL AND c_invoice.ispaid = 'N'
        AND abs(c_invoice.grandtotal - (SELECT sum(pd.amount) from fin_payment_scheduledetail psd, fin_payment_detail pd WHERE pd.fin_payment_detail_id=psd.fin_payment_detail_id
     and psd.fin_payment_schedule_invoice =fin_payment_schedule.fin_payment_schedule_id))<1)

UPDATE c_invoice a
        SET totalpaid = grandtotal,
            outstandingamt = 0,
            finalsettlement = created,
            ispaid = 'Y'
        WHERE exists (
        SELECT c_invoice.c_invoice_id
        FROM c_invoice
        INNER JOIN c_invoiceline ON c_invoice.c_invoice_id = c_invoiceline.c_invoice_id
        LEFT JOIN fin_payment_schedule ON c_invoice.c_invoice_id = fin_payment_schedule.c_invoice_id
        INNER JOIN fin_payment_scheduledetail on fin_payment_schedule.fin_payment_schedule_id=fin_payment_scheduledetail.fin_payment_schedule_invoice
        INNER JOIN fin_payment_detail det on fin_payment_scheduledetail.fin_payment_detail_id=det.fin_payment_detail_id
        INNER JOIN c_orderline ON c_invoiceline.c_orderline_id = c_orderline.c_orderline_id
        INNER JOIN c_order ON c_orderline.c_order_id = c_order.c_order_id
        WHERE c_order.em_obpos_app_cashup_id IS NOT null AND c_invoice.c_invoice_id=a.c_invoice_id AND fin_payment_schedule.fin_payment_schedule_id IS NOT NULL AND c_invoice.ispaid = 'N'
        AND abs((SELECT sum(pd.amount) from fin_payment_scheduledetail psd, fin_payment_detail pd WHERE pd.fin_payment_detail_id=psd.fin_payment_detail_id
     and psd.fin_payment_schedule_invoice =fin_payment_schedule.fin_payment_schedule_id)-c_invoice.grandtotal)<1)
        )