Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0030184Openbravo ERP07. Sales managementpublic2015-06-15 16:072015-06-23 16:47
ngarcia 
aferraz 
immediatemajoralways
closedfixed 
5
 
 
vmromanos
Core
Production - QA Approved
2015-02-18
3.0PR15Q2
https://code.openbravo.com/erp/devel/pi/rev/a1c3c8123501 [^]
No
0030184: Wrong commission amount if the invoice has fractionated payment terms but it is paid in the same commission period
Wrong commission amount if the invoice has fractionated payment terms but it is paid in the same commission period
As group admin role:
   Create a Commission
      Basis Document: Invoice
      Basis Status: Fully paid documents
      Basis Amount: Net amount
   Add a line to it:
      Based on Sales Rep.: 'Y'
      Business Partner Category: 'Customer - Tier 3'
      Multiplier amount: 0.13
   Create a Payment Term:
      Overdue Payment Days Rule: 60
   Add a line to it
      Percentage Due: 50
      Overdue Payment Days Rule: 30
   Create a Sales Invoice for 'Hoteles Buenas Noches, S.A.'
   Add the previously defined sales representative and payment terms
   Add a line with any product and quantity and tax: Ventas exentas
   Complete it
   Pay it in one payment
   Go to Commission window and click on Generate Commission process
   Go to Commission Payment window and check there is only one line with the Actual Amount different from the invoice's total net amount
No tags attached.
related to defect 00272803.0PR15Q1 closed reinaldoguerra Commission payment details are duplicated if the invoice has fractionated payment terms 
depends on backport 00301923.0PR15Q2.3 closed aferraz Wrong commission amount if the invoice has fractionated payment terms but it is paid in the same commission period 
caused by defect 00287723.0PR15Q2 closed AtulOpenbravo Commission payment details are duplicated if the invoice is paid in two different months 
related to defect 0031107 closed vmromanos Only the commission related with the payment amount of the last payment is considered when invoice has split payment plan 
Issue History
2015-06-15 16:07ngarciaNew Issue
2015-06-15 16:07ngarciaAssigned To => Triage Finance
2015-06-15 16:07ngarciaModules => Core
2015-06-15 16:07ngarciaResolution time => 1436738400
2015-06-15 16:07ngarciaTriggers an Emergency Pack => No
2015-06-15 16:08ngarciaRelationship addedcaused by 0027280
2015-06-15 16:09ngarciaIssue Monitored: networkb
2015-06-15 16:18heccamIssue Monitored: heccam
2015-06-15 18:08aferrazAssigned ToTriage Finance => aferraz
2015-06-16 19:31aferrazRelationship deletedcaused by 0027280
2015-06-16 19:31aferrazRelationship addedrelated to 0027280
2015-06-16 19:31aferrazRelationship addedcaused by 0028772
2015-06-16 19:32aferrazRelationship addedrelated to 0026553
2015-06-16 19:41aferrazRegression level => Production - QA Approved
2015-06-16 19:41aferrazRegression date => 2015-02-18
2015-06-16 19:41aferrazRegression introduced in release => 3.0PR15Q2
2015-06-16 19:41aferrazRegression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/a1c3c8123501 [^]
2015-06-16 19:42aferrazStatusnew => scheduled
2015-06-16 19:51aferrazNote Added: 0078330
2015-06-16 19:52aferrazRelationship deletedrelated to 0026553
2015-06-16 19:57aferrazNote Edited: 0078330bug_revision_view_page.php?bugnote_id=0078330#r8843
2015-06-16 19:58aferrazSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=8845#r8845
2015-06-22 11:30hgbotCheckin
2015-06-22 11:30hgbotNote Added: 0078405
2015-06-22 11:30hgbotStatusscheduled => resolved
2015-06-22 11:30hgbotResolutionopen => fixed
2015-06-22 11:30hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/eb4384a42e54d1e4b3584e2ab205fab64291475d [^]
2015-06-22 11:32vmromanosReview Assigned To => vmromanos
2015-06-22 11:32vmromanosNote Added: 0078406
2015-06-22 11:32vmromanosStatusresolved => closed
2015-06-23 16:47hudsonbotCheckin
2015-06-23 16:47hudsonbotNote Added: 0078440
2015-10-08 16:48ngarciaRelationship addedrelated to 0031107

