Compare commits

...

67 Commits

Author SHA1 Message Date
Dillon Ngo 359eba36e3 Laravel Vapor - Attempt to solve random downloading of 0KB pdf files when using docker 2024-01-04 03:38:32 +08:00
Dillon Ngo 8a99ceda4c Merge branch 'dillon/51-vue-polling-experimental-2' into dillon/34-jenkins-vapor 2024-01-04 03:03:17 +08:00
Dillon Ngo c81863811e Merge branch 'dillon/51-vue-polling-experimental-2' into dillon/34-jenkins-vapor 2024-01-03 05:40:16 +08:00
Dillon Ngo bbf61b757d Laravel Vapor - Version 2 of Commands, fix syntax inaccurate 2024-01-02 03:07:04 +08:00
Dillon Ngo f05bd50991 Laravel Vapor - Change to use private repository with Amazon Elastic Container Registry 2024-01-01 05:00:21 +08:00
Dillon Ngo 4504bf5eb0 Laravel Vapor - Change to use private repository with Amazon Elastic Container Registry 2024-01-01 04:52:23 +08:00
Dillon Ngo 9ecf0e5c9e Laravel Vapor - Change to use private repository with Amazon Elastic Container Registry 2024-01-01 04:48:17 +08:00
Dillon Ngo 2c5b9e55c5 Laravel Vapor - Change to use private repository with Amazon Elastic Container Registry 2024-01-01 04:19:01 +08:00
Dillon Ngo 9b61470d95 Laravel Vapor - Change to use private repository with Amazon Elastic Container Registry 2024-01-01 04:14:24 +08:00
Dillon Ngo ac3f4ce71f Laravel Vapor - Test run command to do housekeeping as part of deployment process 2023-12-31 22:15:36 +08:00
Dillon Ngo 1c9ce1510d Laravel Vapor - Test run command to do housekeeping as part of deployment process 2023-12-31 21:48:29 +08:00
Dillon Ngo 318995e42b Laravel Vapor - Test run command to do housekeeping as part of deployment process 2023-12-31 21:28:05 +08:00
Dillon Ngo 5a3e015b6d Laravel Vapor - Test run command to do housekeeping as part of deployment process 2023-12-31 21:08:45 +08:00
Dillon Ngo 3021ed49cd Laravel Vapor - Test run command to do housekeeping as part of deployment process 2023-12-31 05:15:08 +08:00
Dillon Ngo 45151688c9 Laravel Vapor - Test run command to do housekeeping as part of deployment process 2023-12-31 05:04:47 +08:00
Dillon Ngo 97dc8d7b68 Laravel Vapor - Fix error 400 with any api call (long term solution) 2023-12-30 19:27:05 +08:00
Dillon Ngo bfa5cee44e Merge branch 'dillon/51-vue-polling-experimental-2' into dillon/34-jenkins-vapor 2023-12-30 19:14:02 +08:00
Dillon Ngo 6ad2427989 Laravel Vapor - Fix error 400 with any api call 2023-12-30 00:28:29 +08:00
Dillon Ngo 783b7d2b91 Laravel Vapor - Fix error 400 with any api call 2023-12-30 00:12:09 +08:00
Dillon Ngo e8f5a803a6 Laravel Vapor - Sync code from exchange, dynamic path upload of documents to S3 bucket 2023-12-29 23:15:59 +08:00
Dillon Ngo 6e3286c29a Laravel Vapor - Undo Api Gateway version 2 2023-12-28 15:06:11 +08:00
Dillon Ngo 6d029e3fde Laravel Vapor - Reinstate Api Gateway version 2 2023-12-28 14:58:26 +08:00
Dillon Ngo 3ab0224094 Laravel Vapor - Reinstate Api Gateway version 2 2023-12-28 14:41:34 +08:00
Dillon Ngo b0d40591b8 Laravel Vapor - Undo Api Gateway version 2 2023-12-28 14:06:53 +08:00
Dillon Ngo 5e2b011aca Laravel Vapor - Fix missing static images 2023-12-28 13:44:01 +08:00
Dillon Ngo 1facf73c05 Laravel Vapor - Fix missing static images 2023-12-28 13:13:37 +08:00
Dillon Ngo 9882f6f634 Version 2 of Commands for Laravel Vapor 2023-12-28 02:39:22 +08:00
Dillon Ngo 69c26af01b Version 2 of Commands for Laravel Vapor 2023-12-28 02:14:17 +08:00
Dillon Ngo 2ae3ac1c59 Version 2 of Commands for Laravel Vapor 2023-12-28 02:09:42 +08:00
Dillon Ngo 52acd4c69d Version 2 of Commands for Laravel Vapor 2023-12-28 01:58:49 +08:00
Dillon Ngo c80c59aadf testing schedule tasks 2023-12-26 19:39:47 +08:00
Dillon Ngo 921f500fcd Trigger deployment 2023-12-26 04:37:24 +08:00
Dillon Ngo 3880dbd616 Merge branch 'dillon/51-vue-polling-experimental-2' into dillon/34-jenkins-vapor 2023-12-26 04:22:11 +08:00
Dillon Ngo add6de3410 Merge branch 'dillon/51-vue-polling-experimental-2' into dillon/34-jenkins-vapor 2023-12-24 22:05:57 +08:00
Dillon Ngo 12da4b4e60 testing multiple queue in sqs 2023-12-23 03:40:16 +08:00
Dillon Ngo 0ab6d2f38e testing multiple queue in sqs 2023-12-23 03:30:34 +08:00
Dillon Ngo c0368bfd19 testing multiple queue in sqs 2023-12-23 03:20:32 +08:00
Dillon Ngo eab11fa7f2 testing multiple queue in sqs 2023-12-23 02:50:27 +08:00
Dillon Ngo 328d61d044 testing multiple queue in sqs 2023-12-23 02:25:06 +08:00
Dillon Ngo ce76544ac1 testing multiple queue in sqs 2023-12-23 02:10:08 +08:00
Dillon Ngo 1d49d25f98 testing multiple queue in sqs 2023-12-23 01:56:21 +08:00
Dillon Ngo 570b6e53cc testing multiple queue in sqs 2023-12-23 01:31:41 +08:00
Dillon Ngo 7b6da3d13a Set api gateway to version 2 to see if there is any performance improvement + new certificate for ap-southeast-1 2023-12-22 16:11:45 +08:00
Dillon Ngo 28aabea1cf Set api gateway to version 2 to see if there is any performance improvement 2023-12-20 18:50:11 +08:00
Dillon Ngo a840c8b172 Increase memory to see if there is any performance improvement 2023-12-20 18:26:19 +08:00
Dillon Ngo 2bff13537d Increase memory to see if there is any performance improvement 2023-12-20 18:11:00 +08:00
Dillon Ngo b4477c5925 Increase memory to see if there is any performance improvement 2023-12-20 17:40:17 +08:00
Dillon Ngo ede9712513 Debug 2023-12-20 17:18:25 +08:00
Dillon Ngo 7157ce169a Fix typo 2023-12-20 16:22:28 +08:00
Dillon Ngo 937b70530c Merge branch 'dillon/51-vue-polling-experimental-1' into dillon/34-jenkins-vapor 2023-12-20 15:07:10 +08:00
Dillon Ngo 96796850b6 Merge branch 'dillon/51-vue-polling-experimental-1' into dillon/34-jenkins-vapor 2023-12-17 17:25:06 +08:00
Dillon Ngo bb79903eb9 Setup development.portal.izyim.com 2023-12-16 20:30:10 +08:00
Dillon Ngo c7644b5f25 Setup dev.portal.izyim.com 2023-12-16 20:10:48 +08:00
Dillon Ngo 9f601a2ce1 Setup dev.portal.izyim.com 2023-12-16 20:03:10 +08:00
Dillon Ngo ffef6356f9 Setup dev.portal.izyim.com 2023-12-16 19:57:17 +08:00
Dillon Ngo 826d7288a0 Trigerring deployment 2023-12-10 23:39:42 +08:00
Dillon Ngo 4cf18d42ed Jenkinsfile update to cater for Multibranch deployment through Jenkins + staging.portal.izyim.com setup 2023-11-27 12:17:44 +08:00
Dillon Ngo 1f11ad0a09 Jenkinsfile update to cater for Multibranch deployment through Jenkins + staging.portal.izyim.com setup 2023-11-27 12:01:30 +08:00
Dillon Ngo c95b82520a Jenkinsfile update to cater for Multibranch deployment through Jenkins + staging.portal.izyim.com setup 2023-11-27 11:48:47 +08:00
Dillon Ngo 7435ad9c4a Jenkinsfile update to cater for Multibranch deployment through Jenkins + staging.portal.izyim.com setup 2023-11-27 11:46:21 +08:00
Dillon Ngo f06019d2b5 Update domain to production.portal.izyim.com 2023-11-22 15:08:40 +08:00
Dillon Ngo 52d9a6de14 Test deployment 2023-10-21 07:56:50 +08:00
Dillon Ngo 50c4ff7388 Fix error from Jenkins deployment 2023-10-21 07:18:56 +08:00
Dillon Ngo a50a0961bf Test deployment 2023-10-21 07:04:46 +08:00
Dillon 5208c654ad Jenkins Vapor initial commit 2023-09-26 20:35:53 +08:00
Dillon 883afbe04f Jenkins Vapor initial commit 2023-09-26 20:27:20 +08:00
Dillon 16c45a36d2 Jenkins Vapor initial commit 2023-09-26 20:24:15 +08:00
87 changed files with 2323 additions and 130 deletions
+3
View File
@@ -59,3 +59,6 @@ YD_API_CODE=''
PERFEXCRM_BASE_URL=""
PERFEXCRM_API_KEY=""
PERFEXCRM_IS_ENABLED="false"
LARAVEL_VAPOR_ENABLED=false
COMMANDS_V2_ENABLED=false
+4
View File
@@ -25,3 +25,7 @@ package-lock.json
public/*
/public/*
storage/framework/laravel-excel/*
.vapor/
.env.production
.env.staging
.env.development
Vendored
+115
View File
@@ -0,0 +1,115 @@
// Webhook + Gitlab git pull + Vapor
// def payload = readJSON text: "${payload}"
// String userName = payload.user_name
// String userEmail = payload.user_email
// String httpUrl = payload.project.http_url
pipeline {
agent {
docker {
args '--group-add 992 -v /var/run/docker.sock:/var/run/docker.sock'
image '303644228504.dkr.ecr.ap-southeast-1.amazonaws.com/jenkins-pipeline-agent:latest'
registryCredentialsId "ecr:ap-southeast-1:aws-ec2-instance-iam-role"
registryUrl "https://303644228504.dkr.ecr.ap-southeast-1.amazonaws.com"
}
}
environment {
HOME = '.'
}
stages {
stage('Download source code from Git') {
steps {
script{
currentBuild.description = 'Step 1 of 6 Completed'
switch(GIT_BRANCH) {
case "vapor/production":
case "vapor/staging":
case "vapor/development":
git(
url: 'https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git',
credentialsId: 'gitlab-jenkins-localhost',
branch: GIT_BRANCH
)
case "origin/dillon/34-jenkins-vapor":
git(
url: 'https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git',
credentialsId: 'gitlab-jenkins-localhost',
branch: 'dillon/34-jenkins-vapor'
)
break
}
currentBuild.description = 'Step 2 of 6 Completed'
}
}
}
stage('Install') {
steps {
sh 'composer update'
script{
currentBuild.description = 'Step 3 of 6 Completed'
}
}
}
stage('Tests') {
steps {
sh 'vendor/bin/phpunit tests/Unit'
script{
currentBuild.description = 'Step 4 of 6 Completed'
}
}
}
stage('Deploy') {
steps {
script{
String gitCommitMessage = getCommitMessage()
println("GIT CommitMessage: " + gitCommitMessage)
println("GIT GIT_BRANCH: " + GIT_BRANCH)
switch(GIT_BRANCH) {
case "vapor/production":
sh "vendor/bin/vapor deploy production --message='${gitCommitMessage}'"
break
case "vapor/staging":
sh "vendor/bin/vapor deploy staging --message='${gitCommitMessage}'"
break
case "vapor/development":
sh "vendor/bin/vapor deploy development --message='${gitCommitMessage}'"
break
case "origin/dillon/34-jenkins-vapor":
sh "vendor/bin/vapor deploy development --message='${gitCommitMessage}'"
break
}
currentBuild.description = 'Step 5 of 6 Completed'
}
}
}
stage('Cleanup') {
steps {
script {
try {
sh 'docker image prune -a -f'
} catch (Exception e) {
echo "Error during cleanup: ${e.message}"
}
currentBuild.description = 'Step 6 of 6 Completed'
}
}
}
}
}
@NonCPS
String getCommitMessage(){
commitMessage = " "
for ( changeLogSet in currentBuild.changeSets){
for (entry in changeLogSet.getItems()){
commitMessage = entry.msg
}
}
return commitMessage
}
+8
View File
@@ -49,4 +49,12 @@ class Helper
static function collectionResponse(ResourceCollection $collection){
return json_decode($collection->response()->getContent(), true);
}
/**
* @param null|string $json
* @return array
*/
static function deserializeFilters(?string $json): array {
return $json !== null ? collect(json_decode($json))->toArray() : [];
}
}
@@ -0,0 +1,46 @@
<?php
namespace App\Classes\Jobs\Commands\V2;
use Carbon\Carbon;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Log;
use App\Classes\Modules\Transactions\Processors\ApproveShippingInvoiceTransactionProcessor;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\TransactionType;
use App\Models\Transaction;
use Exception;
class ApproveInvoiceV2CommandJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public function handle()
{
Log::info(Carbon::now() . ': Start job - Approve Invoice Command.');
$start = new Carbon();
$invoices = Transaction::where('type', TransactionType::SHIPPING_INVOICE)->where('status', ApprovalStatus::PENDING_SUBMISSION)->get();
foreach ($invoices as $invoice) {
$packingList = $invoice->owner;
$order = $packingList->owner;
try {
(App()->make(ApproveShippingInvoiceTransactionProcessor::class))->execute($packingList);
Log::info('Invoice Approved for reference ' . $order->reference . '.');
} catch (Exception $exception) {
Log::info('Failed to Approve invoice for reference ' . $order->reference . '. Exception: ' . $exception->getMessage());
}
}
$end = new Carbon();
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
Log::info(Carbon::now() . ': End job - Approve Invoice Command. ElapsedTime: ' . $elapsedTime . '.');
}
}
@@ -0,0 +1,53 @@
<?php
namespace App\Classes\Jobs\Commands\V2;
use Carbon\Carbon;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\PaymentMethodType;
use App\Classes\ValueObjects\Constants\TransactionType;
use App\Models\Transaction;
use Illuminate\Support\Facades\Log;
class AuditBillplzInvoiceV2CommandJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public function handle()
{
Log::info(Carbon::now() . ': Start job - Audit Billplz Invoice.');
$start = new Carbon();
// ini_set('memory_limit', '-1');
$transactions = Transaction::where('type', TransactionType::SHIPPING_INVOICE)->where('status', ApprovalStatus::COMPLETED)->whereHas('transactions', function($query){
return $query->where('type', TransactionType::PAYMENT)->where('payment_method', PaymentMethodType::PAYMENT_GATEWAY)->where('status', ApprovalStatus::REJECTED);
})->get();
$totalTransactions = count($transactions);
$counter = 1;
$totalAmount = 0;
foreach ($transactions as $transaction){
$payment_transaction = $transaction->transactions->sortByDesc('created_at')->first();
if ($payment_transaction->status === ApprovalStatus::REJECTED) {
Log::info($counter . ' of ' . $totalTransactions . '. Order Marking: '. $payment_transaction->owner->owner->owner->reference . '. Transaction Id: '. $payment_transaction->id . '. Invoice Id: '. $transaction->id . ' - Date: '.$payment_transaction->created_at->format('d-m-Y').' - Amount: '. $payment_transaction->amount);
$totalAmount += $transaction->amount;
$counter++;
}
}
$end = new Carbon();
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
Log::info(Carbon::now() . ': End job - Audit Billplz Invoice. ElapsedTime: ' . $elapsedTime . '. Total: ' . $totalAmount);
}
}
@@ -0,0 +1,55 @@
<?php
namespace App\Classes\Jobs\Commands\V2;
use Carbon\Carbon;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\PaymentMethodType;
use App\Classes\ValueObjects\Constants\TransactionType;
use App\Models\Transaction;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;
class AuditBillplzPaymentV2CommandJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public function handle()
{
Log::info(Carbon::now() . ': Start job - Audit Billplz Payment.');
$start = new Carbon();
// ini_set('memory_limit', '-1');
$transactions = Transaction::where('type', TransactionType::PAYMENT)->where('payment_method', PaymentMethodType::PAYMENT_GATEWAY)->whereIn('status', [ApprovalStatus::COMPLETED, ApprovalStatus::APPROVED])->get();
$totalTransactions = count($transactions);
$counter = 1;
$totalAmount = 0;
foreach ($transactions as $transaction){
$response = Http::withBasicAuth(config('billplz.api_key').':', '')->get(config('billplz.base_url').'/api/v3/bills/'.$transaction->payment_reference);
if($response->successful()){
$data = $response->json();
if($data['paid']){
} else {
$totalAmount += $transaction->amount;
Log::info($counter . ' of ' . $totalTransactions . '. Order: '. $transaction->owner->owner->owner->reference . ' - Date: '.$transaction->owner->created_at->format('d-m-Y').' - Amount: '. $transaction->amount);
}
}else{
Log::info("billplz error</br>");
}
$counter++;
}
$end = new Carbon();
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
Log::info(Carbon::now() . ': End job - Audit Billplz Payment. ElapsedTime: ' . $elapsedTime . '. Total: ' . $totalAmount);
}
}
@@ -0,0 +1,62 @@
<?php
namespace App\Classes\Jobs\Commands\V2;
use Carbon\Carbon;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use App\Classes\Modules\PackingLists\Services\ListsPackingLists;
use App\Classes\Modules\Transactions\Processors\CreateInvoiceTransactionProcessor;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Models\Order;
use Exception;
use Illuminate\Support\Facades\Log;
class AutoGenerateInvoiceV2CommandJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public function handle()
{
Log::info(Carbon::now() . ': Start job - Auto generate invoice.');
$start = new Carbon();
$packingLists = (App()->make(ListsPackingLists::class))->execute(['does_not_have_transaction_type' => 1, 'type' => 2]);
if (count($packingLists)) {
foreach ($packingLists as $packingList) {
$order = $packingList->owner;
if (!($order instanceof Order)) {
Log::info('Failed to generate invoice for reference' . $order->reference . '. It is not an instance of Order.');
continue;
}
$companyModule = $order->companyModule;
$billingAddress = $companyModule->addresses()->where('type', \App\Classes\ValueObjects\Constants\AddressType::BILLING)->first();
$deliveryAddress = $order->addresses()->where('status', ApprovalStatus::APPROVED)->first();
$postCodes = \App\Models\SegmentConstant::whereIn('reference', ['CENTER_POSTCODE', 'OUTSTATION_POSTCODE'])->get()->pluck('value')->flatten();
if (!!$billingAddress && in_array($deliveryAddress->postcode, $postCodes->toArray())) {
try {
(App()->make(CreateInvoiceTransactionProcessor::class))->execute($packingList);
Log::info('Invoice generated for reference ' . $order->reference . '.');
} catch (Exception $exception) {
log::info('Failed to generate invoice for reference ' . $order->reference . '. Exception: ' . $exception->getMessage());
}
}
Log::info('Failed to generate invoice for reference ' . $order->reference . '. Billing Address is not defined / Postcode area is not defined.');
}
}
$end = new Carbon();
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
Log::info(Carbon::now() . ': End job - Auto generate invoice. ElapsedTime: ' . $elapsedTime . '.');
}
}
@@ -0,0 +1,63 @@
<?php
namespace App\Classes\Jobs\Commands\V2;
use Carbon\Carbon;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use App\Classes\ValueObjects\Constants\PaymentMethodType;
use App\Classes\ValueObjects\Constants\TransactionType;
use App\Models\Transaction;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;
class CheckDeletedInvoiceButPaidV2CommandJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public function handle()
{
Log::info(Carbon::now() . ': Start job - Check all deleted invoice but has completed payment.');
$start = new Carbon();
// ini_set('memory_limit', '-1');
$totalAmount = 0;
$softDeletedTransactions = Transaction::onlyTrashed()->where('type', TransactionType::SHIPPING_INVOICE)->whereHas('transactions', function (Builder $query) {
$query->where('type', TransactionType::PAYMENT)->where('payment_method', PaymentMethodType::PAYMENT_GATEWAY);
})->get();
foreach ($softDeletedTransactions as $invoice) {
$invoice_payments = $invoice->transactions()->payments()->get();
foreach($invoice_payments as $invoice_payment) {
$response = Http::withBasicAuth(config('billplz.api_key').':', '')->get(config('billplz.base_url').'/api/v3/bills/'.$invoice_payment->payment_reference);
if($response->successful()){
$data = $response->json();
$orderReference = $invoice->owner->owner->reference ?? null;
if($data['paid']){
Log::info('Invoice id: ' . $invoice->id. '. Payment id: ' . $invoice_payment->id . '. Order: ' . $orderReference);
} else {
}
}else{
Log::info("billplz error</br>");
}
}
}
$end = new Carbon();
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
Log::info(Carbon::now() . ': End job - Check all deleted invoice but has completed payment. ElapsedTime: ' . $elapsedTime . '. Total: ' . $totalAmount);
}
}
@@ -0,0 +1,48 @@
<?php
namespace App\Classes\Jobs\Commands\V2;
use Carbon\Carbon;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use App\Classes\Modules\Transactions\Services\ListsGroups;
use App\Classes\Modules\Transactions\Processors\CheckStorageInvoiceTransactionProcessor;
use App\Models\Order;
use Illuminate\Support\Facades\Log;
class CheckStorageInvoicesGroupTransactionsV2CommandJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public function handle()
{
Log::info(Carbon::now() . ': Start job - Check all pending group payment with storage invoice is valid.');
$start = new Carbon();
$newfilters['order_by_updated_at_desc'] = true;
$newfilters['status_in'] = [0, 1];
$groups = (App()->make(ListsGroups::class))->execute($newfilters);
foreach ($groups as $group){
Log::info('CheckForStorageInvoiceByTransactions group: '.json_encode($group));
foreach ($group->groupTransactions as $groupTransaction) {
$invoice = $groupTransaction->transaction;
$packingList = $invoice->owner()->first();
if($packingList){
$order = $packingList->owner()->first();
if($order instanceof Order){
$storages = (App()->make(CheckStorageInvoiceTransactionProcessor::class))->executeOrder($order);
}
}
}
}
$end = new Carbon();
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
Log::info(Carbon::now() . ': End job - Check all pending group payment with storage invoice is valid. ElapsedTime: ' . $elapsedTime . '.');
}
}
@@ -0,0 +1,45 @@
<?php
namespace App\Classes\Jobs\Commands\V2;
use Carbon\Carbon;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use App\Classes\Modules\Orders\Services\ListsOrders;
use App\Classes\Modules\Transactions\Processors\CheckStorageInvoiceTransactionProcessor;
use App\Classes\ValueObjects\Constants\OrderType;
use Illuminate\Support\Facades\Log;
class CheckStorageInvoicesOrdersV2CommandJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public function handle()
{
Log::info(Carbon::now() . ': Start job - Check all orders for storage invoice.');
$start = new Carbon();
$orders = (App()->make(ListsOrders::class))->execute(['with_parcels' => true, 'type_in' => [OrderType::SHARED_CONTAINER, OrderType::DEDICATED_CONTAINER]]);
$count = 0;
foreach ($orders as $order){
try{
$storages = (App()->make(CheckStorageInvoiceTransactionProcessor::class))->executeOrder($order);
$count = $count + 1;
Log::info('Order '.$count);
}
catch(\Exception $ex){
Log::info('Exception '.$ex->getMessage());
break;
}
}
$end = new Carbon();
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
Log::info(Carbon::now() . ': End job - Check all orders for storage invoice. ElapsedTime: ' . $elapsedTime . '.');
}
}
+29
View File
@@ -0,0 +1,29 @@
<?php
namespace App\Classes\Jobs\Commands\V2;
use Carbon\Carbon;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Log;
class DummyJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public function handle()
{
Log::info(Carbon::now() . ': Start job - Dummy.');
$start = new Carbon();
$end = new Carbon();
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
Log::info(Carbon::now() . ': End job - Dummy. ElapsedTime: ' . $elapsedTime . '.');
}
}
@@ -0,0 +1,75 @@
<?php
namespace App\Classes\Jobs\Commands\V2;
use Carbon\Carbon;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use App\Classes\Modules\Billplzs\Processors\CallbackBillplzProcessor;
use App\Classes\Modules\Billplzs\Services\GetBillplzBill;
use App\Classes\Modules\Orders\Processors\UpdateDoFromVTPortalProcessor;
use App\Classes\Modules\Orders\Processors\UpdateDoFromYDPortalProcessor;
use App\Classes\Modules\Transactions\Services\FetchesTransaction;
use App\Classes\Modules\Transactions\Services\UpdatesTransactionStatus;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\PaymentMethodType;
use App\Classes\ValueObjects\Constants\TransactionType;
use App\Models\Transaction;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;
class FixBillplzFailedCallbackPaymentV2CommandJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public function handle()
{
Log::info(Carbon::now() . ': Start job - Billplz Failled Callback.');
$start = new Carbon();
// ini_set('memory_limit', '-1');
// $this->outputArray = [];
$start = new Carbon();
$approvalStatusArray = ApprovalStatus::APPROVAL_STATUS_ID;
$transactions = Transaction::whereIn('type', [TransactionType::PAYMENT, TransactionType::TOP_UP, TransactionType::GROUP_PAYMENT])->where('payment_method', PaymentMethodType::PAYMENT_GATEWAY)->whereNotIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->get();
$totalTransactions = count($transactions);
if ($totalTransactions) {
Log::info(Carbon::now() . ' : Fix failled callback from billplz cron started.');
}
$counter = 1;
$totalAmount = 0;
foreach ($transactions as $transaction){
$response = Http::withBasicAuth(config('billplz.api_key').':', '')->get(config('billplz.base_url').'/api/v3/bills/'.$transaction->payment_reference);
if($response->successful()){
$data = $response->json();
if($data['paid']) {
$status = ApprovalStatus::PENDING_VERIFICATION;
if($data['state'] === 'paid') {
$status = ApprovalStatus::APPROVED;
}
Log::info(Carbon::now() . ' : Fixing ' . $transaction->payment_reference);
(App()->make(CallbackBillplzProcessor::class))->execute($transaction, $status);
}
}else{
Log::info("billplz error</br>");
}
$counter++;
}
$end = new Carbon();
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
Log::info(Carbon::now() . ': End job - Billplz Failled Callback. ElapsedTime: ' . $elapsedTime . '. Total: ' . $totalAmount);
}
}
@@ -0,0 +1,56 @@
<?php
namespace App\Classes\Jobs\Commands\V2;
use Carbon\Carbon;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use App\Models\Container;
use App\Models\ContainerPackingList;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
class FixDuplicateContainerReferenceV2CommandJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public function handle()
{
Log::info(Carbon::now() . ': Start job - Fix Duplicate Container Reference.');
$start = new Carbon();
// ini_set('memory_limit', '-1');
$duplicatedContainers = Container::select('reference', DB::raw('COUNT(reference) as count'))
->groupBy('reference')
->having('count', '>', 1)
->get();
foreach ($duplicatedContainers as $duplicatedContainer) {
$containers = Container::where('reference', $duplicatedContainer->reference)->get();
$containers = $containers->sortByDesc(function ($container) {
return $container->packingLists->count();
});
$firstContainer = $containers->shift();
foreach ($containers as $container) {
$firstContainer->packingLists()->syncWithoutDetaching($container->packingLists);
$container->packingLists()->detach();
Log::info('Deleted container ' . $container->id);
$container->delete();
}
}
$end = new Carbon();
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
Log::info(Carbon::now() . ': End job - Fix Duplicate Container Reference. ElapsedTime: ' . $elapsedTime . '.');
}
}
@@ -0,0 +1,78 @@
<?php
namespace App\Classes\Jobs\Commands\V2;
use Carbon\Carbon;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use App\Classes\Modules\Documents\DataTransferObjects\DocumentObject;
use App\Classes\Modules\Documents\Services\CreatesDocument;
use App\Classes\Modules\Documents\Services\CreatesFiles;
use App\Classes\Modules\Jobs\DataTransferObjects\FixInvoiceV2CommandObject;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\DocumentType;
use App\Classes\ValueObjects\Constants\TransactionType;
use App\Models\CompanyConnection;
use App\Models\Order;
use Mccarlosen\LaravelMpdf\Facades\LaravelMpdf;
use Illuminate\Support\Facades\Log;
class FixInvoiceV2CommandJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
/** @var FixInvoiceV2CommandObject*/
private $fixInvoiceV2CommandObject;
/**
* FixInvoiceV2CommandJob constructor.
* @param FixInvoiceV2CommandObject $fixInvoiceV2CommandObject
*/
public function __construct(FixInvoiceV2CommandObject $fixInvoiceV2CommandObject)
{
$this->fixInvoiceV2CommandObject = $fixInvoiceV2CommandObject;
}
public function handle()
{
Log::info(Carbon::now() . ': Start job - Fix invoice.');
$start = new Carbon();
$connection = CompanyConnection::where('invitee_reference', $this->fixInvoiceV2CommandObject->getMarking())->first();
$company_module_id = $connection->invitee->id;
$orders = Order::where('company_module_id', $company_module_id)->get();
foreach ($orders as $order){
$invoices = $order->transactions()->where('transactions.type', TransactionType::SHIPPING_INVOICE)->get();
foreach ($invoices as $invoice){
dump($invoice->id);
$invoice->documents()->delete();
$transaction_invoice_pdf = LaravelMpdf::loadView('pages.pdfs.shipping_invoice', ['invoice_transaction' => $invoice]);
$document_object = new DocumentObject(
DocumentType::SHIPPING_INVOICE,
[chunk_split('data:application/pdf;base64,'.base64_encode($transaction_invoice_pdf->output()))],
'',
ApprovalStatus::COMPLETED,
'shipping_invoice'
);
/** @var Document $document */
$document = (App()->make(CreatesDocument::class))->execute($invoice, $document_object);
(App()->make(CreatesFiles::class))->execute($document, $document_object);
}
}
$end = new Carbon();
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
Log::info(Carbon::now() . ': End job - Fix invoice. ElapsedTime: ' . $elapsedTime . '.');
}
}
@@ -0,0 +1,68 @@
<?php
namespace App\Classes\Jobs\Commands\V2;
use Carbon\Carbon;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use App\Models\PackingList;
use Illuminate\Support\Facades\Log;
class FixPackingListV2CommandJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public function handle()
{
Log::info(Carbon::now() . ': Start job - Fix PackingList.');
$start = new Carbon();
$packingLists = PackingList::whereDoesntHave('packages')->get();
if ($packingLists->isNotEmpty()) {
$restoredPackagesCount = 0;
$restoredPackagesIds = [];
// Eager loading packages for all packing lists
$packingLists->load(['packages' => function ($query) {
$query->onlyTrashed();
}]);
foreach ($packingLists as $packingList) {
$deletedPackages = $packingList->packages->filter(function ($package) use ($restoredPackagesIds) {
// Filter out packages that have already been restored
return !in_array($package->id, $restoredPackagesIds);
});
if ($deletedPackages->isNotEmpty()) {
$groupedPackages = $deletedPackages->groupBy(function ($item) {
return $item->only(['type', 'description', 'width', 'height', 'length', 'weight', 'quantity']);
});
foreach ($groupedPackages as $group) {
$latestPackage = $group->sortByDesc('created_at')->first();
// Check if the package ID is already restored before attempting to restore it
if (!in_array($latestPackage->id, $restoredPackagesIds)) {
$latestPackage->restore();
Log::info('Package ID: ' . $latestPackage->id . ' has been restored');
$restoredPackagesCount++;
$restoredPackagesIds[] = $latestPackage->id;
}
}
}
}
Log::info('Restored Packages Count: ' . $restoredPackagesCount);
}
$end = new Carbon();
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
Log::info(Carbon::now() . ': End job - Fix PackingList. ElapsedTime: ' . $elapsedTime . '.');
}
}
@@ -0,0 +1,44 @@
<?php
namespace App\Classes\Jobs\Commands\V2;
use Carbon\Carbon;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use App\Classes\Notifications\ShipmentDepartureEmail;
use App\Models\Order;
use App\Models\Container;
use Illuminate\Support\Facades\Log;
class SendContainerDepartureEmailV2CommandJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public function handle()
{
Log::info(Carbon::now() . ': Start job - Send Container Departure Email.');
$start = new Carbon();
$containers = Container::whereHas('transports', function ($transport){
return $transport->whereDate('dispatch_date', '=', Carbon::today());
})->get();
foreach ($containers as $container){
foreach ($container->packingLists as $packingList){
if(!($packingList->owner instanceof Order)) continue;
$user = $packingList->owner->companyModule->employees()->first();
if(app()->environment(['production'])) {
$user->notify(new ShipmentDepartureEmail($user, $packingList));
}
}
}
$end = new Carbon();
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
Log::info(Carbon::now() . ': End job - Send Container Departure Email. ElapsedTime: ' . $elapsedTime . '.');
}
}
@@ -0,0 +1,57 @@
<?php
namespace App\Classes\Jobs\Commands\V2;
use App\Classes\Modules\Jobs\DataTransferObjects\ShowBillplzPaymentStatusV2CommandObject;
use Carbon\Carbon;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;
class ShowBillplzPaymentStatusV2CommandJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
/** @var ShowBillplzPaymentStatusV2CommandObject*/
private $showBillplzPaymentStatusV2CommandObject;
/**
* ShowBillplzPaymentStatusV2CommandJob constructor.
* @param ShowBillplzPaymentStatusV2CommandObject $showBillplzPaymentStatusV2CommandObject
*/
public function __construct(ShowBillplzPaymentStatusV2CommandObject $showBillplzPaymentStatusV2CommandObject)
{
$this->showBillplzPaymentStatusV2CommandObject = $showBillplzPaymentStatusV2CommandObject;
}
public function handle()
{
Log::info(Carbon::now() . ': Start job - Show Billplz payment status.');
$start = new Carbon();
// ini_set('memory_limit', '-1');
$billplz_id = $this->showBillplzPaymentStatusV2CommandObject->getBillplzId();
$billplz_id = explode(",", $billplz_id);
foreach ($billplz_id as $payment) {
$response = Http::withBasicAuth(config('billplz.api_key').':', '')->get(config('billplz.base_url').'/api/v3/bills/'.$payment);
if($response->successful()){
$data = $response->json();
dump($data);
}else{
Log::info("billplz error</br>");
}
}
$end = new Carbon();
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
Log::info(Carbon::now() . ': End job - Show Billplz payment status. ElapsedTime: ' . $elapsedTime . '.');
}
}
@@ -0,0 +1,63 @@
<?php
namespace App\Classes\Jobs\Commands\V2;
use Carbon\Carbon;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\PaymentMethodType;
use App\Classes\ValueObjects\Constants\TransactionType;
use App\Models\Transaction;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;
class ShowFailediBllplzCallbackV2CommandJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public function handle()
{
Log::info(Carbon::now() . ': Start job - Show all failled callback from billplz.');
$start = new Carbon();
// ini_set('memory_limit', '-1');
$transactions = Transaction::whereIn('type', [TransactionType::PAYMENT, TransactionType::TOP_UP, TransactionType::GROUP_PAYMENT])->where('payment_method', PaymentMethodType::PAYMENT_GATEWAY)->whereNotIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->get();
$totalTransactions = count($transactions);
if ($totalTransactions) {
Log::info(Carbon::now() . ' totalTransactions : ' . $totalTransactions);
}
$counter = 1;
$totalAmount = 0;
foreach ($transactions as $transaction){
$response = Http::withBasicAuth(config('billplz.api_key').':', '')->get(config('billplz.base_url').'/api/v3/bills/'.$transaction->payment_reference);
if($response->successful()){
$data = $response->json();
if($data['paid']){
dump($transaction->payment_reference);
dump($transaction->id);
}
}else{
Log::info("billplz error</br>");
}
$counter++;
}
// if ($totalTransactions) {
// Log::info(Carbon::now() . ' : Done Billplz Failled Callback. ElapsedTime: ' . $elapsedTime . '. Total: ' . $totalAmount);
// }
$end = new Carbon();
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
Log::info(Carbon::now() . ': End job - Show all failled callback from billplz. ElapsedTime: ' . $elapsedTime . '. Total: ' . $totalAmount);
}
}
@@ -0,0 +1,82 @@
<?php
namespace App\Classes\Jobs\Commands\V2;
use Carbon\Carbon;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\PaymentMethodType;
use App\Classes\ValueObjects\Constants\TransactionType;
use App\Models\Order;
use App\Models\Transaction;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;
class ShowFixBillplzFailedCallbackPaymentV2CommandJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public function handle()
{
Log::info(Carbon::now() . ': Start job - Show Billplz Failled Callback.');
$start = new Carbon();
// ini_set('memory_limit', '-1');
// $this->outputArray = [];
$approvalStatusArray = ApprovalStatus::APPROVAL_STATUS_ID;
$transactions = Transaction::where('type', TransactionType::PAYMENT)->where('payment_method', PaymentMethodType::PAYMENT_GATEWAY)->whereNotIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->get();
$totalTransactions = count($transactions);
$counter = 1;
$totalAmount = 0;
foreach ($transactions as $transaction){
$response = Http::withBasicAuth(config('billplz.api_key').':', '')->get(config('billplz.base_url').'/api/v3/bills/'.$transaction->payment_reference);
if($response->successful()){
$data = $response->json();
if($data['paid']){
$totalAmount += $transaction->amount;
$invoiceStatus = null;
switch($transaction->owner->status) {
case 3:
$invoiceStatus = 'Payment Completed';
break;
case 5:
$invoiceStatus = 'Dispute in progress';
break;
case 6:
$invoiceStatus = 'Cancelled Invoice';
break;
default:
$invoiceStatus = 'Pending Payment';
}
$order = $transaction->owner->owner->owner;
if(!$order instanceof Order) {
Log::info("Error transaction id:" . $transaction->id . 'Type: ' . get_class($order));
} else {
Log::info($counter . ' of ' . $totalTransactions . '. Order: '. $order->reference . ' - Date: '.$transaction->owner->created_at->format('d-m-Y').' - Amount: '. $transaction->amount . '. Status: ' . $approvalStatusArray[$transaction->status] . '. Invoice Status: ' . $invoiceStatus);
}
} else {
// $totalAmount += $transaction->amount;
// $this->appendToOutput($counter . ' of ' . $totalTransactions . '. Order: '. $transaction->owner->owner->owner->reference . ' - Date: '.$transaction->owner->created_at->format('d-m-Y').' - Amount: '. $transaction->amount);
}
}else{
Log::info("billplz error</br>");
}
$counter++;
}
$end = new Carbon();
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
Log::info(Carbon::now() . ': End job - Show Billplz Failled Callback. ElapsedTime: ' . $elapsedTime . '. Total: ' . $totalAmount);
}
}
@@ -0,0 +1,88 @@
<?php
namespace App\Classes\Jobs\Commands\V2;
use Carbon\Carbon;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use App\Classes\Modules\Billplzs\Services\GetBillplzBill;
use App\Classes\Modules\Orders\Processors\UpdateDoFromVTPortalProcessor;
use App\Classes\Modules\Orders\Processors\UpdateDoFromYDPortalProcessor;
use App\Classes\Modules\Transactions\Services\FetchesTransaction;
use App\Classes\Modules\Transactions\Services\UpdatesTransactionStatus;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\PaymentMethodType;
use App\Classes\ValueObjects\Constants\TransactionType;
use App\Models\Transaction;
use Illuminate\Support\Facades\Log;
class SuccessUpdatePaymentStatusV2CommandJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public function handle()
{
Log::info(Carbon::now() . ': Start job - Success Updated Payment Status.');
$start = new Carbon();
// ini_set('memory_limit', '-1');
// $this->outputArray = [];
$approvalStatusArray = ApprovalStatus::APPROVAL_STATUS_ID;
$transactions = Transaction::where('type', TransactionType::PAYMENT)
->where('payment_method', PaymentMethodType::PAYMENT_GATEWAY)
->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])
->get();
foreach ($transactions as $payment) {
$invoice = $payment->owner ?? null;
if (!$invoice) {
Log::info('Payment has no owner. Payment ID: ' . $payment->id);
continue;
}
$packingList = $invoice->owner ?? null;
if (!$packingList) {
Log::info('Invoice has no owner. Invoice ID: ' . $invoice->id);
continue;
}
$order = $packingList->owner;
if (!$invoice) {
Log::info('PackingList has no owner. PackingList ID: ' . $packingList->id);
continue;
}
if ($invoice->status == ApprovalStatus::APPROVED) {
$totalPaidAmount = $invoice->transactions->where('type', TransactionType::PAYMENT)->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->sum('amount');
if(($invoice->amount - $totalPaidAmount) < 0.01) {
(App()->make(UpdatesTransactionStatus::class))->execute($invoice, ApprovalStatus::COMPLETED);
$packingList->status = ApprovalStatus::APPROVED;
$packingList->save();
if(app()->environment('production')){
(App()->make(UpdateDoFromVTPortalProcessor::class))->execute($packingList);
(App()->make(UpdateDoFromYDPortalProcessor::class))->execute($packingList);
}
dump('Updated invoice ' . $invoice->id . '. Order: '. $order->reference);
} else {
Log::info('Failed Update invoice ' . $invoice->id . ' because payment not enough. Invoice Amount: ' . $invoice->amount . ' . Paid Amount: ' . $totalPaidAmount . ' . Order: '. $order->reference);
}
}
}
$end = new Carbon();
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
Log::info(Carbon::now() . ': End job - Success Updated Payment Status. ElapsedTime: ' . $elapsedTime . '.');
}
}
@@ -54,11 +54,20 @@ class RenderDocumentLogic extends AbstractControllerLogic
$this->canRenderDocument->passes();
if(!Storage::disk('documents')->exists($file))
{
throw new ResourceNotFoundException();
$filesystemDriver = Storage::getDefaultDriver();
if($filesystemDriver == 's3'){
if(!Storage::disk('s3')->exists($file))
{
throw new ResourceNotFoundException();
}
return $this->response(['src' => explode('.', $file)[1] == 'pdf' ? chunk_split(base64_encode(Storage::disk('s3')->get($file))) : Storage::disk('s3')->get($file) ]);
}
else{
if(!Storage::disk('documents')->exists($file))
{
throw new ResourceNotFoundException();
}
return $this->response(['src' => explode('.', $file)[1] == 'pdf' ? chunk_split(base64_encode(Storage::disk('documents')->get($file))) : Storage::disk('documents')->get($file) ]);
}
return $this->response(['src' => explode('.', $file)[1] == 'pdf' ? chunk_split(base64_encode(Storage::disk('documents')->get($file))) : Storage::disk('documents')->get($file) ]);
}
}
}
@@ -98,13 +98,17 @@ class ConvertsBase64ToFile
* @throws MalformedRequestException
*/
private function generateFile(FileObject $file, string $suffix = '') {
$filePath = $this->path.'/'.$file->getFileName().$suffix.'.'.$file->getExtension();
Storage::disk('documents')->put($filePath, $file->getDecodedData());
return $filePath;
$filesystemDriver = Storage::getDefaultDriver();
if($filesystemDriver == 's3'){
$filePath = 'documents/'.$this->path.'/'.$file->getFileName().$suffix.'.'.$file->getExtension();
Storage::put($filePath, $file->getDecodedData(), 's3');
return $filePath;
}
else{
$filePath = $this->path.'/'.$file->getFileName().$suffix.'.'.$file->getExtension();
Storage::disk('documents')->put($filePath, $file->getDecodedData());
return $filePath;
}
}
/**
@@ -0,0 +1,26 @@
<?php
namespace App\Classes\Modules\Jobs\DataTransferObjects;
use App\Classes\General\Interfaces\DataTransferObject;
class FixInvoiceV2CommandObject implements DataTransferObject
{
/** @var string */
private $marking;
public function __construct(string $marking)
{
$this->marking = $marking;
}
/**
* @return string
*/
public function getMarking(): string
{
return $this->marking;
}
}
@@ -0,0 +1,26 @@
<?php
namespace App\Classes\Modules\Jobs\DataTransferObjects;
use App\Classes\General\Interfaces\DataTransferObject;
class ShowBillplzPaymentStatusV2CommandObject implements DataTransferObject
{
/** @var string */
private $billplzId;
public function __construct(string $billplzId)
{
$this->billplzId = $billplzId;
}
/**
* @return string
*/
public function getBillplzId(): string
{
return $this->billplzId;
}
}
@@ -4,6 +4,7 @@
namespace App\Classes\Modules\PackingLists\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\General\Helper;
use App\Classes\Jobs\ListPackingListsJob;
use App\Classes\Modules\Jobs\DataTransferObjects\ListGenericJobObject;
use Illuminate\Http\JsonResponse;
@@ -64,6 +65,16 @@ class ListPackingListsJobLogic extends AbstractControllerLogic
$userInfo
);
// $filters = Helper::deserializeFilters($request->input('filters'));
// if(isset($filters['priority'])){
// if($filters['priority'] == '1'){
// ListPackingListsJob::dispatch($listGenericJobObject)->onQueue('hellokitty1'); //cief todo: testing sqs
// }
// else{
// ListPackingListsJob::dispatch($listGenericJobObject)->onQueue('hellokitty2'); //cief todo: testing sqs
// }
// }
ListPackingListsJob::dispatch($listGenericJobObject);
$result = [];
@@ -0,0 +1,43 @@
<?php
namespace App\Console\Commands\V2;
use App\Classes\Jobs\Commands\V2\ApproveInvoiceV2CommandJob;
use Illuminate\Console\Command;
class ApproveInvoiceV2Command extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'approve-invoice-command';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
ApproveInvoiceV2CommandJob::dispatch();
}
}
@@ -0,0 +1,44 @@
<?php
namespace App\Console\Commands\V2;
use App\Classes\Jobs\Commands\V2\AuditBillplzInvoiceV2CommandJob;
use Illuminate\Console\Command;
class AuditBillplzInvoiceV2Command extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'billplz-invoice-audit-command';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Check all unpaid invoice but marked paid at our system';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
AuditBillplzInvoiceV2CommandJob::dispatch();
}
}
@@ -0,0 +1,43 @@
<?php
namespace App\Console\Commands\V2;
use App\Classes\Jobs\Commands\V2\AuditBillplzPaymentV2CommandJob;
use Illuminate\Console\Command;
class AuditBillplzPaymentV2Command extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'billplz-payment-audit-command';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Check all failed payment in billplz, but marked at success at our system';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
AuditBillplzPaymentV2CommandJob::dispatch();
}
}
@@ -0,0 +1,43 @@
<?php
namespace App\Console\Commands\V2;
use App\Classes\Jobs\Commands\V2\AutoGenerateInvoiceV2CommandJob;
use Illuminate\Console\Command;
class AutoGenerateInvoiceV2Command extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'invoice-generate-command';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Auto generate invoice';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
AutoGenerateInvoiceV2CommandJob::dispatch();
}
}
@@ -0,0 +1,43 @@
<?php
namespace App\Console\Commands\V2;
use App\Classes\Jobs\Commands\V2\CheckDeletedInvoiceButPaidV2CommandJob;
use Illuminate\Console\Command;
class CheckDeletedInvoiceButPaidV2Command extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'check-deleted-paid-invoice-command';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Check all deleted invoice but has completed payment';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
CheckDeletedInvoiceButPaidV2CommandJob::dispatch();
}
}
@@ -0,0 +1,35 @@
<?php
namespace App\Console\Commands\V2;
use App\Classes\Jobs\Commands\V2\CheckStorageInvoicesGroupTransactionsV2CommandJob;
use Illuminate\Console\Command;
class CheckStorageInvoicesGroupTransactionsV2Command extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'check-storage-invoices-group-transactions-command';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Check all storage invoices due to make sure that they are up to date daily, prevent \'back door\' cases';
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
CheckStorageInvoicesGroupTransactionsV2CommandJob::dispatch();
}
}
@@ -0,0 +1,36 @@
<?php
namespace App\Console\Commands\V2;
use App\Classes\Jobs\Commands\V2\CheckStorageInvoicesOrdersV2CommandJob;
use Illuminate\Console\Command;
class CheckStorageInvoicesOrdersV2Command extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'check-storage-invoices-orders-command';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Check all storage invoices due to make sure that they are up to date daily, prevent \'back door\' cases';
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
CheckStorageInvoicesOrdersV2CommandJob::dispatch();
}
}
@@ -0,0 +1,49 @@
<?php
namespace App\Console\Commands\V2;
use Illuminate\Console\Command;
use App\Classes\Jobs\FetchLoadedContainersFromVTPortalJob;
use App\Classes\Jobs\FetchWarehouseReceiveListFromVTPortalJob;
class CurlVTV2Command extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'curl-vt-command';
// php artisan queue:work
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
return FetchWarehouseReceiveListFromVTPortalJob::withChain([
new FetchLoadedContainersFromVTPortalJob,
])->dispatch();
}
}
@@ -0,0 +1,45 @@
<?php
namespace App\Console\Commands\V2;
use App\Classes\Jobs\FetchOrdersFromYDPortalJob;
use Illuminate\Console\Command;
class CurlYdOrderListV2Command extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'curl-yd-order-list-command';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
return FetchOrdersFromYDPortalJob::withChain([])->dispatch();
}
}
+47
View File
@@ -0,0 +1,47 @@
<?php
namespace App\Console\Commands\V2;
use App\Classes\Jobs\Commands\V2\DummyJob;
use Illuminate\Console\Command;
class DummyCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'dummy-command';
/**
* The console command description.
*
* @var string
*/
protected $description = 'A test run at Laravel Vapor for schedule tasks run via dispatch a queued job';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
ini_set('memory_limit', '-1');
DummyJob::dispatch();
}
}
@@ -0,0 +1,47 @@
<?php
namespace App\Console\Commands\V2;
use App\Classes\Jobs\Commands\V2\FixBillplzFailedCallbackPaymentV2CommandJob;
use Illuminate\Console\Command;
class FixBillplzFailedCallbackPaymentV2Command extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'billplz-failed-callback-fix-command';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Fix all failled callback from billplz';
protected $output = null;
protected $outputArray = [];
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
FixBillplzFailedCallbackPaymentV2CommandJob::dispatch();
}
}
@@ -0,0 +1,44 @@
<?php
namespace App\Console\Commands\V2;
use App\Classes\Jobs\Commands\V2\FixDuplicateContainerReferenceV2CommandJob;
use Illuminate\Console\Command;
class FixDuplicateContainerReferenceV2Command extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'fix-duplicate-container-reference-command';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Fix all duplicated container reference';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
FixDuplicateContainerReferenceV2CommandJob::dispatch();
}
}
@@ -0,0 +1,47 @@
<?php
namespace App\Console\Commands\V2;
use App\Classes\Jobs\Commands\V2\FixInvoiceV2CommandJob;
use App\Classes\Modules\Jobs\DataTransferObjects\FixInvoiceV2CommandObject;
use Illuminate\Console\Command;
class FixInvoiceV2Command extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'invoice-fix-command {--marking=}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Fix Invoice By Company Module Marking';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
$fixInvoiceV2CommandObject = new FixInvoiceV2CommandObject(
$this->option('marking')
);
FixInvoiceV2CommandJob::dispatch($fixInvoiceV2CommandObject);
}
}
@@ -0,0 +1,44 @@
<?php
namespace App\Console\Commands\V2;
use App\Classes\Jobs\Commands\V2\FixPackingListV2CommandJob;
use Illuminate\Console\Command;
class FixPackingListV2Command extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'fix-packinglist-command';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Fix PackingList';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
FixPackingListV2CommandJob::dispatch();
}
}
@@ -0,0 +1,44 @@
<?php
namespace App\Console\Commands\V2;
use App\Classes\Jobs\Commands\V2\SendContainerDepartureEmailV2CommandJob;
use Illuminate\Console\Command;
class SendContainerDepartureEmailV2Command extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'send-container-departure-email-command';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
SendContainerDepartureEmailV2CommandJob::dispatch();
}
}
@@ -0,0 +1,47 @@
<?php
namespace App\Console\Commands\V2;
use App\Classes\Jobs\Commands\V2\ShowBillplzPaymentStatusV2CommandJob;
use App\Classes\Modules\Jobs\DataTransferObjects\ShowBillplzPaymentStatusV2CommandObject;
use Illuminate\Console\Command;
class ShowBillplzPaymentStatusV2Command extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'billplz-payment-status-command {billplz_id}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Show Billplz payment status';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
$showBillplzPaymentStatusV2CommandObject = new ShowBillplzPaymentStatusV2CommandObject(
$this->argument('billplz_id')
);
ShowBillplzPaymentStatusV2CommandJob::dispatch($showBillplzPaymentStatusV2CommandObject);
}
}
@@ -0,0 +1,45 @@
<?php
namespace App\Console\Commands\V2;
use App\Classes\Jobs\Commands\V2\ShowFailediBllplzCallbackV2CommandJob;
use Illuminate\Console\Command;
class ShowFailediBllplzCallbackV2Command extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'show-failed-billplz-callback-command';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Show all failled callback from billplz';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
ShowFailediBllplzCallbackV2CommandJob::dispatch();
}
}
@@ -0,0 +1,49 @@
<?php
namespace App\Console\Commands\V2;
use App\Classes\Jobs\Commands\V2\ShowFixBillplzFailedCallbackPaymentV2CommandJob;
use Illuminate\Console\Command;
class ShowFixBillplzFailedCallbackPaymentV2Command extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'billplz-failed-callback-show-command';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Check all failled callback from billplz';
protected $output = null;
protected $outputArray = [];
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
ShowFixBillplzFailedCallbackPaymentV2CommandJob::dispatch();
}
}
@@ -0,0 +1,38 @@
<?php
namespace App\Console\Commands\V2;
use App\Classes\Jobs\Commands\V2\SuccessUpdatePaymentStatusV2CommandJob;
use Illuminate\Console\Command;
class SuccessUpdatePaymentStatusV2Command extends Command //SuccessUpdatePaymentStatusButFailedCallbackV2Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'fix-invoice-status';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Success Updated Payment Status But Inoie stat';
protected $output = null;
protected $outputArray = [];
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
SuccessUpdatePaymentStatusV2CommandJob::dispatch();
}
}
+71 -32
View File
@@ -27,46 +27,84 @@ class Kernel extends ConsoleKernel
*/
protected function schedule(Schedule $schedule)
{
//Commands Version 2: Laravel Vapor with AWS
$isEnabled = env('COMMANDS_V2_ENABLED', false);
if($isEnabled){
$schedule->command('dummy-command')
->everyFiveMinutes()
->withoutOverlapping();
$schedule->command('command:curlVTCommand')
->cron('0 8 * * *')
->withoutOverlapping()
->appendOutputTo (storage_path().'/logs/curlvt.log');
$schedule->command('curl-vt-command')
->cron('0 8 * * *')
->withoutOverlapping();
$schedule->command('command:curlYdOrderListCommand')
->cron('0 9-18/3 * * *')
->withoutOverlapping()
->appendOutputTo (storage_path().'/logs/curlyd.log');
$schedule->command('curl-yd-order-list-command')
->cron('0 9-18/3 * * *')
->withoutOverlapping();
$schedule->command('fix-packinglist')
->cron('30 9-18/3 * * *')
->withoutOverlapping()
->appendOutputTo (storage_path().'/logs/fix_packinglist.log');
$schedule->command('fix-packinglist-command')
->cron('30 9-18/3 * * *')
->withoutOverlapping();
// $schedule->command('command:curlYdOrderListCommand')
// ->cron('0 9 * * *')
// ->withoutOverlapping()
// ->appendOutputTo (storage_path().'/logs/departure_email.log');
$schedule->command('fix-duplicate-container-reference-command')
->cron('0 1 * * *')
->withoutOverlapping();
$schedule->command('fix-duplicate-container-reference')
->cron('0 1 * * *')
->withoutOverlapping()
->appendOutputTo (storage_path().'/logs/fix_duplicate_container_reference.log');
$schedule->command('invoice-generate-command')
->hourly()
->withoutOverlapping();
$schedule->command('invoice:generate')
->hourly()
->withoutOverlapping()
->appendOutputTo (storage_path().'/logs/auto_generate_invoice.log');
$schedule->command('billplz-failed-callback-fix-command')
->hourly()
->withoutOverlapping();
$schedule->command('billplz-failed-callback:fix')
->hourly()
->withoutOverlapping()
->appendOutputTo (storage_path().'/logs/fix_failed_callback_from_billplz.log');
$schedule->command('check-storage-invoices-group-transactions-command')
->dailyAt('0:01')
->withoutOverlapping();
}
//Commands Version 1: Before AWS
else
{
$schedule->command('command:curlVTCommand')
->cron('0 8 * * *')
->withoutOverlapping()
->appendOutputTo (storage_path().'/logs/curlvt.log');
$schedule->command('check-storage-invoices-group-transactions')
->dailyAt('0:01')
->withoutOverlapping()
->appendOutputTo(storage_path().'/logs/check_storage_invoices.log');
$schedule->command('command:curlYdOrderListCommand')
->cron('0 9-18/3 * * *')
->withoutOverlapping()
->appendOutputTo (storage_path().'/logs/curlyd.log');
$schedule->command('fix-packinglist')
->cron('30 9-18/3 * * *')
->withoutOverlapping()
->appendOutputTo (storage_path().'/logs/fix_packinglist.log');
// $schedule->command('command:curlYdOrderListCommand')
// ->cron('0 9 * * *')
// ->withoutOverlapping()
// ->appendOutputTo (storage_path().'/logs/departure_email.log');
$schedule->command('fix-duplicate-container-reference')
->cron('0 1 * * *')
->withoutOverlapping()
->appendOutputTo (storage_path().'/logs/fix_duplicate_container_reference.log');
$schedule->command('invoice:generate')
->hourly()
->withoutOverlapping()
->appendOutputTo (storage_path().'/logs/auto_generate_invoice.log');
$schedule->command('billplz-failed-callback:fix')
->hourly()
->withoutOverlapping()
->appendOutputTo (storage_path().'/logs/fix_failed_callback_from_billplz.log');
$schedule->command('check-storage-invoices-group-transactions')
->dailyAt('0:01')
->withoutOverlapping()
->appendOutputTo(storage_path().'/logs/check_storage_invoices.log');
}
}
/**
@@ -77,6 +115,7 @@ class Kernel extends ConsoleKernel
protected function commands()
{
$this->load(__DIR__.'/Commands');
$this->load(__DIR__.'/Commands/V2');
require base_path('routes/console.php');
}
@@ -29,7 +29,7 @@ class ExportCustomersToExcelController
public function paymentTransactions(Request $request){
$exportsTransactions = new ExportsPaymentTransactions($request);
$response = $exportsTransactions->download('payment-transactions.xls', Excel::XLS, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']);
ob_end_clean();
// ob_end_clean();
return $response;
}
+2
View File
@@ -17,6 +17,8 @@
"intervention/image": "^2.5",
"laravel/framework": "^8.40",
"laravel/tinker": "^2.5",
"laravel/vapor-cli": "^1.60",
"laravel/vapor-core": "^2.33",
"maatwebsite/excel": "^3.1",
"rinvex/countries": "^6.1",
"spatie/laravel-activitylog": "^3.14",
+3
View File
@@ -0,0 +1,3 @@
FROM laravelphp/vapor:php74
COPY . /var/task
+1
View File
@@ -59,6 +59,7 @@
"gulp-uglify": "^3.0.0",
"gulp-uglify-es": "^2.0.0",
"laravel-mix": "^5.0.9",
"laravel-vapor": "^0.7.0",
"lodash": "^4.17.19",
"postcss": "^8.1.14",
"resolve-url-loader": "^3.1.2"
+3
View File
@@ -0,0 +1,3 @@
FROM laravelphp/vapor:php74
COPY . /var/task
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 MiB

+3 -2
View File
@@ -15,7 +15,8 @@
}
.login-wrapper {
background: linear-gradient(rgba(0, 0, 0, 0.6), $color-primary), url('../images/iStock-976354264_Malaysia.jpg');
background: linear-gradient(rgba(0, 0, 0, 0.6), $color-primary), url('../images/iStock-976354264_Malaysia.jpg');
/*background: linear-gradient(rgba(0, 0, 0, 0.6), $color-primary), url('{{asset("images/iStock-976354264_Malaysia.jpg")}}');*/
background-size: cover;
padding: 80px 0 20px 0;
min-height: 100%;
@@ -67,4 +68,4 @@
width: 100%;
}
}
}
}
+5 -1
View File
@@ -24,6 +24,9 @@ import closable from './general/directives/closable';
import Avatar from 'vue-avatar';
import Vapor from 'laravel-vapor';
window.Vapor = Vapor;
/** Application Injections */
Vue.use(vuelidate);
Vue.use(VueTheMask);
@@ -37,7 +40,8 @@ Vue.directive('tooltip', function(el, binding){
})
Vue.mixin({
methods: {
route: route
route: route,
asset: window.Vapor.asset
},
mixins: [request, crudHandler]
});
@@ -23,7 +23,7 @@
<div class="col bg-info-primary-gradient text-white b-rad-lg padding-25">
<div class="row align-items-center">
<div class="d-none d-sm-inline col-3 text-center no-padding">
<img src="/images/qr-box.svg" class="w-75">
<img :src="asset('images/qr-box.svg')" class="w-75">
</div>
<div class="col">
<div class="row m-b-10">
@@ -16,7 +16,7 @@
<div class="col bg-master-lightest text-white b-rad-lg padding-25">
<div class="row align-items-center">
<div class="d-none d-sm-inline col-3 text-center no-padding">
<img src="/images/qr-box.svg" class="w-75">
<img :src="asset('images/qr-box.svg')" class="w-75">
</div>
<div class="col">
<div class="row m-b-10">
@@ -103,4 +103,4 @@
}
}
}
</script>
</script>
@@ -26,7 +26,7 @@
<div class="col p-t-10 p-b-25 p-l-25 p-r-25 bg-master-lightest b-r b-grey">
<div class="row m-b-15">
<div class="col text-center">
<img src="/images/qr-box.svg" width="150" height="150">
<img :src="asset('images/qr-box.svg')" width="150" height="150">
</div>
</div>
<div class="row justify-content-center">
@@ -47,7 +47,7 @@
<div class="col p-t-10 p-b-25 p-l-25 p-r-25 bg-master-lightest b-r b-grey">
<div class="row m-b-15">
<div class="col text-center">
<img src="/images/package.svg" width="120" height="150">
<img :src="asset('images/package.svg')" width="120" height="150">
</div>
</div>
<div class="row justify-content-center">
@@ -68,7 +68,7 @@
<div class="col p-t-10 p-b-25 p-l-25 p-r-25 bg-master-lightest">
<div class="row m-b-15">
<div class="col">
<img src="/images/package_hands.svg" width="160" height="150">
<img :src="asset('images/package_hands.svg')" width="160" height="150">
</div>
</div>
<div class="row justify-content-center">
@@ -21,7 +21,7 @@
<div class="b-a b-thick p-t-15 p-b-15 p-l-35 p-r-35 pointer" :class="{ 'b-primary': parameters.company_module_id === 3, 'b-grey': parameters.company_module_id !== 3 }" @click="parameters.company_module_id = 3">
<div class="row m-b-15 justify-content-center">
<div class="col-8">
<img src="/images/guangzhou-map.png" class="w-100">
<img :src="asset('images/guangzhou-map.png')" class="w-100">
</div>
</div>
<div class="row">
@@ -35,7 +35,7 @@
<div class="b-a b-thick p-t-15 p-b-15 p-l-35 p-r-35 pointer" :class="{ 'b-primary': parameters.company_module_id === 4, 'b-grey': parameters.company_module_id !== 4 }" @click="parameters.company_module_id = 4">
<div class="row m-b-15 justify-content-center">
<div class="col-8">
<img src="/images/yiwu-map.png" class="w-100">
<img :src="asset('images/yiwu-map.png')" class="w-100">
</div>
</div>
<div class="row">
@@ -108,8 +108,8 @@
seal_reference: this.seal_reference,
container_type: 1,
company_module_id: this.company_module_id,
etd: this.etd,
eta: this.eta,
etd: this.etd,
eta: this.eta,
}
};
},
@@ -121,4 +121,4 @@
mixins: [createContainerFormValidation, componentHandler, modalFormHandler]
}
</script>
</script>
@@ -10,7 +10,7 @@
<div class="col text-center">
<img :src="src" class="w-100" v-if="type !== 'pdf'">
<div class="btn btn-complete pointer m-b-20" @click="openBase64NewTab()" v-show="type === 'pdf'">Open in new window</div>
<iframe v-if="type === 'pdf'" class="pdf-display w-100 scrollable" style="height: 80vh" :src="'data:application/pdf;base64,'+src"></iframe>
<iframe v-if="type === 'pdf' && isClicked" class="pdf-display w-100 scrollable" style="height: 80vh" :src="'data:application/pdf;base64,'+src"></iframe>
</div>
</div>
</modal-component>
@@ -30,7 +30,8 @@
return {
isLoading: false,
loaded: false,
src: ''
src: '',
isClicked: false
}
},
computed: {
@@ -40,6 +41,7 @@
},
methods:{
loadFile(){
this.isClicked = true;
if(!this.loaded) {
this.isLoading = true;
let filePath = this.type === 'pdf' ? this.file.file.file_info.original.file : this.file.file.file_info[0].original.file;
@@ -88,7 +90,7 @@
}
},
errorHandler(error, statusCode){
this.src = statusCode === 404 ? '/images/3231370.jpg' : '/images/2942005.jpg'
this.src = statusCode === 404 ? asset('images/3231370.jpg') : asset('images/2942005.jpg')
this.isLoading = false;
}
},
@@ -98,4 +100,4 @@
<style scoped>
</style>
</style>
@@ -8,7 +8,7 @@
<div class="row align-items-center justify-content-center p-t-50 p-b-50" v-show="!$store.getters.getListData(section).length && !$store.getters.isLoading(section) && emptyListSection">
<div class="col-10">
<div class="row align-items-center justify-content-center hint-text">
<div class="col-4 hint-text"><img src="/images/not-found-illustration.png" class="w-100 hint-text"/></div>
<div class="col-4 hint-text"><img :src="asset('images/not-found-illustration.png')" class="w-100 hint-text"/></div>
</div>
<div class="row text-center">
<div class="col">
@@ -8,7 +8,7 @@
<div class="row align-items-center justify-content-center p-t-50 p-b-50" v-show="!$store.getters.getListData(section).length && !isLoading && emptyListSection">
<div class="col-10">
<div class="row align-items-center justify-content-center hint-text">
<div class="col-4 hint-text"><img src="/images/not-found-illustration.png" class="w-100 hint-text"/></div>
<div class="col-4 hint-text"><img :src="asset('images/not-found-illustration.png')" class="w-100 hint-text"/></div>
</div>
<div class="row text-center">
<div class="col">
@@ -36,7 +36,7 @@
<div class="row text-center m-t-50 m-b-50" v-if="notificationsLength === 0" v-show="!isLoading">
<div class="col">
<div class="row align-items-center justify-content-center hint-text">
<div class="col-4 hint-text"><img src="/images/not-found-illustration.png" class="w-100 hint-text"/></div>
<div class="col-4 hint-text"><img :src="asset('images/not-found-illustration.png')" class="w-100 hint-text"/></div>
</div>
<div class="row text-center">
<div class="col">
@@ -95,4 +95,4 @@
},
mixins: [ModalFormHandler]
}
</script>
</script>
@@ -5,7 +5,7 @@
<div class="col">
<div class="row">
<div class="col">
<img class="w-100" src="/images/search-illustration.png" />
<img class="w-100" :src="asset('images/search-illustration.png')" />
</div>
</div>
</div>
@@ -78,4 +78,4 @@
}
}
}
</script>
</script>
@@ -1,7 +1,7 @@
<template>
<div class="row bear parentContainer">
<div class="col">
<div class="absolute" style="width: 50px;top: 73px;right: 15px;"><img src="/images/easter-egg.png" class="w-100 pointer requestModal" data-type="openBear" ></div>
<div class="absolute" style="width: 50px;top: 73px;right: 15px;"><img :src="asset('images/easter-egg.png')" class="w-100 pointer requestModal" data-type="openBear" ></div>
<modal-component class="animate__animated animate__fast animate__fadeIn" size="small" styleType="fill-in" type="openBear">
<div class="row">
<div class="col p-t-50 p-b-50">
@@ -21,4 +21,4 @@
}
}
</script>
</script>
@@ -98,10 +98,10 @@
vm.isLoading = true;
if(file.name.split('.').pop() === 'pdf'){
$(file.previewElement).closest("img[data-dz-thumbnail]").attr("src", "/images/icons/pdf.png");
$(file.previewElement).closest("img[data-dz-thumbnail]").attr("src", asset("images/icons/pdf.png"));
}
if(file.name.split('.').pop().indexOf("xls") !== -1){
$(file.previewElement).closest("img[data-dz-thumbnail]").attr("src", "/images/icons/xlsx.png");
$(file.previewElement).closest("img[data-dz-thumbnail]").attr("src", asset("images/icons/xlsx.png"));
}
Promise.all(dropzone.files.map(function(file){
@@ -147,4 +147,4 @@
}
}
</script>
</script>
@@ -8,7 +8,7 @@
<div class="row align-items-center justify-content-center p-t-50 p-b-50" v-show="!$store.getters.getListData(section).length && !$store.getters.isLoading(section) && emptyListSection">
<div class="col-10">
<div class="row align-items-center justify-content-center hint-text">
<div class="col-4 hint-text"><img src="/images/not-found-illustration.png" class="w-100 hint-text"/></div>
<div class="col-4 hint-text"><img :src="asset('images/not-found-illustration.png')" class="w-100 hint-text"/></div>
</div>
<div class="row text-center">
<div class="col">
@@ -16,7 +16,7 @@
<div class="b-a b-thick p-t-15 p-b-15 p-l-35 p-r-35 pointer h-100" :class="{ 'b-primary': parameters.warehouse_id === 3, 'b-grey': parameters.warehouse_id !== 3 }" @click="parameters.warehouse_id = 3">
<div class="row m-b-15 justify-content-center">
<div class="col-8">
<img src="/images/guangzhou-map.png" class="w-100">
<img :src="asset('images/guangzhou-map.png')" class="w-100">
</div>
</div>
<div class="row">
@@ -30,7 +30,7 @@
<div class="b-a b-thick p-t-15 p-b-15 p-l-35 p-r-35 pointer h-100" @click="parameters.warehouse_id = 4" :class="{ 'b-primary': parameters.warehouse_id === 4, 'b-grey': parameters.warehouse_id !== 4 }">
<div class="row m-b-15 justify-content-center">
<div class="col-8">
<img src="/images/yiwu-map.png" class="w-100">
<img :src="asset('images/yiwu-map.png')" class="w-100">
</div>
</div>
<div class="row">
@@ -44,7 +44,7 @@
<div class="b-a b-thick p-t-15 p-b-15 p-l-35 p-r-35 pointer h-100" @click="parameters.warehouse_id = 'foshan'" :class="{ 'b-primary': parameters.warehouse_id === 'foshan', 'b-grey': parameters.warehouse_id !== 'foshan'}">
<div class="row m-b-15 justify-content-center">
<div class="col-8">
<img src="/images/foshan-map.png" class="w-100">
<img :src="asset('images/foshan-map.png')" class="w-100">
</div>
</div>
<div class="row">
@@ -144,7 +144,7 @@
<div class="col-8 p-t-50 p-b-50 text-center">
<div class="row justify-content-center m-b-35">
<div class="col-6">
<img src="/images/qr.svg" class="w-25 animate__animated animate__flip animate__infinite animate__slower">
<img :src="asset('images/qr.svg')" class="w-25 animate__animated animate__flip animate__infinite animate__slower">
</div>
</div>
<loading-component class="m-l-0" style="height: 50px; top: 0;" color="info"></loading-component>
@@ -166,7 +166,7 @@
<div class="col-8 p-t-50 p-b-50 text-center">
<div class="row justify-content-center">
<div class="col-6">
<img src="/images/qr.svg" class="w-50">
<img :src="asset('images/qr.svg')" class="w-50">
</div>
</div>
</div>
@@ -186,7 +186,7 @@
<div class="row align-items-center justify-content-center p-t-50 p-b-50" v-if="!order.parcels.origin_warehouse_packages.length">
<div class="col-10">
<div class="row align-items-center justify-content-center hint-text">
<div class="col-4 hint-text"><img src="/images/not-found-illustration.png" class="w-100 hint-text"/></div>
<div class="col-4 hint-text"><img :src="asset('images/not-found-illustration.png')" class="w-100 hint-text"/></div>
</div>
<div class="row text-center">
<div class="col">
@@ -219,7 +219,7 @@
<div class="row align-items-center justify-content-center p-t-50 p-b-50" v-if="!order.parcels.in_transit_packages.length">
<div class="col-10">
<div class="row align-items-center justify-content-center hint-text">
<div class="col-4 hint-text"><img src="/images/not-found-illustration.png" class="w-100 hint-text"/></div>
<div class="col-4 hint-text"><img :src="asset('images/not-found-illustration.png')" class="w-100 hint-text"/></div>
</div>
<div class="row text-center">
<div class="col">
@@ -252,7 +252,7 @@
<div class="row align-items-center justify-content-center p-t-50 p-b-50" v-if="!order.parcels.destination_warehouse_packages.length">
<div class="col-10">
<div class="row align-items-center justify-content-center hint-text">
<div class="col-4 hint-text"><img src="/images/not-found-illustration.png" class="w-100 hint-text"/></div>
<div class="col-4 hint-text"><img :src="asset('images/not-found-illustration.png')" class="w-100 hint-text"/></div>
</div>
<div class="row text-center">
<div class="col">
@@ -285,7 +285,7 @@
<div class="row align-items-center justify-content-center p-t-50 p-b-50" v-if="!order.parcels.delivered_packages.flatMap(packing_list => packing_list.packages).length">
<div class="col-10">
<div class="row align-items-center justify-content-center hint-text">
<div class="col-4 hint-text"><img src="/images/not-found-illustration.png" class="w-100 hint-text"/></div>
<div class="col-4 hint-text"><img :src="asset('images/not-found-illustration.png')" class="w-100 hint-text"/></div>
</div>
<div class="row text-center">
<div class="col">
@@ -342,4 +342,4 @@
}
}
}
</script>
</script>
@@ -334,7 +334,7 @@
<div class="row align-items-center justify-content-center p-t-50 p-b-50" v-if="!order.parcels.origin_warehouse_packages.length">
<div class="col-10">
<div class="row align-items-center justify-content-center hint-text">
<div class="col-4 hint-text"><img src="/images/not-found-illustration.png" class="w-100 hint-text"/></div>
<div class="col-4 hint-text"><img :src="asset('images/not-found-illustration.png')" class="w-100 hint-text"/></div>
</div>
<div class="row text-center">
<div class="col">
@@ -367,7 +367,7 @@
<div class="row align-items-center justify-content-center p-t-50 p-b-50" v-if="!order.parcels.in_transit_packages.length">
<div class="col-10">
<div class="row align-items-center justify-content-center hint-text">
<div class="col-4 hint-text"><img src="/images/not-found-illustration.png" class="w-100 hint-text"/></div>
<div class="col-4 hint-text"><img :src="asset('images/not-found-illustration.png')" class="w-100 hint-text"/></div>
</div>
<div class="row text-center">
<div class="col">
@@ -400,7 +400,7 @@
<div class="row align-items-center justify-content-center p-t-50 p-b-50" v-if="!order.parcels.destination_warehouse_packages.length">
<div class="col-10">
<div class="row align-items-center justify-content-center hint-text">
<div class="col-4 hint-text"><img src="/images/not-found-illustration.png" class="w-100 hint-text"/></div>
<div class="col-4 hint-text"><img :src="asset('images/not-found-illustration.png')" class="w-100 hint-text"/></div>
</div>
<div class="row text-center">
<div class="col">
@@ -433,7 +433,7 @@
<div class="row align-items-center justify-content-center p-t-50 p-b-50" v-if="!order.parcels.delivered_packages.flatMap(packing_list => packing_list.packages).length">
<div class="col-10">
<div class="row align-items-center justify-content-center hint-text">
<div class="col-4 hint-text"><img src="/images/not-found-illustration.png" class="w-100 hint-text"/></div>
<div class="col-4 hint-text"><img :src="asset('images/not-found-illustration.png')" class="w-100 hint-text"/></div>
</div>
<div class="row text-center">
<div class="col">
@@ -115,7 +115,7 @@
<div class="col">
<div class="row no-margin align-items-end">
<div class="col-4 d-none d-md-inline">
<img src="/images/on-hold.png" class="w-100" alt="">
<img :src="asset('images/on-hold.png')" class="w-100" alt="">
</div>
<div class="col">
<div class="row m-l-0">
@@ -234,4 +234,4 @@
export default {
mixins: [componentHandler]
}
</script>
</script>
@@ -105,7 +105,7 @@
<div class="row align-items-center justify-content-center p-t-50 p-b-50">
<div class="col-10">
<div class="row align-items-center justify-content-center hint-text">
<div class="col-4 hint-text"><img src="/images/not-found-illustration.png" class="w-100 hint-text"/></div>
<div class="col-4 hint-text"><img :src="asset('images/not-found-illustration.png')" class="w-100 hint-text"/></div>
</div>
<div class="row text-center">
<div class="col">
@@ -170,7 +170,7 @@
</div>
</div>
</div>
<div>entries</div>
<div>entries</div>
</div>
<div class="col-auto" v-show="filters.per_page < metaData.total">
<pagination-component :section="section" class="mb-5" ref="pagination"></pagination-component>
@@ -197,8 +197,8 @@
orderStatusFilterArray: ['Active', 'Complete', 'Pending Verification', 'Cancelled'],
orderStatusFilterDropDownStatus: false,
filters: {
per_page: 2,
status_in: [1],
per_page: 2,
status_in: [1],
with_packing_lists: true,
reference_like: '',
order_by: {
@@ -256,7 +256,7 @@
case 'Pending Verification':
this.filters.status_in = [1];
break;
case 'Cancelled':
this.filters.status_in = [4, 5, 6];
break;
@@ -35,7 +35,7 @@
<div class="row h-100">
<div class="col b-a padding-10 pointer" :class="{ 'b-primary': paymentMethod.name === 'Online Transfer', 'text-primary': paymentMethod.name === 'Online Transfer', 'b-grey': paymentMethod.name !== 'Online Transfer' }" @click="updatePaymentType({name: 'Online Transfer', id: 'payment_gateway'})">
<div class="m-b-15 m-t-10 text-center">
<img src="/images/fpx-logo-vector-01.png" alt="logo" height="25">
<img :src="asset('images/fpx-logo-vector-01.png')" alt="logo" height="25">
</div>
<p id="online-banking" class="no-margin bold all-caps">Online Banking</p>
</div>
@@ -35,7 +35,7 @@
<div class="row h-100">
<div class="col b-a padding-10 pointer" :class="{ 'b-primary': paymentMethod.name === 'Online Transfer', 'text-primary': paymentMethod.name === 'Online Transfer', 'b-grey': paymentMethod.name !== 'Online Transfer' }" @click="updatePaymentType({name: 'Online Transfer', id: 'payment_gateway'})">
<div class="m-b-15 m-t-10 text-center">
<img src="/images/fpx-logo-vector-01.png" alt="logo" height="25">
<img :src="asset('images/fpx-logo-vector-01.png')" alt="logo" height="25">
</div>
<p id="online-banking" class="no-margin bold all-caps">Online Banking</p>
</div>
@@ -102,23 +102,23 @@
<div class="col bg-master-lightest p-1 p-sm-4">
<div class="row tabsContainer tabContent" tab-name="pendingInvoice" v-if="isActiveTab('pendingInvoice') || showTabContent('pendingInvoice')">
<div class="col">
<admin-payments-billing-with-search-component :options="{does_not_have_transaction_type: 1, type: 2, per_page: 5}" section="pendingInvoiceSection" invoice_status="Pending Invoice"></admin-payments-billing-with-search-component>
<admin-payments-billing-with-search-component :options="{does_not_have_transaction_type: 1, type: 2, per_page: 5, priority: 2}" section="pendingInvoiceSection" invoice_status="Pending Invoice"></admin-payments-billing-with-search-component>
</div>
</div>
<div class="row tabsContainer tabContent hide" tab-name="pendingApproval" v-if="isActiveTab('pendingApproval') || showTabContent('pendingApproval')">
<div class="col">
<admin-payments-billing-with-search-component :options="{has_invoice_status_in: [0, 1], per_page: 5}" section="pendingApprovalSection" invoice_status="Pending Approval"></admin-payments-billing-with-search-component>
<admin-payments-billing-with-search-component :options="{has_invoice_status_in: [0, 1], per_page: 5, priority: 2}" section="pendingApprovalSection" invoice_status="Pending Approval"></admin-payments-billing-with-search-component>
</div>
</div>
<div class="row tabsContainer tabContent hide" tab-name="pendingPayment" v-if="isActiveTab('pendingPayment') || showTabContent('pendingPayment')">
<div class="col">
<payment-filter-component :endpoint="route('api.packing_list.list')" :data="data"></payment-filter-component>
<admin-payments-billing-with-search-component :options="{has_invoice_status_in: [2], packing_list_ordered_by_invoice_date: true, per_page: 5}" section="pendingPaymentSection" invoice_status="Pending Payment" :with_export="true"></admin-payments-billing-with-search-component>
<admin-payments-billing-with-search-component :options="{has_invoice_status_in: [2], packing_list_ordered_by_invoice_date: true, per_page: 5, priority: 1}" section="pendingPaymentSection" invoice_status="Pending Payment" :with_export="true"></admin-payments-billing-with-search-component>
</div>
</div>
<div class="row tabsContainer tabContent hide" tab-name="paidInvoice" v-if="isActiveTab('paidInvoice') || showTabContent('paidInvoice')">
<div class="col">
<admin-payments-billing-with-search-component :options="{has_invoice_status_in: [3], per_page: 5}" section="paidInvoiceSection" invoice_status="Paid Invoice" :with_export="true"></admin-payments-billing-with-search-component>
<admin-payments-billing-with-search-component :options="{has_invoice_status_in: [3], per_page: 5, priority: 2}" section="paidInvoiceSection" invoice_status="Paid Invoice" :with_export="true"></admin-payments-billing-with-search-component>
</div>
</div>
</div>
@@ -88,7 +88,7 @@
<div class="row align-items-center justify-content-center p-t-10 p-b-10" v-if="basePriceData.length === 0">
<div class="col">
<div class="row align-items-center justify-content-center hint-text">
<div class="col-4 hint-text"><img src="/images/not-found-illustration.png" class="w-100 hint-text"/></div>
<div class="col-4 hint-text"><img :src="asset('images/not-found-illustration.png')" class="w-100 hint-text"/></div>
</div>
<div class="row text-center">
<div class="col">
@@ -129,8 +129,8 @@
section: 'basePriceSection',
basePriceData: [],
searchParam:{
dateFrom: '',
dateTo: '',
dateFrom: '',
dateTo: '',
},
filters:{
},
@@ -67,7 +67,7 @@
<!-- <div class="row align-items-center justify-content-center p-t-50 p-b-50" v-if="!wallet.transactions || !wallet.transactions.length">
<div class="col-12">
<div class="row align-items-center justify-content-center hint-text">
<div class="col-4 hint-text"><img src="/images/not-found-illustration.png" class="w-100 hint-text"></div>
<div class="col-4 hint-text"><img :src="asset('images/not-found-illustration.png')" class="w-100 hint-text"></div>
</div>
<div class="row text-center">
<div class="col">
@@ -103,7 +103,7 @@
<div class="row align-items-center justify-content-center p-t-50 p-b-50" v-if="!wallet.top_up_records.length">
<div class="col-10">
<div class="row align-items-center justify-content-center hint-text">
<div class="col-4 hint-text"><img src="/images/not-found-illustration.png" class="w-100 hint-text"></div>
<div class="col-4 hint-text"><img :src="asset('images/not-found-illustration.png')" class="w-100 hint-text"></div>
</div>
<div class="row text-center">
<div class="col">
@@ -149,9 +149,9 @@ export default {
startDate: null,
endDate: null,
options: {
status_in: [2, 3],
owner_type: 'App\\Models\\Wallet',
owner_id: 0,
status_in: [2, 3],
owner_type: 'App\\Models\\Wallet',
owner_id: 0,
per_page: this.showingTransactionCount
}
}
@@ -201,7 +201,7 @@ export default {
if (this.endDate) {
this.options.created_before_or_equal = this.endDate
}
this.key ++;
},
successHandler(response){
+31 -1
View File
@@ -1,7 +1,25 @@
export default {
actions: {
crudRequest({getters, dispatch}, {endpoint, method, parameters}){
return fetch(endpoint, {
console.log(endpoint);
console.log(window.LARAVEL_VAPOR_ENABLED);
let combinedAbsoluteUrl = endpoint;
if(window.LARAVEL_VAPOR_ENABLED){
const queryDomain = endpoint.split('?')[0];
let encodedParams = endpoint.split('?')[1];
let decodedParams = fullyDecodeURI(encodedParams);
const queryParams = encodeURIComponent(decodedParams);
encodedParams = queryParams.toString();
let filteredEncodedParams = encodedParams.replace(/%3D/g,'=');
filteredEncodedParams = filteredEncodedParams.replace(/%26/g,'&');
combinedAbsoluteUrl = queryDomain;
if(filteredEncodedParams !== undefined && filteredEncodedParams !== 'undefined'){
combinedAbsoluteUrl = queryDomain + '?' + filteredEncodedParams;
}
}
// return fetch(endpoint, {
return fetch(combinedAbsoluteUrl, {
method: method,
responseType: 'json',
body: parameters ? JSON.stringify(parameters):null,
@@ -20,3 +38,15 @@ export default {
}
}
}
function isEncoded(uri) {
uri = uri || '';
return uri !== decodeURIComponent(uri);
}
function fullyDecodeURI(uri){
while (isEncoded(uri)){
uri = decodeURIComponent(uri);
}
return uri;
}
+2 -2
View File
@@ -16,7 +16,7 @@
.background {
background-blend-mode: multiply; -webkit-background-size: cover;
background-size: cover;
background: #202020 url({{asset('/images/iStock-976354264_Malaysia.jpg')}}) no-repeat center center;
background: #202020 url({{asset('images/iStock-976354264_Malaysia.jpg')}}) no-repeat center center;
}
.container {
width: 600px;
@@ -135,4 +135,4 @@
</div>
</div>
</body>
</html>
</html>
+1 -1
View File
@@ -125,4 +125,4 @@
</div>
</div>
</div>
@endsection
@endsection
@@ -29,7 +29,7 @@
<div class="col p-t-10 p-b-25 p-l-25 p-r-25 bg-master-lightest b-r b-grey">
<div class="row m-b-15">
<div class="col text-center">
<img src="/images/qr.svg" width="100" height="150">
<img src="{{asset('images/qr.svg')}}" width="100" height="150">
</div>
</div>
<div class="row justify-content-center">
@@ -50,7 +50,7 @@
<div class="col p-t-10 p-b-25 p-l-25 p-r-25 bg-master-lightest b-r b-grey">
<div class="row m-b-15">
<div class="col text-center">
<img src="/images/package.svg" width="120" height="150">
<img src="{{asset('images/package.svg')}}" width="120" height="150">
</div>
</div>
<div class="row justify-content-center">
@@ -71,7 +71,7 @@
<div class="col p-t-10 p-b-25 p-l-25 p-r-25 bg-master-lightest">
<div class="row m-b-15">
<div class="col">
<img src="/images/package_hands.svg" width="160" height="150">
<img src="{{asset('images/package_hands.svg')}}" width="160" height="150">
</div>
</div>
<div class="row justify-content-center">
@@ -109,7 +109,7 @@
<div class="col bg-info-primary-gradient text-white b-rad-lg padding-25">
<div class="row align-items-center">
<div class="d-none d-sm-inline col-3 text-center no-padding">
<img src="/images/qr-box.svg" class="w-75">
<img src="{{asset('images/qr-box.svg')}}" class="w-75">
</div>
<div class="col">
<div class="row m-b-10">
@@ -223,7 +223,7 @@
<div class="row">
<div class="col">
<div class="peelable-corner overflow-hidden relative b-t b-l b-grey">
<img src="/images/qr.svg" class="w-100">
<img src="{{asset('images/qr.svg')}}" class="w-100">
</div>
</div>
</div>
+3 -3
View File
@@ -40,7 +40,7 @@
<div class="h-100 row align-items-center justify-content-center p-t-50 p-b-50">
<div class="col-10">
<div class="row align-items-center justify-content-center hint-text">
<div class="col-4 hint-text"><img src="/images/not-found-illustration.png" class="w-100 hint-text"/></div>
<div class="col-4 hint-text"><img src="{{asset('images/not-found-illustration.png')}}" class="w-100 hint-text"/></div>
</div>
<div class="row text-center">
<div class="col">
@@ -76,7 +76,7 @@
</div>
</div>
</div>
</div>
</div>
@endsection
<script>
function clearOtherFields(fieldName) {
@@ -88,4 +88,4 @@
}
});
}
</script>
</script>
+2 -2
View File
@@ -5,7 +5,7 @@
<div class="row">
<div class="col d-inline d-md-none">
<a :href="[7,8].includes($store.getters.getCompanyModuleType) ? route('last_mile_delivery.dashboard') : route('dashboard')">
<img :class="[{'w-50': ![7,8].includes($store.getters.getCompanyModuleType)}]" :style="{'width': '70px'}" :src="[7,8].includes($store.getters.getCompanyModuleType) ? '/images/hy-logo.png' : '/images/cief-izyim-logo.png'">
<img :class="[{'w-50': ![7,8].includes($store.getters.getCompanyModuleType)}]" :style="{'width': '70px'}" :src="[7,8].includes($store.getters.getCompanyModuleType) ? '{{asset('images/hy-logo.png')}}' : '{{asset('images/cief-izyim-logo.png')}}'">
</a>
</div>
</div>
@@ -34,4 +34,4 @@
</div>
</div>
</div>
</div>
</div>
+1 -1
View File
@@ -5,7 +5,7 @@
<a :href="[7,8].includes($store.getters.getCompanyModuleType) ? route('last_mile_delivery.dashboard') : route('dashboard')">
<div class="row align-items-center">
<div class="col-auto p-r-0">
<img :class="[{'w-50': ![7,8].includes($store.getters.getCompanyModuleType)}]" :style="{'width': '70px'}" :src="[7,8].includes($store.getters.getCompanyModuleType) ? '/images/hy-logo.png' : '/images/cief-izyim-logo.png'">
<img :class="[{'w-50': ![7,8].includes($store.getters.getCompanyModuleType)}]" :style="{'width': '70px'}" :src="[7,8].includes($store.getters.getCompanyModuleType) ? '{{asset('images/hy-logo.png')}}' : '{{asset('images/cief-izyim-logo.png')}}'">
</div>
<div class="col p-l-0 d-none" :class="[{'d-flex': [7,8].includes($store.getters.getCompanyModuleType)}]" v-if="[7,8].includes($store.getters.getCompanyModuleType)">
<h4 class="no-margin bold text-complete">HY WAVE TECH</h4>
+1 -1
View File
@@ -5,7 +5,7 @@
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-T3XCNMB');</script>
<!-- End Google Tag Manager -->
<script>window.LARAVEL_VAPOR_ENABLED=@json(env('LARAVEL_VAPOR_ENABLED', false));</script>
<meta http-equiv="content-type" content="text/html;charset=UTF-8"/>
<meta charset="utf-8"/>
<title>@yield('title', 'IZYIM Shipping')</title>
+2 -2
View File
@@ -1,4 +1,4 @@
<?php
<?php
use Illuminate\Support\Facades\Route;
@@ -7,4 +7,4 @@ Route::group(['namespace' => 'Currencies', 'as' => 'currency.', 'prefix' => 'cur
Route::get('/list', 'ListCurrencyController@list')->name('list');
Route::post('/create', 'CreateCurrencyController@create')->name('create');
Route::delete('/delete/{id}', 'DeleteCurrencyController@delete')->name('delete');
});
});
+3
View File
@@ -0,0 +1,3 @@
FROM laravelphp/vapor:php74
COPY . /var/task
+54
View File
@@ -0,0 +1,54 @@
id: 52493
name: shipping-portal
environments:
production:
domain: production.portal.izyim.com
memory: 1024
cli-memory: 512
database: cief-rds-mysql
storage: shipping-portal-production
runtime: 'docker'
timeout: 180
build:
- 'composer update'
- 'npm install'
- 'npm run dev'
- 'gulp build'
deploy:
- 'php artisan migrate --force'
staging:
domain: staging.portal.izyim.com
memory: 1024
cli-memory: 512
database: cief-rds-mysql
storage: shipping-portal-staging
runtime: 'docker'
timeout: 180
build:
- 'composer update'
- 'npm install'
- 'npm run dev'
- 'gulp build'
deploy:
- 'php artisan migrate --force'
development:
domain: development.portal.izyim.com
memory: 1024
cli-memory: 512
# queue-memory: 1024
# queues:
# - hellokitty1 #cief todo: testing sqs
# - hellokitty2 #cief todo: testing sqs
# gateway-version: 2
database: cief-rds-mysql
storage: shipping-portal-development
runtime: 'docker'
timeout: 180
build:
- 'composer update'
- 'npm install'
- 'npm run dev'
- 'gulp build'
deploy:
- 'php artisan migrate --force'