Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0009447
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 07. Sales managementcriticalalways2009-06-11 18:482009-06-27 00:00
ReporternetworkbView Statuspublic 
Assigned Torafaroda 
PriorityimmediateResolutionfixedFixed in Versionmain
StatusclosedFix in branchpiFixed in SCM revisionbf2ae654c0cc
ProjectionnoneETAnoneTarget Version
OSLinux 64 bitDatabaseOracleJava version
OS VersionDatabase versionAnt version
Product Version2.40MP4SCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0009447: Is not possible to complete a invoice using a different currency if it has not conversion to the date obtained of payment terms

DescriptionIs not possible to complete a invoice using a different currency if it has not conversion to the date obtained of payment terms.
Steps To Reproduce-Create a price list with a currency different than the standard.
-This currency has a conversion rate with the standard to the date of today
but the conversion is not available in the future (i.e. in one or two months)
-Create a sales invoice with the price list created before.
-select payment terms "two month"
-Create a line.
-Complete the invoice line and you get a error.

-If you reactivate the invoice and change the payment terms to immediate
the invoice is completed properly.
Proposed Solution* The problem is in C_BP_SOCREDITUSED_REFRESH function which updates the credit used by the business partner.
* This function is called both from C_INVOICE_POST and C_SETTLEMENT_POST.
* In order to make the amount conversion, the date taken by this function is the debt payment planned (due) date, which is wrong because customers burn credit in the moment that the document (invoice or settlement) is completed, not when the payment is done (that can happen far in the future or even never happen).
* The date to be taken by this function is the one that generates the debt payment: if it is an invoice, take the invoice date; if it is a settlement, take the settlement transaction date (if it does not come from an invoice, otherwise take the date invoiced).

For this, a new column DOCDATE needs to be added to C_DEBT_PAYMENT_V view.
TagsNo tags attached.
Attached Filespng file icon ConversionRate.png [^] (81,993 bytes) 2009-06-12 16:26

- Relationships Relation Graph ] Dependency Graph ]
depends on backport 0009487 closedrafaroda Is not possible to complete a invoice using a different currency if it has not conversion to the date obtained of payment terms 
related to defect 0009507 closedrafaroda api check: build 50 failed 

-  Notes
(0017269)
rafaroda (developer)
2009-06-12 16:15

This is not an issue but the expected behavior.

1) Create a sales price list in Japanese Yens.
2) Create a price list version.
3) Create some prices for some products (in Yens).

Do NOT create any currency conversion rate from Yens to Euro.

4) Create a Sales Invoice with Payment Tems = Immediate (forget about the payment terms) and the price list in Japanese Yens.
5) Create some lines.
5) Go back to invoice header and complete it.

You will get "There is no conversion rate defined from (JPY-¥) to (EUR-€) for date '12-06-2008', Client 'BigBazaar' and Organization 'Main'." error message.

When completing an invoice, C_Invoice_Post process makes some conversions from the invoice currency (JPY-¥) to (EUR-€). If you are using payment terms in the future, the due date is correctly taken and is the one used for the conversion (and makes sense that you do not have conversion rates yet defined).

Do you think that if there is no conversion rate in the future, the invoice date should be taken?
(0017270)
rafaroda (developer)
2009-06-12 16:16

Downgraded to major http://wiki.openbravo.com/wiki/Bug_Reporting_Guidelines#How_to_Choose_the_Right_Severity [^]
(0017273)
networkb (developer)
2009-06-12 17:00

This is a critical issue because a customer that was in 2.40mp3 was able to complete invoices properly. He has update the environment to 2.40mp4 and now
he can not complete invoices and he can't unprocess the invoices that were completed on the 2.40mp3 release
(0017362)
hgbot (developer)
2009-06-16 18:55

Repository: erp/devel/pi
Changeset: bf2ae654c0cc3d5838a2a62c26c8789a49badda2
Author: Rafa Roda Palacios <rafael.roda <at> openbravo.com>
Date: Tue Jun 16 18:50:53 2009 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/bf2ae654c0cc3d5838a2a62c26c8789a49badda2 [^]

Fixes issue 0009447 Now conversion rate date is properly taken in C_BP_SOCREDITUSED_REFRESH function.

