fix deposit is net value

This commit is contained in:
viehlieb 2023-09-28 22:42:52 +02:00
parent f29ab603b6
commit 90e06a475f
10 changed files with 75 additions and 34 deletions

View file

@ -99,6 +99,14 @@ class OrderArticle < ApplicationRecord
units * price.unit_quantity * price.gross_price
end
def total_gross_price_without_deposit
units * price.unit_quantity * price.gross_price_without_deposit
end
def total_deposit_price
units * price.unit_quantity * price.deposit
end
def ordered_quantities_different_from_group_orders?(ordered_mark = '!', billed_mark = '?', received_mark = '?')
if !units_received.nil?
(units_received * price.unit_quantity) == group_orders_sum[:quantity] ? false : received_mark