Changeset e77ce7f in rattail


Ignore:
Timestamp:
07/24/2022 03:04:16 PM (6 months ago)
Author:
Lance Edgar <lance@…>
Branches:
master
Children:
c6756e8
Parents:
1b69309
Message:

Maybe omit rows w/ no qty when making purchase from ordering batch

probably this should be the default behavior, but for now i'm leaving
legacy behavior as default

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rattail/batch/purchase.py

    r1b69309 re77ce7f  
    394394            total = purchase.invoice_total
    395395        distinction = purchase.department or purchase.buyer
    396         return "{} for ${:0,.2f} ({})".format(date, total or 0, distinction)
     396        return "({}) {} for ${:0,.2f} ({})".format(purchase.id_str,
     397                                                   date, total or 0, distinction)
    397398
    398399    def populate(self, batch, progress=None):
     
    32573258        return cases_pending, units_pending
    32583259
    3259     def make_purchase(self, batch, user, progress=None):
     3260    def make_purchase(self, batch, user,
     3261                      ordered_only=False, progress=None):
    32603262        """
    32613263        Effectively clones the given batch, creating a new Purchase in the
    32623264        Rattail system.
     3265
     3266        :param ordered_only: If true, only include rows which have an
     3267           effective "ordered" quantity.  If false (the default) then
     3268           *all* rows will be cloned regardless of ordered quantity.
    32633269        """
    32643270        session = orm.object_session(batch)
     
    32793285
    32803286        def clone(row, i):
     3287            if ordered_only and not self.get_units_ordered(row):
     3288                return
    32813289            item = model.PurchaseItem()
    32823290            # TODO: should be smarter and only copy certain fields here
Note: See TracChangeset for help on using the changeset viewer.