Bug #4047 » purchead-docstatus.js
| 1 |
var doctype = undefined; |
|---|---|
| 2 |
var menuid = MinovaUtil.GetMenuID(); |
| 3 |
Ext.Ajax.request({ |
| 4 |
async: false, |
| 5 |
method: 'POST', |
| 6 |
url: '/UserControl/GetStore', |
| 7 |
params: { |
| 8 |
tableName: 'PCMEPMODULETYPE', |
| 9 |
param: 'MenuID[=]' + menuid |
| 10 |
},
|
| 11 |
success: function (response) { |
| 12 |
var results = Ext.decode(response.responseText); |
| 13 |
if (results.data.length > 0) { |
| 14 |
doctype = results.data[0].ModuleItem; |
| 15 |
}
|
| 16 |
}
|
| 17 |
});
|
| 18 |
var form = Ext.ComponentQuery.query('[name=searchFilter]')[0].getForm(); |
| 19 |
var formhead = Ext.ComponentQuery.query('[name=MainHeaderDocument]')[0].getForm(); |
| 20 |
var docstatus = formhead.findField("DocStatus").getValue(); |
| 21 |
form.findField("DocType").setValue(doctype); |
| 22 |
if (menuid == 'PURCHDEMANDFORGOODS') { |
| 23 |
form.findField("DocStatus").setValue('2'); |
| 24 |
} else if (doctype == 'PR' && docstatus == '4') { |
| 25 |
alert("You can't choose this doc status"); |
| 26 |
formhead.findField("DocStatus").setValue(''); |
| 27 |
}
|
- « Previous
- 1
- 2
- 3
- Next »