round incoming unit_price and quantity to match digits of fields

This commit is contained in:
Frederik Jaeckel 2025-01-29 10:50:13 +01:00 committed by Mathias Behrle
parent 76f1e97b00
commit 9a83b24477
2 changed files with 21 additions and 17 deletions

View file

@ -23,7 +23,7 @@ parsed_data_ci_invoice = {
'total': {'amount': Decimal('1350.00')},
'line_no': '1',
'quantity': {
'billed': Decimal('1.0'),
'billed': 1.0,
'unit_code': 'KGM'},
'unit_net_price': {'amount': Decimal('1350.00')},
}, {
@ -34,7 +34,7 @@ parsed_data_ci_invoice = {
'total': {'amount': Decimal('1200.00')},
'line_no': '2',
'quantity': {
'billed': Decimal('1.5'),
'billed': 1.5,
'unit_code': 'KGM'},
'unit_net_price': {'amount': Decimal('800.00')},
}, {
@ -42,7 +42,7 @@ parsed_data_ci_invoice = {
'total': {'amount': Decimal('300.00')},
'line_no': '3',
'quantity': {
'billed': Decimal('2.0'),
'billed': 2.0,
'unit_code': 'MTR'},
'unit_net_price': {'amount': Decimal('150.00')}}],
'note_list': [{
@ -101,7 +101,7 @@ parsed_data_facturx_en16931 = {
'description': 'Description of Product 1',
'unit_net_price': {'amount': Decimal('1350.00')},
'quantity': {
'billed': Decimal('1.0'), 'unit_code': 'KGM'},
'billed': 1.0, 'unit_code': 'KGM'},
'taxes': [{
'type': 'VAT',
'category_code': 'S',
@ -127,7 +127,7 @@ parsed_data_facturx_en16931 = {
'amount': Decimal('950.00'),
'basequantity': Decimal('1.0')},
'quantity': {
'billed': Decimal('1.5'),
'billed': 1.5,
'unit_code': 'KGM'},
'taxes': [{
'type': 'VAT',
@ -141,7 +141,7 @@ parsed_data_facturx_en16931 = {
'description': 'Description of Product 3',
'unit_net_price': {'amount': Decimal('150.00')},
'quantity': {
'billed': Decimal('2.0'),
'billed': 2.0,
'unit_code': 'MTR'},
'taxes': [{
'type': 'VAT',
@ -213,7 +213,7 @@ parsed_data_facturx_basic = {
'line_no': '1',
'name': 'Name of Product 1',
'unit_net_price': {'amount': Decimal('1350.00')},
'quantity': {'billed': Decimal('1.0'), 'unit_code': 'KGM'},
'quantity': {'billed': 1.0, 'unit_code': 'KGM'},
'taxes': [{
'type': 'VAT',
'category_code': 'S',
@ -231,7 +231,7 @@ parsed_data_facturx_basic = {
'amount': Decimal('950.00'),
'basequantity': Decimal('1.0')},
'quantity': {
'billed': Decimal('1.5'),
'billed': 1.5,
'unit_code': 'KGM'},
'taxes': [{
'type': 'VAT',
@ -243,7 +243,7 @@ parsed_data_facturx_basic = {
'name': 'Name of Product 3',
'unit_net_price': {'amount': Decimal('150.00')},
'quantity': {
'billed': Decimal('2.0'),
'billed': 2.0,
'unit_code': 'MTR'},
'taxes': [{
'type': 'VAT',
@ -328,7 +328,7 @@ parsed_data_facturx_extended = {
'name': 'Name of Product 1',
'description': 'Description of Product 1',
'unit_net_price': {'amount': Decimal('1350.00')},
'quantity': {'billed': Decimal('1.0'), 'unit_code': 'KGM'},
'quantity': {'billed': 1.0, 'unit_code': 'KGM'},
'taxes': [{
'type': 'VAT',
'category_code': 'S',
@ -379,7 +379,7 @@ parsed_data_facturx_extended = {
'amount': Decimal('950.00'),
'basequantity': Decimal('1.0')},
'quantity': {
'billed': Decimal('1.5'),
'billed': 1.5,
'unit_code': 'KGM',
'package': Decimal('1.5')},
'taxes': [{
@ -392,7 +392,7 @@ parsed_data_facturx_extended = {
'name': 'Name of Product 3',
'description': 'Description of Product 3',
'unit_net_price': {'amount': Decimal('150.00')},
'quantity': {'billed': Decimal('2.0'), 'unit_code': 'MTR'},
'quantity': {'billed': 2.0, 'unit_code': 'MTR'},
'taxes': [{
'type': 'VAT',
'category_code': 'S',