|
|
@@ -257,10 +257,11 @@ class WaybillsController extends Controller
|
|
|
if ($waybillPriceModel_id){
|
|
|
$carrier_weight=$request->input('carrier_weight');
|
|
|
$waybillPriceModel=WaybillPriceModel::find($waybillPriceModel_id);
|
|
|
+ $carrier=Carrier::find($waybill->carrier_id);
|
|
|
if ($carrier_weight<$waybillPriceModel->initial_weight){
|
|
|
- $fee=($waybillPriceModel->unit_price)*($waybillPriceModel->initial_weight);
|
|
|
+ $fee=(($waybillPriceModel->unit_price)*($waybillPriceModel->initial_weight))+$carrier->delivery_fee;
|
|
|
}else{
|
|
|
- $fee=($waybillPriceModel->unit_price)*$carrier_weight;
|
|
|
+ $fee=(($waybillPriceModel->unit_price)*$carrier_weight)+$carrier->delivery_fee;
|
|
|
}
|
|
|
$waybill->fee=$fee;
|
|
|
$waybill->waybill_price_model_id=$waybillPriceModel_id;
|
|
|
@@ -443,6 +444,11 @@ class WaybillsController extends Controller
|
|
|
'dispatchAuditor'=>'调度审核人',
|
|
|
'created_at'=>'创建时间'
|
|
|
]];
|
|
|
+ $feeVisible=true;
|
|
|
+ if(!Gate::allows('运单管理-可见费用项')){
|
|
|
+ $feeVisible=false;
|
|
|
+ unset($row[0]['fee'],$row[0]['pick_up_fee'],$row[0]['other_fee'],$row[0]['collect_fee']);
|
|
|
+ }
|
|
|
$list=[];
|
|
|
for ($i=0; $i<count($id);$i++){
|
|
|
$waybill=Waybill::with(['owner', 'waybillAuditLogs' => function ($query) {
|
|
|
@@ -490,6 +496,9 @@ class WaybillsController extends Controller
|
|
|
'dispatchAuditor'=>isset($dispatchAuditor)?$dispatchAuditor:'',
|
|
|
'created_at'=>isset($waybill->created_at)?$waybill->created_at:''
|
|
|
];
|
|
|
+ if(!$feeVisible){
|
|
|
+ unset($w['fee'],$w['pick_up_fee'],$w['other_fee'],$w['collect_fee']);
|
|
|
+ }
|
|
|
$list[$i]=$w;
|
|
|
}
|
|
|
$this->log(__METHOD__,__FUNCTION__,json_encode($waybill),Auth::user()['id']);
|