|
@@ -216,24 +216,55 @@ class InvCat extends BaseController{
|
|
|
$value['tax'] = str_replace('%', '', $value['tax']);
|
|
|
$value['tax'] = round(bcdiv($value['tax'], 100, 3), 2);
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- if ($value['is_discount'] == 1) {
|
|
|
-
|
|
|
- if($value['tax'] == 0){
|
|
|
- if ( $value['inv_tag'] == 3) throw new Exception($value['spuCode'].'税率标识不能选择零税率');
|
|
|
- if ($value['addTax'] == '') throw new Exception($value['spuCode'].'参数 addTax 不能为空');
|
|
|
- if($value['addTax']!=$this->Tax[$value['inv_tag']]){
|
|
|
- throw new Exception($value['spuCode'].'税率标识与增值税管理内容不符');
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
+ if($value['is_discount'] ==1){
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if($value['tax'] ==0){
|
|
|
+ if($value['inv_tag']==3){
|
|
|
+ throw new Exception($value['spuCode'].'税率标识不能选择零税率');
|
|
|
+ }
|
|
|
+ if($value['addTax']==''){
|
|
|
+ throw new Exception($value['spuCode'].'参数 addTax 不能为空');
|
|
|
+ }
|
|
|
+ if($value['addTax']!=$this->Tax[$value['inv_tag']]){
|
|
|
+ throw new Exception($value['spuCode'].'参数 addTax 不能为空');
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- } else {
|
|
|
-
|
|
|
-
|
|
|
- if ($value['tax'] == 0 && $value['inv_tag'] != 3) throw new Exception($value['spuCode'].'税率标识只能选择零税率');
|
|
|
- $value['addTax'] = '';
|
|
|
- }
|
|
|
+ }else{
|
|
|
+
|
|
|
+
|
|
|
+ if($value['tax'] == 0 && $value['inv_tag'] != 3){
|
|
|
+ throw new Exception($value['spuCode'].'税率标识只能选择零税率');
|
|
|
+ }
|
|
|
+ if($value['tax']!=0 && $value['inv_tag']!=0){
|
|
|
+ throw new Exception($value['spuCode']."税率标识只能选择非零税率");
|
|
|
+ }
|
|
|
+ $value['addTax']='';
|
|
|
+ }
|
|
|
|
|
|
$data = [
|
|
|
'inv_cat_name' => $all_cat_code[$value['cat_code']]['short_name'],
|