The problem is, that the field "base_row_total_incl_tax" is null (None) for all order-items which I have imported from Amazon to my Magento store. But this field is required for the particular ma mapping-function for the "price" field on Sale Order Line
Which is this:
result=[
('price_unit_tax_included', (float(resource['base_row_total_incl_tax']))/float(resource['qty_ordered'])),
('price_unit_tax_excluded', (float(resource['base_row_total']))/float(resource['qty_ordered'])),
('tax_rate', float(resource['base_row_total']) and (float(resource['base_row_total_incl_tax'])/float(resource['base_row_total'])-1)),
]
So two approaches to solve this:
First:
Change the mapping function to don't use "base_row_total_incl_tax" like this:
result=[
('price_unit_tax_included', float(resource['price_incl_tax'])),
('price_unit_tax_excluded', (float(resource['base_row_total']))/float(resource['qty_ordered'])),
('tax_rate', float(resource['base_row_total']) and ((float(resource['price_incl_tax'])*float(resource['qty_ordered']))/float(resource['base_row_total'])-1)),
]
I don't know if this is save for all use-cases, so someone should have a look at it.
Second:
Change Magento code to automatically calculate base_row_total_incl_tax on every order (from Amazon) created.
But I haven't looked into the code, yet. So I don't know where to actually do this.
And you would also have to change all previously created orders in the database.
Ok, I solved this Mapping Error.
The problem is, that the field "base_row_ total_incl_ tax" is null (None) for all order-items which I have imported from Amazon to my Magento store. But this field is required for the particular ma mapping-function for the "price" field on Sale Order Line
Which is this:
result=[ unit_tax_ included' , (float( resource[ 'base_row_ total_incl_ tax'])) /float( resource[ 'qty_ordered' ])), unit_tax_ excluded' , (float( resource[ 'base_row_ total'] ))/float( resource[ 'qty_ordered' ])), 'base_row_ total'] ) and (float( resource[ 'base_row_ total_incl_ tax'])/ float(resource[ 'base_row_ total'] )-1)),
('price_
('price_
('tax_rate', float(resource[
]
So two approaches to solve this:
First: total_incl_ tax" like this:
Change the mapping function to don't use "base_row_
result=[ unit_tax_ included' , float(resource[ 'price_ incl_tax' ])), unit_tax_ excluded' , (float( resource[ 'base_row_ total'] ))/float( resource[ 'qty_ordered' ])), 'base_row_ total'] ) and ((float( resource[ 'price_ incl_tax' ])*float( resource[ 'qty_ordered' ]))/float( resource[ 'base_row_ total'] )-1)),
('price_
('price_
('tax_rate', float(resource[
]
I don't know if this is save for all use-cases, so someone should have a look at it.
Second: total_incl_ tax on every order (from Amazon) created.
Change Magento code to automatically calculate base_row_
But I haven't looked into the code, yet. So I don't know where to actually do this.
And you would also have to change all previously created orders in the database.
Hope this helps anyone.