|
@@ -1243,26 +1243,11 @@ sql
|
|
|
//获取运输费
|
|
//获取运输费
|
|
|
$logisticInfo = $this->getLogisticFeeInfo($order);
|
|
$logisticInfo = $this->getLogisticFeeInfo($order);
|
|
|
|
|
|
|
|
- //信息仍然不完整
|
|
|
|
|
- if ($logisticInfo["logisticFee"] && $logisticInfo["fee_info"])OwnerFeeExpress::query()->insert($logisticInfo["fee_info"]);
|
|
|
|
|
- //向指定表插入标记
|
|
|
|
|
-
|
|
|
|
|
//获取作业费
|
|
//获取作业费
|
|
|
/** @var OwnerPriceOperationService $service */
|
|
/** @var OwnerPriceOperationService $service */
|
|
|
$service = app("OwnerPriceOperationService");
|
|
$service = app("OwnerPriceOperationService");
|
|
|
$GLOBALS["FEE_INFO"] = [];
|
|
$GLOBALS["FEE_INFO"] = [];
|
|
|
list($id,$money,$workTaxFee) = $service->matching($order,Feature::MAPPING["order"],$order->owner_id);
|
|
list($id,$money,$workTaxFee) = $service->matching($order,Feature::MAPPING["order"],$order->owner_id);
|
|
|
- if ($money>0)app("StoreService")->constructFeeInfo([
|
|
|
|
|
- "worked_at" => $order->wms_edittime ?: $order->updated_at,
|
|
|
|
|
- "owner_id" => $order->owner_id,
|
|
|
|
|
- "model_id" => $id,
|
|
|
|
|
- "source_number"=> $order->client_code,
|
|
|
|
|
- "doc_number" => $order->code,
|
|
|
|
|
- "commodity_id" => 0,
|
|
|
|
|
- "total_fee" =>0,
|
|
|
|
|
- "tax_rate" =>0,
|
|
|
|
|
- "fee_description"=>'',
|
|
|
|
|
- ]);
|
|
|
|
|
|
|
|
|
|
//数据组装
|
|
//数据组装
|
|
|
$detail = OwnerFeeDetail::query()->create([
|
|
$detail = OwnerFeeDetail::query()->create([
|
|
@@ -1288,6 +1273,19 @@ sql
|
|
|
"work_tax_fee" => $workTaxFee,
|
|
"work_tax_fee" => $workTaxFee,
|
|
|
"logistic_tax_fee" => $logisticInfo["logisticTaxFee"],
|
|
"logistic_tax_fee" => $logisticInfo["logisticTaxFee"],
|
|
|
]);
|
|
]);
|
|
|
|
|
+ //向指定表插入标记
|
|
|
|
|
+ if ($logisticInfo["logisticFee"] && $logisticInfo["fee_info"])OwnerFeeExpress::query()->insert($logisticInfo["fee_info"]);
|
|
|
|
|
+ if ($money>0)app("StoreService")->constructFeeInfo([
|
|
|
|
|
+ "worked_at" => $order->wms_edittime ?: $order->updated_at,
|
|
|
|
|
+ "owner_id" => $order->owner_id,
|
|
|
|
|
+ "model_id" => $id,
|
|
|
|
|
+ "source_number"=> $order->client_code,
|
|
|
|
|
+ "doc_number" => $order->code,
|
|
|
|
|
+ "commodity_id" => 0,
|
|
|
|
|
+ "total_fee" =>0,
|
|
|
|
|
+ "tax_rate" =>0,
|
|
|
|
|
+ "fee_description"=>'',
|
|
|
|
|
+ ]);
|
|
|
//后续处理
|
|
//后续处理
|
|
|
foreach ($logisticInfo["items"] as &$item)$item["owner_fee_detail_id"] = $detail->id;
|
|
foreach ($logisticInfo["items"] as &$item)$item["owner_fee_detail_id"] = $detail->id;
|
|
|
if (count($logisticInfo["items"])>1)OwnerFeeDetailLogistic::query()->insert($logisticInfo["items"]);
|
|
if (count($logisticInfo["items"])>1)OwnerFeeDetailLogistic::query()->insert($logisticInfo["items"]);
|
|
@@ -1387,15 +1385,24 @@ sql
|
|
|
if (!$order->packages->count() || !$order->owner)return false;
|
|
if (!$order->packages->count() || !$order->owner)return false;
|
|
|
//获取运输费
|
|
//获取运输费
|
|
|
$logisticInfo = $this->getLogisticFeeInfo($order);
|
|
$logisticInfo = $this->getLogisticFeeInfo($order);
|
|
|
- //向指定表插入标记
|
|
|
|
|
if (!$logisticInfo["logisticFee"] || !$logisticInfo["fee_info"])return false;
|
|
if (!$logisticInfo["logisticFee"] || !$logisticInfo["fee_info"])return false;
|
|
|
- OwnerFeeExpress::query()->insert($logisticInfo["fee_info"]);
|
|
|
|
|
- foreach ($logisticInfo["items"] as &$item)$item["owner_fee_detail_id"] = $feeBill->id;
|
|
|
|
|
- if (count($logisticInfo["items"])>1)OwnerFeeDetailLogistic::query()->insert($logisticInfo["items"]);
|
|
|
|
|
-
|
|
|
|
|
//获取作业费
|
|
//获取作业费
|
|
|
$GLOBALS["FEE_INFO"] = [];
|
|
$GLOBALS["FEE_INFO"] = [];
|
|
|
list($id,$money,$workTaxFee) = app("OwnerPriceOperationService")->matching($order,Feature::MAPPING["order"],$order->owner_id);
|
|
list($id,$money,$workTaxFee) = app("OwnerPriceOperationService")->matching($order,Feature::MAPPING["order"],$order->owner_id);
|
|
|
|
|
+ //数据组装
|
|
|
|
|
+ $feeBill->update([
|
|
|
|
|
+ "commodity_amount" => $logisticInfo["amount"],
|
|
|
|
|
+ "logistic_bill" => $logisticInfo["logisticBill"],
|
|
|
|
|
+ "volume" => $logisticInfo["volume"],
|
|
|
|
|
+ "weight" => $logisticInfo["weight"],
|
|
|
|
|
+ "logistic_fee" => $logisticInfo["logisticFee"],
|
|
|
|
|
+ "logistic_tax_fee" => $logisticInfo["logisticTaxFee"],
|
|
|
|
|
+ "work_fee" => $money,
|
|
|
|
|
+ "owner_price_operation_id" => $id,
|
|
|
|
|
+ "work_tax_fee" => $workTaxFee,
|
|
|
|
|
+ ]);
|
|
|
|
|
+ foreach ($logisticInfo["items"] as &$item)$item["owner_fee_detail_id"] = $feeBill->id;
|
|
|
|
|
+ if (count($logisticInfo["items"])>1)OwnerFeeDetailLogistic::query()->insert($logisticInfo["items"]);
|
|
|
if ($money>0){
|
|
if ($money>0){
|
|
|
app("StoreService")->clearFeeInfo($order->code);
|
|
app("StoreService")->clearFeeInfo($order->code);
|
|
|
app("StoreService")->constructFeeInfo([
|
|
app("StoreService")->constructFeeInfo([
|
|
@@ -1410,18 +1417,8 @@ sql
|
|
|
"fee_description"=>'',
|
|
"fee_description"=>'',
|
|
|
]);
|
|
]);
|
|
|
}
|
|
}
|
|
|
- //数据组装
|
|
|
|
|
- $feeBill->update([
|
|
|
|
|
- "commodity_amount" => $logisticInfo["amount"],
|
|
|
|
|
- "logistic_bill" => $logisticInfo["logisticBill"],
|
|
|
|
|
- "volume" => $logisticInfo["volume"],
|
|
|
|
|
- "weight" => $logisticInfo["weight"],
|
|
|
|
|
- "logistic_fee" => $logisticInfo["logisticFee"],
|
|
|
|
|
- "logistic_tax_fee" => $logisticInfo["logisticTaxFee"],
|
|
|
|
|
- "work_fee" => $money,
|
|
|
|
|
- "owner_price_operation_id" => $id,
|
|
|
|
|
- "work_tax_fee" => $workTaxFee,
|
|
|
|
|
- ]);
|
|
|
|
|
|
|
+ //向指定表插入标记
|
|
|
|
|
+ OwnerFeeExpress::query()->insert($logisticInfo["fee_info"]);
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
|
|
|