Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0012793Openbravo ERP07. Sales managementpublic2010-03-24 23:192010-07-13 00:00
dalsasua 
sivaraman 
urgentmajoralways
closedfixed 
20Ubuntu 9.04
main 
pi 
Core
No
0012793: Sales invoices of a business partner with a withholding associated creates payments with incorrect amount
In sales invoices, when processing the invoice, the payment is created. In case the BP of the invoice has got a withholding as default, amount of the created payment has this withholding percentage is subtracted, when withholdings can only be applied in purchase invoices. Actually, withholding combo is not shown in sales invoices, but only in purchase ones.
1. Create sales invoice for McGiver
2. Create a line with donuts
3. Realize that line net amount is 0.60 €
4. Set tax to Exempt
5. Go to header and complete
6. Go to payment tab
7. Realize that the payment amount is 0.60 €
8. Go to Business Partner Setup -> Withholding
9. Create a new one with rate 10
10.Go to Business Partner
11.Look for McGiver
12.Go to withholding tab
13.Create a new record, activate Default check and choose the withholding created in step 9
14.Create a new invoice repeating steps from 1 to 6
15.Please realize that payment amount is not 0.60 €, but 0.54 €

Please realize that before completing the invoice, the header source code has got this element:

<INPUT type="hidden" name="inpwithholdingamount" id="Withholdingamount" value=""></INPUT>

and after completing it, it shows this element:

<INPUT type="hidden" name="inpwithholdingamount" id="Withholdingamount" value="0.60"></INPUT>
No tags attached.
Issue History
2010-03-24 23:19dalsasuaNew Issue
2010-03-24 23:19dalsasuaAssigned To => adrianromero
2010-03-24 23:23dalsasuaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=175#r175
2010-03-24 23:57dalsasuaNote Added: 0025711
2010-03-24 23:57dalsasuaSeveritycritical => major
2010-07-07 13:26sivaramanAssigned Toadrianromero => sivaraman
2010-07-07 13:32hgbotCheckin
2010-07-07 13:32hgbotNote Added: 0029125
2010-07-07 13:32hgbotStatusnew => resolved
2010-07-07 13:32hgbotResolutionopen => fixed
2010-07-07 13:32hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/110640fbe62b57b1c1b2cd04b41ddc745eb27bb5 [^]
2010-07-07 13:42sivaramanNote Added: 0029126
2010-07-10 11:23hudsonbotCheckin
2010-07-10 11:23hudsonbotNote Added: 0029198
2010-07-12 08:30sureshbabuNote Added: 0029216
2010-07-12 08:30sureshbabuStatusresolved => closed
2010-07-13 00:00anonymoussf_bug_id0 => 3028662

Notes
(0025711)
dalsasua   
2010-03-24 23:57   
Decreased to major. It's a very important issue, but configuration where will occur is not that common: a business partner that is customer is not normally filled in with a withholding: just providers does.
(0029125)
hgbot   
2010-07-07 13:32   
Repository: erp/devel/pi
Changeset: 110640fbe62b57b1c1b2cd04b41ddc745eb27bb5
Author: Sivaraman Rajagopal <sivaraman.rajagopal <at> openbravo.com>
Date: Wed Jul 07 16:58:42 2010 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/110640fbe62b57b1c1b2cd04b41ddc745eb27bb5 [^]

Fixes issue 12793: Sales invoices of a business partner with a withholding associated creates payments with incorrect amount

C_INVOICE_POST is responsible to complete both purchase and sales invoices. There, It just subtracts the withholding from the net amount without checking the document type if corresponding Business Partner is associated with any Withholding.
As a fix, an IF clause has been added to take Withholding into account only if document type is ''PURCHASE\" otherwise 0 amount will be subtracted.

---
M src-db/database/model/functions/C_INVOICE_POST.xml
---
(0029126)
sivaraman   
2010-07-07 13:42   
Steps to test:

Kindly follow all the steps as given in Steps to reproduce section and verify if withholding amount is not subtracted in Sales Invoice.

Impact:
The same procedure is used for Purchase Invoice also. Therefore verify the same for Purchase Invoice where it has to be subtracted from the net amount.
(0029198)
hudsonbot   
2010-07-10 11:23   
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/110640fbe62b [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/8cb9c6ccb2e4 [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.17829.obx [^]
(0029216)
sureshbabu   
2010-07-12 08:30   
verified in liveqa builds, checked both sales invoice and purchase invoice ..withholding rightly applied to purchase invoice but not to sales invoice..