mirror of
https://github.com/mruwnik/invoices.git
synced 2025-06-08 21:34:44 +02:00
Add brutto option for items
This commit is contained in:
parent
bb85a5f2fa
commit
433a03cc30
@ -72,6 +72,7 @@ item is VAT free), :to (the date from which this item is valid), :from (the date
|
|||||||
The price can be provided in one of the following ways:
|
The price can be provided in one of the following ways:
|
||||||
|
|
||||||
* :netto - is a set price and will be displayed as provided
|
* :netto - is a set price and will be displayed as provided
|
||||||
|
* :brutto - is a set price and will be first scaled down to netto
|
||||||
* :hourly - is an hourly price - worklogs will be queried in order to work out how many hours should be billed.
|
* :hourly - is an hourly price - worklogs will be queried in order to work out how many hours should be billed.
|
||||||
If no worklog could be found (or its :worked is nil), this item will be skipped.
|
If no worklog could be found (or its :worked is nil), this item will be skipped.
|
||||||
* :base + :per-day - in the case of a variable number of hours worked. :base provides the amount that would be paid
|
* :base + :per-day - in the case of a variable number of hours worked. :base provides the amount that would be paid
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
(if-not vat-level 0 (* netto (/ vat-level 100))))
|
(if-not vat-level 0 (* netto (/ vat-level 100))))
|
||||||
|
|
||||||
(defn brutto [{netto :netto :as item}] (round (+ netto (vat item))))
|
(defn brutto [{netto :netto :as item}] (round (+ netto (vat item))))
|
||||||
|
(defn netto [{brutto :brutto vat :vat}] (/ (* brutto 100) (+ 100 vat)))
|
||||||
|
|
||||||
(defn parse-custom
|
(defn parse-custom
|
||||||
"Parse the given function definition and execute it with the given `worklog`."
|
"Parse the given function definition and execute it with the given `worklog`."
|
||||||
@ -36,5 +37,6 @@
|
|||||||
(contains? item :function) (assoc item :netto (calc-custom worked item))
|
(contains? item :function) (assoc item :netto (calc-custom worked item))
|
||||||
(contains? item :hourly) (assoc item :netto (calc-hourly worked item))
|
(contains? item :hourly) (assoc item :netto (calc-hourly worked item))
|
||||||
(contains? item :base) (assoc item :netto (calc-part-time worked item))
|
(contains? item :base) (assoc item :netto (calc-part-time worked item))
|
||||||
|
(contains? item :brutto) (assoc item :netto (netto item))
|
||||||
(not (contains? item :netto)) (assoc item :netto 0)
|
(not (contains? item :netto)) (assoc item :netto 0)
|
||||||
:else item))
|
:else item))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user