New Warehouse Storage Fee

This commit is contained in:
Dillon Ngo
2023-11-04 14:58:50 +08:00
parent b5bcd5c553
commit 06751fdc78
24 changed files with 704 additions and 53 deletions
@@ -0,0 +1,20 @@
<?php
namespace App\Classes\General\Eloquent\Filters;
use Illuminate\Database\Eloquent\Builder;
class WithTrashed implements Filter
{
/**
* @param Builder $builder
* @param $value
* @return mixed
*/
public static function apply(Builder $builder, $value)
{
return $builder->withTrashed();
}
}
@@ -9,10 +9,12 @@ use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\TransactionType;
use App\Classes\ValueObjects\Constants\PaymentMethodType;
use App\Classes\Modules\Transactions\Processors\CreatePaymentTransactionProcessor;
use App\Classes\Modules\Transactions\Processors\CreateStorageInvoiceDocTransactionProcessor;
use App\Classes\Modules\Transactions\Services\UpdatesTransactionStatus;
use App\Classes\Modules\Wallets\Services\UpdatesWalletBalance;
use App\Classes\Modules\Orders\Processors\UpdateDoFromVTPortalProcessor;
use App\Classes\Modules\Orders\Processors\UpdateDoFromYDPortalProcessor;
use Illuminate\Support\Facades\Log;
class CallbackBillplzProcessor
{
@@ -31,6 +33,9 @@ class CallbackBillplzProcessor
/** @var CreatePaymentTransactionProcessor */
private $createPaymentTransactionProcessor;
/** @var CreateStorageInvoiceDocTransactionProcessor */
private $ceateStorageInvoiceDocTransactionProcessor;
/**
* CreateUserProcessor constructor.
* @param UpdatesTransactionStatus $updatesTransactionStatus
@@ -38,14 +43,16 @@ class CallbackBillplzProcessor
* @param UpdateDoFromYDPortalProcessor $updateDoFromYDPortalProcessor
* @param UpdatesWalletBalance $updatesWalletBalance
* @param CreatePaymentTransactionProcessor $createPaymentTransactionProcessor
* @param CreateStorageInvoiceDocTransactionProcessor $ceateStorageInvoiceDocTransactionProcessor
*/
public function __construct(UpdatesTransactionStatus $updatesTransactionStatus, UpdateDoFromVTPortalProcessor $updateDoFromVTPortalProcessor, UpdateDoFromYDPortalProcessor $updateDoFromYDPortalProcessor, UpdatesWalletBalance $updatesWalletBalance, CreatePaymentTransactionProcessor $createPaymentTransactionProcessor)
public function __construct(UpdatesTransactionStatus $updatesTransactionStatus, UpdateDoFromVTPortalProcessor $updateDoFromVTPortalProcessor, UpdateDoFromYDPortalProcessor $updateDoFromYDPortalProcessor, UpdatesWalletBalance $updatesWalletBalance, CreatePaymentTransactionProcessor $createPaymentTransactionProcessor, CreateStorageInvoiceDocTransactionProcessor $ceateStorageInvoiceDocTransactionProcessor)
{
$this->updatesTransactionStatus = $updatesTransactionStatus;
$this->updateDoFromVTPortalProcessor = $updateDoFromVTPortalProcessor;
$this->updateDoFromYDPortalProcessor = $updateDoFromYDPortalProcessor;
$this->updatesWalletBalance = $updatesWalletBalance;
$this->createPaymentTransactionProcessor = $createPaymentTransactionProcessor;
$this->ceateStorageInvoiceDocTransactionProcessor = $ceateStorageInvoiceDocTransactionProcessor;
}
@@ -66,32 +73,65 @@ class CallbackBillplzProcessor
$this->updatesWalletBalance->execute($transaction->owner, $transaction->amount);
$group = Group::where('reference', $transaction->payment_reference)->first();
// check if is group payment
if ($group) {
foreach ($group->groupTransactions as $groupTransaction) {
$invoice = $groupTransaction->transaction;
$this->createPaymentTransactionProcessor->execute($invoice, PaymentMethodType::WALLET, null);
$paymentTransaction = $this->createPaymentTransactionProcessor->execute($invoice, PaymentMethodType::WALLET, null);
if($paymentTransaction && $paymentTransaction->status == ApprovalStatus::APPROVED){
$pL = $invoice->owner;
$this->processPackingListAndInvoice($pL);
if($invoice->type == TransactionType::STORAGE_INVOICE){
$this->ceateStorageInvoiceDocTransactionProcessor->execute($pL);
}
}
}
$group->status = $status;
$group->save();
}
}
if (!$transaction->owner instanceof Wallet) {
$totalPaidAmount = $invoice->transactions->where('type', TransactionType::PAYMENT)->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->sum('amount');
$this->processPackingListAndInvoice($packingList, $invoice);
if (($invoice->amount - $totalPaidAmount) < 0.01) {
if($invoice->type == TransactionType::STORAGE_INVOICE){
$this->ceateStorageInvoiceDocTransactionProcessor->execute($packingList);
}
}
}
private function processPackingListAndInvoice($packingList, $invoice = null){
$totalInvoiceAmmuntPaid = 0.00;
$totalInvoiceAmmunt = 0.00;
$invoiceTransactions = $packingList->transactions()->whereIn('type', [TransactionType::SHIPPING_INVOICE, TransactionType::STORAGE_INVOICE])->get();
foreach($invoiceTransactions as $invoiceTransaction){
$totalInvoiceAmmunt = $totalInvoiceAmmunt + $invoiceTransaction->amount;
$totalInvoiceAmmuntPaid = $totalInvoiceAmmuntPaid + $invoiceTransaction->transactions->where('type', TransactionType::PAYMENT)->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->sum('amount');
}
Log::info('Total invoice amount paid 1: '.$totalInvoiceAmmunt); //cief todo: to be removed
Log::info('Total invoice amount paid 2: '.$totalInvoiceAmmuntPaid); //cief todo: to be removed
// if (($invoice->amount - $totalPaidAmount) < 0.01) {
if (($totalInvoiceAmmunt - $totalInvoiceAmmuntPaid) < 0.01) {
// dd(json_encode($totalInvoiceAmmunt));
if($invoice){
$this->updatesTransactionStatus->execute($invoice, ApprovalStatus::COMPLETED);
}
$packingList->status = ApprovalStatus::APPROVED;
$packingList->save();
Log::info('Total invoice amount paid 3: '.$totalInvoiceAmmuntPaid); //cief todo: to be removed
if (app()->environment('production')) {
$this->updateDoFromVTPortalProcessor->execute($packingList);
$this->updateDoFromYDPortalProcessor->execute($packingList);
}
$packingList->status = ApprovalStatus::APPROVED;
$packingList->save();
if (app()->environment('production')) {
$this->updateDoFromVTPortalProcessor->execute($packingList);
$this->updateDoFromYDPortalProcessor->execute($packingList);
}
}
}
@@ -52,9 +52,11 @@ class FetchOrderV2Logic extends AbstractControllerLogic
$this->canFetchOrder->passes();
$query = $this->fetchesOrder->execute(['reference' => $request->route('id'), 'with_packing_lists' => true]);
$query->storages = $request->input('storages'); //from middleware
return $this->resourceResponse(new OrderV2Resource($query));
}
}
}
@@ -0,0 +1,286 @@
<?php
namespace App\Classes\Modules\Transactions\Processors;
use App\Classes\Exceptions\MalformedRequestException;
use App\Classes\Modules\Orders\Services\FetchesOrder;
use App\Classes\Modules\Transactions\Services\GeneratesTransactionBillNumber;
use App\Classes\Modules\Transactions\Services\CreatesTransaction;
use App\Classes\Modules\Transactions\Services\CreatesTransactionDetail;
use App\Classes\Modules\Transactions\Services\UpdatesTransaction;
use App\Classes\Modules\Transactions\Services\FetchesTransaction;
use App\Classes\Modules\Transactions\Services\UpdatesTransactionDetail;
use App\Classes\Modules\Transactions\Services\UpdatesTransactionStatus;
use App\Classes\Modules\Transactions\Services\DeletesGroup;
use App\Classes\Modules\Transactions\DataTransferObjects\TransactionObject;
use App\Classes\Modules\Transactions\DataTransferObjects\TransactionDetailObject;
use App\Classes\ValueObjects\Constants\TransactionType;
use App\Classes\ValueObjects\Constants\PaymentMethodType;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\PackageType;
use App\Classes\ValueObjects\Constants\TransactionDetailType;
use App\Models\PackingList;
use App\Models\Transaction;
use Carbon\Carbon;
use Illuminate\Support\Facades\Log;
class CheckAndCreateStorageInvoiceTransactionProcessor
{
/** @var FetchesOrder */
private $fetchesOrder;
/** @var GeneratesTransactionBillNumber */
private $generatesTransactionBillNumber;
/** @var FetchesTransaction */
private $fetchesTransaction;
/** @var CreatesTransaction */
private $createsTransaction;
/** @var CreatesTransactionDetail */
private $createsTransactionDetail;
/** @var UpdatesTransaction */
private $updatesTransaction;
/** @var UpdatesTransactionDetail */
private $updatesTransactionDetail;
/** @var UpdatesTransactionStatus */
private $updatesTransactionStatus;
/** @var DeletesGroup */
private $deletesGroup;
/**
* @param FetchesOrder $fetchesOrder
* @param GeneratesTransactionBillNumber $generatesTransactionBillNumber
* @param FetchesTransaction $fetchesTransaction
* @param CreatesTransaction $createsTransaction
* @param CreatesTransactionDetail $createsTransactionDetail
* @param UpdatesTransaction $updatesTransaction
* @param UpdatesTransactionDetail $updatesTransactionDetail
* @param UpdatesTransactionStatus $updatesTransactionStatus
* @param DeletesGroup $deletesGroup
*/
public function __construct(FetchesOrder $fetchesOrder, GeneratesTransactionBillNumber $generatesTransactionBillNumber, FetchesTransaction $fetchesTransaction, CreatesTransaction $createsTransaction, CreatesTransactionDetail $createsTransactionDetail, UpdatesTransaction $updatesTransaction, UpdatesTransactionDetail $updatesTransactionDetail, UpdatesTransactionStatus $updatesTransactionStatus, DeletesGroup $deletesGroup)
{
$this->fetchesOrder = $fetchesOrder;
$this->generatesTransactionBillNumber = $generatesTransactionBillNumber;
$this->fetchesTransaction = $fetchesTransaction;
$this->createsTransaction = $createsTransaction;
$this->createsTransactionDetail = $createsTransactionDetail;
$this->updatesTransaction = $updatesTransaction;
$this->updatesTransactionDetail = $updatesTransactionDetail;
$this->updatesTransactionStatus = $updatesTransactionStatus;
$this->deletesGroup = $deletesGroup;
}
/**
* @throws MalformedRequestException
*/
public function execute(int $orderId)
{
$multipleResults = array();
$order = $this->fetchesOrder->execute(['reference' => $orderId, 'with_packing_lists' => true]);
$eta = "";
$destinationWarehousePackages = $order->destinationWarehousePackages;
foreach ($destinationWarehousePackages as $destinationWarehousePackage){
if ($destinationWarehousePackage) {
$package = $destinationWarehousePackage->packages->first();
if ($package) {
$container = $package->container()->first();
if ($container) {
$transport = $container->transports->first();
if ($transport) {
$schedule = $transport->schedules->last();
if ($schedule) {
$eta = $schedule->eta;
if($eta){
$transactions = $destinationWarehousePackage->transactions()->where('transactions.type', TransactionType::SHIPPING_INVOICE)->whereIn('transactions.status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->get();
// $transactions = $destinationWarehousePackage->transactions()->where('transactions.type', TransactionType::SHIPPING_INVOICE)->where('transactions.status', ApprovalStatus::APPROVED)->get();
/** @var Transaction $invoice_transaction */
foreach ($transactions as $invoice_transaction){
$multipleResults[] = $this->processSingleTransactionOfTypeShippingInvoice($invoice_transaction, $destinationWarehousePackage, $order, $eta);
}
}
}
}
}
}
}
}
return $multipleResults;
}
function processSingleTransactionOfTypeShippingInvoice($transaction, $destinationWarehousePackage, $order, $eta){
$pricePerCBM = 3;
$resultNumberOfDaysFree = 10;
$dt1 = $eta->copy()->addDay()->startOfDay();
$resultStartDate = $dt1->format('Y-m-d');
$currentDatetime = Carbon::now();
$dt2 = $currentDatetime->copy()->addDay()->startOfDay();
$resultCurrentDate = $dt2->format('Y-m-d H:i:s');
$interval = Carbon::parse($dt2)->diff($dt1);
$resultNumberOfDaysExceeded = $interval->days - $resultNumberOfDaysFree;
$storageInvoice = $destinationWarehousePackage->transactions()->where('transactions.type', TransactionType::STORAGE_INVOICE)->first();
$storageInvoiceId = 0;
$transactionDetailsItems = $transaction->transactionDetails()->get();
$cbm = 0.00;
foreach ($transactionDetailsItems as $tdItem){
$quantity = $tdItem->quantity;
if($tdItem->price < 0.00){
$quantity = $quantity * -1;
}
$cbm = $cbm + $quantity;
}
$price_cbm = $pricePerCBM * $cbm * $resultNumberOfDaysExceeded;
if(!$storageInvoice && $resultNumberOfDaysExceeded > 0 && $transaction->status != ApprovalStatus::COMPLETED){
$billNumber = $this->generatesTransactionBillNumber->execute('STOR-');
$invoiceTransaction = $this->createTransaction($destinationWarehousePackage, $billNumber, $order->company_module_id, $price_cbm);
$storageInvoiceId = $invoiceTransaction->id;
$this->createTransactionDetails($invoiceTransaction, $destinationWarehousePackage, $cbm, 3 * $resultNumberOfDaysExceeded, $resultNumberOfDaysExceeded);
}
else if($storageInvoice){
$amount = $storageInvoice->amount;
$epsilon = 0.0001; // Tolerance for the comparison
//cief todo: to be removed - starts
Log::info('price_cbm: '.$price_cbm."-".gettype($price_cbm));
Log::info('amount: '.$amount."-".gettype($amount));
if (abs($price_cbm - $amount) > $epsilon) {
Log::info("The values are not equal.");
} else {
Log::info("The values are approximately equal.");
}
//cief todo: to be removed - ends
if(abs($price_cbm - $amount) > $epsilon && $storageInvoice->status !== ApprovalStatus::COMPLETED){
$paymentTransactions = $storageInvoice->transactions()->where('transactions.type', TransactionType::PAYMENT)->where('transactions.status', ApprovalStatus::PENDING_SUBMISSION)->get();
if(count($paymentTransactions) > 0){ //PAYMENT type
foreach ($paymentTransactions as $paymentTransaction){
$this->updatesTransactionStatus->execute($paymentTransaction, ApprovalStatus::EXPIRED);
}
}
else{ //TOP UP type
$groups = $storageInvoice->groups()->get();
foreach ($groups as $grp){
$groupReference = $grp->reference;
$walletTransaction = $this->fetchesTransaction->execute(['payment_reference' => $groupReference]);
if($walletTransaction->status === ApprovalStatus::PENDING_SUBMISSION || $walletTransaction->status === ApprovalStatus::PENDING_VERIFICATION){
$grp->status = ApprovalStatus::EXPIRED;
$grp->save();
$this->deletesGroup->execute($grp);
$this->updatesTransactionStatus->execute($walletTransaction, ApprovalStatus::EXPIRED);
}
}
}
$invoiceTransaction = $this->updateTransaction($storageInvoice, $price_cbm);
$invoiceTransactionDetails = $storageInvoice->transactionDetails()->first();
$this->updateTransactionDetails($invoiceTransactionDetails, $cbm, 3 * $resultNumberOfDaysExceeded);
}
$storageInvoiceId = $storageInvoice->id;
}
$result = [
'parentInvoiceId' => $transaction->id,
'storageInvoiceId' => $storageInvoiceId,
'numberOfDaysExceeded' => $resultNumberOfDaysExceeded,
'numberOfDaysFree' => $resultNumberOfDaysFree,
'startDate' => $resultStartDate,
'currentDate' => $resultCurrentDate,
'cbm' => $cbm,
'pricePerCBM' => $pricePerCBM,
];
return $result;
}
function updateTransaction(Transaction $transaction, float $totalAmount){
$object = new TransactionObject(
$transaction->bill_no,
TransactionType::STORAGE_INVOICE,
1,
$transaction->receiver,
1,
PaymentMethodType::CASH,
$totalAmount,
$totalAmount,
1,
1,
0,
0,
0,
null,
ApprovalStatus::APPROVED
);
/** @var Transaction $invoice_transaction */
$invoice_transaction = $this->updatesTransaction->execute($transaction, $object);
return $invoice_transaction;
}
function updateTransactionDetails($invoice_transaction_details, $cbm, $price_cbm){
$object_detail = new TransactionDetailObject(
'STORAGE_FEE',
$invoice_transaction_details->name,
$cbm,
$price_cbm
);
$this->updatesTransactionDetail->execute($invoice_transaction_details, $object_detail);
}
function createTransaction(PackingList $packing_list, string $billNumber, int $companyModuleId, float $totalAmount){
$object = new TransactionObject(
$billNumber,
TransactionType::STORAGE_INVOICE,
1,
$companyModuleId,
1,
PaymentMethodType::CASH,
$totalAmount,
$totalAmount,
1,
1,
0,
0,
0,
null,
ApprovalStatus::APPROVED
);
/** @var Transaction $invoice_transaction */
$invoice_transaction = $this->createsTransaction->execute($packing_list, $object);
return $invoice_transaction;
}
function createTransactionDetails($invoice_transaction, PackingList $packing_list, $cbm, $price_cbm, $numberOfDays){
$object_detail = new TransactionDetailObject(
'SHIPPING_FEE',
TransactionDetailType::STORAGE_FEE.' for '.$numberOfDays. ' days<br>'.round($packing_list->packages->where('type', '!=', PackageType::OVER_WEIGHT)->sum('quantity'), 3).' CTNS - '.round($cbm, 3).' CBM',
$cbm,
$price_cbm
);
$this->createsTransactionDetail->execute($invoice_transaction, $object_detail);
}
}
@@ -127,15 +127,15 @@ class CreatePaymentTransactionProcessor
$this->updatesWalletBalance->execute($wallet, ($amount * -1));
$packingList = $invoice->owner;
$order = $packingList->owner;
$packingList->status = ApprovalStatus::APPROVED;
$packingList->save();
// $packingList = $invoice->owner;
// $order = $packingList->owner;
// $packingList->status = ApprovalStatus::APPROVED;
// $packingList->save();
if(app()->environment('production')){
$this->updateDoFromVTPortalProcessor->execute($packingList);
$this->updateDoFromYDPortalProcessor->execute($packingList);
}
// if(app()->environment('production')){
// $this->updateDoFromVTPortalProcessor->execute($packingList);
// $this->updateDoFromYDPortalProcessor->execute($packingList);
// }
// later use this variabke to create a approved payment transaction
$approvalStatus = ApprovalStatus::APPROVED;
@@ -0,0 +1,79 @@
<?php
namespace App\Classes\Modules\Transactions\Processors;
use App\Classes\Exceptions\MalformedRequestException;
use App\Classes\Notifications\InvoiceIssuedEmail;
use App\Models\Document;
use App\Models\PackingList;
use App\Models\Transaction;
use Mccarlosen\LaravelMpdf\Facades\LaravelMpdf;
use App\Classes\ValueObjects\Constants\DocumentType;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\TransactionType;
use App\Classes\Modules\Documents\Services\CreatesFiles;
use App\Classes\Modules\Documents\Services\CreatesDocument;
use App\Classes\Modules\Documents\DataTransferObjects\DocumentObject;
use App\Classes\Modules\Transactions\Services\UpdatesTransactionStatus;
class CreateStorageInvoiceDocTransactionProcessor
{
/** @var UpdatesTransactionStatus */
private $updatesTransactionStatus;
/** @var CreatesDocument */
private $createsDocument;
/** @var CreatesFiles */
private $createsFiles;
/**
* @param UpdatesTransactionStatus $updatesTransactionStatus
* @param CreatesDocument $createsDocument
* @param CreatesFiles $createsFiles
*/
public function __construct(UpdatesTransactionStatus $updatesTransactionStatus, CreatesDocument $createsDocument, CreatesFiles $createsFiles)
{
$this->updatesTransactionStatus = $updatesTransactionStatus;
$this->createsDocument = $createsDocument;
$this->createsFiles = $createsFiles;
}
/**
* @throws MalformedRequestException
*/
public function execute(PackingList $packingList)
{
/** @var Transaction $invoice_transaction */
$invoice_transaction = $packingList->transactions()->where('transactions.type', TransactionType::STORAGE_INVOICE)->whereIn('status', [ApprovalStatus::COMPLETED])->first();
// $this->updatesTransactionStatus->execute($invoice_transaction, ApprovalStatus::APPROVED);
$transaction_invoice_pdf = LaravelMpdf::loadView('pages.pdfs.shipping_invoice', ['invoice_transaction' => $invoice_transaction]);
$document_object = new DocumentObject(
DocumentType::STORAGE_INVOICE,
[chunk_split('data:application/pdf;base64,'.base64_encode($transaction_invoice_pdf->output()))],
'',
ApprovalStatus::COMPLETED,
'storage_invoice'
);
$invouce_transaction_document = $invoice_transaction->documents()->where('document_type', DocumentType::STORAGE_INVOICE)->first();
if(!$invouce_transaction_document){
/** @var Document $document */
$document = $this->createsDocument->execute($invoice_transaction, $document_object);
$this->createsFiles->execute($document, $document_object);
$user = $packingList->owner->companyModule->employees()->first();
if(app()->environment(['production'])) {
$user->notify(new InvoiceIssuedEmail($user, $packingList));
}
}
}
}
@@ -24,5 +24,6 @@ final class DocumentType {
public const SHIPPING_INVOICE = 'SHIPPING_INVOICE';
public const STORAGE_INVOICE = 'STORAGE_INVOICE';
}
@@ -11,4 +11,6 @@ final class TransactionDetailType {
public const MIN_CBM_CHARGES = 'Minimum Charge for 0.3 CBM Per Container';
public const CUSTOM_CHARGES = 'Custom charges';
public const STORAGE_FEE = 'Malaysia Warehoue Storage Fee';
}
@@ -5,9 +5,9 @@ namespace App\Classes\ValueObjects\Constants;
final class TransactionType {
// public const PAYMENT_ATTEMPT = 0;
public const SHIPPING_INVOICE = 1;
public const PAYMENT = 2;
// public const BILL = 3;
@@ -35,10 +35,11 @@ final class TransactionType {
// public const SHIPPING_COST = 14;
public const GROUP_PAYMENT = 15;
public const TRANSACTION_TYPE_ID = [
self::SHIPPING_INVOICE => "Shipping Invoice",
self::PAYMENT => "Payment",
];
public const STORAGE_INVOICE = 16;
}
+2
View File
@@ -70,5 +70,7 @@ class Kernel extends HttpKernel
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
'valid.token' => ValidateToken::class,
'token.check' => \App\Http\Middleware\TokenCheckerMiddleware::class,
'storage.invoice.check.byorder' => \App\Http\Middleware\CheckForStorageInvoiceByOrderId::class,
'storage.invoice.check.bytransactions' => \App\Http\Middleware\CheckForStorageInvoiceByTransactions::class,
];
}
@@ -0,0 +1,37 @@
<?php
namespace App\Http\Middleware;
use Closure;
use App\Classes\Modules\Transactions\Processors\CheckAndCreateStorageInvoiceTransactionProcessor;
use Illuminate\Http\Request;
class CheckForStorageInvoiceByOrderId
{
/** @var CheckAndCreateStorageInvoiceTransactionProcessor */
private $storageInvoiceTransactionProcessor;
public function __construct(CheckAndCreateStorageInvoiceTransactionProcessor $storageInvoiceTransactionProcessor)
{
$this->storageInvoiceTransactionProcessor = $storageInvoiceTransactionProcessor;
}
/**
* Handle an incoming request.
*
* @param Request $request
* @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
*/
public function handle(Request $request, Closure $next)
{
$orderId = $request->route('id');
$result = $this->storageInvoiceTransactionProcessor->execute($orderId);
$request->merge(['storages' => $result]);
return $next($request);
}
}
@@ -0,0 +1,72 @@
<?php
namespace App\Http\Middleware;
use Closure;
use App\Classes\Modules\Transactions\Processors\CheckAndCreateStorageInvoiceTransactionProcessor;
use App\Classes\Modules\Transactions\Services\ListsTransactions;
use App\Models\CompanyConnection;
use App\Models\Order;
use App\Models\PackingList;
use Illuminate\Http\Request;
class CheckForStorageInvoiceByTransactions
{
/** @var CheckAndCreateStorageInvoiceTransactionProcessor */
private $storageInvoiceTransactionProcessor;
/** @var ListsTransactions */
private $listsTransactions;
public function __construct(CheckAndCreateStorageInvoiceTransactionProcessor $storageInvoiceTransactionProcessor, ListsTransactions $listsTransactions)
{
$this->storageInvoiceTransactionProcessor = $storageInvoiceTransactionProcessor;
$this->listsTransactions = $listsTransactions;
}
/**
* Handle an incoming request.
*
* @param Request $request
* @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
*/
public function handle(Request $request, Closure $next)
{
//{"per_page":999,"order_by":{"column":"id","DESC":true},"status_in":[2],"receiver":298,"type_in":[1,16],"does_not_have_payment_status_in":[0,1],"does_not_have_groups":1}
$transactions = null;
$marking = $request->route('marking');
if($marking){
$connection = CompanyConnection::where('invitee_reference', $marking)->first();
$company_module_id = $connection->invitee->id;
$filters = [
'per_page' => 999,
'status_in' => [2],
'receiver' => $company_module_id,
'type_in' => [1, 16]
];
$transactions = $this->listsTransactions->execute($filters);
}
else{
$filters = json_decode($request->input('filters'), true);
$filters['per_page'] = 999;
unset($filters['does_not_have_payment_status_in']);
unset($filters['does_not_have_groups']);
unset($filters['order_by']);
$transactions = $this->listsTransactions->execute($filters);
}
foreach($transactions as $transaction){
$packingList = $transaction->owner()->first();
$order = $packingList->owner()->first();
if($order instanceof Order){
$this->storageInvoiceTransactionProcessor->execute($order->reference);
}
}
return $next($request);
}
}
+2 -1
View File
@@ -31,8 +31,9 @@ class OrderV2Resource extends JsonResource
'address' => new AddressResource($this->addresses()->where('status', '=', ApprovalStatus::APPROVED)->first()),
'address_change_request' => new AddressResource($this->addressesPendingVerification()->first()),
'invoices' => $this->whenLoaded('packingLists', function() {
return TransactionResource::collection($this->transactions()->whereNotIn('transactions.status', [0, 1])->where('transactions.type', TransactionType::SHIPPING_INVOICE)->get());
return TransactionResource::collection($this->transactions()->whereNotIn('transactions.status', [0, 1])->whereIn('transactions.type', [TransactionType::SHIPPING_INVOICE, TransactionType::STORAGE_INVOICE])->get());
}),
'storages' => $this->storages ? $this->storages : null, //from middleware
'remarks' => RemarkResource::collection($this->remarks),
'created_at' => $this->created_at->format('d-m-Y')
];
+6 -1
View File
@@ -40,7 +40,7 @@ class TransactionResource extends JsonResource
if ($group) {
$groupTransactions = GroupTransactionResource::collection($group->groupTransactions);
}
}
return [
@@ -71,6 +71,11 @@ class TransactionResource extends JsonResource
->payments()->where('status', ApprovalStatus::PENDING_SUBMISSION)
->get()
),
'payments_expired' => TransactionResource::collection(
$this->transactions()
->payments()->where('status', ApprovalStatus::EXPIRED)
->get()
),
'payment_history' => TransactionResource::collection(
$this->transactions()
->payments()
@@ -12,7 +12,7 @@
</list-component>
</div>
</div>
<div class="col-12 col-sm-12 col-md-4" v-if="!['customerPaidGroupInvoiceComponent', 'customerGroupPaymentInProgressInvoiceComponent'].includes(section)">
<div class="col-12 col-sm-12 col-md-4" v-if="!['customerPaidGroupInvoiceComponent', 'customerGroupPaymentInProgressInvoiceComponent', 'customerGroupPaymentExpiredInvoiceComponent'].includes(section)">
<div class="row align-items-center">
<div class="col">
<div class="row" v-if="section === 'customerPendingPaymentInvoiceComponent'">
@@ -43,6 +43,22 @@
</div>
</div>
</div>
<div class="col p-t-20 p-b-20 bg-master-lighter tabButton" tab-name="groupPaymentExpired">
<div class="row justify-content-center m-b-5">
<div class="col-auto">
<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px"
width="35" height="35"
viewBox="0 0 172 172"
style=" fill:#000000;"><g fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><path d="M0,172v-172h172v172z" fill="none"></path><g fill="#000000"><path d="M39.81699,21.5l-18.31699,22.89414v106.10586h129v-2.15v-103.95586l-18.31699,-22.89414zM41.88301,25.8h88.23398l13.75664,17.2h-47.12363v2.15c0,5.96338 -4.78662,10.75 -10.75,10.75c-5.96338,0 -10.75,-4.78662 -10.75,-10.75v-2.15h-47.12363zM25.8,47.3h45.58672c1.08865,7.23076 7.08802,12.9 14.61328,12.9c7.52526,0 13.52463,-5.66924 14.61328,-12.9h45.58672v98.9h-120.4zM86,68.8c-15.41089,0 -27.95,12.53911 -27.95,27.95c0,15.41089 12.53911,27.95 27.95,27.95c15.41089,0 27.95,-12.53911 27.95,-27.95c0,-15.41089 -12.53911,-27.95 -27.95,-27.95zM86,73.1c13.087,0 23.65,10.563 23.65,23.65c0,13.087 -10.563,23.65 -23.65,23.65c-13.087,0 -23.65,-10.563 -23.65,-23.65c0,-13.087 10.563,-23.65 23.65,-23.65zM85.96641,77.37061c-1.18576,0.01854 -2.13264,0.9936 -2.11641,2.17939v16.125l-7.73916,5.80332c-0.95086,0.71198 -1.1445,2.05998 -0.43252,3.01084c0.71198,0.95086 2.05998,1.1445 3.01084,0.43252l9.46084,-7.09668v-18.275c0.00796,-0.58115 -0.21968,-1.14076 -0.63105,-1.55134c-0.41137,-0.41057 -0.97142,-0.63714 -1.55255,-0.62806zM38.7,135.45c-1.18741,0 -2.15,0.96259 -2.15,2.15c0,1.18741 0.96259,2.15 2.15,2.15c1.18741,0 2.15,-0.96259 2.15,-2.15c0,-1.18741 -0.96259,-2.15 -2.15,-2.15zM47.3,135.45c-1.18741,0 -2.15,0.96259 -2.15,2.15c0,1.18741 0.96259,2.15 2.15,2.15c1.18741,0 2.15,-0.96259 2.15,-2.15c0,-1.18741 -0.96259,-2.15 -2.15,-2.15zM55.9,135.45c-1.18741,0 -2.15,0.96259 -2.15,2.15c0,1.18741 0.96259,2.15 2.15,2.15c1.18741,0 2.15,-0.96259 2.15,-2.15c0,-1.18741 -0.96259,-2.15 -2.15,-2.15zM64.5,135.45c-1.18741,0 -2.15,0.96259 -2.15,2.15c0,1.18741 0.96259,2.15 2.15,2.15c1.18741,0 2.15,-0.96259 2.15,-2.15c0,-1.18741 -0.96259,-2.15 -2.15,-2.15zM73.1,135.45c-1.18741,0 -2.15,0.96259 -2.15,2.15c0,1.18741 0.96259,2.15 2.15,2.15c1.18741,0 2.15,-0.96259 2.15,-2.15c0,-1.18741 -0.96259,-2.15 -2.15,-2.15zM81.7,135.45c-1.18741,0 -2.15,0.96259 -2.15,2.15c0,1.18741 0.96259,2.15 2.15,2.15c1.18741,0 2.15,-0.96259 2.15,-2.15c0,-1.18741 -0.96259,-2.15 -2.15,-2.15zM90.3,135.45c-1.18741,0 -2.15,0.96259 -2.15,2.15c0,1.18741 0.96259,2.15 2.15,2.15c1.18741,0 2.15,-0.96259 2.15,-2.15c0,-1.18741 -0.96259,-2.15 -2.15,-2.15zM98.9,135.45c-1.18741,0 -2.15,0.96259 -2.15,2.15c0,1.18741 0.96259,2.15 2.15,2.15c1.18741,0 2.15,-0.96259 2.15,-2.15c0,-1.18741 -0.96259,-2.15 -2.15,-2.15zM107.5,135.45c-1.18741,0 -2.15,0.96259 -2.15,2.15c0,1.18741 0.96259,2.15 2.15,2.15c1.18741,0 2.15,-0.96259 2.15,-2.15c0,-1.18741 -0.96259,-2.15 -2.15,-2.15zM116.1,135.45c-1.18741,0 -2.15,0.96259 -2.15,2.15c0,1.18741 0.96259,2.15 2.15,2.15c1.18741,0 2.15,-0.96259 2.15,-2.15c0,-1.18741 -0.96259,-2.15 -2.15,-2.15zM124.7,135.45c-1.18741,0 -2.15,0.96259 -2.15,2.15c0,1.18741 0.96259,2.15 2.15,2.15c1.18741,0 2.15,-0.96259 2.15,-2.15c0,-1.18741 -0.96259,-2.15 -2.15,-2.15zM133.3,135.45c-1.18741,0 -2.15,0.96259 -2.15,2.15c0,1.18741 0.96259,2.15 2.15,2.15c1.18741,0 2.15,-0.96259 2.15,-2.15c0,-1.18741 -0.96259,-2.15 -2.15,-2.15z"></path></g></g>
</svg>
</div>
</div>
<div class="row">
<div class="col">
<div class="fs-12 m-t-5 all-caps">Group Payment Expired</div>
</div>
</div>
</div>
<div class="col p-t-20 p-b-20 bg-master-lighter tabButton" tab-name="paidGroupInvoice">
<div class="row justify-content-center m-b-5">
<div class="col-auto">
@@ -75,7 +91,7 @@
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@@ -84,7 +100,7 @@
<div class="col bg-master-lightest p-1 p-sm-4">
<div class="row tabsContainer tabContent" tab-name="pendingPayment">
<div class="col">
<customer-payment-billing-inner-component :endpoint="route('api.transaction.list')" section="customerPendingPaymentInvoiceComponent" :company_module_id="company_module_id" :options="{'per_page': 10, order_by: {column: 'id', DESC: true}, 'status_in': [2], 'receiver': company_module_id, 'type': 1, 'does_not_have_payment_status_in': [0,1] ,'does_not_have_groups': 1}"></customer-payment-billing-inner-component>
<customer-payment-billing-inner-component :endpoint="route('api.transaction.list')" section="customerPendingPaymentInvoiceComponent" :company_module_id="company_module_id" :options="{'per_page': 10, order_by: {column: 'id', DESC: true}, 'status_in': [2], 'receiver': company_module_id, 'type_in': [1,16], 'does_not_have_payment_status_in': [0,1] ,'does_not_have_groups': 1}"></customer-payment-billing-inner-component>
</div>
</div>
<div class="row tabsContainer tabContent hide" tab-name="groupPaymentInProgress">
@@ -92,6 +108,11 @@
<customer-payment-billing-inner-component :endpoint="route('api.transaction.group.list')" section="customerGroupPaymentInProgressInvoiceComponent" :company_module_id="company_module_id" :options="{'per_page': 10, order_by: {column: 'id', DESC: true}, 'status_in': [0, 1], 'receiver': company_module_id, order_by: {column: 'updated_at', DESC: true}}"></customer-payment-billing-inner-component>
</div>
</div>
<div class="row tabsContainer tabContent hide" tab-name="groupPaymentExpired">
<div class="col">
<customer-payment-billing-inner-component :endpoint="route('api.transaction.group.list')" section="customerGroupPaymentExpiredInvoiceComponent" :company_module_id="company_module_id" :options="{'per_page': 10, order_by: {column: 'id', DESC: true}, 'status_in': [6], 'receiver': company_module_id, 'with_trashed': true, order_by: {column: 'updated_at', DESC: true}}"></customer-payment-billing-inner-component>
</div>
</div>
<div class="row tabsContainer tabContent hide" tab-name="paidGroupInvoice">
<div class="col">
<customer-payment-billing-inner-component :endpoint="route('api.transaction.group.list')" section="customerPaidGroupInvoiceComponent" :company_module_id="company_module_id" :options="{'per_page': 10, order_by: {column: 'id', DESC: true}, 'status_in': [2], 'receiver': company_module_id, order_by: {column: 'updated_at', DESC: true}}"></customer-payment-billing-inner-component>
@@ -99,7 +120,7 @@
</div>
<div class="row tabsContainer tabContent hide" tab-name="paidInvoice">
<div class="col">
<customer-payment-billing-inner-component :endpoint="route('api.transaction.list')" section="customerPaidInvoiceComponent" :company_module_id="company_module_id" :options="{'per_page': 10, order_by: {column: 'id', DESC: true}, 'status_in': [3], 'receiver': company_module_id, 'type': 1, order_by: {column: 'updated_at', DESC: true}}"></customer-payment-billing-inner-component>
<customer-payment-billing-inner-component :endpoint="route('api.transaction.list')" section="customerPaidInvoiceComponent" :company_module_id="company_module_id" :options="{'per_page': 10, order_by: {column: 'id', DESC: true}, 'status_in': [3], 'receiver': company_module_id, 'type_in': [1,16], order_by: {column: 'updated_at', DESC: true}}"></customer-payment-billing-inner-component>
</div>
</div>
</div>
@@ -149,7 +149,7 @@
</div>
<div class="row bg-master-lightest p-t-15" v-for="invoice in order.invoices">
<div class="col">
<customer-payments-billing-component :data="invoice" invoice_status="Pending Payment" :section="section"></customer-payments-billing-component>
<customer-payments-billing-component :data="invoice" :storage="getStorage(invoice)" invoice_status="Pending Payment" :section="section"></customer-payments-billing-component>
</div>
</div>
</div>
@@ -201,6 +201,16 @@
this.$store.dispatch('completeList', {'name': this.section, 'data': []});
this.isLoading = false;
this.order = response.payload.data;
},
getStorage(invoice) {
const storageObject = this.findStorageObject(invoice.id);
return storageObject;
},
findStorageObject(storageInvoiceId) {
if(this.order.storages){
return this.order.storages.find(storage => storage.storageInvoiceId === storageInvoiceId);
}
return null;
}
}
}
@@ -111,7 +111,7 @@
</div>
</div>
<div class="row text-center parentContainer m-t-10" v-if="['Pending Invoice', 'Pending Approval'].includes(invoice_status)" >
<div class="col">
<div class="col" v-if="item.order">
<div class="row" v-if="!item.order.company_module.billingAddress">
<div class="col">
<div>
@@ -1,6 +1,17 @@
<template>
<div class="row m-b-15 m-l-5 m-r-10 parentContainer">
<div class="col bg-white rounded">
<div class="row">
<div class="col padding-20" v-if="storage" v-show="item.type === 16">
<div v-if="storage.numberOfDaysExceeded > 0">
If your items have been here for over 10 days after goods arrival in Malaysia, a storage fee of RM3 per cubic meter per day applies. Storage fees are recalculated daily, please make immediate payment before it expires at the end of the day.
</div>
<p >Warehouse Storage Fee (Days): {{ storage.numberOfDaysExceeded }} x 3 x {{ storage.cbm }}CBM</p>
</div>
<div class="col padding-20" v-show="item.type === 1 && item.status !== 3">
<p> Warehouese Storage Fee applies ten days after goods arrival in Malaysia.</p>
</div>
</div>
<div class="row" :class="[{'b-danger': item.status == 5 ||item.status == 6, 'b-a': item.status == 5||item.status == 6}]">
<div class="col padding-20">
<div class="row align-items-center">
@@ -96,6 +107,20 @@
</div>
</div>
</div>
<div class="row bg-master-lightest" v-if="item.payments_expired.length">
<div class="col">
<div class="row m-t-10 m-b-10">
<div class="col">
<div class="font-head fs-10 all-caps">Payment Expired</div>
</div>
</div>
<div class="row">
<div class="col">
<payment-expired-component v-for="item in item.payments_expired" v-bind:key="item.id" :data="item" ></payment-expired-component>
</div>
</div>
</div>
</div>
<div class="row bg-master-lightest" v-if="item.payment_history.length">
<div class="col">
<div class="row m-t-10 m-b-10">
@@ -188,6 +213,9 @@
section:{
type: String,
required: true
},
storage:{
type: Object
}
},
data(){
@@ -200,12 +228,12 @@
}
},
computed: {
cbm () {
return (Math.ceil((this.item.packages.reduce((total, obj) => (obj.type === 2 ? 0 : obj.cbm) + total, 0)) * 1000) / 1000).toFixed(3)
},
overweight(){
return (Math.ceil((this.item.packages.reduce((total, obj) => (obj.type === 2 ? obj.cbm : 0) + total, 0)) * 1000) / 1000).toFixed(3)
},
// cbm () {
// return (Math.ceil((this.item.packages.reduce((total, obj) => (obj.type === 2 ? 0 : obj.cbm) + total, 0)) * 1000) / 1000).toFixed(3)
// },
// overweight(){
// return (Math.ceil((this.item.packages.reduce((total, obj) => (obj.type === 2 ? obj.cbm : 0) + total, 0)) * 1000) / 1000).toFixed(3)
// },
latestComment() {
let questions = this.item.remarks;
return questions.slice().reverse()[0];
@@ -20,7 +20,7 @@
<p class="no-margin fs-10 all-caps">Payment Date</p>
<div>{{ item.created_at }}</div>
</div>
<div class="col-auto pointer btn btn-success" v-if="item.payment_method == 5 && item.status != 2" @click="retryPayment()">
<div class="col-auto pointer btn btn-success" v-if="item.payment_method == 5 && item.status != 2 && item.status != 6" @click="retryPayment()">
<div class=" no-border h-100">
<i class="fa fa-repeat fs-20 text-white"></i>
</div>
@@ -31,10 +31,10 @@
</div>
</div>
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="deleteGroupTransaction">
<general-confirmation-form-component
contentText="Are you sure you want to delete this Group Payment?"
modalType="delete"
buttonText="Delete"
<general-confirmation-form-component
contentText="Are you sure you want to delete this Group Payment?"
modalType="delete"
buttonText="Delete"
class="text-center"
:apiRoute="route('api.transaction.group.delete', item.id)"
apiMethod="delete"
@@ -75,7 +75,7 @@
<i class="fa fa-repeat fs-20 text-white"></i>
</div>
</div>
<div class="col-auto">
<div class="col-auto" v-if="!['customerGroupPaymentExpiredInvoiceComponent'].includes(section)">
<div class="btn bg-grey no-border" @click="expanded = !expanded">
<i class="fa" :class="{'fa-angle-down': !expanded, 'fa-angle-up': expanded}" ></i>
</div>
@@ -83,7 +83,7 @@
</div>
</div>
</div>
<div class="row b-t b-grey p-t-10 m-l-5 m-r-5" v-show="expanded" v-if="item.invoices">
<div class="row b-t b-grey p-t-10 m-l-5 m-r-5" v-show="expanded" v-if="item.invoices && !['customerGroupPaymentExpiredInvoiceComponent'].includes(section)">
<div class="col">
<payments-billing-components :section="section" v-for="invoice in data.invoices" v-bind:key="invoice.id" :data="invoice" :selectedInvoice="selectedInvoice" v-on:input="updateList($event)"></payments-billing-components>
</div>
@@ -98,7 +98,7 @@
selectedInvoice: {
type: Array,
required: false,
},
},
section:{
type: String,
default: null
@@ -0,0 +1,41 @@
<template>
<div class="row m-l-0 m-b-10 m-r-0 parentContainer" :class="[{'b-a': item.status === 4}, {'b-danger': item.status === 4}, {'b-a': item.status === 5}, {'b-danger': item.status === 5}]" >
<div class="col">
<div class="row" v-if="!item.transaction_bill">
<div class="col">
<div class="row bg-white parentContainer">
<div class="col p-t-10 p-b-10 p-r-0" :class="[{'bg-master-lighter': item.status === 1 && item.type !== 6}, {'bg-white': item.status !== 1 && item.status !== 4}, {'bg-warning-lighter': item.type === 6}]">
<div class="row m-b-5">
<div class="col-auto">
<div class="font-heading fs-8 muted all-caps">Status</div>
<div class="font-heading fs-10 bold" :class="[{'text-danger': item.status === 1 || item.status === 4}, {'text-success': item.status !== 1 && item.status !== 4}]">
{{ item.status === 1 ? 'Pending Verification' : item.status === ( 4 || 5) ? 'Rejected' : 'Expired'}}
</div>
</div>
<div class="col-auto p-l-0">
<div class="font-heading fs-8 muted all-caps">Payment Amount</div>
<div class="font-heading fs-10 bold">
{{item.currency.short_code}} {{(Math.round((item.amount + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}
</div>
</div>
<div class="col-auto p-l-0">
<div class="font-heading fs-8 muted all-caps">Bill Number</div>
<div class="font-heading fs-10 bold">
{{ item.bill_no }}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import componentHandler from '../../../general/mixins/componentHandler';
export default {
mixins: [componentHandler]
}
</script>
+2 -1
View File
@@ -4,7 +4,8 @@ use Illuminate\Support\Facades\Route;
Route::group(['prefix' => 'order', 'as' => 'order.', 'namespace' => 'Orders'], function () {
Route::get('/show/{id}', 'FetchOrderController@fetch')->name('show');
Route::get('/v2/show/{id}', 'FetchOrderV2Controller@fetch')->name('v2.show');
// Route::get('/v2/show/{id}', 'FetchOrderV2Controller@fetch')->name('v2.show');
Route::get('/v2/show/{id}', 'FetchOrderV2Controller@fetch')->middleware('storage.invoice.check.byorder')->name('v2.show');
Route::get('/list', 'ListOrdersController@list')->name('list');
Route::get('/v2/list', 'ListOrdersV2Controller@list')->name('v2.list');
Route::post('/create', 'CreateOrderController@create')->name('create');
+3 -3
View File
@@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Route;
Route::group(['prefix' => 'transactions', 'namespace' => 'Transactions', 'as' => 'transaction.'], function () {
Route::get('/list', 'ListTransactionsController@list')->name('list');
Route::get('/list', 'ListTransactionsController@list')->middleware('storage.invoice.check.bytransactions')->name('list');
Route::delete('/suspend/{id}', 'SuspendTransactionController@suspend')->name('suspend');
Route::delete('/delete/{id}', 'DeleteTransactionController@delete')->name('delete');
Route::delete('/delete-payment/{id}', 'DeletePaymentTransactionController@delete')->name('payment.delete');
@@ -17,7 +17,7 @@ Route::group(['prefix' => 'transactions', 'namespace' => 'Transactions', 'as' =>
Route::post('/upload-verification-document/{transaction_id}', 'UploadPaymentVerificationDocumentController@upload')->name('verification.create');
Route::put('/approve/{transaction_id}/{status}', 'ApprovePaymentTransactionController@approve')->where('status', 'approve|reject')->name('approval');
});
Route::group(['prefix' => 'invoice', 'as' => 'invoice.'], function () {
route::post('/shipping-invoice/create', 'CreateShippingInvoiceTransactionController@create')->name('create');
route::post('/shipping-invoice/company/{company_module_id}/regenerate', 'RegenerateShippingInvoiceTransactionController@regenerate')->name('company.regenerate');
@@ -48,4 +48,4 @@ Route::group(['prefix' => 'transactions', 'namespace' => 'Transactions', 'as' =>
// Route::post('/bulk/po', 'CreateBulkPurchaseOrderDocumentController@create')->name('bulk.po');
});
});
});
+5 -3
View File
@@ -262,6 +262,7 @@ Route::get('/customer/{marking}/payment-and-billing', function ($marking) {
$company_module_id = $connection->invitee->id;
return view('pages.customers.paymentsBilling', ['company_module_id' => $company_module_id]);
})->name('customer.payment-and-billing');
// })->middleware('storage.invoice.check.bytransactions')->name('customer.payment-and-billing');
Route::get('/customer-invoices/{company_module_id}/payment-and-billing', function ($company_module_id) {
// todo-new: check company_module_id
@@ -1234,6 +1235,7 @@ Route::get('/accident-approve-invoice', function(){
}
});
Route::get('/check', function (Request $request){
dd(json_encode(Carbon::parse($request->input('start_date'))));
})->name('check');
//cief todo: to delete
// Route::get('/check', function (Request $request){
// dd(json_encode(Carbon::parse($request->input('start_date'))));
// })->name('check');