From fcd3c6e49dd33424383eea9098dfaab20efe8628 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Thu, 22 Nov 2018 20:36:27 -0600 Subject: [PATCH] Add "import batch" support for Square -> CORE-POS (TransactionDetail) --- rattail_corepos/corepos/importing/square.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rattail_corepos/corepos/importing/square.py b/rattail_corepos/corepos/importing/square.py index 16e7baa..c7fbc69 100644 --- a/rattail_corepos/corepos/importing/square.py +++ b/rattail_corepos/corepos/importing/square.py @@ -59,6 +59,8 @@ class TransactionDetailImporter(FromSquare, corepos_importing.model.TransactionD 'total', ] + batches_supported = True + def setup(self): super(TransactionDetailImporter, self).setup() @@ -129,6 +131,9 @@ class TransactionDetailImporter(FromSquare, corepos_importing.model.TransactionD if card_number: card_number = int(card_number) + # description + description = csvrow['Item'] + # quantity quantity = float(csvrow['Qty']) @@ -161,11 +166,12 @@ class TransactionDetailImporter(FromSquare, corepos_importing.model.TransactionD log.warning("cannot parse 'total' from: %s", csvrow['Net Sales']) return { + '_object_str': "({}) {}".format(upc, description), 'store_row_id': store_row_id, 'date_time': date_time, 'card_number': card_number, 'upc': upc, - 'description': csvrow['Item'], + 'description': description, 'quantity': quantity, 'unit_price': unit_price, 'discount': discount,