This commit is contained in:
edmondlang
2022-05-24 00:12:34 +08:00
4 changed files with 7 additions and 4 deletions
@@ -4,6 +4,7 @@ namespace App\Classes\Modules\Exports\Services;
use App\Models\Order;
use App\Models\PackingList;
use Carbon\Carbon;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\FromQuery;
use Maatwebsite\Excel\Concerns\WithHeadingRow;
@@ -36,7 +37,9 @@ class ExportsArrivedParcel implements WithHeadings, WithHeadingRow, WithMapping,
*/
public function query()
{
return PackingList::where('type', '=', 1)->where('status', '=', 2)->where('owner_type', Order::class);
return PackingList::where('type', '=', 1)->where('status', '=', 2)->where('owner_type', Order::class)->whereHas('transports', function($query){
return $query->where('drop_date', '>=',Carbon::now()->subMonth());
});
}
/**
@@ -222,7 +222,7 @@ class FetchOrderListsFromYdPortalProcessor
$unstuffingDate = Carbon::parse($trackingRow->trackingtime);
}
if (Str::contains($trackingRow->tracking, ['派送中'])) {
if (Str::contains($trackingRow->tracking, ['派送中', '签收完成', ' 第三方提货', '货物已派送完成'])) {
$deliveryDate = Carbon::parse($trackingRow->trackingtime);
}
}
@@ -128,7 +128,7 @@ class FetchWarehouseReceiveListFromVTPortalProcessor
$filter = '["ParcelDate:$between$%js%\"'.$start->format('Y-m-d').'T00:00:00.000\"$and$%js%\"'.$end->format('Y-m-d').'T00:00:00.000\"\u0000"]';
$warehouseListRequest = $this->fetchesDataFRomVTPortal->clientRequest('http://portal.vtnation.com.my/Services/DataControllerService.asmx/GetPage', 'POST', json_decode('{"controller":"WarehouseList","view":"grid1","request":{"PageIndex":-1,"PageSize":10000,"SortExpression":"ParcelDate asc","Filter":'.$filter.'}}'), '');
$warehouseListRequest = $this->fetchesDataFRomVTPortal->clientRequest('http://portal.vtnation.com.my/Services/DataControllerService.asmx/GetPage', 'POST', json_decode('{"controller":"Parcel","view":"grid1","request":{"PageIndex":-1,"PageSize":10000,"SortExpression":"ParcelDate asc","Filter":'.$filter.'}}'), '');
$response = $this->fetchesDataFRomVTPortal->getResponseBody($warehouseListRequest);
@@ -43,7 +43,7 @@ final class WarehouseReferences {
public const YD_DESTINATION_WAREHOUSE = self::YD_KLANG;
public const YD_EXEMPT_LIST = [230, 294, 320, 652, 1248, 1726];
public const YD_EXEMPT_LIST = [230, 294, 320, 652, 1248, 1726, 2349];
public const REPLICA_WHITE_LIST = [502];