Add tender importer from CORE; apply tender in CORE POS batch

still some work to be done yet but getting there
This commit is contained in:
Lance Edgar 2023-09-27 17:14:28 -05:00
parent 3add006b7e
commit f61ae7a7e0
6 changed files with 132 additions and 2 deletions

View file

@ -81,6 +81,10 @@ class POSBatchHandler(base.POSBatchHandler):
d = self.make_d_customer(row)
dtransactions.append(d)
elif row.row_type == 'tender':
d = self.make_d_tender(row)
dtransactions.append(d)
self.progress_loop(add, rows, progress,
message="Normalizing items for CORE-POS transaction")
@ -131,8 +135,9 @@ class POSBatchHandler(base.POSBatchHandler):
def make_d_item(self, row):
batch = row.batch
d = self.make_d_basic(batch, row)
d.transaction_type = 'I'
d.upc = row.product.item_id
d.department_number = row.department_number
d.description = row.product.description
if d.description and len(d.description) > self.maxlen_description:
@ -146,3 +151,12 @@ class POSBatchHandler(base.POSBatchHandler):
d.total = row.sales_total
# d.voided = False # TODO
return d
def make_d_tender(self, row):
batch = row.batch
d = self.make_d_basic(batch, row)
d.transaction_type = 'T'
d.transaction_subtype = row.item_entry
d.description = row.description
d.total = row.tender_total
return d