Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0039318Openbravo ERP09. Financial managementpublic2018-09-19 13:482018-12-11 20:22
ngarcia 
Sandrahuguet 
urgentmajoralways
closedfixed 
5
 
3.0PR18Q4 
dmiguelez
Core
No
0039318: Wrong accounting entry for a doubtful debt payment if the invoice has more than one payment plan detail
Wrong accounting entry for a doubtful debt payment if the invoice has more than one payment plan detail. This situation can be reached for instance when the invoice price is higher than order price

The problem is in updateDoubtfulDebtScheduleDetails function of FIN_DoubtfulDebtProcess class. It is setting the doubtful debt amount in the payment plan detail only when the debt amount is greater or equal the payment plan detail amount.
As group admin role:
   Set the following accounts for 'Customer - Tier 3' Business Partner Category:
      Doubtful Debt Account
      Bad Debt Expense Account
      Bad Debt Revenue Account
      Allowance For Doubtful Debt Account

   Create a Sales Order
   Set its Invoice as Immediate
   Create a Sales Invoice header
   Create lines from Order
   Increase the Net Price in the invoice line
   Complete it
   
   Create a Doubtful Debt Run
   Select Doubtful Debt and select the previously created invoice
   Process it

   Go to Doubtful Debt window and Post it
   Check Doubtful Debt accounts configured before are used

   Add a Payment In to the invoice
   Post it (you should post the associated transaction in the financial account depending on the payment method configuration)
   Check Doubtful Debt Accounts are not used
No tags attached.
Issue History
2018-09-19 13:48ngarciaNew Issue
2018-09-19 13:48ngarciaAssigned To => Triage Finance
2018-09-19 13:48ngarciaModules => Core
2018-09-19 13:48ngarciaResolution time => 1539122400
2018-09-19 13:48ngarciaTriggers an Emergency Pack => No
2018-09-19 13:49ngarciaIssue Monitored: networkb
2018-09-19 13:53ngarciaSummaryWrong accounting entry for a doubtful debt payment is the invoice has more than one payment plan detail => Wrong accounting entry for a doubtful debt payment if the invoice has more than one payment plan detail
2018-09-19 13:53ngarciaDescription Updatedbug_revision_view_page.php?rev_id=17645#r17645
2018-09-19 13:57PracticsIssue Monitored: Practics
2018-09-20 11:29SandrahuguetAssigned ToTriage Finance => markmm82
2018-09-20 20:51markmm82Statusnew => scheduled
2018-10-01 18:03markmm82Note Added: 0107094
2018-10-03 09:33hgbotCheckin
2018-10-03 09:33hgbotNote Added: 0107128
2018-10-03 09:33hgbotStatusscheduled => resolved
2018-10-03 09:33hgbotResolutionopen => fixed
2018-10-03 09:33hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/cdc00e66f2c2dc8af8ba79af6b13bae3acd39c19 [^]
2018-10-03 09:38SandrahuguetNote Added: 0107129
2018-10-03 12:22SandrahuguetReview Assigned To => dmiguelez
2018-10-03 12:22SandrahuguetAssigned Tomarkmm82 => Sandrahuguet
2018-10-03 17:18hgbotCheckin
2018-10-03 17:18hgbotNote Added: 0107142
2018-10-03 17:29dmiguelezNote Added: 0107143
2018-10-03 17:29dmiguelezStatusresolved => closed
2018-10-03 17:29dmiguelezFixed in Version => 3.0PR18Q4
2018-12-11 20:22hudsonbotCheckin
2018-12-11 20:22hudsonbotNote Added: 0108415
2018-12-11 20:22hudsonbotCheckin
2018-12-11 20:22hudsonbotNote Added: 0108417

