Fix #7123 - getting abra ready to test
[Pman.Xtuple] / Pman.Tab.XtuplePriceLists.js
index 4f9ad64..b90dcbf 100644 (file)
@@ -70,7 +70,7 @@ Pman.Tab.XtuplePriceLists = new Roo.XComponent({
                                 xtype: 'RowSelectionModel',
                                 xns: Roo.grid,
                                 listeners : {
-                                    selectionchange : function (_self)
+                                    afterselectionchange : function (_self)
                                     {
                                         _this.igrid.footer.onClick('first');
                                     }
@@ -331,26 +331,33 @@ Pman.Tab.XtuplePriceLists = new Roo.XComponent({
                                 },
                                 afteredit : function (e)
                                 {
-                                    Roo.log(e);    
-                                    /*
-                                
+                                    if(e.value == e.originalValue){
+                                        return false;       
+                                    }
+                                    
+                                    var p = _this.grid.getSelectionModel().getSelected();
+                                    
+                                    if(!p || p.data.ipshead_id * 1 < 1){
+                                        Roo.MessageBox.alert('Error','Please select a price list');
+                                        return false;       
+                                    }
+                                    
                                     new Pman.Request({
-                                        url : baseURL +'/Roo/Charass',
+                                        url : baseURL +'/Roo/Item',
+                                        method : 'POST',
+                                        marks : 'Posting',
                                         params : {
-                                             charass_char_id_char_name : e.field.replace(/^item_char_/,'').toUpperCase(),
-                                             charass_value : e.value,
-                                             charass_target_type : 'I',
-                                             charass_default : 1,
-                                             charass_target_id : e.record.data.item_id
+                                             update_ipshead : 1,
+                                             ipshead_id : p.data.ipshead_id,
+                                             item_id : e.record.data.item_id,
+                                             _price : e.value,
                                          },
-                                         method : 'POST'
+                                         success : function() {
+                                            _this.igrid.footer.onClick('refresh');
+                                        }
+                                         
                                      });
                                     
-                                    
-                                    e.record.commit();
-                                    */
-                                    
-                                    
                                 },
                                 beforeedit : function (e)
                                 {
@@ -378,30 +385,10 @@ Pman.Tab.XtuplePriceLists = new Roo.XComponent({
                                             return false;
                                         }
                                         
-                                        o.params.item_active = 1;
+                                        //o.params.item_active = 1;
                                         o.params._ipshead_price = 1;
                                         o.params._ipshead_id = p.data.ipshead_id;
                                     
-                                    },
-                                    update : function (_self, record, operation)
-                                    {
-                                        if(operation != 'commit'){
-                                            return;
-                                        }
-                                        
-                                        var nv  = record.data.itemsrc_active ? 0 : 1;
-                                        new Pman.Request({
-                                            mask : 'Saving',
-                                            url : baseURL + '/Roo/Itemsrc',
-                                            params : {
-                                                _update_by_item : 1,
-                                                item_id : record.data.item_id,
-                                                itemsrc_active : nv
-                                            },
-                                            success : function(res) {
-                                                record.set('itemsrc_active', nv);
-                                            }
-                                        });
                                     }
                                 },
                                 remoteSort : true,