bugfix
This commit is contained in:
@@ -61,10 +61,12 @@ class NalogoService:
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
# API expects quantity as integer when it's a whole number
|
||||||
|
qty = int(quantity) if float(quantity).is_integer() else Decimal(str(quantity))
|
||||||
service_item = IncomeServiceItem(
|
service_item = IncomeServiceItem(
|
||||||
name=item_name,
|
name=item_name,
|
||||||
amount=Decimal(str(amount)),
|
amount=Decimal(str(amount)),
|
||||||
quantity=Decimal(str(quantity)),
|
quantity=qty,
|
||||||
)
|
)
|
||||||
total_amount = service_item.get_total_amount()
|
total_amount = service_item.get_total_amount()
|
||||||
request = IncomeRequest(
|
request = IncomeRequest(
|
||||||
|
|||||||
Reference in New Issue
Block a user