Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0037628Openbravo ERP09. Financial managementpublic2018-01-12 11:232018-01-22 16:10
ngarcia 
collazoandy4 
urgentmajoralways
closedfixed 
5
 
3.0PR18Q2 
dmiguelez
Core
No
0037628: Wrong tax amount calculated for a negative tax based on the amount of other tax
Wrong tax amount calculated for a negative tax based on the amount of other tax
As group admin role:
   Create the following 4 taxes:
   1. Name: Parent
      Valid From: today
      Tax Category: IVA Normal
      Summary Level: Y
      Sales/Purchase Type: Purchase Tax
      Country, Destination Country, Region, Destination Region: empty
      Line No.: 10

   2. Name: Child 16
      Valid From: today
      Tax Category: IVA Normal
      Summary Level: N
      Rate: 16
      Sales/Purchase Type: Purchase Tax
      Document Tax Amount Calculation: Document based amount by rate
      Country, Destination Country, Region, Destination Region: empty
      Base Amount: Line net Amount
      Line No.: 10
      Parent Tax Rate: Parent

   3. Name: Child -66
      Valid From: today
      Tax Category: IVA Normal
      Summary Level: N
      Rate: -66.66666
      Sales/Purchase Type: Purchase Tax
      Document Tax Amount Calculation: Document based amount by rate
      Country, Destination Country, Region, Destination Region: empty
      Base Amount: Tax Amount
      Line No.: 20
      Parent Tax Rate: Parent

   Refresh the tab
   Select Child 16 as Tax Base for Child -66

   4. Name: Child -10
      Valid From: today
      Tax Category: IVA Normal
      Summary Level: N
      Rate: -10
      Sales/Purchase Type: Purchase Tax
      Document Tax Amount Calculation: Document based amount by rate
      Country, Destination Country, Region, Destination Region: empty
      Base Amount: Line net Amount
      Line No.: 30
      Parent Tax Rate: Parent

   Create a purchase order
   Add a line to it
   Set a unit price of 2000 and select previously created tax ('Parent')

   Add a new line to it
   Set a unit price of 185.00 and select previously created tax ('Parent')

   Check that in the tax tab the following values are shown:
      Child 16
         Tax amount: 349.60
         Taxable amount: 2185.00

      Child -66:
         Tax amount: -1689.73 (it should be -233.07)
         Taxable amount: 2534.60 (check which value should be used here)
 
       Child -10:
         Tax amount: -218.50
         Taxable amount: 2185.00
No tags attached.
Issue History
2018-01-12 11:23ngarciaNew Issue
2018-01-12 11:23ngarciaAssigned To => Triage Finance
2018-01-12 11:23ngarciaModules => Core
2018-01-12 11:23ngarciaResolution time => 1517526000
2018-01-12 11:23ngarciaTriggers an Emergency Pack => No
2018-01-12 11:23ngarciaIssue Monitored: networkb
2018-01-12 13:53dmiguelezAssigned ToTriage Finance => collazoandy4
2018-01-12 21:02collazoandy4Statusnew => scheduled
2018-01-12 22:22collazoandy4Statusscheduled => feedback
2018-01-15 09:43ngarciaStatusfeedback => scheduled
2018-01-17 21:34collazoandy4Note Added: 0101765
2018-01-19 10:04dmiguelezSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=16553#r16553
2018-01-19 11:12dmiguelezNote Edited: 0101765bug_revision_view_page.php?bugnote_id=0101765#r16563
2018-01-19 11:19dmiguelezNote Edited: 0101765bug_revision_view_page.php?bugnote_id=0101765#r16564
2018-01-22 11:45dmiguelezNote Added: 0101830
2018-01-22 11:45dmiguelezStatusscheduled => resolved
2018-01-22 11:45dmiguelezFixed in Version => 3.0PR18Q2
2018-01-22 11:45dmiguelezFixed in SCM revision => https://code.openbravo.com/erp/devel/pi/rev/25ba8c2893a6 [^]
2018-01-22 11:45dmiguelezResolutionopen => fixed
2018-01-22 11:46dmiguelezReview Assigned To => dmiguelez
2018-01-22 11:46dmiguelezNote Added: 0101831
2018-01-22 11:46dmiguelezStatusresolved => closed
2018-01-22 16:10dmiguelezNote Added: 0101852

