Changeset ad7b347 in tailbone
- Timestamp:
- 07/24/2022 10:29:55 PM (6 months ago)
- Branches:
- master
- Children:
- 9589606
- Parents:
- f33d7b7
- Location:
- tailbone
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
tailbone/api/batch/receiving.py
rf33d7b7 rad7b347 3 3 # 4 4 # Rattail -- Retail Software Framework 5 # Copyright © 2010-202 1Lance Edgar5 # Copyright © 2010-2022 Lance Edgar 6 6 # 7 7 # This file is part of Rattail. … … 75 75 data['invoice_total_calculated'] = batch.invoice_total_calculated 76 76 77 data['can_auto_receive'] = self.handler.can_auto_receive(batch) 78 77 79 return data 78 80 … … 82 84 batch = super(ReceivingBatchViews, self).create_object(data) 83 85 return batch 86 87 def auto_receive(self): 88 """ 89 View which handles auto-marking as received, all items within 90 a pending batch. 91 """ 92 batch = self.get_object() 93 self.handler.auto_receive_all_items(batch) 94 return self._get(obj=batch) 84 95 85 96 def mark_receiving_complete(self): … … 136 147 collection_url_prefix = cls.get_collection_url_prefix() 137 148 object_url_prefix = cls.get_object_url_prefix() 149 150 # auto-receive 151 config.add_route('{}.auto_receive'.format(route_prefix), 152 '{}/{{uuid}}/auto-receive'.format(object_url_prefix)) 153 config.add_view(cls, attr='auto_receive', 154 route_name='{}.auto_receive'.format(route_prefix), 155 permission='{}.auto_receive'.format(permission_prefix), 156 renderer='json') 138 157 139 158 # mark receiving complete -
tailbone/templates/receiving/configure.mako
rf33d7b7 rad7b347 130 130 </b-field> 131 131 132 <b-field >132 <b-field message="If set, one or more "quick receive" buttons will be available for mobile receiving."> 133 133 <b-checkbox name="rattail.batch.purchase.mobile_quick_receive" 134 134 v-model="simpleSettings['rattail.batch.purchase.mobile_quick_receive']" … … 139 139 </b-field> 140 140 141 <b-field >141 <b-field message="If set, only a "quick receive all" button will be shown. Only applicable if quick receive (above) is enabled."> 142 142 <b-checkbox name="rattail.batch.purchase.mobile_quick_receive_all" 143 143 v-model="simpleSettings['rattail.batch.purchase.mobile_quick_receive_all']" 144 144 native-value="true" 145 145 @input="settingsNeedSaved = true"> 146 Allow "Quick Receive All"146 Quick Receive "All or Nothing" 147 147 </b-checkbox> 148 148 </b-field> -
tailbone/views/purchasing/receiving.py
rf33d7b7 rad7b347 130 130 'vendor_phone', 131 131 'date_ordered', 132 'date_received',133 132 'po_number', 134 133 'po_total', 134 'date_received', 135 135 'invoice_date', 136 136 'invoice_number', … … 1825 1825 1826 1826 def can_auto_receive(self, batch): 1827 if batch.executed: 1828 return False 1829 if batch.complete: 1830 return False 1831 1832 if batch.is_truck_dump_related(): 1833 if not batch.is_truck_dump_parent(): 1834 return False 1835 if not batch.truck_dump_children_first(): 1836 return False 1837 1838 # only auto-receive once per batch 1839 if batch.get_param('auto_received'): 1840 return False 1841 1842 return True 1827 return self.handler.can_auto_receive(batch) 1843 1828 1844 1829 def auto_receive(self): … … 1866 1851 session = RattailSession() 1867 1852 batch = session.query(model.PurchaseBatch).get(uuid) 1868 user = session.query(model.User).get(user_uuid)1853 # user = session.query(model.User).get(user_uuid) 1869 1854 try: 1870 1855 self.handler.auto_receive_all_items(batch, progress=progress)
Note: See TracChangeset
for help on using the changeset viewer.