|
|
@@ -180,28 +180,6 @@ class TestController extends Controller
|
|
|
}
|
|
|
public function test()
|
|
|
{
|
|
|
- DeliveryAppointment::query()->where("created_at",">=","2021-05-17 00:00:00")
|
|
|
- ->whereNotNull("asn_number")->get()->each(function ($model){
|
|
|
- $asn = preg_split('/[,, ]+/is', $model->asn_number);
|
|
|
- $query = Store::query()->whereIn("asn_code",$asn);
|
|
|
- if ($model->owner_id)$query->where("owner_id",$model->owner_id);
|
|
|
- $stores = $query->with("storeItems")->get();
|
|
|
- if ($stores){
|
|
|
- $items = [];
|
|
|
- $stores->each(function ($store)use(&$items){
|
|
|
- if ($store->storeItems)foreach($store->storeItems as $it){
|
|
|
- $items[] = [
|
|
|
- "name"=>"",
|
|
|
- "amount"=>$it->amount,
|
|
|
- "bar_code"=>"",
|
|
|
- "commodity_id"=>$it->commodity_id,
|
|
|
- ];
|
|
|
- }
|
|
|
- });
|
|
|
- app("DeliveryAppointmentService")->insertDetails($model,$items);
|
|
|
- }
|
|
|
- });
|
|
|
- dd("OK");
|
|
|
$asnno = "ASN2105141388";
|
|
|
$query = DB::raw("SELECT b.ALTERNATE_SKU1,h.WAREHOUSEID,h.asnno,d.ASNLINENO,d.SKUDESCRC,h.CUSTOMERID,d.SKU,d.PACKID,d.RECEIVEDQTY_EACH,d.EXPECTEDQTY_EACH,d.LOTATT01,d.LOTATT02,d.lotatt04,".
|
|
|
"d.lotatt05,d.lotatt08,d.USERDEFINE1,d.USERDEFINE2,d.USERDEFINE3,d.USERDEFINE4,d.USERDEFINE5,d.RECEIVINGLOCATION FROM DOC_ASN_DETAILS d ".
|
|
|
@@ -241,6 +219,13 @@ class TestController extends Controller
|
|
|
$ser->createInstantBill($store);
|
|
|
dd($store);
|
|
|
}
|
|
|
+ public function orderCreateBill()
|
|
|
+ {
|
|
|
+ $order = Order::query()->find(\request("id"));
|
|
|
+ $ser = new OrderService();
|
|
|
+ $ser->createInstantBill($order);
|
|
|
+ dd("order create bill success");
|
|
|
+ }
|
|
|
public function supplementMarchOwnerReport()
|
|
|
{
|
|
|
$ows = OwnerAreaReport::query()->select("owner_id")->where("counting_month",'like',"2021-03%")->get();
|