---
M src-db/database/model/functions/C_BP_SOCREDITUSED_REFRESH.xml
M src-db/database/model/views/C_DEBT_PAYMENT_V.xml
---
(0017363)
rafaroda (developer)
2009-06-16 18:56

Steps to test this fix:
1) Create a sales price list in Russian Rubles (RUB).
2) Create a price list version.
3) Create some prices for some products (in Rubles).
4) Create a new customer business partner and give him an address.
5) In customer tab give him:
* The price list created in Rubles.
* Form of Payment: Bank Deposit
* Payment Terms: One month
* Credit Limit: 100 (please notice that this limit is give in the base currency of the Entity, not the currency of customer's price list).
6) Create a conversion rate from RUB to your base currency with dates today until tomorrow and with multiplier 0.5 (1 RUB = 0.5 your Entity base currency)
7) Create a conversion rate from your base currency to RUB with dates today until tomorrow and with multiplier 2 (1 Entity base currency = 2 RUB)
8) Create new AR sales invoice for your new customer for date today: price list is in RUB and payment terms is One month.
9) Create a line with Line Net Amount = 100 (RUB) and Tax 16%.
10) Create a Payment line in this same invoice with Due Date = today + 1 month and Amount 20 with currency your base currency
11) Go back to invoice header and complete this invoice.
12) Go back to Payment tab and check that a new payment has been created for due date today + 1 month with Amount = 76 (RUB): 76 RUB = 116 RUB - 40 RUB (2 x 20 your base currency which comes from first payment in step 10).
13) Go to business partner customer's tab and check that Credit Used read-only field is 58 (in your Entity base currency): 116 (RUB) * 0.5
14) Create a new Settlement with transaction date today and currency your base currency.
15) Click on Create Lines From, select your business partner and click on Search.
16) Select the 76 RUB line and click on OK.
17) Go to Created Payments tab and create a new one with:
* Business Partner your customer
* Due Date = today + 1 month
* Amount = 76 with currency RUB
18) Go back to header and click on process: check that Canceled/Not Charged and Created Amount read-only fields equal 38 (in your base currency)
19) Create a new Bank Statement with transaction date today.
20) Click on Create Lines From, select your customer, leave Account drop-down blank and click on Search.
21) Select line of 76 RUB and click on OK.
22) Check that Ending Balance read-only field equals 38 (in your base currency).
23) Click on Process button: your customer has paid you, let's check that his credit used has decreased.
24) Go to business partner customer's tab and check that Credit Used read-only field is 20 (in your Entity base currency) which corresponds to the reamining payment.

- Issue History
Date Modified Username Field Change
2009-06-11 18:48 networkb New Issue
2009-06-11 18:48 networkb Assigned To => rafaroda
2009-06-12 16:15 rafaroda Note Added: 0017269
2009-06-12 16:15 rafaroda Status new => feedback
2009-06-12 16:16 rafaroda Note Added: 0017270
2009-06-12 16:16 rafaroda Severity critical => major
2009-06-12 16:26 rafaroda File Added: ConversionRate.png
2009-06-12 17:00 networkb Note Added: 0017273
2009-06-12 17:00 networkb Status feedback => new
2009-06-15 10:52 networkb Severity major => critical
2009-06-15 18:40 rafaroda Steps to Reproduce Updated
2009-06-15 18:41 rafaroda Status new => scheduled
2009-06-15 18:41 rafaroda fix_in_branch => pi
2009-06-16 18:55 hgbot Checkin
2009-06-16 18:55 hgbot Note Added: 0017362
2009-06-16 18:55 hgbot Status scheduled => resolved
2009-06-16 18:55 hgbot Resolution open => fixed
2009-06-16 18:55 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/bf2ae654c0cc3d5838a2a62c26c8789a49badda2 [^]
2009-06-16 18:56 rafaroda Note Added: 0017363
2009-06-17 08:16 rafaroda Relationship added related to 0009507
2009-06-22 11:09 psarobe Fixed in Version => main
2009-06-26 17:25 psarobe Status resolved => closed
2009-06-27 00:00 anonymous sf_bug_id 0 => 2813027


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker