Openbravo Issue Tracking System - Modules | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0039064 | Modules | SAP Connector | public | 2018-07-30 12:45 | 2018-08-22 10:24 |
Reporter | gorkaion | ||||
Assigned To | nonofrancisco | ||||
Priority | urgent | Severity | major | Reproducibility | have not tried |
Status | closed | Resolution | fixed | ||
Platform | OS | 5 | OS Version | ||
Product Version | |||||
Target Version | Fixed in Version | ||||
Merge Request Status | |||||
Regression date | |||||
Regression introduced by commit | |||||
Regression level | |||||
Review Assigned To | aferraz | ||||
Support ticket | |||||
OBNetwork customer | |||||
Regression introduced in release | |||||
Summary | 0039064: Payment details not added when a layaway is partially paid. | ||||
Description | Having a Layaway that it is partially paid and the generated Sales Invoice payment plan is split in 2. one with the payments and the other one with the outstanding amount. When the PUBON is exported the payments are not included. The getPaymentMethodLines() method is considering only 1 of the payment plans. In case it takes the one with the outstanding amount the payments are not included. See proposed solution. | ||||
Steps To Reproduce | Create a Sales Invoice with several payment plan records. Try to export it. Check that only the data from a payment plan is included. How to generate an invoice with several payment plans: - Assign a split payment terms to Arturo Montoro. - Enable the "Pay on Credit" and assign a credit limit to Arturo Montoro. - Refresh the POS and create a ticket partially paid leaving the remaining amoutn on credit. - Do the cashup to generate the invoice and check that it has 2 payment plans. - Alternatively it is possible use the generate the invoice on ticket completion with the same result. | ||||
Proposed Solution | Some errors found in the InvoiceJavaPropertyMappingHandler.getPaymentMethodLines() method: protected List<SynchronizableBusinessObject> getPaymentMethodLines(Invoice invoice) { List<SynchronizableBusinessObject> sbos = new ArrayList<>(); List<FIN_PaymentSchedule> invoicePaymentsSchedule = invoice.getFINPaymentScheduleList(); if (!invoicePaymentsSchedule.isEmpty()) { for (FIN_PaymentScheduleDetail paymentDetails : invoicePaymentsSchedule.get(0) .getFINPaymentScheduleDetailInvoicePaymentScheduleList()) { if (paymentDetails.getAPRMPaymentMethod() != null && paymentDetails.getAPRMFinancialAccount() != null) { SynchronizableBusinessObject sbo = getPaymentMethodLines(paymentDetails); processPaymentDetail(sbo, paymentDetails); sbos.add(sbo); } } } return sbos; } Attached a diff with a proposal fix. 1. invoicePaymentsSchedule.get(0) -> It is considering invoices with a single payment plan: This is wrong, it is possible to have split payments so all payment schedules should be iterated. 2. paymentDetails.getAPRMPaymentMethod() and paymentDetails.getAPRMFinancialAccount(): These are computed columns. So it is required to compute them before accessing their values paymentDetails.get_computedColumns().getAPRMFinancialAccount() 3. The computed columns are not considering payments with total amount 0. Is this the expected behavior in order to include the payment amount in the pubon? The Payment Method and Financial account are mandatory fields of the Payment entity. The code could be simplified to check if the paymentDetails is related to a "FIN_PaymetnDetail" if (paymentDetails.getPaymentDetails() != null) and to get the method and account: paymentDetails.getPaymentDetails().getFinPayment().getPaymentMethod() paymentDetails.getPaymentDetails().getFinPayment().getAccount() | ||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | paymentsMissingInPUBON.diff (4,141) 2018-07-30 12:45 https://issues.openbravo.com/file_download.php?file_id=12016&type=bug issue-39064.patch (4,715) 2018-08-17 21:48 https://issues.openbravo.com/file_download.php?file_id=12057&type=bug | ||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2018-07-30 12:45 | gorkaion | New Issue | |||
2018-07-30 12:45 | gorkaion | Assigned To | => platform | ||
2018-07-30 12:45 | gorkaion | File Added: paymentsMissingInPUBON.diff | |||
2018-07-30 12:45 | gorkaion | Resolution time | => 1534716000 | ||
2018-08-13 14:05 | gorkaion | Assigned To | platform => Triage Finance | ||
2018-08-16 08:18 | Sandrahuguet | Assigned To | Triage Finance => nonofrancisco | ||
2018-08-16 10:56 | Sandrahuguet | Assigned To | nonofrancisco => Triage Finance | ||
2018-08-16 11:12 | aferraz | Assigned To | Triage Finance => nonofrancisco | ||
2018-08-17 12:34 | gorkaion | Steps to Reproduce Updated | bug_revision_view_page.php?rev_id=17542#r17542 | ||
2018-08-17 21:48 | nonofrancisco | File Added: issue-39064.patch | |||
2018-08-21 14:49 | hgbot | Checkin | |||
2018-08-21 14:49 | hgbot | Note Added: 0106429 | |||
2018-08-21 14:49 | hgbot | Status | new => resolved | ||
2018-08-21 14:49 | hgbot | Resolution | open => fixed | ||
2018-08-21 14:49 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/pmods/org.openbravo.service.integration.sap.ecc.mappings/rev/a9aa182dbcd678f74a5d3a8c8b06bd24c8402476 [^] | ||
2018-08-21 14:50 | aferraz | Review Assigned To | => aferraz | ||
2018-08-21 14:50 | aferraz | Note Added: 0106430 | |||
2018-08-21 14:50 | aferraz | Status | resolved => closed | ||
2018-08-22 10:23 | hgbot | Checkin | |||
2018-08-22 10:23 | hgbot | Note Added: 0106440 | |||
2018-08-22 10:24 | aferraz | Note Deleted: 0106430 | |||
2018-08-22 10:24 | aferraz | Note Added: 0106441 |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|