@ -53,7 +53,7 @@ Ext.extend(Shipping.FeeAmendEditGrid, Ext.Panel, {
this . ADDAMENDNOTFEECLOSE = 0 ;
this . AmendSalenotedit = 0 ;
this . FEELOCKNOTPR = 0 ;
this . ACCTAXRATESAMETAXRATE = 0 ;
_thisAmendfee = this ;
this . StoreDrOpRange = Ext . create ( 'DsExt.ux.RefTableStore' , {
model : 'MsFeeOP' ,
@ -934,7 +934,21 @@ Ext.extend(Shipping.FeeAmendEditGrid, Ext.Panel, {
} ,
width : 150
} , {
} , {
sortable : true ,
dataIndex : 'AccTax' ,
header : Zi . LAN . FEE . AccTax2 , //'销项税率',
renderer : function ( value , cellmeta , record , rowIndex , columnIndex , store ) { try { var lsValue = usMoney ( value , 2 , '' , false ) ; if ( lsValue != "NaN" ) { value = lsValue ; if ( parseFloat ( lsValue ) < 0 ) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>' ; } } else { return value ; } } catch ( e ) { return value ; } return value ; } ,
align : 'right' ,
width : 80
} , {
sortable : true ,
dataIndex : 'AccAmount' ,
header : Zi . LAN . FEE . AccAmount2 , //'销项税率',
renderer : function ( value , cellmeta , record , rowIndex , columnIndex , store ) { try { var lsValue = usMoney ( value , 2 , '' , false ) ; if ( lsValue != "NaN" ) { value = lsValue ; if ( parseFloat ( lsValue ) < 0 ) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>' ; } } else { return value ; } } catch ( e ) { return value ; } return value ; } ,
align : 'right' ,
width : 80
} , {
sortable : true ,
dataIndex : 'IsAdvancedpay' ,
header : Zi . LAN . FEE . IsAdvancedpay , //'是否垫付',
@ -1743,7 +1757,21 @@ Ext.extend(Shipping.FeeAmendEditGrid, Ext.Panel, {
}
} ,
width : 150
} , {
} , {
sortable : true ,
dataIndex : 'AccTax' ,
header : Zi . LAN . FEE . AccTax , //'进项税率',
renderer : function ( value , cellmeta , record , rowIndex , columnIndex , store ) { try { var lsValue = usMoney ( value , 2 , '' , false ) ; if ( lsValue != "NaN" ) { value = lsValue ; if ( parseFloat ( lsValue ) < 0 ) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>' ; } } else { return value ; } } catch ( e ) { return value ; } return value ; } ,
align : 'right' ,
width : 80
} , {
sortable : true ,
dataIndex : 'AccAmount' ,
header : Zi . LAN . FEE . AccAmount , //'进项金额',
renderer : function ( value , cellmeta , record , rowIndex , columnIndex , store ) { try { var lsValue = usMoney ( value , 2 , '' , false ) ; if ( lsValue != "NaN" ) { value = lsValue ; if ( parseFloat ( lsValue ) < 0 ) { return '<SPAN style="COLOR: red">' + lsValue + '</SPAN>' ; } } else { return value ; } } catch ( e ) { return value ; } return value ; } ,
align : 'right' ,
width : 80
} , {
sortable : true ,
dataIndex : 'IsAdvancedpay' ,
header : Zi . LAN . FEE . IsAdvancedpay , //'是否垫付',
@ -3957,7 +3985,32 @@ Ext.extend(Shipping.FeeAmendEditGrid, Ext.Panel, {
} ,
scope : this
} ) ;
Ext . Ajax . request ( {
waitMsg : '' ,
url : '/MvcShipping/MsSysParamSet/GetData' ,
params : {
condition : "PARAMNAME='ACCTAXRATESAMETAXRATE'"
} ,
callback : function ( options , success , response ) {
if ( success ) {
var result = Ext . JSON . decode ( response . responseText ) ;
if ( result . Success != true ) {
} else {
var data = result . data ;
if ( data . PARAMVALUE == '1' ) {
this . ACCTAXRATESAMETAXRATE = 1 ;
} else {
}
}
} else {
}
} ,
scope : this
} ) ;
Ext . Ajax . request ( {
waitMsg : '' ,
@ -6370,7 +6423,22 @@ Ext.extend(Shipping.FeeAmendEditGrid, Ext.Panel, {
var unitPrice = e . record . data [ 'UnitPrice' ] ;
var quantity = e . record . data [ 'Quantity' ] ;
if ( _thisAmendfee . ACCTAXRATESAMETAXRATE == 1 ) e . record . set ( 'AccTaxRate' , taxrate ) ;
if ( _thisAmendfee . ACCTAXRATESAMETAXRATE == 1 ) {
e . record . set ( 'AccTaxRate' , taxrate ) ;
var amount = e . record . data [ 'Amount' ] ;
if ( taxrate == 0 ) {
e . record . set ( 'AccTax' , 0 ) ;
} else {
var taxrateb = Add ( 1 , Div ( taxrate , 100 , 4 ) , 4 ) ;
var taxb = Div ( amount , taxrateb ) ;
var tax = Div ( Mul ( taxb , taxrate ) , 100 ) ;
var accamount = Add ( amount , - tax ) ;
e . record . set ( 'AccTax' , tax ) ;
e . record . set ( 'AccAmount' , accamount ) ;
}
}
if ( unitPrice != null ) {
var taxrateb = Add ( 1 , Div ( taxrate , 100 , 4 ) , 4 ) ;
//parseFloat(1 + parseFloat(taxrate).mul(0.01));