|
|
@@ -24,6 +24,7 @@ use App\UserWorkgroup;
|
|
|
use App\Waybill;
|
|
|
use App\OraccleBasCustomer;
|
|
|
use App\WMSReflectReceive;
|
|
|
+use App\WMSWaybillOrder;
|
|
|
use Carbon\Carbon;
|
|
|
use Endroid\QrCode\QrCode;
|
|
|
use Endroid\QrCode\Response\QrCodeResponse;
|
|
|
@@ -141,7 +142,29 @@ class TestController extends Controller
|
|
|
});
|
|
|
}
|
|
|
public function test1(){
|
|
|
- Owner::update([["id"=>18,"code"=>"test1"],["id"=>17,"code"=>"test2"]]);
|
|
|
+ $waybills=Waybill::select('id','wms_bill_number')->get();
|
|
|
+ foreach ($waybills as $waybill){
|
|
|
+ $orders=WMSWaybillOrder::where('OrderNo',$waybill->wms_bill_number)->get();
|
|
|
+ if (count($orders)>0){
|
|
|
+ $warehouseWeight=0;
|
|
|
+ $sign=false;
|
|
|
+ foreach ($orders as $order){
|
|
|
+ $warehouseWeight+=$order->Cubic;
|
|
|
+ if ($order->Cubic==0)$sign=true;
|
|
|
+ }
|
|
|
+ if ($sign)unset($warehouseWeight);
|
|
|
+ }
|
|
|
+ $waybill=Waybill::find($waybill->id);
|
|
|
+ if (isset($warehouseWeight)){
|
|
|
+ if ($waybill){
|
|
|
+ $waybill->warehouse_weight=$warehouseWeight;
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ $waybill->warehouse_weight=null;
|
|
|
+ $waybill->warehouse_weight_unit_id=null;
|
|
|
+ }
|
|
|
+ $waybill->update();
|
|
|
+ }
|
|
|
}
|
|
|
public function test3()
|
|
|
{
|