From 801c56f06e9d7282eecf33b04c6825dd795ba486 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sun, 31 Jan 2021 12:10:44 -0600 Subject: [PATCH] More tweaks for receiving batch workflows now first step requires choice of vendor and workflow. supports receiving from PO at least for native use case. --- tailbone/api/batch/receiving.py | 10 +-- tailbone/templates/batch/view.mako | 6 +- tailbone/templates/receiving/view.mako | 18 +++- tailbone/views/purchasing/receiving.py | 118 +++++++++++++++++++++---- 4 files changed, 118 insertions(+), 34 deletions(-) diff --git a/tailbone/api/batch/receiving.py b/tailbone/api/batch/receiving.py index 71a8bcba..22632b80 100644 --- a/tailbone/api/batch/receiving.py +++ b/tailbone/api/batch/receiving.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2020 Lance Edgar +# Copyright © 2010-2021 Lance Edgar # # This file is part of Rattail. # @@ -126,13 +126,7 @@ class ReceivingBatchViews(APIBatchView): } def render_eligible_purchase(self, purchase): - if purchase.status == self.enum.PURCHASE_STATUS_ORDERED: - date = purchase.date_ordered - total = purchase.po_total - elif purchase.status == self.enum.PURCHASE_STATUS_RECEIVED: - date = purchase.date_received - total = purchase.invoice_total - return '{} for ${:0,.2f} ({})'.format(date, total or 0, purchase.department or purchase.buyer) + return self.handler.render_eligible_purchase(purchase) @classmethod def defaults(cls, config): diff --git a/tailbone/templates/batch/view.mako b/tailbone/templates/batch/view.mako index d0a1ca21..bfc22833 100644 --- a/tailbone/templates/batch/view.mako +++ b/tailbone/templates/batch/view.mako @@ -212,7 +212,7 @@