1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Pman.Dialog.XtupleShipmentNew = {
10 show : function(data, cb)
18 this.dialog.show(this.data._el);
21 this.form.setValues(data);
22 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
30 this.dialog = Roo.factory({
31 xtype: 'LayoutDialog',
34 show : function (_self)
36 _this.form.findField('shiphead_location_id').focus();
43 title : "Create new Shipment",
47 xtype: 'ContentPanel',
55 rendered : function (form)
59 actioncomplete : function (_self, action)
61 if (action.type == 'setdata') {
62 // see if there are multiple possilbe targets
64 url : baseURL + '/Roo/cohead',
67 cohead_id : _this.data.shiphead_order_id,
68 _has_multiple_ship : 1
70 success : function(res) {
71 // if there is one row returned, then assign values, and press OK
72 // otherwise.. cary on..
73 if (res.total === 1) {
74 _this.form.setValues( {
76 shiphead_location_id : res.data[0].coitem_location_src,
77 shiphead_location_id_location_name : res.data[0].coitem_location_src_name,
78 shiphead_shipto_id : res.data[0].coitem_shipto_id,
79 shiphead_shipto_id_shipto_name : res.data[0].coitem_shipto_id_name
81 _this.okButton.fireEvent('click');
85 failure : function(res) {
87 Roo.MessageBox.alert("Error", res.errorMsg);
104 displayField : 'location_name',
106 emptyText : "Select location",
107 fieldLabel : 'From Location',
108 forceSelection : true,
109 hiddenName : 'shiphead_location_id',
111 loadingText : "Searching...",
113 name : 'shiphead_location_id_location_name',
115 qtip : "Select location",
117 selectOnFocus : true,
118 tpl : '<div class="x-grid-cell-text x-btn button"><b>{location_name}</b> </div>',
119 triggerAction : 'all',
121 valueField : 'location_id',
127 beforeload : function (_self, o){
128 o.params = o.params || {};
129 o.params['query[for_cohead_id]'] = _this.data.shiphead_order_id;
134 sortInfo : { direction : 'ASC', field: 'location_name' },
139 url : baseURL + '/Roo/location.php'
146 totalProperty : 'total',
147 fields : [{"name":"id","type":"int"},{"name":"location_name","type":"string"}]
156 displayField : 'shipto_name',
158 emptyText : "Select Ship to name",
160 forceSelection : true,
161 hiddenName : 'shiphead_shipto_id',
163 loadingText : "Searching...",
165 name : 'shiphead_shipto_id_shipto_name',
167 qtip : "Select Ship to name",
169 selectOnFocus : true,
170 tpl : '<div class="x-grid-cell-text x-btn button"><b>{shipto_name}</b> </div>',
171 triggerAction : 'all',
173 valueField : 'shipto_id',
179 beforeload : function (_self, o){
180 o.params = o.params || {};
182 o.params['query[for_cohead_id]'] = _this.data.shiphead_order_id;
186 sortInfo : { direction : 'ASC', field: 'shipto_name' },
191 url : baseURL + '/Roo/shiptoinfo.php'
198 totalProperty : 'total',
199 fields : [{"name":"id","type":"int"},{"name":"shipto_name","type":"string"}]
206 name : 'shiphead_order_id'
211 name : 'shiphead_shipdate'
219 xtype: 'LayoutRegion',
227 click : function (_self, e)
239 click : function (_self, e)
241 //_this.findField('cuinfo_
243 // check if customer is filled in.
244 if (_this.form.findField('shiphead_location_id').getValue() < 1) {
245 Roo.MessageBox.alert("Error", "Select a source location");
248 if (_this.form.findField('shiphead_shipto_id').getValue() < 1) {
249 Roo.MessageBox.alert("Error", "Select where to ship to");
253 var rv = _this.form.getFieldValues();
256 Pman.Dialog.XtupleShipment.show(rv ,
264 render : function (_self)
266 _this.okButton = _self;