Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0031888Openbravo ERP07. Sales managementpublic2016-01-14 11:002016-03-17 10:54
ngarcia 
AtulOpenbravo 
urgentmajoralways
closedfixed 
5
 
 
vmromanos
Core
No
0031888: Create Order from Sales Quotation is not truncating date fields, thus, payment against invoice is being considered a prepayment
Create Order from Sales Quotation is not truncating date fields, thus, payment against invoice is being considered a prepayment

C_ORDER: dateordered, dateacct
M_INOUT: dateordered, movementdate
C_INVOICE: dateinvoiced, dateacct, dateordered, taxdate...
Two ways of reproduce it:
1. Create a Sales Quotation, add a line to it and book it
   Launch the Create Order process
   Go to Sales Order screen and set its Invoice Terms as Immediate
   Launch the Create Invoices from Orders process and do not assign an invoice date (the order date will be taken as invoice date, C_INVOICE_CREATE)
   Add a Payment In to that invoice with the same date
   Post it and check a prepayment entry is made

2. Go to Quotation document type and configure POS Order as Document Type for Order
   Create a Sales Quotation, add a line to it and book it
   Launch the Create Order process
   Navigate to the Sales Invoice created.
   Add a Payment In to that invoice with the same date
   Post it and check a prepayment entry is made
No tags attached.
related to defect 00270893.0PR15Q1 closed fsoto82 Invoice Date and Accounting Date should be truncated when invoice is created using "Generate Invoice from Receipt" process 
diff 31888_ms.diff (7,461) 2016-01-19 16:03
https://issues.openbravo.com/file_download.php?file_id=8944&type=bug
Issue History
2016-01-14 11:00ngarciaNew Issue
2016-01-14 11:00ngarciaAssigned To => Triage Finance
2016-01-14 11:00ngarciaModules => Core
2016-01-14 11:00ngarciaResolution time => 1455404400
2016-01-14 11:00ngarciaTriggers an Emergency Pack => No
2016-01-14 11:01ngarciaIssue Monitored: networkb
2016-01-14 11:02ngarciaRelationship addedrelated to 0027089
2016-01-18 11:22AtulOpenbravoAssigned ToTriage Finance => AtulOpenbravo
2016-01-18 11:22AtulOpenbravoStatusnew => scheduled
2016-01-18 12:28AtulOpenbravoNote Added: 0083368
2016-01-18 18:13psanjuanNote Added: 0083385
2016-01-19 14:01psanjuanNote Edited: 0083368bug_revision_view_page.php?bugnote_id=0083368#r10696
2016-01-19 14:08psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=10698#r10698
2016-01-19 14:09psanjuanNote Edited: 0083368bug_revision_view_page.php?bugnote_id=0083368#r10699
2016-01-19 14:10psanjuanNote Edited: 0083368bug_revision_view_page.php?bugnote_id=0083368#r10700
2016-01-19 14:16psanjuanNote Edited: 0083368bug_revision_view_page.php?bugnote_id=0083368#r10701
2016-01-19 14:26psanjuanNote Edited: 0083368bug_revision_view_page.php?bugnote_id=0083368#r10704
2016-01-19 16:03vmromanosFile Added: 31888_ms.diff
2016-01-19 16:05hgbotCheckin
2016-01-19 16:05hgbotNote Added: 0083406
2016-01-19 16:05hgbotStatusscheduled => resolved
2016-01-19 16:05hgbotResolutionopen => fixed
2016-01-19 16:05hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/d4762042e1ad755083f8a3f2c3d2f880cde6ac85 [^]
2016-01-19 16:24vmromanosReview Assigned To => vmromanos
2016-01-19 16:24vmromanosNote Added: 0083407
2016-01-19 16:24vmromanosStatusresolved => closed
2016-03-17 10:54hudsonbotCheckin
2016-03-17 10:54hudsonbotNote Added: 0085054

Notes
(0083368)
AtulOpenbravo   
2016-01-18 12:28   
(edited on: 2016-01-19 14:26)
Test Plan A
- Create a Sales Quotation, add a line to it and book it
- Launch the Create Order process
- Go to Sales Order screen and set it
s Invoice Terms as Immediate
- Launch the Create Invoices from Orders process and do not assign an invoice
  date (the order date will be taken as invoice date, C_INVOICE_CREATE).
- Add a Payment In to that invoice with the same date and choose option
  "Process Payment Received and Deposit".
- Post it and check that no prepayment entry is made. If Posting is disabled in Payment In, it could be done in Financial Account Transaction Tab.

Test Plan B
- Go to Quotation document type and configure POS Order as Document Type for
  Order.
- Create a Sales Quotation, add a line to it and book it.
- Launch the Create Order process.
- Navigate to the Sales Invoice created.
- Add a Payment In to that invoice with the same date and choose option
  "Process Payment Received and Deposit".
- Post it and check that no prepayment entry is made. If Posting is disabled in Payment In, it could be done in Financial Account Transaction Tab.

Test Plan C
Repeat Test Plan A above by entering below dates:
Quotation = 19-01-2016
Sales Order = 19-01-2016 (by using Create Order process from the Quotation)
Sales Invoice = 18-01-2016 (by entering an invoice date = 18-01-2016 in "Create Invoices from Orders window).
Payment In date = 18-01-2016

check that no customer prepayment is used either while posting the payment or the invoice.

Test Plan D

Repeat Test Plan A above by entering below dates:
Quotation = 19-01-2016
Sales Order = 19-01-2016 (by using Create Order process from the Quotation)
Sales Invoice = 18-01-2016 (by entering an invoice date = 18-01-2016 in "Create Invoices from Orders window).
Payment In date = 15-01-2016

check that a customer prepayment is used while posting the payment while no customer prepayment is used while posting the invoice, which is correct.

Invoice Posting looks like (18-01-2015)
55.54 (43000) Account Receivables DEBIT
5.10 (70000) Product Revenue (discount) DEBIT
51.00 (70000) Product Revenue CREDIT
9.64 (47700) Sales Tax CREDIT

Payment Posting looks like:
15-01-2015
55.54 (57200) Bank DEBIT
55.54 (43800) Customer Prepayments CREDIT

18-01-2015
55.54 (43800) Customer Prepayments DEBIT
55.54 (43000) Account Receivables CREDIT

(0083385)
psanjuan   
2016-01-18 18:13   
Issue verified.
(0083406)
hgbot   
2016-01-19 16:05   
Repository: erp/devel/pi
Changeset: d4762042e1ad755083f8a3f2c3d2f880cde6ac85
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Mon Jan 18 16:22:34 2016 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/d4762042e1ad755083f8a3f2c3d2f880cde6ac85 [^]

Fixes Issue 31888: Create Order from Sales Quotation is not truncating date
fields, thus, payment against invoice is being considered a prepayment

While creating sales order header, order date is truncated and set.

---
M src/org/openbravo/erpCommon/ad_process/ConvertQuotationIntoOrder.java
---
(0083407)
vmromanos   
2016-01-19 16:24   
Code review + testing OK

Attached 31888_ms.diff which is the module script modification to fix wrong data.
We don't include it in core as it might impact the time for the update database process in high volume instances.
(0085054)
hudsonbot   
2016-03-17 10:54   
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/b22fb0500156 [^]
Maturity status: Test