From 30f87caecfafbf34662bae1f27859187c33a87cc Mon Sep 17 00:00:00 2001 From: anhilmy Date: Wed, 21 Aug 2024 13:22:07 +0700 Subject: [PATCH] fix: rounding adjustment in transfer folio --- .../doctype/inn_folio_transaction/inn_folio_transaction.py | 2 +- inn/inn_hotels/page/pos_extended/pos_extended.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/inn/inn_hotels/doctype/inn_folio_transaction/inn_folio_transaction.py b/inn/inn_hotels/doctype/inn_folio_transaction/inn_folio_transaction.py index 8bab5dd..543d403 100644 --- a/inn/inn_hotels/doctype/inn_folio_transaction/inn_folio_transaction.py +++ b/inn/inn_hotels/doctype/inn_folio_transaction/inn_folio_transaction.py @@ -13,7 +13,7 @@ class InnFolioTransaction(Document): def validate(self): - amount = int(self.amount) + amount = float(self.amount) if amount == 0: raise ValueError("Amount cannot be zero") diff --git a/inn/inn_hotels/page/pos_extended/pos_extended.py b/inn/inn_hotels/page/pos_extended/pos_extended.py index 3543b79..6f3a9c7 100644 --- a/inn/inn_hotels/page/pos_extended/pos_extended.py +++ b/inn/inn_hotels/page/pos_extended/pos_extended.py @@ -179,7 +179,7 @@ def transfer_to_folio(invoice_doc, folio_name): create_folio_trx(invoice_doc["name"], folio_name, taxe["tax_amount_after_discount_amount"], tax_type[ii], ftb_doc, remarks[ii], idx, guest_account_receiveable, taxe["account_head"]) idx = idx + 1 - if invoice_doc["rounding_adjustment"] != 0: + if "rounding_adjustment" in invoice_doc and invoice_doc["rounding_adjustment"] != 0: roundoff_remark = 'Rounding off Amount of Transfer Restaurant Charges from Restaurant Order: ' + invoice_doc["name"] create_folio_trx(invoice_doc["name"], folio_name, invoice_doc["rounding_adjustment"], "Round Off", ftb_doc, roundoff_remark, idx, guest_account_receiveable)