Notes
(0078330)
aferraz   
2015-06-16 19:51   
(edited on: 2015-06-16 19:57)
Test plan 1:

As group admin role:
   Create a Commission
      Basis Document: Invoice
      Basis Status: Fully paid documents
      Basis Amount: Net amount
   Add a line to it:
      Based on Sales Rep.: 'Y'
      Business Partner Category: 'Customer - Tier 3'
      Multiplier amount: 0.13
   Create a Payment Term:
      Overdue Payment Days Rule: 60
   Add a line to it
      Percentage Due: 50
      Overdue Payment Days Rule: 30
   Create a Sales Invoice for 'Hoteles Buenas Noches, S.A.'
   Add the previously defined sales representative and payment terms
   Add a line with any product and quantity and tax: Ventas exentas
   Complete it
   Pay it in one payment
   Go to Commission window and click on Generate Commission process
   Go to Commission Payment window and check there are two lines, each one with half of the invoice's total net amount

Test plan 2:

- Login as International Group Admin.
- Create a Payment Term header:
   Overdue Payment Days Rule: 30
   Add a line to it:
      Percentage due: 50
      Overdue Payment Days Rule: 0
- Create a Commission with:
      Business Partner / Sales Rep.: define one
      Frequency Type: Monthly
      Basis Document: Invoice
      Basis Status. Fully paid docuemnts
      Basis Amount: Net amount
   Add a line to it:
      Based on Sales Rep. = Y
      Multiplier amount: 0.5
- Create a Sales Invoice and associate the previously created payment terms and the sales representative to it. Complete it
- Pay it in two payments: one in each due date
- Generate Commission for the month which contains the first payment
- Generate Commission for the month which contains the second payment
- Go to the Commission Payment window and check amount for each month is not whole invoice amount. It is properly split as per the payment amount done month wise.

Test plan 3:

Test plan used:
1- Login into Openbravo ERP
2- Go to Payment Term window and create a new header record.
3- Set Overdue Payment Days Rule: 30
4- Add a new line to it
5- Set Percentage due: 50 and Overdue Payment Days Rule: 0
6- Go to Commission window and create a new header
7- Select a Business Partner / Sales Rep (create a new one if is required).
   Set Frequency Type: Monthly
   Basis Document: Invoice
   Basis Status. Fully paid docuemnts
   Basis Amount: Net amount
8- Go to lines tab and create a new record
9- Check Based on Sales Rep. flag and set Multiplier amount: 0.5
10- Go to Sales Invoice window and create a new one selecting the same sales representative and the previously created payment terms.
11- Add a line with a product
11- Complete it
12- Pay the whole amount by clicking add payment button, realize that two record are selected in the invoice grid as the invoice has fractionated payment terms. Complete the process.
13- Go back to Commission window, select previous commision record and click in Generate Commission button
14- Go to the Commission Payment window, select created record, go to Amounts tab and then select Details tab.
15- Realize that one record per invoice is shown.

(0078405)
hgbot   
2015-06-22 11:30   
Repository: erp/devel/pi
Changeset: eb4384a42e54d1e4b3584e2ab205fab64291475d
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Tue Jun 16 20:02:44 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/eb4384a42e54d1e4b3584e2ab205fab64291475d [^]

Fixes issue 30184: Wrong commission amount

In case of Basis Status = "Fully paid documents", select query should not have distinct clause, as each line will be retrieved as percentage of invoice line amount.

---
M src-db/database/model/functions/C_COMMISSION_PROCESS.xml
---
(0078406)
vmromanos   
2015-06-22 11:32   
Code review + testing OK
(0078440)
hudsonbot   
2015-06-23 16:47   
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/1697e5e9cd2d [^]
Maturity status: Test