Changeset 17810d9 in tailbone
- Timestamp:
- 07/26/2022 04:30:04 PM (6 months ago)
- Branches:
- master
- Children:
- 3726a26
- Parents:
- 92a5213
- Location:
- tailbone
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
tailbone/static/js/tailbone.buefy.numericinput.js
r92a5213 r17810d9 21 21 props: { 22 22 name: String, 23 value: String,23 value: [Number, String], 24 24 placeholder: String, 25 25 iconPack: String, … … 54 54 }, 55 55 56 select() { 57 this.$el.children[0].select() 58 }, 59 56 60 valueChanged(value) { 57 61 this.$emit('input', value) -
tailbone/templates/receiving/view_row.mako
r92a5213 r17810d9 83 83 <div> 84 84 % if row.product: 85 ${form.render_field_readonly( 'upc')}85 ${form.render_field_readonly(product_key_field)} 86 86 ${form.render_field_readonly('product')} 87 87 % else: 88 88 ${form.render_field_readonly('item_entry')} 89 ${form.render_field_readonly( 'upc')}89 ${form.render_field_readonly(product_key_field)} 90 90 ${form.render_field_readonly('brand_name')} 91 91 ${form.render_field_readonly('description')} … … 193 193 <b-field grouped> 194 194 195 <b-field label="Case Qty."> 196 <span class="control"> 197 {{ rowData.case_quantity }} 198 </span> 199 </b-field> 200 201 <span class="control"> 202 203 </span> 195 % if allow_cases: 196 <b-field label="Case Qty."> 197 <span class="control"> 198 {{ rowData.case_quantity }} 199 </span> 200 </b-field> 201 202 <span class="control"> 203 204 </span> 205 % endif 204 206 205 207 <b-field label="Product State" … … 227 229 228 230 <div class="level-item"> 229 <b-input v-model="accountForProductQuantity" 230 type="number" step="0.0001" 231 ref="accountForProductQuantityInput"> 232 </b-input> 231 <numeric-input v-model="accountForProductQuantity" 232 ref="accountForProductQuantityInput"> 233 </numeric-input> 233 234 </div> 234 235 235 236 <div class="level-item"> 236 <b-field> 237 <b-radio-button v-model="accountForProductUOM" 238 @click.native="accountForProductUOMClicked('units')" 239 native-value="units"> 240 Units 241 </b-radio-button> 242 <b-radio-button v-model="accountForProductUOM" 243 @click.native="accountForProductUOMClicked('cases')" 244 native-value="cases"> 245 Cases 246 </b-radio-button> 247 </b-field> 237 % if allow_cases: 238 <b-field> 239 <b-radio-button v-model="accountForProductUOM" 240 @click.native="accountForProductUOMClicked('units')" 241 native-value="units"> 242 Units 243 </b-radio-button> 244 <b-radio-button v-model="accountForProductUOM" 245 @click.native="accountForProductUOMClicked('cases')" 246 native-value="cases"> 247 Cases 248 </b-radio-button> 249 </b-field> 250 % else: 251 <b-field> 252 <input type="hidden" v-model="accountForProductUOM" /> 253 Units 254 </b-field> 255 % endif 248 256 </div> 249 257 250 <div class="level-item" 251 v-if="accountForProductUOM == 'cases' && accountForProductQuantity"> 252 = {{ accountForProductTotalUnits }} 253 </div> 258 % if allow_cases: 259 <div class="level-item" 260 v-if="accountForProductUOM == 'cases' && accountForProductQuantity"> 261 = {{ accountForProductTotalUnits }} 262 </div> 263 % endif 254 264 255 265 </div> … … 326 336 327 337 <div class="level-item"> 328 <b-input v-model="declareCreditQuantity" 329 type="number" step="0.0001" 330 ref="declareCreditQuantityInput"> 331 </b-input> 338 <numeric-input v-model="declareCreditQuantity" 339 ref="declareCreditQuantityInput"> 340 </numeric-input> 332 341 </div> 333 342 334 343 <div class="level-item"> 335 <b-field> 336 <b-radio-button v-model="declareCreditUOM" 337 @click.native="declareCreditUOMClicked('units')" 338 native-value="units"> 339 Units 340 </b-radio-button> 341 <b-radio-button v-model="declareCreditUOM" 342 @click.native="declareCreditUOMClicked('cases')" 343 native-value="cases"> 344 Cases 345 </b-radio-button> 346 </b-field> 344 % if allow_cases: 345 <b-field> 346 <b-radio-button v-model="declareCreditUOM" 347 @click.native="declareCreditUOMClicked('units')" 348 native-value="units"> 349 Units 350 </b-radio-button> 351 <b-radio-button v-model="declareCreditUOM" 352 @click.native="declareCreditUOMClicked('cases')" 353 native-value="cases"> 354 Cases 355 </b-radio-button> 356 </b-field> 357 % else: 358 <b-field> 359 <input type="hidden" v-model="declareCreditUOM" /> 360 Units 361 </b-field> 362 % endif 347 363 </div> 348 364 349 <div class="level-item" 350 v-if="declareCreditUOM == 'cases' && declareCreditQuantity"> 351 = {{ declareCreditTotalUnits }} 352 </div> 365 % if allow_cases: 366 <div class="level-item" 367 v-if="declareCreditUOM == 'cases' && declareCreditQuantity"> 368 = {{ declareCreditTotalUnits }} 369 </div> 370 % endif 353 371 354 372 </div> … … 495 513 return true 496 514 } 497 if (!this.accountForProductQuantity ) {515 if (!this.accountForProductQuantity || this.accountForProductQuantity == 0) { 498 516 return true 499 517 } … … 507 525 this.accountForProductMode = 'received' 508 526 this.accountForProductExpiration = null 509 this.accountForProductQuantity = null527 this.accountForProductQuantity = 0 510 528 this.accountForProductUOM = 'units' 511 529 this.accountForProductShowDialog = true 530 this.$nextTick(() => { 531 this.$refs.accountForProductQuantityInput.select() 532 this.$refs.accountForProductQuantityInput.focus() 533 }) 512 534 } 513 535 … … 607 629 return true 608 630 } 609 if (!this.declareCreditQuantity ) {631 if (!this.declareCreditQuantity || this.declareCreditQuantity == 0) { 610 632 return true 611 633 } … … 619 641 this.declareCreditType = null 620 642 this.declareCreditExpiration = null 621 if (this.rowData.cases_received) { 622 this.declareCreditQuantity = this.rowData.cases_received 623 this.declareCreditUOM = 'cases' 624 } else { 643 % if allow_cases: 644 if (this.rowData.cases_received) { 645 this.declareCreditQuantity = this.rowData.cases_received 646 this.declareCreditUOM = 'cases' 647 } else { 648 this.declareCreditQuantity = this.rowData.units_received 649 this.declareCreditUOM = 'units' 650 } 651 % else: 625 652 this.declareCreditQuantity = this.rowData.units_received 626 653 this.declareCreditUOM = 'units' 627 }654 % endif 628 655 this.declareCreditShowDialog = true 629 656 } … … 639 666 } 640 667 641 if (this.declareCreditUOM == 'cases') { 642 params.cases = this.declareCreditQuantity 643 } else { 668 % if allow_cases: 669 if (this.declareCreditUOM == 'cases') { 670 params.cases = this.declareCreditQuantity 671 } else { 672 params.units = this.declareCreditQuantity 673 } 674 % else: 644 675 params.units = this.declareCreditQuantity 645 }676 % endif 646 677 647 678 this.submitForm(url, params, response => { -
tailbone/views/custorders/orders.py
r92a5213 r17810d9 340 340 'normalized_batch': self.normalize_batch(batch), 341 341 'new_order_requires_customer': self.batch_handler.new_order_requires_customer(), 342 'product_key_field': self.rattail_config.product_key(),343 342 'product_price_may_be_questionable': self.batch_handler.product_price_may_be_questionable(), 344 343 'allow_contact_info_choice': self.batch_handler.allow_contact_info_choice(), -
tailbone/views/master.py
r92a5213 r17810d9 2209 2209 } 2210 2210 2211 key = self.rattail_config.product_key() 2212 context['product_key_field'] = self.product_key_fields.get(key, key) 2213 2211 2214 if self.expose_quickie_search: 2212 2215 context['quickie'] = self.get_quickie_context() -
tailbone/views/products.py
r92a5213 r17810d9 1181 1181 use_buefy = self.get_use_buefy() 1182 1182 1183 key = self.rattail_config.product_key()1184 kwargs['product_key_field'] = self.product_key_fields.get(key, key)1185 1186 1183 kwargs['image_url'] = self.products_handler.get_image_url(product) 1187 1184 -
tailbone/views/purchasing/batch.py
r92a5213 r17810d9 804 804 cases = getattr(row, 'cases_{}'.format(field)) 805 805 units = getattr(row, 'units_{}'.format(field)) 806 return app.render_cases_units(cases, units) 806 # nb. do not render anything if empty quantities 807 if cases or units: 808 return app.render_cases_units(cases, units) 807 809 808 810 def make_row_credits_grid(self, row): … … 816 818 columns=[ 817 819 'credit_type', 818 # 'cases_shorted',819 # 'units_shorted',820 820 'shorted', 821 821 'credit_total', … … 828 828 labels={ 829 829 'credit_type': "Type", 830 'cases_shorted': "Cases",831 'units_shorted': "Units",832 830 'shorted': "Quantity", 833 831 'credit_total': "Total", 834 'mispick_upc': "Mispick UPC",835 'mispick_brand_name': "MP Brand",836 'mispick_description': "MP Description",837 'mispick_size': "MP Size",832 # 'mispick_upc': "Mispick UPC", 833 # 'mispick_brand_name': "MP Brand", 834 # 'mispick_description': "MP Description", 835 # 'mispick_size': "MP Size", 838 836 }) 839 837 840 g.set_type('cases_shorted', 'quantity')841 g.set_type('units_shorted', 'quantity')842 838 g.set_type('credit_total', 'currency') 839 840 if not self.batch_handler.allow_expired_credits(): 841 g.remove('expiration_date') 843 842 844 843 return g -
tailbone/views/purchasing/receiving.py
r92a5213 r17810d9 153 153 row_grid_columns = [ 154 154 'sequence', 155 'upc', 156 # 'item_id', 155 '_product_key_', 157 156 'vendor_code', 158 157 'brand_name', … … 178 177 'sequence', 179 178 'item_entry', 180 'upc', 181 'item_id', 179 '_product_key_', 182 180 'vendor_code', 183 181 'product', … … 770 768 row = kwargs['instance'] 771 769 770 kwargs['allow_cases'] = self.batch_handler.allow_cases() 771 772 772 if row.product: 773 773 kwargs['image_url'] = products_handler.get_image_url(row.product) … … 777 777 if use_buefy: 778 778 kwargs['row_context'] = self.get_context_row(row) 779 kwargs['possible_receiving_modes'] = POSSIBLE_RECEIVING_MODES 780 kwargs['possible_credit_types'] = POSSIBLE_CREDIT_TYPES 779 780 modes = list(POSSIBLE_RECEIVING_MODES) 781 types = list(POSSIBLE_CREDIT_TYPES) 782 if not self.batch_handler.allow_expired_credits(): 783 if 'expired' in modes: 784 modes.remove('expired') 785 if 'expired' in types: 786 types.remove('expired') 787 kwargs['possible_receiving_modes'] = modes 788 kwargs['possible_credit_types'] = types 781 789 782 790 return kwargs
Note: See TracChangeset
for help on using the changeset viewer.