Openbravo Issue Tracking System - Retail Modules
View Issue Details
0033676Retail ModulesWeb POSpublic2016-08-10 10:392016-08-19 10:39
vmromanos 
Retail 
immediatemajoralways
closedfixed 
5
 
RR16Q2.2RR16Q2.2 
guilleaer
No
0033676: FIN_PaymentScheduleDetail created from POS doesn't include the Business Partner
The FIN_PaymentScheduleDetail created from POS doesn't include the Business Partner.

The ERP always sets the business partner information when creating the PSD from an invoice or an order (through extension points on C_Invoice_Post and C_Order_Post). However the POS doesn't fill it.

When the order is directly paid from the POS there is no problem. However, credit orders generated from POS couldn't be paid in the ERP after fixing 0033629, because that fix requires to have the Business Partner information.
1. Create and pay and order in POS
2. Go to the ERP and search for the associated payment (Sales Order | Payment Plan | Payment Details, and browse to the Payment In window)
3. Inside the Payment In window, go to Lines tab and verify Business Partner field is empty. It should have the order's business partner
Modify OrderLoader
Ensure created PSD has set the business partner:
paymentScheduleDetail.setBusinessPartner(order.getBusinessPartner());

Wrong data PSD should be updated. You can reuse module script UpdateBpPaymentLine.
It's recommended to modify the update queries to filter by isinvoicepaid = 'N', so it performs faster:

update fin_payment_scheduledetail psd
set c_bpartner_id = (select c_bpartner_id from c_invoice i, fin_payment_schedule ps
                     where ps.fin_payment_schedule_id = fin_payment_schedule_invoice
                     and ps.c_invoice_id = i.c_invoice_id)
where c_bpartner_id is null and fin_payment_schedule_invoice is not null and isinvoicepaid = 'N';


update fin_payment_scheduledetail psd
set c_bpartner_id = (select c_bpartner_id from c_order o, fin_payment_schedule ps
                                                     where ps.fin_payment_schedule_id = fin_payment_schedule_order
                                                     and ps.c_order_id = o.c_order_id)
where c_bpartner_id is null and fin_payment_schedule_order is not null
and fin_payment_schedule_invoice is null and isinvoicepaid = 'N';
No tags attached.
blocks defect 0033671 closed mario_castello FIN_PaymentScheduleDetail created from POS doesn't include the Business Partner 
Issue History
2016-08-10 11:09OrekariaTypedefect => backport
2016-08-10 11:09OrekariaTarget Version => RR16Q2.2
2016-08-18 16:50hgbotCheckin
2016-08-18 16:50hgbotNote Added: 0089220
2016-08-18 16:50hgbotStatusscheduled => resolved
2016-08-18 16:50hgbotResolutionopen => fixed
2016-08-18 16:50hgbotFixed in SCM revision => http://code.openbravo.com/retail/backports/3.0RR16Q2.2/org.openbravo.retail.posterminal/rev/8d0e695943483738a435cc250e43ed38c41cf7f6 [^]
2016-08-19 10:39guilleaerReview Assigned To => guilleaer
2016-08-19 10:39guilleaerStatusresolved => closed
2016-08-19 10:39guilleaerFixed in Version => RR16Q2.2

Notes
(0089220)
hgbot   
2016-08-18 16:50   
Repository: retail/backports/3.0RR16Q2.2/org.openbravo.retail.posterminal
Changeset: 8d0e695943483738a435cc250e43ed38c41cf7f6
Author: Mario Castello <mario.castello <at> peoplewalking.com>
Date: Wed Aug 17 09:16:59 2016 -0600
URL: http://code.openbravo.com/retail/backports/3.0RR16Q2.2/org.openbravo.retail.posterminal/rev/8d0e695943483738a435cc250e43ed38c41cf7f6 [^]

Fixed issue 0033676: Added Business Partner for FIN_PaymentScheduleDetail for Orders created from POS

---
M src/org/openbravo/retail/posterminal/OrderLoader.java
---