Add 'auto_discount' to Catapult export
This commit is contained in:
		
							parent
							
								
									e3204993b1
								
							
						
					
					
						commit
						d87c889d26
					
				
					 1 changed files with 7 additions and 6 deletions
				
			
		|  | @ -91,7 +91,7 @@ class InventoryItemImporter(FromCore, catapult_importing.model.InventoryItemImpo | |||
|         'alt_receipt_alias', | ||||
|         'alt_pkg_qty', | ||||
|         'alt_pkg_price', | ||||
|         # 'auto_discount', | ||||
|         'auto_discount', | ||||
|         'supplier_unit_id', | ||||
|         'supplier_id', | ||||
|         'unit', | ||||
|  | @ -230,11 +230,12 @@ class InventoryItemImporter(FromCore, catapult_importing.model.InventoryItemImpo | |||
|         #         if tax_rate_ids_2 and rate.id in tax_rate_ids_2: | ||||
|         #             tax_2 += rate.rate | ||||
| 
 | ||||
|         # no alt item by default | ||||
|         # no alt item (or auto discount) by default | ||||
|         alt_id = None | ||||
|         alt_receipt_alias = None | ||||
|         alt_pkg_qty = None | ||||
|         alt_pkg_price = None | ||||
|         auto_discount = None | ||||
| 
 | ||||
|         # make an alt item, when main item has pack pricing (e.g. Zevia sodas) | ||||
|         # note that in this case the main item_id and alt_id are the same | ||||
|  | @ -254,6 +255,9 @@ class InventoryItemImporter(FromCore, catapult_importing.model.InventoryItemImpo | |||
|             alt_pkg_qty = product.quantity | ||||
|             alt_pkg_price = product.group_price | ||||
| 
 | ||||
|             # we also must declare an "auto discount" to get pack price | ||||
|             auto_discount = "{} @ ${:0.2f}".format(alt_pkg_qty, alt_pkg_price) | ||||
| 
 | ||||
|         # no supplier info by default | ||||
|         supplier_unit_id = None | ||||
|         supplier_id = None | ||||
|  | @ -366,10 +370,7 @@ class InventoryItemImporter(FromCore, catapult_importing.model.InventoryItemImpo | |||
|             'alt_receipt_alias': alt_receipt_alias, | ||||
|             'alt_pkg_qty': alt_pkg_qty, | ||||
|             'alt_pkg_price': alt_pkg_price, | ||||
| 
 | ||||
|             # TODO: does CORE have this? | ||||
|             # 'auto_discount': None, | ||||
| 
 | ||||
|             'auto_discount': auto_discount, | ||||
|             'supplier_unit_id': supplier_unit_id, | ||||
|             'supplier_id': supplier_id, | ||||
|             'unit': supplier_unit, | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Lance Edgar
						Lance Edgar