Ticket #40 (closed enhancement: fixed)

Opened 3 years ago

Last modified 3 years ago

invoice editing: make total amount calculations

Reported by: jzarate Owned by: jzarate
Priority: major Milestone: 0.1
Component: Keywords: invoice, editing, calculus
Cc: enrique

Description (last modified by jzarate) (diff)

make the final result calculation (cost, taxes, discounts).

also , make the invoice form displays new totals as the user edits new unitary cost or quantity or discount values.

Change History

Changed 3 years ago by jzarate

  • status changed from new to assigned
  • description modified (diff)

Changed 3 years ago by jzarate

Changed 3 years ago by jzarate

r192 added even listening for dom-created nodes

r193 added 2 decimal rounding

Changed 3 years ago by jzarate

  • cc enrique added

r194 subtotal field

Enrique, I used the following model for the subtotals calculation. I need confirmation on this:

  • subtotal: the gross sum of the total amount of each item, discounts of the item aplied, taxes excluded.
  • taxes: the overall sum of all the items taxes, whatever they be. That field is label with a generic "taxes", since each item can have different taxes types.
  • discount: the global discount defined in the field "customer discount", applied to the gross sum
  • totals are calculated as this:

subtotal + taxes - discount

Changed 3 years ago by jzarate

r202 javascript refactoring

Changed 3 years ago by jzarate

r203 corrected small bug from r202

Changed 3 years ago by jzarate

  • status changed from assigned to closed
  • type changed from defect to enhancement
  • resolution set to fixed

Changed 3 years ago by jzarate

r272 adpated to the new fields related to "totals" in the invoice model. these fields are:

  • base : the base amount (sum qty*u_price for each item)
  • discount : the total discount (sum the discounts -not in percentage, but in real value- that are to be applied for each item)
  • taxes: the total taxes (sum over the taxes to be applied for each item -not in percentage, but in real value)
  • net: the price after discount (summed over every item: base amount - discount)
  • gross: the final price (base - discount + taxes).
Note: See TracTickets for help on using tickets.