Fixed again
This commit is contained in:
@ -9,6 +9,7 @@ from brewman.models.voucher import Voucher, VoucherType, Batch, Inventory, Journ
|
||||
|
||||
__author__ = 'tanshu'
|
||||
|
||||
|
||||
def purchase_return_create_voucher(json, user):
|
||||
dt = datetime.datetime.strptime(json['Date'], '%d-%b-%Y')
|
||||
voucher = Voucher(date=dt, narration=json['Narration'], user_id=user.id, type=VoucherType.by_name(json['Type']))
|
||||
@ -50,7 +51,7 @@ def purchase_return_create_journals(inventories, ledgerID):
|
||||
ledger = Product.by_id(item.product_id).ledger
|
||||
amount += round(item.amount, 2)
|
||||
if ledger.id in journals:
|
||||
journals[ledger.id].amount += amount
|
||||
journals[ledger.id].amount += round(item.amount, 2)
|
||||
else:
|
||||
journals[ledger.id] = Journal(debit=-1, cost_center_id=ledger.costcenter_id, ledger_id=ledger.id,
|
||||
amount=item.amount)
|
||||
|
||||
Reference in New Issue
Block a user