Fix #7123 - getting abra ready to test
[Pman.Xtuple] / Pman.Dialog.XtupleCreditMemo.js
index 40b9d43..e2e8298 100644 (file)
@@ -62,10 +62,11 @@ Pman.Dialog.XtupleCreditMemo = {
                                 },
                                 success : function(res) {
                                     // update the items and tax values...?
-                                    _this.form.findField('cmhead_value').setValue(res.data.cmhead_value);
+                        
+                                    _this.form.findField('cmhead_taxfree_value').setValue(res.data.cmhead_taxfree_value);
                                     _this.form.findField('cmhead_tax_value').setValue(res.data.cmhead_tax_value * 1);            
                                     _this.form.findField('cmhead_taxable_value').setValue(res.data.cmhead_taxable_value * 1);  
-                                     _this.form.findField('cmhead_misc_per').update();
+                                    _this.form.findField('cmhead_misc_per').update();
                                     _this.form.findField('cmhead_total').recalc();
                                 
                                 }
@@ -492,7 +493,8 @@ Pman.Dialog.XtupleCreditMemo = {
                                                                     width : 35,
                                                                     update : function() {
                                                                         var m = _this.form.findField('cmhead_misc_per');
-                                                                        var pv =  parseFloat(_this.form.findField('cmhead_value').getValue());
+                                                                        var pv =  parseFloat(_this.form.findField('cmhead_taxfree_value').getValue()) + 
+                                                                                parseFloat(_this.form.findField('cmhead_taxable_value').getValue()) ;
                                                                         var discount = parseFloat(_this.form.findField('cmhead_misc').getValue());
                                                                         
                                                                         if (discount > 0.0) {
@@ -638,7 +640,11 @@ Pman.Dialog.XtupleCreditMemo = {
                                                                     recalc : function() {
                                                                         var vals = _this.form.getValues();
                                                                         this.setValue(
-                                                                            (1*vals.cmhead_value) + (1*vals.cmhead_freight) + (1*vals.cmhead_tax_value) + (1*vals.cmhead_misc)
+                                                                            (1*vals.cmhead_taxable_value) + 
+                                                                            (1*vals.cmhead_taxfree_value) + 
+                                                                            (1*vals.cmhead_freight) + 
+                                                                            (1*vals.cmhead_tax_value) + 
+                                                                            (1*vals.cmhead_misc)
                                                                         );
                                                                     }
                                                                 }
@@ -837,11 +843,6 @@ Pman.Dialog.XtupleCreditMemo = {
                                     xns: Roo.form,
                                     name : 'cmhead_billto_addr_id'
                                 },
-                                {
-                                    xtype: 'Hidden',
-                                    xns: Roo.form,
-                                    name : 'cmhead_taxable_value'
-                                },
                                 {
                                     xtype: 'Hidden',
                                     xns: Roo.form,