Notes
(0107094)
markmm82   
2018-10-01 18:03   
Test Plan:
As group admin role:
   Set the following accounts for 'Customer - Tier 1' Business Partner Category (just for testing):
    For F&B España, S.A. US/A/Euro GL:
      Doubtful Debt Account = 17000 - Deudas a largo plazo con entidades de crédito
      Bad Debt Expense Account = 17100 - Deudas a largo plazo
      Bad Debt Revenue Account = 17200 - Deudas a largo plazo transformables en subvenciones donaciones y legados
      Allowance For Doubtful Debt Account = 17900 - Deudas representadas en otros valores negociables

    For F&B International Group US/A/US Dollar GL:
      Doubtful Debt Account = 7810 - Bad Debts Write-off
      Bad Debt Expense Account = 8020 - Bad Debt Expense
      Bad Debt Revenue Account = 4100 - Revenue - Product
      Allowance For Doubtful Debt Account = 4960 - Returns and Allowances

   Create a Sales Order for Alimentos y Supermercados, S.A bp.
   Set its Invoice as Immediate.
   Remove the discount in the Basic discounts tab.
   Add a line, for instance:
     Product: Cerveza Ale 0,5L
     Quantity: 100
     Unit Price: 2.04
     Tax: Ventas exentas.
   Complete it.

   Create a Sales Invoice header for Alimentos y Supermercados, S.A bp.
   Create lines from Order
   Increase the Net Price in the invoice line from 2.04 to 3.00
   Complete it
   
   Create a Doubtful Debt Run
   Clear filters and select Doubtful Debt and select the previously created invoice
   Process it

   Go to Doubtful Debt window and Post it
   Check Doubtful Debt accounts configured before are used:
      Post in F&B España, S.A. US/A/Euro GL looks like:
        17000 - Deudas a largo plazo con entidades de crédito 300 (Debit)
        43000 - Clientes (euros) a corto plazo 300 (Credit)
        17100 - Deudas a largo plazo 300 (Debit)
        17900 - Deudas representadas en otros valores negociables 300 (Credit)

      Post in F&B International Group US/A/US Dollar GL looks like:
        8020 - Bad Debt Expense 351 (Debit)
        4960 - Returns and Allowances 351 (Credit)
        7810 - Bad Debts Write-off 351 (Debit)
        1130 - Accounts Receivable 351 (Credit)


   Add a Payment In to the invoice
   Post it (you should post the associated transaction in the financial account depending on the payment method configuration)
   Check Doubtful Debt accounts configured before are used:
      Post in F&B España, S.A. US/A/Euro GL looks like:
        17900 - Deudas representadas en otros valores negociables 300 (Debit)
        17200 - Deudas a largo plazo transformables en subvenciones donaciones y legados 300 (Credit)
        55500 - Partidas pendientes de aplicación 300 (Debit)
        17000 - Deudas a largo plazo con entidades de crédito 300 (Credit)

      Post in F&B International Group US/A/US Dollar GL looks like:
        1140 - Checking In-Transfer 351 (Debit)
        7810 - Bad Debts Write-off 351 (Credit)
        4960 - Returns and Allowances 351 (Debit)
        4100 - Revenue - Product 351 (Credit)
(0107128)
hgbot   
2018-10-03 09:33   
Repository: erp/devel/pi
Changeset: cdc00e66f2c2dc8af8ba79af6b13bae3acd39c19
Author: Sandra Huguet <sandra.huguet <at> openbravo.com>
Date: Tue Oct 02 17:45:00 2018 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/cdc00e66f2c2dc8af8ba79af6b13bae3acd39c19 [^]

Fixed issue 39318 Wrong accounting entry for a doubtful debt payment
if the invoice has more than one payment plan detail

When more that one payment schedule detail, set the doubtful debt amount correctly.

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_DoubtfulDebtProcess.java
---
(0107129)
Sandrahuguet   
2018-10-03 09:38   
we should not modify customer data in closed periods
(0107142)
hgbot   
2018-10-03 17:18   
Repository: erp/devel/pi
Changeset: 6ce7922086d7889cedb6cc6beaeda7a718da2308
Author: Sandra Huguet <sandra.huguet <at> openbravo.com>
Date: Wed Oct 03 17:18:12 2018 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/6ce7922086d7889cedb6cc6beaeda7a718da2308 [^]

related to issue 39318 set a properly name to variable and function

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_DoubtfulDebtProcess.java
---
(0107143)
dmiguelez   
2018-10-03 17:29   
Code Review + Testing Ok
(0108415)
hudsonbot   
2018-12-11 20:22   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/470e3cd384c5 [^]
Maturity status: Test
(0108417)
hudsonbot   
2018-12-11 20:22   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/470e3cd384c5 [^]
Maturity status: Test