_this.saveBtn.show();
_this.form.findField('pohead_agent_username').setValue(Pman.Login.authUser.name);
_this.form.findField('pohead_orderdate').setValue(new Date());
+ _this.form.findField('pohead_bg_arrival_est_day').setValue(new Date());
+ _this.form.findField('pohead_bg_available_est_day').setValue(new Date());
+ _this.form.findField('pohead_bg_available_latest_day').setValue(new Date());
return;
}
_this.dialog.setTitle("Edit Purchase Order");
Roo.MessageBox.alert("Error", "Select a cell");
return;
}
- _this.grid.stopEditing()
+ _this.grid.stopEditing();
var r = _this.grid.ds.getAt(cs[0]);
if(r.data.poitem_qty_received * 1 > 0){
field : {
xtype: 'NumberField',
xns: Roo.form,
+ allowBlank : false,
allowDecimals : false,
decimalPrecision : 0,
minValue : 1,
{
xtype: 'Button',
xns: Roo.Toolbar,
- text : "Varience",
+ text : "Apply fixes",
menu : {
xtype: 'Menu',
xns: Roo.menu,
items : [
+ {
+ xtype: 'Item',
+ xns: Roo.menu,
+ listeners : {
+ click : function()
+ {
+ var pohead_number = _this.form.findField('pohead_number').getValue();
+ var pohead_id = _this.form.findField('pohead_id').getValue();
+
+
+ new Pman.Request({
+ url : baseURL + '/Roo/pohead.php',
+ mask : 'sending',
+ method :'POST',
+ params : {
+ pohead_id : pohead_id,
+ _recv_fix : 1
+
+ },
+ success : function(res) {
+ Roo.MessageBox.alert('Notice', 'DONE');
+ }
+ });
+
+
+
+
+
+ }
+ },
+ cls : 'x-btn-text-icon',
+ text : "Repost goods reciept",
+ icon : rootURL + '/Pman/templates/images/trash.gif'
+ },
+ {
+ xtype: 'Separator',
+ xns: Roo.menu
+ },
{
xtype: 'Item',
xns: Roo.menu,
cls : 'x-btn-text-icon',
text : "Delete Varinace on voucher",
icon : rootURL + '/Pman/templates/images/trash.gif'
+ },
+ {
+ xtype: 'Separator',
+ xns: Roo.menu
+ },
+ {
+ xtype: 'Item',
+ xns: Roo.menu,
+ listeners : {
+ click : function()
+ {
+ var pohead_number = _this.form.findField('pohead_number').getValue();
+ var pohead_id = _this.form.findField('pohead_id').getValue();
+
+ var addv = function(){
+ new Pman.Request({
+ url : baseURL + '/Roo/pohead.php',
+ method :'POST',
+ params : {
+ pohead_id : pohead_id,
+ _fix_voids : 1
+
+ },
+ success : function(res) {
+ Roo.MessageBox.alert('Notice', 'DONE');
+ }
+ });
+ }
+
+ Roo.MessageBox.confirm(
+ "Confirm",
+ "Are you sure to add all the fix the voids for " + pohead_number + " ?",
+ function(r) {
+ if (r != 'yes') {
+ return;
+ }
+
+ addv();
+ return;
+ }
+ );
+
+
+ }
+ },
+ cls : 'x-btn-text-icon',
+ text : "Recalculate voids",
+ icon : Roo.rootURL + 'images/default/tree/leaf.gif'
}
]
}
width : 80,
renderer : function(v) { return String.format('{0}', v); }
},
+ {
+ xtype: 'ColumnModel',
+ xns: Roo.grid,
+ align : 'right',
+ dataIndex : 'location_name',
+ header : 'Location',
+ width : 60,
+ renderer : function(v,x,r) {
+
+
+ return String.format('{0}', v);
+
+ }
+ },
{
xtype: 'ColumnModel',
xns: Roo.grid,
mask: 'sending',
params : {
pohead_id : _this.form.findField('pohead_id').getValue(),
- _autovoid : 1,
+ _autovoid : 1
},
success : function() {
_this.gltxpanel.footer.onClick('first');
{
if(_this.grid){
var ar = [];
-
+ var err = false;
_this.grid.ds.each(function(r) {
+ if(r.data.poitem_unitprice < 1){
+ err = true;
+ return;
+ }
ar.push({
poitem_id : r.data.poitem_id,
poitem_itemsite_id : r.data.poitem_itemsite_id,
});
});
-
+
+ if(err){
+ Roo.MessageBox.alert('Error','Unit Price does not allow $0' );
+ return;
+ }
+
_this.form.findField('items').setValue(JSON.stringify(ar));
}