Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0031701Openbravo ERP07. Sales managementpublic2015-12-14 12:082015-12-21 20:21
maite 
nonofrancisco 
urgentmajoralways
closedfixed 
5
 
3.0PR16Q1 
vmromanos
Core
No
0031701: It is not possible to modify order's payment terms when related partial invoice is in Void status
It is not possible to modify order's payment terms when related partial invoice is in Void status. However, it is possible when related partial invoice is in Completed status
1. Register Sales Order with qty=10 and complete
2. Register related Shipment with qty=3 and complete
3. Register related Sales Invoice with qty=3 and complete
4. Void sales invoice
5. Access Sales Order, Reactivate it and modify "Payment terms" (for example). Try to save it and following error will be raised
"Error
Saving failed. Document posted/processed Where: SQL statement "UPDATE C_Invoice SET PaymentRule=new.PaymentRule, C_PaymentTerm_ID=new.C_PaymentTerm_ID, DateAcct=new.DateAcct WHERE C_Order_ID=new.C_Order_ID AND DocStatus NOT IN('RE', 'CL', 'CO')" PL/pgSQL function "c_order_trg2" line 40 at SQL statement"

If you repeat same steps without Void invoice you will be able to modify Payment Terms
"c_order_trg2" trigger should also consider VO status
No tags attached.
related to defect 00309713.0PR16Q1 closed aferraz When voiding an unpaid invoice, payment schedule details should be canceled instead of deleted 
related to defect 00262423.0PR14Q3 closed AtulOpenbravo Orders could be reactivated although they have a related payment if it is not paid 
Issue History
2015-12-14 12:08maiteNew Issue
2015-12-14 12:08maiteAssigned To => Triage Finance
2015-12-14 12:08maiteModules => Core
2015-12-14 12:08maiteResolution time => 1451602800
2015-12-14 12:08maiteTriggers an Emergency Pack => No
2015-12-14 12:08maiteIssue Monitored: networkb
2015-12-17 11:17vmromanosStatusnew => scheduled
2015-12-17 11:17vmromanosAssigned ToTriage Finance => nonofrancisco
2015-12-17 12:05vmromanosRelationship addedrelated to 0030971
2015-12-17 12:58vmromanosRelationship addedrelated to 0026242
2015-12-17 13:10vmromanosNote Added: 0082825
2015-12-17 13:24hgbotCheckin
2015-12-17 13:24hgbotNote Added: 0082826
2015-12-17 13:24hgbotStatusscheduled => resolved
2015-12-17 13:24hgbotResolutionopen => fixed
2015-12-17 13:24hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/1a0f60909e60384cb01a3dd62a7584f83a3073f6 [^]
2015-12-17 13:24hgbotCheckin
2015-12-17 13:24hgbotNote Added: 0082827
2015-12-17 13:24vmromanosReview Assigned To => vmromanos
2015-12-17 13:24vmromanosNote Added: 0082828
2015-12-17 13:24vmromanosStatusresolved => closed
2015-12-21 20:21hudsonbotCheckin
2015-12-21 20:21hudsonbotNote Added: 0082909
2015-12-21 20:21hudsonbotCheckin
2015-12-21 20:21hudsonbotNote Added: 0082910

Notes
(0082825)
vmromanos   
2015-12-17 13:10   
Test plan:

As Openbravo admin

Create a new Physical Inventory
 Product = Agua sin gas
 Quantity = 1000
Process Inventory

Create a new sales order.
 Business Partner = Hoteles buenas noches
 Product = Agua sin gas
 Quantity = 10
Process order

Create a new Goods Shipment
 Business Partner = Hoteles buenas noches
 Press Create lines from and select previous order line
 Edit the line and change quantity to 3
Process the shipment

Create a new Sales Invoice
 Business Partner = Hoteles buenas noches
 Press Create lines from and select previous order line
 Edit the line and change quantity to 3
Process the invoice
Void the invoice
Verify a new payment for amount 0 has been automatically created to cancel the payment schedule lines

Go back to the previous sales order.
Try to reactivate it.
An error is shown informing it's linked to a payment.

Go to the payment and reactivate it.

Go back to the previous sales order and reactivate it.
Change the Payment term and save it.
Verify you can save it properly.
(0082826)
hgbot   
2015-12-17 13:24   
Repository: erp/devel/pi
Changeset: 1a0f60909e60384cb01a3dd62a7584f83a3073f6
Author: Nono <f.carballo <at> nectus.com>
Date: Tue Dec 15 12:57:28 2015 -0500
URL: http://code.openbravo.com/erp/devel/pi/rev/1a0f60909e60384cb01a3dd62a7584f83a3073f6 [^]

Fixes Issue 31701 It is not posible to modify order's payments ....
The C_ORDER_TRG2 trigger was updated to take into account sales invoices
with document status 'VO' when updating.

---
M src-db/database/model/triggers/C_ORDER_TRG2.xml
---
(0082827)
hgbot   
2015-12-17 13:24   
Repository: erp/devel/pi
Changeset: 6e39d4773c59411ce8a5618cbc5a82e81d908f83
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Thu Dec 17 13:23:14 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/6e39d4773c59411ce8a5618cbc5a82e81d908f83 [^]

Related to issue 31701: code review improvements

When reactivating an order, do not consider payments in Awaiting Payment status as payments really linked to the order. This is a way to ensure reactivation of orders already linked to a voided invoice is possible, because since 0030971 a 0 amount payment is automatically when voiding an invoice.
So the flow in that case will be to manually reactivate that payment, and then reactivate the order.

Updated copyright year.

---
M modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_GEN_PAYMENTSCHEDULE_ORD.xml
M src-db/database/model/triggers/C_ORDER_TRG2.xml
---
(0082828)
vmromanos   
2015-12-17 13:24   
Code review + testing OK
(0082909)
hudsonbot   
2015-12-21 20:21   
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/1874af35afc7 [^]
Maturity status: Test
(0082910)
hudsonbot   
2015-12-21 20:21   
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/1874af35afc7 [^]
Maturity status: Test