Add (restore?) basic support for mobile receiving from PO
This commit is contained in:
		
							parent
							
								
									87ba8026e5
								
							
						
					
					
						commit
						34bdd2ac84
					
				
					 5 changed files with 122 additions and 67 deletions
				
			
		|  | @ -5,16 +5,16 @@ | |||
| 
 | ||||
| <%def name="page_title()">${h.link_to("Receiving", url('mobile.receiving'))} » New Batch</%def> | ||||
| 
 | ||||
| ${h.form(request.current_route_url(), class_='ui-filterable', name='new-purchasing-batch')} | ||||
| ${h.form(form.action_url, class_='ui-filterable', name='new-receiving-batch')} | ||||
| ${h.csrf_token(request)} | ||||
| 
 | ||||
| % if vendor is Undefined: | ||||
| % if phase == 1: | ||||
| 
 | ||||
|     <div class="field-wrapper vendor"> | ||||
|       <div class="field autocomplete" data-url="${url('vendors.autocomplete')}"> | ||||
|         ${h.hidden('vendor')} | ||||
|         ${h.text('new-purchasing-batch-vendor-text', placeholder="Vendor name", autocomplete='off', **{'data-type': 'search'})} | ||||
|         <ul data-role="listview" data-inset="true" data-filter="true" data-input="#new-purchasing-batch-vendor-text"></ul> | ||||
|         ${h.text('new-receiving-batch-vendor-text', placeholder="Vendor name", autocomplete='off', **{'data-type': 'search'})} | ||||
|         <ul data-role="listview" data-inset="true" data-filter="true" data-input="#new-receiving-batch-vendor-text"></ul> | ||||
|         <button type="button" style="display: none;">Change Vendor</button> | ||||
|       </div> | ||||
|     </div> | ||||
|  | @ -24,25 +24,29 @@ ${h.csrf_token(request)} | |||
|     <div id="new-receiving-types" style="display: none;"> | ||||
| 
 | ||||
|       ${h.hidden('workflow')} | ||||
|       ${h.hidden('phase', value='1')} | ||||
| 
 | ||||
|       % if master.allow_from_po: | ||||
|           ## ${h.submit('submit', "Find purchase orders")} | ||||
|           <button type="button">Receive from PO</button> | ||||
|           <button type="button" class="start-receiving" data-workflow="from_po">Receive from PO</button> | ||||
|       % endif | ||||
| 
 | ||||
|       % if master.allow_from_scratch: | ||||
|           <button type="button" id="receive-from-scratch">Receive from Scratch</button> | ||||
|           <button type="button" class="start-receiving" data-workflow="from_scratch">Receive from Scratch</button> | ||||
|       % endif | ||||
| 
 | ||||
|       % if master.allow_truck_dump: | ||||
|           <button type="button" id="receive-truck-dump">Receive Truck Dump</button> | ||||
|           <button type="button" class="start-receiving" data-workflow="truck_dump">Receive Truck Dump</button> | ||||
|       % endif | ||||
| 
 | ||||
|     </div> | ||||
| 
 | ||||
| % else: ## vendor is known | ||||
| % else: ## phase 2 | ||||
| 
 | ||||
|     ${h.hidden('workflow')} | ||||
|     ${h.hidden('phase', value='2')} | ||||
| 
 | ||||
|     <div class="field-wrapper vendor"> | ||||
|       <label>Vendor</label> | ||||
|       <div class="field"> | ||||
|         ${h.hidden('vendor', value=vendor.uuid)} | ||||
|         ${vendor} | ||||
|  | @ -50,17 +54,22 @@ ${h.csrf_token(request)} | |||
|     </div> | ||||
| 
 | ||||
|     % if purchases: | ||||
|         ${h.hidden('purchase')} | ||||
|         ${h.hidden(purchase_order_fieldname, class_='purchase-order-field')} | ||||
|         <p>Please choose a Purchase Order to receive:</p> | ||||
|         <ul data-role="listview" data-inset="true"> | ||||
|           % for uuid, purchase in purchases: | ||||
|               <li data-uuid="${uuid}">${h.link_to(purchase, '#')}</li> | ||||
|           % for key, purchase in purchases: | ||||
|               <li data-key="${key}">${h.link_to(purchase, '#')}</li> | ||||
|           % endfor | ||||
|         </ul> | ||||
|     % else: | ||||
|         <p>(no eligible purchases found)</p> | ||||
|     % endif | ||||
| 
 | ||||
|     ## ${h.link_to("Receive from scratch for {}".format(vendor), '#', class_='ui-btn ui-corner-all')} | ||||
|     % if master.allow_from_scratch: | ||||
|         <button type="button" class="start-receiving" data-workflow="from_scratch">Receive from Scratch</button> | ||||
|     % endif | ||||
| 
 | ||||
|     ${h.link_to("Cancel", url('mobile.{}'.format(route_prefix)), class_='ui-btn ui-corner-all')} | ||||
| 
 | ||||
| % endif | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Lance Edgar
						Lance Edgar