Changeset aa74623 in rattail


Ignore:
Timestamp:
04/01/19 13:30:26 (6 months ago)
Author:
Lance Edgar <ledgar@…>
Branches:
master
Children:
15d110a
Parents:
1d05f73
Message:

Use shipped instead of ordered, for setting purchase batch row status

i.e. when "shipped vs. received differ"

Location:
rattail
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • rattail/batch/purchase.py

    r1d05f73 raa74623  
    947947                # sure what the priority should be..perhaps config should say?
    948948                if batch.order_quantities_known and (
    949                         self.get_units_ordered(row) != self.get_units_accounted_for(row)):
     949                        self.get_units_shipped(row) != self.get_units_accounted_for(row)):
    950950                    row.status_code = row.STATUS_ORDERED_RECEIVED_DIFFER
    951951                elif case_quantity_differs:
     
    17601760        return self.get_units(row.cases_ordered, row.units_ordered, case_quantity)
    17611761
    1762     # TODO: we now have shipped quantities...should return sum of those instead?
    17631762    def get_units_shipped(self, row, case_quantity=None):
    17641763        case_quantity = case_quantity or row.case_quantity or 1
    1765         units_damaged = (row.units_damaged or 0) + case_quantity * (row.cases_damaged or 0)
    1766         units_expired = (row.units_expired or 0) + case_quantity * (row.cases_expired or 0)
    1767         return self.get_units_received(row) + units_damaged + units_expired
     1764        return self.get_units(row.cases_shipped, row.units_shipped, case_quantity)
    17681765
    17691766    def get_units_received(self, row, case_quantity=None):
  • rattail/db/model/batch/purchase.py

    r1d05f73 raa74623  
    211211        STATUS_CASE_QUANTITY_DIFFERS    : "case quantity differs",
    212212        STATUS_INCOMPLETE               : "incomplete",
    213         STATUS_ORDERED_RECEIVED_DIFFER  : "ordered / received differ",
     213        STATUS_ORDERED_RECEIVED_DIFFER  : "shipped / received differ",
    214214        STATUS_TRUCKDUMP_UNCLAIMED      : "not claimed by any child(ren)",
    215215        STATUS_TRUCKDUMP_PARTCLAIMED    : "partially claimed by child(ren)",
Note: See TracChangeset for help on using the changeset viewer.