Mapping update to include shipment site, taxes, and discounts.

master
bleeson 2024-03-11 13:11:02 -07:00
parent 7ca7b0edb8
commit 85a0b11a86
2 changed files with 31 additions and 29 deletions

View File

@ -109,7 +109,7 @@ def process_files(file):
if num == 0:
continue #skip header lines
if num >= 1: #gather header information
current_order = row[5]
current_order = row[6]
if current_order != previous_order:
time_stamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
if sales_order.header.cusordref != '':
@ -119,33 +119,33 @@ def process_files(file):
sales_order.output(import_file)
sales_order = SalesOrder()
previous_order = current_order
order_id = row[5]
order_date = row[8]
customer_name = row[9]
ship_site = row[0]
order_id = row[6]
order_date = row[9]
customer_name = row[10]
# shipadd1 = row[9] # address information is not stored in X3
# shipadd2 = row[10]
# shipcity = row[11]
# shipstate = row[12]
# shipzip = row[13]
tracking = row[14]
weight = row[16]
ship_charge = row[20]
taxes = "?" #TODO fixme
ship_site = "?" #TODO fixme
discount = "?" #TODO fixme
tracking = row[16]
weight = row[18]
taxes = row[22]
ship_charge = row[21]
discount = row[24]
sales_order.header.cusordref = order_id
sales_order.header.orddat = datetime.datetime.strptime(order_date,'%m/%d/%y %I:%M %p').strftime('%Y%m%d') #TODO strftim this
sales_order.header.stofcy = ship_site
sales_order.header.bpdnam = customer_name
sales_order.header.invdtaamt_5 = ship_charge
sales_order.header.invdtaamt_7 = '0.33' #TODO discount
sales_order.header.invdtaamt_8 = '0.51'#TODO taxes
sales_order.header.invdtaamt_7 = discount
sales_order.header.invdtaamt_8 = taxes
#gather line data
line_product = row[0]
line_qty = row[2]
line_lot = row[3]
line_price = row[19]
line_product = row[1]
line_qty = row[3]
line_lot = row[4]
line_price = row[20]
sales_order.append(
SalesOrderDetail(
itmref=line_product,

View File

@ -76,7 +76,7 @@ def process_files(file):
if num == 0:
continue #skip header lines
if num >= 1: #gather header information
sohnum = find_so_from_po(row[5])
sohnum = find_so_from_po(row[6])
if num == 1:
previous_order = sohnum
if previous_order != sohnum:
@ -88,19 +88,19 @@ def process_files(file):
warehouse_shipment.output(import_file)
warehouse_shipment = WarehouseShipment()
previous_order = sohnum
order_date = row[8]
customer_name = row[9]
order_date = row[9]
customer_name = row[10]
# shipadd1 = row[9] # address information is not stored in X3
# shipadd2 = row[10]
# shipcity = row[11]
# shipstate = row[12]
# shipzip = row[13]
tracking = row[14]
weight = row[16]
ship_charge = row[20]
taxes = "?" #TODO fixme
ship_site = "?" #TODO fixme
discount = "?" #TODO fixme
tracking = row[16]
weight = row[18]
ship_charge = row[21]
taxes = row[22]
ship_site = row[0]
discount = row[4]
warehouse_shipment.sohnum = sohnum
#warehouse_shipment.header.sohnum = sohnum
warehouse_shipment.header.shidat = datetime.datetime.strptime(order_date,'%m/%d/%y %I:%M %p')
@ -108,10 +108,10 @@ def process_files(file):
warehouse_shipment.header.growei = weight
#gather line data
#TODO how are multiple lots processed?
line_product = row[0]
line_qty = row[2]
line_lot = row[3]
line_price = row[19]
line_product = row[1]
line_qty = row[3]
line_lot = row[4]
line_price = row[20]
subdetail = WarehouseShipmentSubDetail(
qtypcu=-1 * int(line_qty),
lot=line_lot,
@ -276,6 +276,8 @@ class WarehouseShipmentDetail:
itmref=self.itmref,
).first()
else:
pprint.pprint(self.sohnum)
pprint.pprint(self.itmref)
raise NotImplementedError # TODO
result = get()
self.soplin = result.SOPLIN_0