class PaymentMethodSchema(ma.Schema): class Meta: ordered = True transtype = ma.String() cash_sales = ma.Number() ar_sales = ma.Number() agent_sales = ma.Number()
class CashTransSchema(ma.Schema): class Meta: ordered = True total_cash_on_hand = ma.Number() cash_sales = ma.Number() ar_cash_sales = ma.Number() ar_agent_sales = ma.Number() deposit = ma.Number() used_dep = ma.Number() bank_dep = ma.Number() epay = ma.Number() gcert = ma.Number()
class ForSAPIPSchema(ma.Schema): class Meta: ordered = True reference = ma.String() cust_code = ma.String() payment_type = ma.String() amount = ma.Number() reference2 = ma.String()
class SalesHeaderSchema(ma.SQLAlchemyAutoSchema): class Meta: model = SalesHeader ordered = True include_fk = True load_instance = True salesrow = ma.Nested(SalesRowSchema, many=True) created_user = ma.Nested(UserSchema, only=("username", )) cashsales = ma.Number() arsales = ma.Number() agentsales = ma.Number() user = ma.String() def dump(self, *args, **kwargs): special = kwargs.pop('special', None) _partial = super(SalesHeaderSchema, self).dump(*args, **kwargs) if special is not None and all(f in _partial for f in special): for field in special: _partial['_{}'.format(field)] = _partial.pop(field) return _partial
class WhseInvSchema(ma.SQLAlchemyAutoSchema): class Meta: model = WhseInv ordered = True include_fk = True price = ma.Number() uom = ma.String() def dump(self, *args, **kwargs): special = kwargs.pop('special', None) _partial = super(WhseInvSchema, self).dump(*args, **kwargs) if special is not None and all(f in _partial for f in special): for field in special: _partial['_{}'.format(field)] = _partial.pop(field) return _partial
class FinalInvCountSchema(ma.Schema): class Meta: ordered = True item_code = ma.String() actual_good = ma.Number() actual_pullout = ma.Number() system_bal = ma.Number() variance = ma.Number() price = ma.Number() total_amount = ma.Number()
class PullOutHeaderRequestSchema(ma.SQLAlchemyAutoSchema): class Meta: model = PullOutHeaderRequest ordered = True include_fk = True price = ma.Number() sales_count = ma.Number() auditor_count = ma.Number() manager_count = ma.Number() final_count = ma.Number() variance = ma.Number() item_code = ma.String() def dump(self, *args, **kwargs): special = kwargs.pop('special', None) _partial = super(PullOutHeaderRequestSchema, self).dump(*args, **kwargs) if special is not None and all(f in _partial for f in special): for field in special: _partial['_{}'.format(field)] = _partial.pop(field) return _partial
class CountingInventoryRowSchema(ma.SQLAlchemyAutoSchema): class Meta: model = CountingInventoryRow ordered = True include_fk = True sales_count = ma.Number() auditor_count = ma.Number() manager_count = ma.Number() final_count = ma.Number() variance = ma.Number() ending_sales_count = ma.Number() ending_auditor_count = ma.Number() ending_manager_count = ma.Number() ending_final_count = ma.Number() po_sales_count = ma.Number() po_auditor_count = ma.Number() po_manager_count = ma.Number() po_final_count = ma.Number() uom = ma.String() sales_user = ma.String() auditor_user = ma.String() manager_user = ma.String() def dump(self, *args, **kwargs): special = kwargs.pop('special', None) _partial = super(CountingInventoryRowSchema, self).dump(*args, **kwargs) if special is not None and all(f in _partial for f in special): for field in special: _partial['_{}'.format(field)] = _partial.pop(field) return _partial
class SalesTransSchema(ma.Schema): class Meta: ordered = True gross = ma.Number() net_sales = ma.Number() disc_amount = ma.Number() gross_cash_sales = ma.Number() disc_cash_sales = ma.Number() net_cash_sales = ma.Number() gross_ar_sales = ma.Number() disc_ar_sales = ma.Number() net_ar_sales = ma.Number() gross_agent_sales = ma.Number() disc_agent_sales = ma.Number() net_agent_sales = ma.Number()