fix: purchase receipt tests
This commit is contained in:
parent
f705bf2efe
commit
fcfdb9b566
@ -824,6 +824,7 @@ class StockController(AccountsController):
|
||||
credit,
|
||||
remarks,
|
||||
against_account,
|
||||
against_type="Account",
|
||||
debit_in_account_currency=None,
|
||||
credit_in_account_currency=None,
|
||||
account_currency=None,
|
||||
@ -838,7 +839,7 @@ class StockController(AccountsController):
|
||||
"cost_center": cost_center,
|
||||
"debit": debit,
|
||||
"credit": credit,
|
||||
"against_type": "Account",
|
||||
"against_type": against_type,
|
||||
"against": against_account,
|
||||
"remarks": remarks,
|
||||
}
|
||||
|
@ -449,6 +449,7 @@ class PurchaseReceipt(BuyingController):
|
||||
debit=0.0,
|
||||
credit=discrepancy_caused_by_exchange_rate_difference,
|
||||
remarks=remarks,
|
||||
against_type="Supplier",
|
||||
against_account=self.supplier,
|
||||
debit_in_account_currency=-1 * discrepancy_caused_by_exchange_rate_difference,
|
||||
account_currency=credit_currency,
|
||||
@ -462,6 +463,7 @@ class PurchaseReceipt(BuyingController):
|
||||
debit=discrepancy_caused_by_exchange_rate_difference,
|
||||
credit=0.0,
|
||||
remarks=remarks,
|
||||
against_type="Supplier",
|
||||
against_account=self.supplier,
|
||||
debit_in_account_currency=-1 * discrepancy_caused_by_exchange_rate_difference,
|
||||
account_currency=credit_currency,
|
||||
@ -666,7 +668,7 @@ class PurchaseReceipt(BuyingController):
|
||||
(self.name, expenses_included_in_valuation),
|
||||
)
|
||||
|
||||
against_account = ", ".join([d.account for d in gl_entries if flt(d.debit) > 0])
|
||||
against_accounts = [d.account for d in gl_entries if flt(d.debit) > 0]
|
||||
total_valuation_amount = sum(valuation_tax.values())
|
||||
amount_including_divisional_loss = negative_expense_to_be_booked
|
||||
stock_rbnb = self.get_company_default("stock_received_but_not_billed")
|
||||
@ -687,16 +689,17 @@ class PurchaseReceipt(BuyingController):
|
||||
)
|
||||
amount_including_divisional_loss -= applicable_amount
|
||||
|
||||
self.add_gl_entry(
|
||||
gl_entries=gl_entries,
|
||||
account=account,
|
||||
cost_center=tax.cost_center,
|
||||
debit=0.0,
|
||||
credit=applicable_amount,
|
||||
remarks=self.remarks or _("Accounting Entry for Stock"),
|
||||
against_account=against_account,
|
||||
item=tax,
|
||||
)
|
||||
for against in against_accounts:
|
||||
self.add_gl_entry(
|
||||
gl_entries=gl_entries,
|
||||
account=account,
|
||||
cost_center=tax.cost_center,
|
||||
debit=0.0,
|
||||
credit=flt(applicable_amount) / len(against_accounts),
|
||||
remarks=self.remarks or _("Accounting Entry for Stock"),
|
||||
against_account=against,
|
||||
item=tax,
|
||||
)
|
||||
|
||||
i += 1
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user