SUBTOTAL
SUBTOTAL
An interface to the assignment table in the database
getOffer() : \offer
Get the offer that this assignment is linked to
The offer
calculate(integer $what = self::TOTAL, integer $round = 2, boolean $format = true) : float|boolean
Calculate useful numbers about the assignment
Subtotal: price_per_hour * hours
VAT: subtotal * VAT_percentage
Total: subtotal + VAT
integer | $what | Any of assignment::SUBTOTAL, assignment::VAT, assignment::TOTAL |
integer | $round | How many decimals to round on |
boolean | $format | Whether to format the number nicely (for output) or not (for calculations) |
If something went wrong with the database
The calculated value rounded on $round decimals, or false when the input is incorrect
delete() : boolean
Remove this assignment from the database
If this doesn't succeed (i.e. false is returned), that means the assignment was removed manually or by another instance of this class
If something went wrong with the database
True on success, false on failure