Openbravo Issue Tracking System - Retail Modules
View Issue Details
0033675Retail ModulesWeb POSpublic2016-08-10 10:392016-08-25 08:55
vmromanos 
mario_castello 
immediatemajoralways
closedfixed 
5
 
RR16Q3.1RR16Q3.1 
guilleaer
No
0033675: 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 => RR16Q3.1
2016-08-17 10:38guilleaerAssigned ToRetail => mario_castello
2016-08-18 17:29hgbotCheckin
2016-08-18 17:29hgbotNote Added: 0089221
2016-08-18 17:29hgbotStatusscheduled => resolved
2016-08-18 17:29hgbotResolutionopen => fixed
2016-08-18 17:29hgbotFixed in SCM revision => http://code.openbravo.com/retail/backports/3.0RR16Q3.1/org.openbravo.retail.posterminal/rev/3a9e5e950b250da2503dcc09b3f2ae8d7f52c2ee [^]
2016-08-25 08:55guilleaerReview Assigned To => guilleaer
2016-08-25 08:55guilleaerStatusresolved => closed
2016-08-25 08:55guilleaerFixed in Version => RR16Q3.1

Notes
(0089221)
hgbot   
2016-08-18 17:29   
Repository: retail/backports/3.0RR16Q3.1/org.openbravo.retail.posterminal
Changeset: 3a9e5e950b250da2503dcc09b3f2ae8d7f52c2ee
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.0RR16Q3.1/org.openbravo.retail.posterminal/rev/3a9e5e950b250da2503dcc09b3f2ae8d7f52c2ee [^]

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

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