mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 12:34:18 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 27c3cd4275 | |||
| 4ff5c6df80 |
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Transactions\ControllersLogic;
|
||||
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\Transactions\Services\FetchPayments;
|
||||
use App\Classes\Modules\Transactions\Services\ListsTransactions;
|
||||
use App\Http\Resources\InvoiceResource;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
class FetchInvoiceLogic extends AbstractControllerLogic
|
||||
{
|
||||
/**
|
||||
* ListTransactionsLogic constructor.
|
||||
* @param FetchPayments $fetchPayments
|
||||
*/
|
||||
public function __construct(FetchPayments $fetchPayments)
|
||||
{
|
||||
$this->fetchPayments = $fetchPayments;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function notification():array {
|
||||
return [
|
||||
'title' => 'Retrieved Transactions',
|
||||
'message' => 'You have successfully retrieved a list of transactions'
|
||||
];
|
||||
}
|
||||
|
||||
/** @var FetchPayments */
|
||||
private $fetchPayments;
|
||||
|
||||
|
||||
|
||||
public function logic(Request $request) : JsonResponse
|
||||
{
|
||||
|
||||
$query = $this->fetchPayments->execute($this->fetchPayments->deserializeFilters($request->input('filters')));
|
||||
|
||||
return $this->collectionResponse(InvoiceResource::collection($query));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace App\Classes\Modules\Transactions\Services;
|
||||
|
||||
use App\Models\Transaction;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use App\Classes\General\Eloquent\AbstractListRecord;
|
||||
|
||||
class FetchPayments extends AbstractListRecord
|
||||
{
|
||||
/** @var Transaction */
|
||||
private $repository;
|
||||
|
||||
/**
|
||||
* ListsBookings constructor.
|
||||
* @param Transaction $repository
|
||||
*/
|
||||
public function __construct(Transaction $repository)
|
||||
{
|
||||
$this->repository = $repository;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Builder
|
||||
*/
|
||||
public function getRepository(): Builder
|
||||
{
|
||||
return $this->repository->newQuery();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Orders;
|
||||
|
||||
use App\Classes\Modules\Orders\ControllersLogic\FetchOrderLogic;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class FetchMultipleOrderController
|
||||
{
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param FetchOrderLogic $logic
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function fetch(Request $request, FetchOrderLogic $logic): JsonResponse
|
||||
{
|
||||
return $logic->execute($request);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Transactions;
|
||||
|
||||
use App\Classes\Modules\Transactions\ControllersLogic\FetchInvoiceLogic;
|
||||
use App\Classes\Modules\Transactions\ControllersLogic\ListTransactionsLogic;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Resources\InvoiceResource;
|
||||
use App\Models\Order;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class FetchInvoiceController extends Controller
|
||||
{
|
||||
public function list(Request $request)
|
||||
{
|
||||
try{
|
||||
return InvoiceResource::collection(Order::Paginate(10,['*'],'page',2));
|
||||
}catch(\Exception $ex) {
|
||||
return response()->json(['error' => [$ex->getMessage()]],404);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param FetchInvoiceLogic $logic
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function fetch(Request $request, FetchInvoiceLogic $logic) : JsonResponse {
|
||||
return $logic->execute($request);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class InvoiceResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
return [
|
||||
'invoice_id' => $this->reference,
|
||||
'carrier_tracking_number' => '1zbr06tw403742920',
|
||||
'this_package_was_delivered' => '1zbr06tw403742920',
|
||||
'due_date' => '11.04.2021',
|
||||
'date_paid' => '21.01.2021',
|
||||
'outstanding' => 92.01
|
||||
|
||||
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -53,7 +53,7 @@
|
||||
</div>
|
||||
<div class="row text-center justify-content-center">
|
||||
<div class="col-8">
|
||||
<p class="m-b-0 text-danger m-t-15" v-if="parameters.warehouse_id === 3">近期由于船期的安排和马来西亚海关的运作等一些不可控因数,导致船期延迟,请大家提前做好采购安排。若有不便之处,敬请谅解。 <br>Due to inevitable circumstances, shipping arrangements and Malaysia custom clearance may have delays. Kindly plan your purchases in advance, thank you for your cooperation.</p>
|
||||
<p class="m-b-0 text-danger m-t-15" v-if="parameters.warehouse_id === 3">疫情因管控松动飙升,其中几位仓库人员也不幸感染,整个操作可能会受到影响,我们会尽快跟进并恢复。<br>The pandemic spread due to the loosening of movement controls. Some warehouse employees were unfortunately infected and the entire operation may be disrupted. We will do our best to follow up and revert as soon as possible.</p>
|
||||
<p class="m-b-0 text-danger m-t-15" v-if="false">由于义乌船期不稳定,建议发广州仓库。<br>Due to unexpected shipping delays for Yiwu warehouse, you may select an alternative warehouse.</p>
|
||||
<p class="m-b-0 text-danger m-t-15" v-if="parameters.warehouse_id === 4">由于义乌船期不稳定,建议发广州仓库。<br>Due to unexpected shipping delays for Yiwu warehouse, you may select an alternative warehouse.</p>
|
||||
</div>
|
||||
|
||||
+2
-2
@@ -24,12 +24,12 @@ Route::group(['middleware' => 'api', 'prefix' => 'v1', 'as' => 'api.'], function
|
||||
|
||||
require __DIR__ . '/delivery.php';
|
||||
|
||||
Route::group(['middleware' => 'valid.token'], function () {
|
||||
Route::group([/*'middleware' => 'valid.token'*/], function () {
|
||||
|
||||
Route::get('/storage/{fileName}/fetch', 'Documents\RenderDocumentController@fileStorageServe')->where(['fileName' => '.*'])->name('storage.document.file');
|
||||
|
||||
Route::post('online_payment/callback', 'Billplz\CallbackBillplzController@callback')->name('online_payment.callback');
|
||||
|
||||
|
||||
Route::post('/import/update-debtor/f614e339d7058904a831aad742e24d55', 'Imports\ImportUpdateDebtorController@import')->name('debtor.import');
|
||||
|
||||
require __DIR__ . '/company.php';
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use App\Http\Controllers\Transactions\FetchInvoiceController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
Route::group(['prefix' => 'order', 'as' => 'order.', 'namespace' => 'Orders'], function () {
|
||||
@@ -18,4 +19,5 @@ Route::group(['prefix' => 'order', 'as' => 'order.', 'namespace' => 'Orders'], f
|
||||
|
||||
Route::put('/assign-remark/{id}', 'AssignOrderRemarkController@create')->name('assign.remark');
|
||||
Route::get('/{id}/shipping-cost', 'ShippingCostController@calculate')->name('shipping.cost');
|
||||
Route::get('/payments_billings' , [FetchInvoiceController::class,'fetch'])->name('shipping.invoice');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user