|
|
@@ -9,6 +9,7 @@ use App\OwnerFeeDetailLogistic;
|
|
|
use App\OwnerFeeExpress;
|
|
|
use App\OwnerFeeLogistic;
|
|
|
use App\Process;
|
|
|
+use App\RejectedBill;
|
|
|
use App\Services\OwnerPriceDirectLogisticService;
|
|
|
use App\Services\OwnerPriceLogisticService;
|
|
|
use App\Services\OwnerPriceOperationService;
|
|
|
@@ -171,10 +172,10 @@ class ResetInstantBill implements ShouldQueue
|
|
|
case "rejected_bills":
|
|
|
/** @var \stdClass $rejectedBill */
|
|
|
$number = array_column(StoreRejected::query()->where("logistic_number_return",$rejectedBill->logistic_number_return)->get()->toArray(),"store_id");
|
|
|
-
|
|
|
- foreach (Store::query()->with("storeItems")->whereIn("id",$number)->get() as $store){
|
|
|
- /** @var OwnerPriceOperationService $service */
|
|
|
- $service = app("OwnerPriceOperationService");
|
|
|
+ $stores = Store::query()->with("storeItems")->whereIn("id",$number)->get();
|
|
|
+ /** @var OwnerPriceOperationService $service */
|
|
|
+ $service = app("OwnerPriceOperationService");
|
|
|
+ foreach ($stores as $store){
|
|
|
$GLOBALS["FEE_INFO"] = [];
|
|
|
list($id,$money,$taxFee) = $service->matching($store, Feature::MAPPING["store"], $store->owner_id, "入库",0);
|
|
|
app("StoreService")->clearFeeInfo($store->asn_code);
|
|
|
@@ -195,6 +196,28 @@ class ResetInstantBill implements ShouldQueue
|
|
|
"fee_description"=>'',
|
|
|
]);
|
|
|
}
|
|
|
+ if ($stores->count())return;
|
|
|
+ $rejectedBill = RejectedBill::query()->find($this->detail->outer_id);
|
|
|
+ $rejectedBill->loadMissing("items");
|
|
|
+ $GLOBALS["FEE_INFO"] = [];
|
|
|
+ list($id,$money,$taxFee) = $service->matching($rejectedBill, Feature::MAPPING["rejected_bill"], $rejectedBill->id_owner, "入库",0);
|
|
|
+ $this->detail->update([
|
|
|
+ "commodity_amount" => $rejectedBill->goods_amount,
|
|
|
+ "work_fee" => $money,
|
|
|
+ "owner_price_operation_id" => $id,
|
|
|
+ "work_tax_fee" => $taxFee,
|
|
|
+ ]);
|
|
|
+ app("StoreService")->constructFeeInfo([
|
|
|
+ "worked_at" => $rejectedBill->updated_at,
|
|
|
+ "owner_id" => $rejectedBill->id_owner,
|
|
|
+ "model_id" => $id,
|
|
|
+ "source_number"=> null,
|
|
|
+ "doc_number" => null,
|
|
|
+ "commodity_id" => 0,
|
|
|
+ "total_fee" =>0,
|
|
|
+ "tax_rate" =>0,
|
|
|
+ "fee_description"=>'',
|
|
|
+ ]);
|
|
|
}
|
|
|
}
|
|
|
}
|