Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0031107Openbravo ERP07. Sales managementpublic2015-10-08 16:482015-12-02 00:10
ngarcia 
vmromanos 
urgentmajoralways
closedfixed 
5
 
 
AtulOpenbravo
Core
No
0031107: Only the commission related with the payment amount of the last payment is considered when invoice has split payment plan
Only the commission related with the payment amount of the last payment is considered when invoice has split payment plan. The user should launch then the Generate Commission process for the months of the rest of the payments in order to get the correct amount and the commissions of the invoices paid in that month will be duplicated
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: 2
   Create a Payment Term:
      Overdue Payment Days Rule: 64
   Add a line to it
      Percentage Due: 50
      Overdue Payment Days Rule: 32
   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
   Complete it
   Create a partial payment in the first due date
   Go to Commission window and click on Generate Commission process for the payment's month
   Go to Commission Payment window and check the amount is 0 as the invoice is not fully paid (this is correct)
      Create a second payment in the second due date
   Go to Commission window and click on Generate Commission process for the payment's month
   Go to Commission Payment window and check the amount is only based on the amount paid in this second payment
No tags attached.
related to defect 0030184 closed aferraz Wrong commission amount if the invoice has fractionated payment terms but it is paid in the same commission period 
Issue History
2015-10-08 16:48ngarciaNew Issue
2015-10-08 16:48ngarciaAssigned To => Triage Finance
2015-10-08 16:48ngarciaModules => Core
2015-10-08 16:48ngarciaTriggers an Emergency Pack => No
2015-10-08 16:48ngarciaRelationship addedrelated to 0030184
2015-10-08 16:49ngarciaResolution time => 1447801200
2015-10-08 16:49ngarciaIssue Monitored: networkb
2015-11-19 10:58AtulOpenbravoAssigned ToTriage Finance => AtulOpenbravo
2015-11-19 10:58AtulOpenbravoStatusnew => scheduled
2015-11-20 10:48AtulOpenbravoNote Added: 0082013
2015-11-25 16:55AtulOpenbravoNote Edited: 0082013bug_revision_view_page.php?bugnote_id=0082013#r10361
2015-11-26 15:07vmromanosAssigned ToAtulOpenbravo => vmromanos
2015-11-26 15:08vmromanosReview Assigned To => AtulOpenbravo
2015-12-01 09:50hgbotCheckin
2015-12-01 09:50hgbotNote Added: 0082476
2015-12-01 09:50hgbotStatusscheduled => resolved
2015-12-01 09:50hgbotResolutionopen => fixed
2015-12-01 09:50hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/873c8764054e5b564802ad828682a43710850448 [^]
2015-12-01 09:51vmromanosNote Added: 0082477
2015-12-01 09:51vmromanosStatusresolved => closed
2015-12-02 00:10hudsonbotCheckin
2015-12-02 00:10hudsonbotNote Added: 0082507

Notes
(0082013)
AtulOpenbravo   
2015-11-20 10:48   
(edited on: 2015-11-25 16:55)
Test Plan
- Login 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: 2
- Create a Payment Term:
   Overdue Payment Days Rule: 64
- Add a line to it
   Percentage Due: 50
   Overdue Payment Days Rule: 32
- 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
   Complete it.
- Create a partial payment in the first due date.
- Go to Commission window and click on Generate Commission process for the payment's month start date.
- Go to Commission Payment window and check the amount is 0 as the invoice is not fully paid.
- Create a second payment in the second due date.
- Go to Commission window and click on Generate Commission process for the payment's month start date.
- Go to Commission Payment window and check the amount is based on the amount total paid amount of the invoice as now in this it is fully paid

Alternate plan.
- In the same scenario as above.
- Go to back to Commission window and click on Generate Commission process for the first payment's month start date.
- Go to Commission Payment window and check the amount is still zero as earlier. Commisssion is calculated only in the month in which the last payment was made to fully pay the invoice.

(0082476)
hgbot   
2015-12-01 09:50   
Repository: erp/devel/pi
Changeset: 873c8764054e5b564802ad828682a43710850448
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Thu Nov 26 14:08:38 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/873c8764054e5b564802ad828682a43710850448 [^]

Fixed bug 31107: Commission for full paid documents split in several payments

For Full paid documents, the query will search for the invoices that are fully paid where the last payment belongs to the selected period.
So the query has been transformed to get all the PSD for the fully paid invoices if it exists at least one PSD paid in the given period and when all the PSD for the invoice are before the "to date" of the given period.

---
M src-db/database/model/functions/C_COMMISSION_PROCESS.xml
---
(0082477)
vmromanos   
2015-12-01 09:51   
Reviewed by AtulOpenbravo
(0082507)
hudsonbot   
2015-12-02 00:10   
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/a52bb700bbaf [^]
Maturity status: Test