|
@@ -306,17 +306,19 @@ class Activity extends Base
|
|
|
if($goodTax->save()){
|
|
|
if(!$order->isEmpty()){
|
|
|
$orderTax=OrderTax::where(['code'=>$order->orderCode,'spuCode'=>$param['spuCode']])->findOrEmpty();
|
|
|
+ $Tax=[
|
|
|
+ 'code'=>$order->orderCode,
|
|
|
+ 'spuCode'=>$param['spuCode'],
|
|
|
+ 'tax_code'=>$catgery->merge_code,
|
|
|
+ 'tax_name'=>$catgery->cat_name,
|
|
|
+ 'tax_short_name'=>$catgery->short_name,
|
|
|
+ 'inv_tax'=>str_replace("%","",$param['out_tax']),
|
|
|
+ 'inv_good_name'=>$goodTax->inv_good_name,
|
|
|
+ ];
|
|
|
if($orderTax->isEmpty()){
|
|
|
- $Tax=[
|
|
|
- 'code'=>$order->orderCode,
|
|
|
- 'spuCode'=>$param['spuCode'],
|
|
|
- 'tax_code'=>$catgery->merge_code,
|
|
|
- 'tax_name'=>$catgery->cat_name,
|
|
|
- 'tax_short_name'=>$catgery->short_name,
|
|
|
- 'inv_tax'=>$param['out_tax'],
|
|
|
- 'inv_good_name'=>$goodTax->inv_good_name,
|
|
|
- ];
|
|
|
OrderTax::create($Tax);
|
|
|
+ }else {
|
|
|
+ $orderTax->save($Tax);
|
|
|
}
|
|
|
};
|
|
|
Db::commit();
|