mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 12:34:18 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d21a930889 |
@@ -13,7 +13,6 @@ use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class FetchOrdersFromYDPortalJob implements ShouldQueue
|
||||
{
|
||||
@@ -30,17 +29,12 @@ class FetchOrdersFromYDPortalJob implements ShouldQueue
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
Log::info('FetchOrdersFromYDPortalJob starts');
|
||||
Log::info('FetchPackingListsFromYdPortalProcessor starts');
|
||||
(App()->make(FetchPackingListsFromYdPortalProcessor::class))->execute();
|
||||
Log::info('FetchContainersFromYdPortalProcessor starts');
|
||||
(App()->make(FetchContainersFromYdPortalProcessor::class))->execute();
|
||||
Log::info('FetchContainersUpdatesFromYdPortalProcessor starts');
|
||||
(App()->make(FetchContainersUpdatesFromYdPortalProcessor::class))->execute();
|
||||
Log::info('FetchDeliveryUpdatesFromYdPortalProcessor starts');
|
||||
(App()->make(FetchDeliveryUpdatesFromYdPortalProcessor::class))->execute();
|
||||
Log::info('FetchOrdersFromYDPortalJob ends');
|
||||
// (App()->make(FetchOrderListsFromYdPortalProcessor::class))->execute();
|
||||
|
||||
// (App()->make(FetchOrderListsFromYdPortalProcessor::class))->execute();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -36,8 +36,6 @@ use App\Models\User;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class CreateCustomerLogic extends AbstractControllerLogic
|
||||
{
|
||||
@@ -169,19 +167,6 @@ class CreateCustomerLogic extends AbstractControllerLogic
|
||||
CreatePerfexCRMCustomer::dispatch($createLeadPerfexCRMObject);
|
||||
}
|
||||
|
||||
if(app()->environment(['production'])){
|
||||
// call wac webhook
|
||||
$url = config('wagWebhookUrl.account_registration_url');
|
||||
$payload = [
|
||||
'name' => $request->input('name'),
|
||||
'email' => $request->input('email'),
|
||||
'phone' => $request->input('phone'),
|
||||
'portal' => 'izyim'
|
||||
];
|
||||
$response = Http::post($url, $payload);
|
||||
Log::channel('wac_webhook')->info('Register Account: ' . json_encode($response));
|
||||
}
|
||||
|
||||
// $this->generateEmailVerificationAttemptProcessor->execute($user);
|
||||
|
||||
return $this->response($this->authenticationProcessor->execute($request));
|
||||
|
||||
@@ -31,7 +31,6 @@ class ExportsPaymentTransactions implements FromQuery, WithHeadings, WithHeading
|
||||
return [
|
||||
'DocNo',
|
||||
'DocDate',
|
||||
'PaymentDate',
|
||||
'DebtorCode',
|
||||
'Ref',
|
||||
'ShipInfo',
|
||||
@@ -60,12 +59,12 @@ class ExportsPaymentTransactions implements FromQuery, WithHeadings, WithHeading
|
||||
{
|
||||
$start_date = $this->request->input('startDate', null);
|
||||
if ($start_date) {
|
||||
$start_date = Carbon::parse($start_date)->startOfDay();
|
||||
$start_date = Carbon::parse($this->request->input('startDate'))->format('Y-m-d');
|
||||
}
|
||||
|
||||
$end_date = $this->request->input('endDate', null);
|
||||
if ($end_date) {
|
||||
$end_date = Carbon::parse($end_date)->endOfDay();
|
||||
$end_date = Carbon::parse($this->request->input('endDate'))->format('Y-m-d');
|
||||
}
|
||||
|
||||
$query = Transaction::query();
|
||||
@@ -78,31 +77,30 @@ class ExportsPaymentTransactions implements FromQuery, WithHeadings, WithHeading
|
||||
$approvalStatus = ApprovalStatus::APPROVED;
|
||||
}
|
||||
|
||||
// Adjusted the query to include both types and status
|
||||
$query->whereIn('type', [TransactionType::SHIPPING_INVOICE, TransactionType::STORAGE_INVOICE])
|
||||
->where('status', $approvalStatus);
|
||||
// $query->where('type', TransactionType::SHIPPING_INVOICE)->whereIn('status', [$approvalStatus]);
|
||||
$query->whereIn('type', [TransactionType::SHIPPING_INVOICE, TransactionType::STORAGE_INVOICE])->whereIn('status', [$approvalStatus]);
|
||||
|
||||
if ($start_date && $end_date) {
|
||||
$query->whereHas('transactions', function($transaction) use ($start_date, $end_date) {
|
||||
$transaction->where('type', TransactionType::PAYMENT)
|
||||
->whereBetween('updated_at', [$start_date, $end_date]);
|
||||
});
|
||||
} elseif ($start_date) {
|
||||
if($start_date && $end_date) {
|
||||
$query->whereBetween('updated_at', [
|
||||
Carbon::parse($start_date)->format('Y-m-d 0:00:00'),
|
||||
Carbon::parse($end_date)->format('Y-m-d 23:59:59')
|
||||
]);
|
||||
}
|
||||
elseif($start_date && !$end_date) {
|
||||
$query->whereHas('transactions', function($transaction) use ($start_date) {
|
||||
$transaction->where('type', TransactionType::PAYMENT)
|
||||
->where('updated_at', '>=', $start_date);
|
||||
$transaction->where('type', TransactionType::PAYMENT)->where('updated_at', '>=', Carbon::parse($start_date)->format('Y-m-d 0:00:00'));
|
||||
});
|
||||
} elseif ($end_date) {
|
||||
|
||||
}
|
||||
elseif(!$start_date && $end_date) {
|
||||
$query->whereHas('transactions', function($transaction) use ($end_date) {
|
||||
$transaction->where('type', TransactionType::PAYMENT)
|
||||
->where('updated_at', '<=', $end_date);
|
||||
$transaction->where('type', TransactionType::PAYMENT)->where('updated_at', '>=', Carbon::parse($end_date)->format('Y-m-d 0:00:00'));
|
||||
});
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
|
||||
public function map($transaction): array
|
||||
{
|
||||
$container = $transaction->owner->containers()->first();
|
||||
@@ -144,7 +142,6 @@ class ExportsPaymentTransactions implements FromQuery, WithHeadings, WithHeading
|
||||
$rows[] = [
|
||||
$firstItem ? '<<New>>' : '',
|
||||
$transaction->created_at->format('m/d/Y H:m'),
|
||||
$transaction->transactions()->where('type', TransactionType::PAYMENT)->first()->updated_at->format('m/d/Y H:m'),
|
||||
$company->debtor,
|
||||
$order->reference,
|
||||
$order->reference,
|
||||
@@ -169,7 +166,7 @@ class ExportsPaymentTransactions implements FromQuery, WithHeadings, WithHeading
|
||||
|
||||
return [
|
||||
'<<New>>',
|
||||
$transaction->transactions()->where('type', TransactionType::PAYMENT)->first()->updated_at->format('m/d/Y H:m'),
|
||||
$transaction->created_at->format('m/d/Y H:m'),
|
||||
$company->debtor,
|
||||
$order->reference,
|
||||
$order->reference,
|
||||
|
||||
+1
-2
@@ -76,7 +76,6 @@ class FetchDeliveryUpdatesFromYdPortalProcessor
|
||||
try {
|
||||
$client = new \GuzzleHttp\Client(['cookies' => true, 'headers' => ['Cookie' => 'utc_offset=480']]);
|
||||
|
||||
Log::info('Delivery tracking sTrackingNo: '. $packingList->reference);
|
||||
$request = $client->request('get', 'https://main.universe.com.my/Tracking/User/Paging?sEcho=1&sTrackingNo='.$packingList->reference.'&sOrgId=sti', ['timeout' => 3]);
|
||||
$deliveryTracking = json_decode($request->getBody()->getContents());
|
||||
foreach (array_reverse($deliveryTracking->aaData) as $trackingRow) {
|
||||
@@ -120,7 +119,7 @@ class FetchDeliveryUpdatesFromYdPortalProcessor
|
||||
}
|
||||
|
||||
}
|
||||
Log::info('FetchDeliveryUpdatesFromYdPortalProcessor ends');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-7
@@ -138,13 +138,7 @@ class FetchPackingListsFromYdPortalProcessor
|
||||
|
||||
$receiveDate = Carbon::parse(substr(preg_replace("/[^0-9]/", "", $row->expressno), 0, 8));
|
||||
|
||||
$customerno = $row->customerno;
|
||||
// Check if $customerno contains '正确唛头YD' and extract the part after it
|
||||
if (strpos($customerno, '正确唛头YD') !== false) {
|
||||
$customerno = explode('正确唛头YD', $customerno)[1];
|
||||
}
|
||||
|
||||
$customerno = preg_split('/[-()\/]/', $customerno);
|
||||
$customerno = preg_split('(-|\(|\)|\/)', $row->customerno);
|
||||
|
||||
$orderNumber = $customerno[array_key_last($customerno)];
|
||||
$allow_contract = true;
|
||||
|
||||
@@ -34,7 +34,6 @@ use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Mccarlosen\LaravelMpdf\Facades\LaravelMpdf;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
|
||||
class CreateInvoiceTransactionProcessor
|
||||
{
|
||||
@@ -75,18 +74,6 @@ class CreateInvoiceTransactionProcessor
|
||||
*/
|
||||
public function execute(PackingList $packingList)
|
||||
{
|
||||
$ori_packing_list = $packingList;
|
||||
// call wac webhook
|
||||
$hasInvoiceCreated = Transaction::withTrashed()
|
||||
->where('type', TransactionType::SHIPPING_INVOICE)
|
||||
->where('owner_type', PackingList::class)
|
||||
->where('owner_id', $ori_packing_list->id)
|
||||
->exists();
|
||||
|
||||
if ($hasInvoiceCreated) {
|
||||
Log::channel('wac_webhook')->info('Regenerating Invoice for PackingList: ' . $ori_packing_list->id . '. No call wac api.');
|
||||
}
|
||||
|
||||
$packing_list = PackingList::where('reference', $packingList->reference)->where('type', PackingListType::SHIPPING_PACKING_LIST)->first();
|
||||
|
||||
$billable_packing_list = $packing_list->packingLists()->first();
|
||||
@@ -251,32 +238,6 @@ class CreateInvoiceTransactionProcessor
|
||||
|
||||
$this->createsTransactionDetail->execute($invoice_transaction, $object_detail);
|
||||
}
|
||||
|
||||
if (app()->environment('production') && !$hasInvoiceCreated) {
|
||||
$order = $ori_packing_list->owner;
|
||||
$companyModule = $order->companyModule;
|
||||
$company = $companyModule->company;
|
||||
$companyContact = $company->contacts()->first();
|
||||
$employee = $companyModule->employees()->first();
|
||||
|
||||
$invoiceCount = Transaction::where('type', TransactionType::SHIPPING_INVOICE)
|
||||
->where('receiver', $companyModule->id)
|
||||
->where('status', ApprovalStatus::APPROVED)
|
||||
->count();
|
||||
|
||||
$payload = [
|
||||
'name' => $employee->name,
|
||||
'email' => $employee->email,
|
||||
'phone' => $companyContact->phone,
|
||||
'order_reference' => $order->reference,
|
||||
'portal' => 'izyim',
|
||||
'invoice_count' => $invoiceCount,
|
||||
];
|
||||
|
||||
Log::channel('wac_webhook')->info('Attempt to send wac_webhook - Invoice Created: ' . json_encode($payload));
|
||||
$response = Http::post(config('wagWebhookUrl.invoice_created_url'), $payload);
|
||||
Log::channel('wac_webhook')->info('Invoice Created: ' . json_encode($response));
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
-188
@@ -1,188 +0,0 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace App\Classes\Modules\Transactions\Processors;
|
||||
|
||||
use App\Classes\Exceptions\MalformedRequestException;
|
||||
use App\Classes\Modules\Transactions\Services\FetchesTransaction;
|
||||
use App\Classes\Modules\Transactions\Services\GeneratesTransactionBillNumber;
|
||||
use App\Classes\Modules\Transactions\Services\CreatesPaymentTransaction;
|
||||
use App\Classes\Modules\Transactions\Services\CreatesTransactionDetail;
|
||||
use App\Classes\Modules\Billplzs\Services\CreatesBillplzBill;
|
||||
use App\Classes\Modules\Transactions\Services\CreatesTransactionableTransaction;
|
||||
use App\Classes\Modules\Transactions\DataTransferObjects\TransactionObject;
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use App\Classes\ValueObjects\Constants\PaymentMethodType;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\Modules\Wallets\Services\UpdatesWalletBalance;
|
||||
use App\Models\Transaction;
|
||||
use App\Models\Wallet;
|
||||
use App\Classes\Modules\Orders\Processors\UpdateDoFromVTPortalProcessor;
|
||||
use App\Classes\Modules\Orders\Processors\UpdateDoFromYDPortalProcessor;
|
||||
use App\Classes\Modules\Transactions\Services\UpdatesTransactionStatus;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
//DATE: 20240616
|
||||
//THIS IS A ONE TIME FIX PROCESSOR MEANT TO FIX A GROUP PAYMENT THAT GOT STUCK: https://izyim.cief-malaysia.com/customer/943GCC/payment-and-billing
|
||||
//TRNASACTION WITH ID: 16803
|
||||
//GROUP WITH ID: 609
|
||||
|
||||
class CreatePaymentTransactionOneTimeFixProcessor
|
||||
{
|
||||
|
||||
/** @var GeneratesTransactionBillNumber */
|
||||
private $generatesTransactionBillNumber;
|
||||
|
||||
/** @var CreatesPaymentTransaction */
|
||||
private $createsPaymentTransaction;
|
||||
|
||||
/** @var CreatesBillplzBill */
|
||||
private $createsBillplzBill;
|
||||
|
||||
/** @var CreatesTransactionableTransaction */
|
||||
private $createsTransactionableTransaction;
|
||||
|
||||
/** @var UpdatesWalletBalance */
|
||||
private $updatesWalletBalance;
|
||||
|
||||
/** @var UpdateDoFromVTPortalProcessor */
|
||||
private $updateDoFromVTPortalProcessor;
|
||||
|
||||
/** @var UpdateDoFromYDPortalProcessor */
|
||||
private $updateDoFromYDPortalProcessor ;
|
||||
|
||||
/** @var UpdatesTransactionStatus */
|
||||
private $updatesTransactionStatus ;
|
||||
|
||||
/**
|
||||
* @param FetchesTransaction $fetchesTransaction,
|
||||
* @param GeneratesTransactionBillNumber $generatesTransactionBillNumber,
|
||||
* @param CreatesPaymentTransaction $createsPaymentTransaction
|
||||
* @param CreatesTransactionDetail $createsTransactionDetail
|
||||
* @param CreatesBillplzBill $createsBillplzBil
|
||||
* @param CreatesTransactionableTransaction $createsTransactionableTransaction
|
||||
* @param UpdatesWalletBalance $updatesWalletBalance
|
||||
* @param UpdateDoFromVTPortalProcessor $updateDoFromVTPortalProcessor
|
||||
* @param UpdateDoFromYDPortalProcessor $updateDoFromYDPortalProcessor
|
||||
* @param UpdatesTransactionStatus $updatesTransactionStatus
|
||||
*/
|
||||
public function __construct(
|
||||
GeneratesTransactionBillNumber $generatesTransactionBillNumber,
|
||||
CreatesPaymentTransaction $createsPaymentTransaction,
|
||||
CreatesBillplzBill $createsBillplzBill,
|
||||
CreatesTransactionableTransaction $createsTransactionableTransaction,
|
||||
UpdatesWalletBalance $updatesWalletBalance,
|
||||
UpdateDoFromVTPortalProcessor $updateDoFromVTPortalProcessor,
|
||||
UpdateDoFromYDPortalProcessor $updateDoFromYDPortalProcessor,
|
||||
UpdatesTransactionStatus $updatesTransactionStatus
|
||||
)
|
||||
{
|
||||
$this->generatesTransactionBillNumber = $generatesTransactionBillNumber;
|
||||
$this->createsPaymentTransaction = $createsPaymentTransaction;
|
||||
$this->createsBillplzBill = $createsBillplzBill;
|
||||
$this->createsTransactionableTransaction = $createsTransactionableTransaction;
|
||||
$this->updatesWalletBalance = $updatesWalletBalance;
|
||||
$this->updateDoFromVTPortalProcessor = $updateDoFromVTPortalProcessor;
|
||||
$this->updateDoFromYDPortalProcessor = $updateDoFromYDPortalProcessor;
|
||||
$this->updatesTransactionStatus = $updatesTransactionStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws MalformedRequestException
|
||||
*/
|
||||
public function execute(Transaction $invoice, $payment_method, $bank_code, $date, $run = true)
|
||||
{
|
||||
$amount = $invoice->amount;
|
||||
Log::info($invoice->owner);
|
||||
$company_module = $invoice->owner->owner->companyModule()->first();
|
||||
$approvalStatus = ApprovalStatus::PENDING_SUBMISSION;
|
||||
$billNumber = $this->generatesTransactionBillNumber->execute('PYMT-');
|
||||
$payment_reference = null;
|
||||
|
||||
if ($payment_method == PaymentMethodType::PAYMENT_GATEWAY) {
|
||||
|
||||
// create billplz transaction
|
||||
$payment_method = PaymentMethodType::PAYMENT_GATEWAY;
|
||||
$billPlzBill = $this->createsBillplzBill->execute(
|
||||
$company_module->name,
|
||||
(app()->environment(['production'])) ? $company_module->employees()->first()->email : 'uldvstar@gmail.com',
|
||||
'This payment is for the invoice number . ' . $billNumber,
|
||||
$amount,
|
||||
$billNumber,
|
||||
$bank_code,
|
||||
true
|
||||
);
|
||||
|
||||
$payment_reference = $billPlzBill->id;
|
||||
}
|
||||
else if ($payment_method === PaymentMethodType::WALLET) {
|
||||
/** @var Wallet $wallet */
|
||||
$wallet = $company_module->wallets()->first();
|
||||
|
||||
|
||||
// if((float) number_format(($wallet->amount - $amount),2) < 0){
|
||||
// throw new MalformedRequestException('Insufficient wallet balance. Please Top up your wallet.');
|
||||
// }
|
||||
|
||||
$walletPaymentBillNumber = $this->generatesTransactionBillNumber->execute('PYMT-');
|
||||
|
||||
$transaction_object = new TransactionObject($walletPaymentBillNumber, TransactionType::PAYMENT, 1, $company_module->id, 1, PaymentMethodType::WALLET, $amount, $amount, 1, 1, 1, 0, 0, null, ApprovalStatus::APPROVED, [], '');
|
||||
$transaction = $this->createsTransactionableTransaction->execute($wallet, $transaction_object);
|
||||
$transaction->created_at = $date;
|
||||
$transaction->updated_at = $date;
|
||||
$transaction->save();
|
||||
|
||||
$payment_reference = $walletPaymentBillNumber;
|
||||
|
||||
$this->updatesWalletBalance->execute($wallet, ($amount * -1));
|
||||
|
||||
if($run)
|
||||
{
|
||||
$packingList = $invoice->owner;
|
||||
$order = $packingList->owner;
|
||||
$packingList->status = ApprovalStatus::APPROVED;
|
||||
$packingList->save();
|
||||
|
||||
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;
|
||||
|
||||
// update invoice to completed
|
||||
if($run){
|
||||
$this->updatesTransactionStatus->execute($invoice, ApprovalStatus::COMPLETED);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$payment_method = PaymentMethodType::CASH;
|
||||
}
|
||||
|
||||
$object = new TransactionObject(
|
||||
$billNumber,
|
||||
TransactionType::PAYMENT,
|
||||
$company_module->id,
|
||||
1,
|
||||
1,
|
||||
$payment_method,
|
||||
$amount,
|
||||
$amount,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
null,
|
||||
$approvalStatus,
|
||||
null,
|
||||
$payment_reference
|
||||
);
|
||||
|
||||
$payment_transaction = $this->createsPaymentTransaction->execute($invoice, $object);
|
||||
|
||||
return $payment_transaction;
|
||||
}
|
||||
}
|
||||
@@ -114,7 +114,7 @@ class CreatePaymentTransactionProcessor
|
||||
/** @var Wallet $wallet */
|
||||
$wallet = $company_module->wallets()->first();
|
||||
|
||||
if((float) number_format(($wallet->amount - $amount),2) < -0.01){
|
||||
if((float) number_format(($wallet->amount - $amount),2) < 0){
|
||||
throw new MalformedRequestException('Insufficient wallet balance. Please Top up your wallet.');
|
||||
}
|
||||
|
||||
|
||||
@@ -1,125 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Wac\ControllersLogic;
|
||||
|
||||
use App\Classes\Exceptions\RequestValidationException;
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\Accounts\DataTransferObjects\RegistrationObject;
|
||||
use App\Classes\Modules\Companies\DataTransferObjects\EmploymentObject;
|
||||
use App\Classes\Modules\HelpMenu\Standards\Rules\CanFetchHelpMenuQuestion;
|
||||
use App\Classes\Modules\HelpMenu\Processors\FetchFirstQuestionQAProcessor;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Http\Resources\HelpMenuQuestionResource;
|
||||
use App\Models\User;
|
||||
use ErrorException;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use App\Classes\Modules\Companies\Processors\AssignEmployeeProcessor;
|
||||
use App\Classes\Modules\Accounts\Services\CreatesUser;
|
||||
use App\Classes\ValueObjects\Constants\RoleTypes;
|
||||
|
||||
class RegisterExchangeEmailLogic extends AbstractControllerLogic
|
||||
{
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function notification(): array
|
||||
{
|
||||
return [
|
||||
'title' => 'Register Exchange Email',
|
||||
'message' => 'You have successfully registered an exchange email address'
|
||||
];
|
||||
}
|
||||
|
||||
/** @var AssignEmployeeProcessor */
|
||||
private $assignEmployeeProcessor;
|
||||
|
||||
/** @var CreatesUser */
|
||||
private $createsUser;
|
||||
|
||||
/**
|
||||
* RegisterEmailLogic constructor.
|
||||
* @param AssignEmployeeProcessor $assignEmployeeProcessor
|
||||
*/
|
||||
public function __construct(AssignEmployeeProcessor $assignEmployeeProcessor, CreatesUser $createsUser)
|
||||
{
|
||||
$this->assignEmployeeProcessor = $assignEmployeeProcessor;
|
||||
$this->createsUser = $createsUser;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return JsonResponse
|
||||
* @throws ErrorException
|
||||
*/
|
||||
public function logic(Request $request): JsonResponse
|
||||
{
|
||||
// Validate the request inputs
|
||||
$validator = Validator::make(
|
||||
$request->all(),
|
||||
[
|
||||
'izyim_email' => 'email|required',
|
||||
'exchange_email' => 'email|required',
|
||||
]
|
||||
);
|
||||
|
||||
if ($validator->fails()) {
|
||||
throw new RequestValidationException($validator->messages()->first());
|
||||
}
|
||||
|
||||
// Retrieve the validated emails from the request
|
||||
$izyimEmail = $request->input('izyim_email');
|
||||
$exchangeEmail = $request->input('exchange_email');
|
||||
|
||||
// Check if both emails are the same
|
||||
if ($izyimEmail === $exchangeEmail) {
|
||||
return response()->json([
|
||||
'message' => 'Both emails are the same.',
|
||||
'status' => 'ok',
|
||||
], 200);
|
||||
}
|
||||
|
||||
// Check if the exchange email already exists in the system
|
||||
$existingUser = User::where('email', $exchangeEmail)->first();
|
||||
if ($existingUser) {
|
||||
return response()->json([
|
||||
'message' => 'The Exchange email already exists in the system.',
|
||||
'status' => 'error',
|
||||
], 400);
|
||||
}
|
||||
|
||||
// Retrieve the izyim user
|
||||
$izyimUser = User::where('email', $izyimEmail)->first();
|
||||
if (!$izyimUser) {
|
||||
return response()->json([
|
||||
'message' => 'The Izyim email not found in system.',
|
||||
'status' => 'error',
|
||||
], 404);
|
||||
}
|
||||
|
||||
$newUser = new User();
|
||||
$newUser->name = $izyimUser->name;
|
||||
$newUser->email = $exchangeEmail;
|
||||
$newUser->password = $izyimUser->password;
|
||||
$newUser->type = RoleTypes::USER;
|
||||
$newUser->status = ApprovalStatus::APPROVED;
|
||||
$newUser->save();
|
||||
|
||||
Log::channel('wac_webhook')->info('Wac created user: ' . $exchangeEmail);
|
||||
|
||||
$companyModule = $izyimUser->companyModule->first();
|
||||
$Object = new EmploymentObject($companyModule, $newUser);
|
||||
|
||||
$this->assignEmployeeProcessor->execute($Object);
|
||||
|
||||
return response()->json([
|
||||
'message' => 'Exchange email registered successfully.',
|
||||
'status' => 'success',
|
||||
], 201);
|
||||
}
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Classes\Modules\Billplzs\Processors\CallbackBillplzProcessor;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Models\Group;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
|
||||
class FixApprovedPaymentFailedGroup extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'fix-approved-payment-failed-group';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Fix all payment is approved or completed but group failed to be updated';
|
||||
|
||||
protected $output = null;
|
||||
|
||||
protected $outputArray = [];
|
||||
|
||||
/** @var CallbackBillplzProcessor */
|
||||
private $callbackBillplzProcessor;
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(CallbackBillplzProcessor $callbackBillplzProcessor)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->callbackBillplzProcessor = $callbackBillplzProcessor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
ini_set('memory_limit', '-1');
|
||||
|
||||
$this->outputArray = [];
|
||||
$start = new Carbon();
|
||||
|
||||
$groups = Group::whereNotIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])
|
||||
->whereHas('payment', function ($query) {
|
||||
$query->whereIn('status', [2, 3]);
|
||||
})->get();
|
||||
|
||||
foreach ($groups as $group) {
|
||||
$transaction = $group->payment;
|
||||
|
||||
$response = Http::withBasicAuth(config('billplz.api_key') . ':', '')->get(config('billplz.base_url') . '/api/v3/bills/' . $transaction->payment_reference);
|
||||
|
||||
dump($transaction->payment_reference);
|
||||
|
||||
if ($response->successful()) {
|
||||
$data = $response->json();
|
||||
if ($data['paid']) {
|
||||
$status = ApprovalStatus::PENDING_VERIFICATION;
|
||||
|
||||
if ($data['state'] === 'paid') {
|
||||
$status = ApprovalStatus::APPROVED;
|
||||
}
|
||||
|
||||
$this->info(Carbon::now() . ' : Fixing ' . $transaction->payment_reference);
|
||||
$this->callbackBillplzProcessor->execute($transaction, $status);
|
||||
}
|
||||
} else {
|
||||
$this->info("billplz error</br>");
|
||||
}
|
||||
}
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
|
||||
if ($groups) {
|
||||
$this->info(Carbon::now() . ' : Done . ElapsedTime: ' . $elapsedTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Classes\Modules\PackingLists\Processors\FetchPackingListsFromYdPortalProcessor;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class FixMissingPackingList extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'fix-missing-packinglist';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Fix Missing Packinglist';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$start_date = '2024-05-05';
|
||||
$end_date = '2024-05-05';
|
||||
|
||||
$start = $start_date ? Carbon::parse($start_date) : null;
|
||||
$end = $end_date ? Carbon::parse($end_date) : null;
|
||||
|
||||
if (!$start || !$end) {
|
||||
return;
|
||||
}
|
||||
|
||||
(App()->make(FetchPackingListsFromYdPortalProcessor::class))->execute($start, $end);
|
||||
}
|
||||
}
|
||||
@@ -55,12 +55,11 @@ class OneTimeTransactionFixBillplzFailedCallback extends Command
|
||||
$this->outputArray = [];
|
||||
$start = new Carbon();
|
||||
|
||||
//Transaction fix with this one time fix command: 15205, 16803
|
||||
//This transaction, 16803 has approve payment but not its owner, shipping invoice
|
||||
$transaction = Transaction::whereIn('id', [16803])->first();
|
||||
$this->info(Carbon::now() . ' : One time fix failled callback from billplz for transaction with id 16803 cron started.');
|
||||
//This transaction, 15205 has approve payment but not its owner, shipping invoice
|
||||
$transaction = Transaction::whereIn('id', [15205])->first();
|
||||
$this->info(Carbon::now() . ' : One time fix failled callback from billplz for transaction with id 15205 cron started.');
|
||||
|
||||
if($transaction && $transaction->id == 16803){
|
||||
if($transaction && $transaction->id == 15205){
|
||||
|
||||
$status = ApprovalStatus::APPROVED;
|
||||
$this->callbackBillplzProcessor->execute($transaction, $status);
|
||||
@@ -69,6 +68,6 @@ class OneTimeTransactionFixBillplzFailedCallback extends Command
|
||||
|
||||
$end = new Carbon();
|
||||
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
||||
$this->info(Carbon::now() . ' : One time fix failled callback from billplz for transaction with id 16803 cron ended. ElapsedTime: ' . $elapsedTime);
|
||||
$this->info(Carbon::now() . ' : One time fix failled callback from billplz for transaction with id 15205 cron ended. ElapsedTime: ' . $elapsedTime);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ class SendPermitsReminderEmails extends Command
|
||||
protected function getEmailList(): array
|
||||
{
|
||||
return [
|
||||
// 'edmond.wuiming2021@gmail.com',
|
||||
'edmond.wuiming2021@gmail.com',
|
||||
'anithagurl96@gmail.com'
|
||||
];
|
||||
}
|
||||
|
||||
@@ -40,41 +40,25 @@ class ImportPermitsReminderController
|
||||
$row['reminder_date'] = $this->changeExcelDate($row['reminder_date']);
|
||||
|
||||
$validator = Validator::make($row, [
|
||||
'model' => 'required',
|
||||
// 'expiry_date' => 'required|date|after_or_equal:today',
|
||||
'expiry_date' => 'required|date',
|
||||
// 'reminder_date' => 'required|date|after_or_equal:today',
|
||||
'reminder_date' => 'required|date',
|
||||
'model' => 'required|unique:permits_reminders,model',
|
||||
'expiry_date' => 'required|date|after_or_equal:today',
|
||||
'reminder_date' => 'required|date|after_or_equal:today',
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
$row['status'] = 'failed';
|
||||
$row['message'] = $validator->errors()->all();
|
||||
|
||||
$returnArray[] = $row;
|
||||
} else {
|
||||
$existingRecord = PermitsReminder::where('model', $row['model'])->first();
|
||||
|
||||
if ($existingRecord) {
|
||||
$existingRecord->update([
|
||||
'expiry_date' => $row['expiry_date'],
|
||||
'reminder_date' => $row['reminder_date'],
|
||||
]);
|
||||
|
||||
$row['status'] = 'Updated';
|
||||
$row['message'] = 'Record has been updated';
|
||||
$returnArray[] = $row;
|
||||
} else {
|
||||
// Add to successful rows for batch insertion
|
||||
$row['created_at'] = Carbon::now();
|
||||
$row['updated_at'] = Carbon::now();
|
||||
$successRows[] = $row;
|
||||
}
|
||||
$row['created_at'] = Carbon::now();
|
||||
$row['updated_at'] = Carbon::now();
|
||||
$successRows[] = $row;
|
||||
}
|
||||
}
|
||||
|
||||
// Insert only if there are new successful rows
|
||||
if (!empty($successRows)) {
|
||||
PermitsReminder::insert($successRows);
|
||||
PermitsReminder::insert($successRows); // Insert only if there are successful rows
|
||||
}
|
||||
|
||||
$successCount = count($successRows);
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Wac;
|
||||
|
||||
use App\Classes\Modules\Wac\ControllersLogic\RegisterExchangeEmailLogic;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class RegisterExchangeEmailController
|
||||
{
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param FetchQuestionQALogic $logic
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function register(Request $request, RegisterExchangeEmailLogic $logic): JsonResponse {
|
||||
return $logic->execute($request);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -28,9 +28,7 @@ class TransactionWithStorageResource extends JsonResource
|
||||
$groupPaymentAttemptsFiltered = [];
|
||||
$group_payment_expired = null;
|
||||
$group_payment_history = null;
|
||||
$group_payment_history_query = null;
|
||||
$groupTotalAmount = 0;
|
||||
$payment_history = null;
|
||||
|
||||
if ($this->owner instanceof Transaction) {
|
||||
if ($this->owner) {
|
||||
@@ -46,8 +44,7 @@ class TransactionWithStorageResource extends JsonResource
|
||||
if($this->groups){
|
||||
$group_payment_attempts = GroupForOrderV2Resource::collection($this->groups->whereNotIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED]));
|
||||
$group_payment_expired = GroupForOrderV2Resource::collection($this->groupsWithTrashed->whereIn('status', [ApprovalStatus::EXPIRED]));
|
||||
$group_payment_history_query = $this->groups->whereIn('status', [ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::REJECTED]);
|
||||
$group_payment_history = GroupForOrderV2Resource::collection($group_payment_history_query);
|
||||
$group_payment_history = GroupForOrderV2Resource::collection($this->groups->whereIn('status', [ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::REJECTED]));
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -64,7 +61,7 @@ class TransactionWithStorageResource extends JsonResource
|
||||
}
|
||||
|
||||
$ts = $this->groups->whereIn('status', [ApprovalStatus::PENDING_VERIFICATION])->last();
|
||||
if ($ts && $group_payment_history && $group_payment_attempts) {
|
||||
if ($ts) {
|
||||
$paymentTransaction = Transaction::where('payment_reference', $ts->reference)->whereIn('status', [ApprovalStatus::PENDING_SUBMISSION])->first();
|
||||
if($paymentTransaction){
|
||||
$groupTotalAmount = (double) $this->amount;
|
||||
@@ -84,21 +81,6 @@ class TransactionWithStorageResource extends JsonResource
|
||||
}
|
||||
|
||||
|
||||
$payment_history = TransactionResource::collection($this->transactions()
|
||||
->payments()
|
||||
->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::COMPLETED, ApprovalStatus::REJECTED])
|
||||
->get());
|
||||
|
||||
//For 'Your Payment Proof' at frontend
|
||||
|
||||
if($group_payment_history_query && count($group_payment_history_query) > 0){
|
||||
if($this->getReferenceForGroupPayment($group_payment_history_query)){
|
||||
foreach ($payment_history as $item) {
|
||||
$item['payment_reference'] = $this->getReferenceForGroupPayment($group_payment_history_query);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'owner_type' => $this->owner_type,
|
||||
@@ -135,7 +117,12 @@ class TransactionWithStorageResource extends JsonResource
|
||||
->payments()->where('status', ApprovalStatus::EXPIRED)
|
||||
->get()
|
||||
),
|
||||
'payment_history' => $payment_history,
|
||||
'payment_history' => TransactionResource::collection(
|
||||
$this->transactions()
|
||||
->payments()
|
||||
->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::COMPLETED, ApprovalStatus::REJECTED])
|
||||
->get()
|
||||
),
|
||||
'remarks' => RemarkResource::collection($this->remarks),
|
||||
'packing_list_reference' => $packingListReference,
|
||||
'storages' => $this->storages ? $this->storages : null, //from middleware
|
||||
@@ -145,12 +132,4 @@ class TransactionWithStorageResource extends JsonResource
|
||||
'created_at' => Carbon::parse($this->created_at)->format('d-m-Y')
|
||||
];
|
||||
}
|
||||
|
||||
private function getReferenceForGroupPayment($groups){
|
||||
if (is_array($groups) && count($groups) > 0) {
|
||||
$firstGroup = $groups[0];
|
||||
return $firstGroup['reference'];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,12 +84,4 @@ class Group extends Model implements Documentable, Transactionable
|
||||
{
|
||||
return $this->BelongsTo(Currency::class, 'original_currency_id', 'id');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return hasOne
|
||||
*/
|
||||
public function payment()
|
||||
{
|
||||
return $this->hasOne(Transaction::class, 'payment_reference', 'reference');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,11 +130,6 @@ return [
|
||||
'path' => storage_path('logs/laravel_perfex_crm.log'),
|
||||
'level' => 'info',
|
||||
],
|
||||
'wac_webhook' => [
|
||||
'driver' => 'single',
|
||||
'path' => storage_path('logs/wac_webhook.log'),
|
||||
'level' => 'info',
|
||||
],
|
||||
],
|
||||
|
||||
];
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'account_registration_url' => 'https://wacontact.readyspace.com/rest/trigger/9fe03daf-2ace-4095-b064-601ef6d9bfe7',
|
||||
'invoice_created_url' => 'https://wacontact.readyspace.com/rest/trigger/c0d38aa7-91ac-458b-8014-cf3287a636e4',
|
||||
];
|
||||
@@ -31,6 +31,7 @@
|
||||
"vue": "^2.6.10",
|
||||
"vue-avatar": "^2.1.8",
|
||||
"vue-debounce": "^2.6.0",
|
||||
"vue-gtag": "^1.16.1",
|
||||
"vue-template-compiler": "^2.6.10",
|
||||
"vue-the-mask": "^0.11.1",
|
||||
"vuelidate": "^0.7.4",
|
||||
|
||||
Vendored
+12
-1
@@ -2,6 +2,7 @@
|
||||
/** Dependencies */
|
||||
import Vue from 'vue'
|
||||
import store from './vuex/store';
|
||||
import VueGtag from 'vue-gtag'
|
||||
|
||||
window.route = require('./general/functions/router');
|
||||
|
||||
@@ -43,7 +44,7 @@ Vue.mixin({
|
||||
route: route
|
||||
},
|
||||
mixins: [request, crudHandler]
|
||||
});
|
||||
});
|
||||
|
||||
/** Components Registrations */
|
||||
Vue.component(Avatar);
|
||||
@@ -51,6 +52,16 @@ Vue.component(Avatar);
|
||||
const files = require.context('./', true, /\.vue$/i);
|
||||
files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default));
|
||||
|
||||
// Google Analytics 4 (GA4) Integration
|
||||
Vue.use(VueGtag, {
|
||||
property: {
|
||||
id: 'G-SP04J05142',
|
||||
params: {
|
||||
user_id: store.getters.getUserId
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const app = new Vue({
|
||||
el: '#app',
|
||||
store,
|
||||
|
||||
+2
-3
@@ -116,10 +116,9 @@
|
||||
},
|
||||
sumAmount () {
|
||||
var new_object = this.selectedInvoice;
|
||||
var total = Object.keys(new_object).reduce(function(total, key) {
|
||||
return total + new_object[key].amount;
|
||||
return Object.keys(new_object).reduce(function(total, key) {
|
||||
return total + Math.round(new_object[key].amount * 100) / 100;
|
||||
}, 0).toFixed(2);
|
||||
return Math.round(total * 100) / 100;
|
||||
},
|
||||
selectedIds () {
|
||||
return this.selectedInvoice.map(s=>s.id);
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<div class="col-auto hide" v-if="$store.getters.isSuperAdmin">
|
||||
<button type="button" class="btn b-rad-none btn-danger fs-11 requestModal" data-type="deletePackingList"><i class="fa fa-times text-white fs-12"></i></button>
|
||||
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="deletePackingList">
|
||||
<delete-packinglist-form-component :data="data" :section="section"></delete-packinglist-form-component>
|
||||
<delete-packinglist-form-component :data="data"></delete-packinglist-form-component>
|
||||
</modal-component>
|
||||
<button type="button" class="btn b-rad-none btn-primary fs-11 requestModal" data-type="claimPackingList">Claim</button>
|
||||
</div>
|
||||
@@ -51,7 +51,7 @@
|
||||
<div class="btn btn-sm btn-success btn-block b-rad-none" data-dismiss="modal">Cancel</div>
|
||||
</div>
|
||||
<div class="col p-l-5">
|
||||
<div class="btn btn-sm btn-danger btn-block b-rad-none" data-dismiss="modal" @click="submit(route('api.packing_list.delete', item.id), 'delete', section, true, true)">Confirm</div>
|
||||
<div class="btn btn-sm btn-danger btn-block b-rad-none" data-dismiss="modal" @click="submit(route('api.packing_list.delete', item.id), 'delete', 'unclaimedPackingListSection', true, true)">Confirm</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -78,12 +78,6 @@
|
||||
<script>
|
||||
import componentHandler from '../../../general/mixins/componentHandler';
|
||||
export default {
|
||||
mixins: [componentHandler],
|
||||
data() {
|
||||
return {
|
||||
isLoading: false,
|
||||
section: 'unclaimedPackingListSection',
|
||||
}
|
||||
}
|
||||
mixins: [componentHandler]
|
||||
}
|
||||
</script>
|
||||
|
||||
+3
-41
@@ -92,22 +92,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row bg-white padding-5" v-if="$store.getters.isSuperAdmin">
|
||||
<div class="col-auto">
|
||||
<div class="font-heading fs-8 muted all-caps">Payment Method</div>
|
||||
<div class="font-heading fs-10">
|
||||
{{ convertPaymentMethodToText(item.payment_method) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<div class="font-heading fs-8 muted all-caps">Created At</div>
|
||||
<div class="font-heading fs-10">{{ item.created_at }}</div>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<div class="font-heading fs-8 muted all-caps">Updated At</div>
|
||||
<div class="font-heading fs-10">{{ item.updated_at }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row b-t b-grey" v-if="expandPaymentDetails">
|
||||
<div class="col bg-white padding-15">
|
||||
<!-- <div class="row align-items-end m-b-10 text-success bold">
|
||||
@@ -173,13 +157,6 @@
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="row no-margin" v-if="item.payment_method === 4 && item.payment_reference">
|
||||
<a :href="route('billplz.bill', item.payment_reference)" target="_blank">
|
||||
<div class="icon-thumbnail fs-11 text-white icon-25 bg-primary btn-rounded float-left m-r-5">
|
||||
<i class="fa fa-file-image-o fs-10"></i>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -204,27 +181,12 @@
|
||||
},
|
||||
methods: {
|
||||
clickExpand(){
|
||||
// if(this.item
|
||||
// && ((this.item.payment_method !== 5 && this. item.documents.length)
|
||||
// || (this.item.payment_method === 5 && (this.item.status === 2 || this.item.status === 3)))){
|
||||
// this.expandPaymentDetails = !this.expandPaymentDetails;
|
||||
// }
|
||||
|
||||
if(this.item){
|
||||
if(this.item
|
||||
&& ((this.item.payment_method !== 5 && this. item.documents.length)
|
||||
|| (this.item.payment_method === 5 && (this.item.status === 2 || this.item.status === 3)))){
|
||||
this.expandPaymentDetails = !this.expandPaymentDetails;
|
||||
}
|
||||
},
|
||||
convertPaymentMethodToText(number) {
|
||||
var paymentMethods = {
|
||||
1: "CASH",
|
||||
2: "CHEQUE",
|
||||
3: "BA",
|
||||
4: "WALLET",
|
||||
5: "PAYMENT_GATEWAY"
|
||||
};
|
||||
|
||||
return paymentMethods[number] || "Unknown Payment Method";
|
||||
},
|
||||
},
|
||||
mixins: [componentHandler]
|
||||
}
|
||||
|
||||
@@ -4,16 +4,6 @@
|
||||
@include('vendor/head')
|
||||
</head>
|
||||
<body class="horizontal-menu horizontal-app-menu bg-white overflow-hidden">
|
||||
<!-- Google tag (gtag.js) -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-SP04J05142"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', 'G-SP04J05142');
|
||||
</script>
|
||||
<!-- End Google Tag Manager -->
|
||||
<div id="app" style="min-height: 100%;">
|
||||
@yield('content')
|
||||
</div>
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" v-if="$store.getters.isAdmin">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<admin-payments-billing-polling-section-component></admin-payments-billing-polling-section-component>
|
||||
</div>
|
||||
|
||||
@@ -34,6 +34,8 @@ Route::group(['middleware' => 'api', 'prefix' => 'v1', 'as' => 'api.'], function
|
||||
|
||||
Route::post('/import/update-debtor/f614e339d7058904a831aad742e24d55', 'Imports\ImportUpdateDebtorController@import')->name('debtor.import');
|
||||
|
||||
Route::post('/import/upload-permits-reminder', 'Imports\ImportPermitsReminderController@import')->name('permits_reminder.upload');
|
||||
|
||||
require __DIR__ . '/company.php';
|
||||
|
||||
require __DIR__ . '/document.php';
|
||||
|
||||
@@ -12,9 +12,5 @@ Route::group(['middleware' => 'apipub', 'prefix' => 'v1', 'as' => 'apipub.'], fu
|
||||
Route::group(['prefix' => 'feedback', 'as' => 'feedback.', 'namespace' => 'HelpMenu'], function () {
|
||||
Route::post('/generate', 'GenerateFeedbackUrlController@generate')->name('feedback.url.generate');
|
||||
});
|
||||
|
||||
Route::group(['prefix' => 'wac', 'as' => 'wac.', 'namespace' => 'Wac'], function () {
|
||||
Route::post('/register-email', 'RegisterExchangeEmailController@register')->name('register_email');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -9,5 +9,3 @@ Route::group(['prefix' => 'permits-reminder', 'as' => 'permits_reminder.', 'name
|
||||
Route::post('/{id}/update', 'UpdatePermitsReminderController@update')->name('update');
|
||||
});
|
||||
|
||||
Route::post('/import/upload-permits-reminder', 'Imports\ImportPermitsReminderController@import')->name('permits_reminder.upload');
|
||||
|
||||
|
||||
@@ -34,7 +34,6 @@ use Carbon\Carbon;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Crypt;
|
||||
use App\Models\Container;
|
||||
use App\Models\Group;
|
||||
use App\Models\Transaction;
|
||||
use App\Models\Wallet;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
@@ -1272,8 +1271,6 @@ Route::get('/payment-and-billing-2', function () {
|
||||
|
||||
Route::get('/show-all-extra-payments', function () {
|
||||
ini_set('memory_limit', '-1');
|
||||
ini_set('max_execution_time', 0);
|
||||
$transactionCounter = 0;
|
||||
|
||||
$invoices = Transaction::where('type', TransactionType::SHIPPING_INVOICE)
|
||||
->where('status', ApprovalStatus::COMPLETED)
|
||||
@@ -1303,7 +1300,6 @@ Route::get('/show-all-extra-payments', function () {
|
||||
if (($paidAmount <= $invoice->amount) || ($paidAmount - $invoice->amount < 0.01)) {
|
||||
continue;
|
||||
}
|
||||
$transactionCounter += 1;
|
||||
|
||||
echo '<tr>';
|
||||
echo '<td>' . $invoice->type . '</td>';
|
||||
@@ -1314,35 +1310,8 @@ Route::get('/show-all-extra-payments', function () {
|
||||
echo '</tr>';
|
||||
}
|
||||
echo '</table>';
|
||||
|
||||
echo'<br> Total: ' . $transactionCounter;
|
||||
});
|
||||
|
||||
Route::get('/segments', function (Request $request) {
|
||||
return view('pages.segments.index');
|
||||
})->name('segments');
|
||||
|
||||
Route::get('/group-transaction-with-completed-payments', function () {
|
||||
$groups = Group::whereNotIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])
|
||||
->whereHas('payment', function ($query) {
|
||||
$query->whereIn('status', [2, 3]);
|
||||
})->get();
|
||||
|
||||
foreach ($groups as $group) {
|
||||
$groupPayment = $group->payment;
|
||||
$order = $group->groupTransactions->first()->transaction->owner->owner;
|
||||
$companyModule = $order->companyModule;
|
||||
|
||||
$connection = $companyModule->connections()->first();
|
||||
$companyMarking = $connection ? $connection->invitee_reference : '';
|
||||
|
||||
dump([
|
||||
'reference' => $group->reference,
|
||||
'groupPayment_id' => $groupPayment->id,
|
||||
'groupPayment_status' => $groupPayment->status,
|
||||
'order' => $order->reference,
|
||||
'companyMarking' => $companyMarking,
|
||||
]);
|
||||
echo '<tr><td><a target="_blank" href="' . route('customer.payment-and-billing', $companyMarking) . '">' . $companyMarking . '</a><br></td></tr>';
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user