def get_json(self): result = {} result['id'] = self.id if self.user else None result['user_id'] = self.user.id if self.user else None result['age'] = self.age if self.age else None result['dob'] = self.dob if self.dob else None result['mobile_no'] = self.mobile_no if self.mobile_no else None result['gender'] = self.gender if self.gender else None result['address'] = self.address if self.address else None result['preferred_time_to_call'] = self.preferred_time_to_call if self.preferred_time_to_call else None result['profession'] = self.profession if self.profession else None result['how_you_know'] = self.how_you_know if self.how_you_know else None result['reason_to_visit_us'] = self.reason_to_visit_us if self.reason_to_visit_us else None result['updates'] = self.updates if self.updates else None result['reason_to_visit_parlour'] = self.reason_to_visit_parlour if self.reason_to_visit_parlour else None result['medical_history'] = self.medical_history if self.medical_history else None result['skin_care_method'] = self.skin_care_method if self.skin_care_method else None result['prescription_medicine_taken'] = self.prescription_medicine_taken if self.prescription_medicine_taken else None result['taken_isotrethnoier_medicine'] = self.taken_isotrethnoier_medicine if self.taken_isotrethnoier_medicine else None result['prescribed_cream_ointment'] = self.prescribed_cream_ointment if self.prescribed_cream_ointment else None result['allergic_to_medicine'] = self.allergic_to_medicine if self.allergic_to_medicine else None result['created'] = convert_date_to_epoch(selficreated) if self.created else None result['modified'] = convert_date_to_epoch(self.modified) if self.modified else None return result
def get_json(self, limited_fields=False): result = {} result["stock_transfer_request_id"] = self.id result["placed_date"] = convert_date_to_epoch( self.placed_date) if self.placed_date else None result["status"] = self.status if self.status else None result["status_display"] = self.get_status_display( ) if self.status else None result["source_department"] = self.source_department.get_json( ) if self.source_department else None result["dest_department"] = self.dest_department.get_json( ) if self.dest_department else None result["honoured_date_ts"] = convert_date_to_epoch( self.honoured_date_ts) if self.honoured_date_ts else None result["cancelled_date_ts"] = convert_date_to_epoch( self.cancelled_date_ts) if self.cancelled_date_ts else None result["created"] = convert_date_to_epoch( self.created) if self.created else None result["last_modified"] = convert_date_to_epoch( self.last_modified) if self.last_modified else None if not limited_fields: result["stock_transfer_request_items"] = [ x.get_json() for x in self.get_stock_transfer_request_items.all() ] return result
def get_json(self): result = {} result["stock_item_id"] = self.id result["code"] = self.code if self.code else None result["name"] = self.name if self.name else None result[ "regional_name"] = self.regional_name if self.regional_name else None result["brand"] = self.brand if self.brand else None result["sale_price"] = self.sale_price if self.sale_price else None result["usage_type"] = self.usage_type if self.usage_type else None result["nature"] = self.nature if self.nature else None result[ "quantity_unit"] = self.quantity_unit if self.quantity_unit else None result["quantity_unit_display"] = self.get_quantity_unit_display( ) if self.quantity_unit else None result["tax_rate"] = self.tax_rate.rate if self.tax_rate else None result["description"] = self.description if self.description else None result["shelf_life"] = self.shelf_life if self.shelf_life else None result["notes"] = self.notes if self.notes else None result["is_active"] = self.is_active if self.is_active else None result["created"] = convert_date_to_epoch( self.created) if self.created else None result["last_modified"] = convert_date_to_epoch( self.last_modified) if self.last_modified else None result["requested_quantity"] = None # For frontend result["received_quantity"] = None # For frontend result["requested_unit_price"] = None # For frontend result["received_unit_price"] = None # For frontend return result
def get_json(self): result = {} result["supplier_id"] = self.id result["code"] = self.code if self.code else None result["name"] = self.name if self.name else None result["address"] = self.address if self.address else None result["city"] = self.city if self.city else None result["state"] = self.state if self.state else None result["created"] = convert_date_to_epoch(self.created) if self.created else None result["last_modified"] = convert_date_to_epoch(self.last_modified) if self.last_modified else None return result
def get_json(self): result = {} result['id'] = self.id result['name'] = self.name result['image'] = str(self.image) if self.image else None result['caption'] = self.caption if self.caption else None result['price'] = self.price if self.price else None result['description'] = self.description if self.description else None result['detail'] = self.detail if self.detail else None result['quantity'] = self.quantity if self.quantity else None result['created'] = convert_date_to_epoch(self.created) if self.created else None result['modified'] = convert_date_to_epoch(self.modified) if self.modified else None return result
def get_json(self): result = {} result["stock_transfer_request_item_id"] = self.id result["stock_transfer_request_id"] = self.stock_transfer_request.id result["stock_item"] = self.item.get_json() if self.item else None result[ "requested_quantity"] = self.requested_quantity if self.requested_quantity else None result[ "received_quantity"] = self.received_quantity if self.received_quantity else None result["created"] = convert_date_to_epoch( self.created) if self.created else None result["last_modified"] = convert_date_to_epoch( self.last_modified) if self.last_modified else None return result
def get_json(self): result = {} result['id'] = self.id result['bill_no'] = self.bill_no if self.bill_no else None result['op_no'] = self.op_no if self.op_no else None result['token'] = self.token if self.token else None result['amount'] = self.amount if self.amount else None result['patient_name'] = '{} {}'.format(self.customer.user.first_name if self.customer else '', self.customer.user.last_name if self.customer else '') result['consultant'] = self.consultant if self.consultant else None result['particulars'] = self.particulars if self.particulars else None # result['dob'] = convert_date_to_epoch(self.dob) if self.dob else None result['qty'] = self.qty if self.qty else None # result['patient_age'] = self.patient_age if self.patient_age else None result['mobile_no'] = self.customer.mobile_no if self.customer else None # result['gender'] = self.gender if self.gender else None result['payment_type'] = self.payment_type if self.payment_type else None result['payment_type_name'] = self.get_payment_type_display() if self.payment_type else None result['created'] = convert_date_to_epoch(self.created) if self.created else None result['modified'] = convert_date_to_epoch(self.modified) if self.modified else None return result
def get_json(self): result = {} result["purchase_order_item_id"] = self.id result["purchase_order_id"] = self.purchase_order.id result["stock_item"] = self.item.get_json() if self.item else None result[ "requested_quantity"] = self.requested_quantity if self.requested_quantity else None result[ "requested_unit_price"] = self.requested_unit_price if self.requested_unit_price else None result[ "received_quantity"] = self.received_quantity if self.received_quantity else None result[ "received_unit_price"] = self.received_unit_price if self.received_unit_price else None result["created"] = convert_date_to_epoch( self.created) if self.created else None result["last_modified"] = convert_date_to_epoch( self.last_modified) if self.last_modified else None return result