Changeset - 936980f28077
[Not reviewed]
0 2 0
Lance Edgar (lance) - 7 years ago 2017-08-15 12:56:53
lance@edbob.org
Add enum for purchase credit status
2 files changed with 12 insertions and 0 deletions:
0 comments (0 inline, 0 general)
rattail/batch/purchase.py
Show inline comments
 
@@ -230,6 +230,7 @@ class PurchaseBatchHandler(BatchHandler):
 
                for prop in mapper.iterate_properties:
 
                    if isinstance(prop, orm.ColumnProperty) and hasattr(credit, prop.key):
 
                        setattr(credit, prop.key, getattr(batch_credit, prop.key))
 
                credit.status = self.enum.PURCHASE_CREDIT_STATUS_NEW
 
                session.add(credit)
 

	
 
        return self.progress_loop(copy, batch.active_rows(), progress,
rattail/enum.py
Show inline comments
 
@@ -157,6 +157,17 @@ PURCHASE_BATCH_MODE = {
 
}
 

	
 

	
 
PURCHASE_CREDIT_STATUS_NEW              = 10
 
PURCHASE_CREDIT_STATUS_SUBMITTED        = 20
 
PURCHASE_CREDIT_STATUS_SATISFIED        = 30
 

	
 
PURCHASE_CREDIT_STATUS = {
 
    PURCHASE_CREDIT_STATUS_NEW          : "new",
 
    PURCHASE_CREDIT_STATUS_SUBMITTED    : "submitted",
 
    PURCHASE_CREDIT_STATUS_SATISFIED    : "satisfied",
 
}
 

	
 

	
 
PURCHASE_STATUS_NEW             = 1 # TODO: is this needed?
 
PURCHASE_STATUS_ORDERED         = 10
 
PURCHASE_STATUS_RECEIVED        = 20
0 comments (0 inline, 0 general)