Notes
(0101765)
collazoandy4   
2018-01-17 21:34   
(edited on: 2018-01-19 11:19)
Configuration Steps
  Go to Tax Rate window and create four taxes:
    1. Name: Parent
       Valid From: Today
       Summary Level: Y
       Sales/Purchase Type: Both
       Country, Destination Country, Region, Destination Region: empty
       Line No.: 10

    2. Name: Child 16
       Valid From: Today
       Rate: 16
       Sales/Purchase Type: Both
       Base Amount: Line net Amount
       Country, Destination Country, Region, Destination Region: empty
       Line No.: 10
       Parent Tax Rate: Parent

    3. Name: Child -66
       Valid From: today
       Tax Category: IVA Normal
       Rate: -66.66666
       Sales/Purchase Type: Both
       Country, Destination Country, Region, Destination Region: empty
       Base Amount: Tax Amount
       Line No.: 20
       Parent Tax Rate: Parent

       After saved the record set Tax Base: Child 16

    4. Name: Child -10
       Valid From: Today
       Tax Category: IVA Normal
       Summary Level: N
       Rate: -10
       Sales/Purchase Type: Purchase Tax
       Country, Destination Country, Region, Destination Region: empty
       Base Amount: Line net Amount
       Line No.: 30
       Parent Tax Rate: Parent

  Test Plan I
    Go to Sales Order window and create a new record:
      Business Partner: Alimentos y Supermercados, S.A
      Create a new record in Lines tab:
        Product: Limonada 0,5L
        Net Unit Price: 2000
        Tax: Parent
        Go to Tax tab and check:
          Tax: Child 16 - IVA Normal, Tax Amount: 320.00, Taxable Amount: 2000.00
          Tax: Child -66 - IVA Normal, Tax Amount: -213.33, Taxable Amount: 320.00
          Tax: Child -10 - IVA Normal, Tax Amount: -200.00, Taxable Amount: 2000.00
      Create another record in Lines tab:
        Product: Vino Blanco 0,75L
        Net Unit Price: 2000
        Tax: Parent
        Go to Tax tab and check:
          Tax: Child 16 - IVA Normal, Tax Amount: 640.00, Taxable Amount: 4000.00
          Tax: Child -66 - IVA Normal, Tax Amount: -426.67, Taxable Amount: 640.00
          Tax: Child -10 - IVA Normal, Tax Amount: -400.00, Taxable Amount: 4000.00
      Remove the line created for Limonada Product
      Go to Tax tab and check:
          Tax: Child 16 - IVA Normal, Tax Amount: 320.00, Taxable Amount: 2000.00
          Tax: Child -66 - IVA Normal, Tax Amount: -213.33, Taxable Amount: 320.00
          Tax: Child -10 - IVA Normal, Tax Amount: -200.00, Taxable Amount: 2000.00

  
  Test Plan II
    Repeat the test plan above for Sales Invoice and Purchase flow

  Test Plan III
    Go to Tax Rate window and create a new record:
      Name: Child -66
      Valid From: today
      Tax Category: IVA Normal
      Rate: -66.66666
      Sales/Purchase Type: Both
      Country, Destination Country, Region, Destination Region: empty
      Base Amount: Line Net Amount + Tax Amount
      Line No.: 40
      Parent Tax Rate: Parent
    After saved the record set Tax Base: Child 16
    Go to Sales Order window and create a new record:
      Business Partner: Alimentos y Supermercados, S.A
      Create a new record in Lines tab:
        Product: Limonada 0,5L
        Net Unit Price: 2000
        Tax: Parent
        Go to Tax tab and check:
          Tax: Child 16 - IVA Normal, Tax Amount: 320.00, Taxable Amount: 2000.00
          Tax: Child -66 - IVA Normal, Tax Amount: -213.33, Taxable Amount: 320.00
          Tax: Child -10 - IVA Normal, Tax Amount: -200.00, Taxable Amount: 2000.00
          Tax: Chid-Tax - IVA Normal, Tax Amount: -1546.67.00, Taxable Amount: 2320.00
      Create another record in Lines tab:
        Product: Vino Blanco 0,75L
        Net Unit Price: 2000
        Tax: Parent
        Go to Tax tab and check:
          Tax: Child 16 - IVA Normal, Tax Amount: 640.00, Taxable Amount: 4000.00
          Tax: Child -66 - IVA Normal, Tax Amount: -426.67, Taxable Amount: 640.00
          Tax: Child -10 - IVA Normal, Tax Amount: -400.00, Taxable Amount: 4000.00
          Tax: Chid-Tax - IVA Normal, Tax Amount: -3093.33.00, Taxable Amount: 4640.00
          
      Remove the line created for Limonada Product
      Go to Tax tab and check:
          Tax: Child 16 - IVA Normal, Tax Amount: 320.00, Taxable Amount: 2000.00
          Tax: Child -66 - IVA Normal, Tax Amount: -213.33, Taxable Amount: 320.00
          Tax: Child -10 - IVA Normal, Tax Amount: -200.00, Taxable Amount: 2000.00
          Tax: Chid-Tax - IVA Normal, Tax Amount: -1546.67.00, Taxable Amount: 2320.00


  Test Plan IV
    Repeat the test plan above for Sales Invoice and Purchase flow

(0101830)
dmiguelez   
2018-01-22 11:45   
Code Review + Testing Ok
(0101831)
dmiguelez   
2018-01-22 11:46   
Code Review + Testing Ok
(0101852)
dmiguelez   
2018-01-22 16:10   
Fixed by this commit:
https://code.openbravo.com/erp/devel/pi/rev/25ba8c2893a6 [^]