mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 12:34:18 +00:00
Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1a3466a8b8 | |||
| 782a5c33ad | |||
| 6d3a2d9259 | |||
| 730b3d439a | |||
| 6b09d5facc | |||
| 4c532deb4d | |||
| 12f05b7aa6 | |||
| 5cdbc09c5b | |||
| c9877bb53e | |||
| 0bf84fa7b1 | |||
| 4c9235cc53 | |||
| babd492caa | |||
| 3d1d1cce11 | |||
| 820d96858f | |||
| 058ba592bf | |||
| d950ee3d68 | |||
| da6ec00dbd | |||
| 412dbd64d5 | |||
| 496df549f6 | |||
| 97eaefa45a | |||
| 68c9e0451a | |||
| 671c7a54fb | |||
| 2a28183426 | |||
| 0ebea79750 | |||
| 56bba0eaaf | |||
| 9fce0efaeb |
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class CreatedAfterOrEqual implements Filter
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
$table = $builder->getModel()->getTable();
|
||||
$startDate = Carbon::createFromFormat('d-m-Y', $value)->startOfDay();
|
||||
return $builder->where("{$table}.created_at", '>=', $startDate);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class CreatedBeforeOrEqual implements Filter
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
$table = $builder->getModel()->getTable();
|
||||
$endDate = Carbon::createFromFormat('d-m-Y', $value)->endOfDay();
|
||||
return $builder->where("{$table}.created_at", '<=', $endDate);
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,8 @@ class OwnerId implements Filter
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->where('owner_id', $value);
|
||||
$table = $builder->getModel()->getTable();
|
||||
return $builder->where("{$table}.owner_id", $value);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class OwnerType implements Filter
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return Builder|mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
$table = $builder->getModel()->getTable();
|
||||
return $builder->where("{$table}.owner_type", $value);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,7 +14,8 @@ class StatusIn implements Filter
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->whereIn('status', $value);
|
||||
$table = $builder->getModel()->getTable();
|
||||
return $builder->whereIn("{$table}.status", $value);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class WithOrderReferenceLike implements Filter
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->join('transactions as t2', 't2.payment_reference', '=', 'transactions.bill_no')
|
||||
->join('transactions as t3', 't3.id', '=', 't2.owner_id')
|
||||
->join('packing_lists', 'packing_lists.id', '=', 't3.owner_id')
|
||||
->join('orders', function ($join) use ($value) {
|
||||
$join->on('orders.id', '=', 'packing_lists.owner_id')
|
||||
->where('orders.reference', 'LIKE', '%'.$value.'%');
|
||||
})
|
||||
->addSelect(['transactions.*', 't2.id as paymentTransactionId', 't3.id as invoiceTransactionId', 'packing_lists.id as packingListId', 'orders.reference as orderReference']);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Exports\Services;
|
||||
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use App\Models\Transaction;
|
||||
use App\Models\Company;
|
||||
use App\Models\Wallet;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\Request;
|
||||
use Maatwebsite\Excel\Concerns\Exportable;
|
||||
use Maatwebsite\Excel\Concerns\FromQuery;
|
||||
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadingRow;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
use Maatwebsite\Excel\Concerns\WithMapping;
|
||||
|
||||
class ExportsCustomersWalletTransactionHistory implements FromQuery, WithHeadings, WithHeadingRow, WithMapping, ShouldAutoSize
|
||||
{
|
||||
use Exportable;
|
||||
|
||||
private $request;
|
||||
private $runningBalance = 0;
|
||||
|
||||
public function __construct(Request $request)
|
||||
{
|
||||
$this->request = $request;
|
||||
}
|
||||
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
'Date',
|
||||
'Description',
|
||||
'Incoming',
|
||||
'Outgoing',
|
||||
'Balance',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Support\Collection|mixed
|
||||
*/
|
||||
public function query()
|
||||
{
|
||||
$wallet = Wallet::find($this->request->route('wallet_id'));
|
||||
$transactions = $wallet->transactions()->whereIn('transactions.status', [2, 3])->orderBy('id');
|
||||
|
||||
return $transactions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Transaction $transaction
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function map($transaction): array
|
||||
{
|
||||
$decimals = $this->request->route('is_precise') == 'true' ? 5 : 2;
|
||||
|
||||
$description = '';
|
||||
switch ((int) $transaction->type) {
|
||||
case TransactionType::TOP_UP:
|
||||
$description = (float) $transaction->amount . ' Credit Top up';
|
||||
break;
|
||||
case TransactionType::GROUP_PAYMENT:
|
||||
$description = (float) $transaction->amount . ' Credit Top up';
|
||||
break;
|
||||
case TransactionType::CREDIT_NOTE:
|
||||
$description = 'Credit Voucher for ' . $transaction->payment_reference;
|
||||
break;
|
||||
case TransactionType::PAYMENT:
|
||||
$booking = Transaction::where('payment_reference', $transaction->bill_no)->first()->owner;
|
||||
|
||||
if (!$booking) {
|
||||
$description = 'Payment for unknown booking, please contact tech support.';
|
||||
break;
|
||||
}
|
||||
|
||||
$marking = $booking->marking;
|
||||
$description = 'Payment For booking refs' . $marking;
|
||||
break;
|
||||
case TransactionType::DEBIT_NOTE:
|
||||
$description = 'Debit Voucher for ' . $transaction->payment_reference;
|
||||
break;
|
||||
}
|
||||
|
||||
$incoming = $outgoing = '';
|
||||
|
||||
if (in_array($transaction->type, [TransactionType::TOP_UP, TransactionType::CREDIT_NOTE, TransactionType::GROUP_PAYMENT])) {
|
||||
$incoming = number_format($transaction->amount, $decimals, '.', ',');
|
||||
$this->runningBalance += $transaction->amount;
|
||||
}
|
||||
|
||||
if (in_array($transaction->type, [TransactionType::PAYMENT, TransactionType::DEBIT_NOTE])) {
|
||||
$outgoing = number_format($transaction->amount, $decimals, '.', ',');
|
||||
$this->runningBalance -= $transaction->amount;
|
||||
}
|
||||
|
||||
return [
|
||||
Carbon::parse($transaction->created_at)->format('d-m-Y h:i:s A'),
|
||||
$description,
|
||||
$incoming,
|
||||
$outgoing,
|
||||
number_format($this->runningBalance, $decimals, '.', ',')
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -20,9 +20,11 @@ class ExportsFeedback implements FromQuery, WithHeadings, WithHeadingRow, WithMa
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
'Version',
|
||||
'Question Set',
|
||||
'Question Text',
|
||||
'Answer',
|
||||
'Answer Text',
|
||||
'Answer Value',
|
||||
'Source System',
|
||||
'Source Marking',
|
||||
'Source Email',
|
||||
@@ -38,7 +40,7 @@ class ExportsFeedback implements FromQuery, WithHeadings, WithHeadingRow, WithMa
|
||||
return QAUserAnswerSelected::whereHas('question', function ($query) {
|
||||
$query->whereHas('questionnaire', function ($innerQuery) {
|
||||
$innerQuery->where('group', 'feedback');
|
||||
})->where('created_at', '>', Carbon::now()->subMonths(1));
|
||||
}); //->where('created_at', '>', Carbon::now()->subMonths(1));
|
||||
})->orderBy('created_at', 'desc');
|
||||
}
|
||||
|
||||
@@ -56,11 +58,14 @@ class ExportsFeedback implements FromQuery, WithHeadings, WithHeadingRow, WithMa
|
||||
$companyModule = $user->companyModule()->first();
|
||||
$user_marking = $companyModule ? $companyModule->inviters()->withPivot('invitee_reference')->first()->pivot->invitee_reference : "";
|
||||
}
|
||||
$answer = $userAnswer->answer;
|
||||
|
||||
return [
|
||||
$userAnswer->question->questionnaire->version,
|
||||
$userAnswer->question->questionnaire->description,
|
||||
$userAnswer->question->question_text,
|
||||
$userAnswer->free_text_answer,
|
||||
$answer->display_text,
|
||||
$answer->value,
|
||||
$user ? QASystemSourceType::getText(QASystemSourceType::IZYIM) : QASystemSourceType::getText($source->system),
|
||||
$user ? $user_marking : $source->marking,
|
||||
$user ? $user->email : $source->email,
|
||||
|
||||
@@ -59,7 +59,7 @@ class ListQuestionsQALogic extends AbstractControllerLogic
|
||||
$delimiter = "|";
|
||||
$parts = explode($delimiter, $decriptedToken);
|
||||
$questionSet = $parts[3];
|
||||
$query = $this->listsHelpMenuQuestions->execute(['questionnaire_set_id' => $questionSet]);
|
||||
$query = $this->listsHelpMenuQuestions->execute(['questionnaire_set_id' => $questionSet, 'order_by' => (object)['column' => 'order','DESC' => false]]);
|
||||
return $this->collectionResponse(HelpMenuQuestionResource::collection($query));
|
||||
}
|
||||
|
||||
|
||||
@@ -72,6 +72,7 @@ class UpdateDoFromYDPortalProcessor
|
||||
|
||||
|
||||
} catch (\Exception $exception){
|
||||
log::debug($exception);
|
||||
throw new InternalServerErrorException('failed to approve address due to an error related to YD portal');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace App\Classes\Modules\Transactions\ControllersLogic;
|
||||
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\Transactions\Services\ListsTransactions;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use App\Http\Resources\WalletTransactionResource ;
|
||||
use App\Models\Transaction;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ListWalletTransactionsLogic extends AbstractControllerLogic
|
||||
{
|
||||
/**
|
||||
* ListTransactionsLogic constructor.
|
||||
* @param ListsTransactions $listsTransactions
|
||||
*/
|
||||
public function __construct(ListsTransactions $listsTransactions)
|
||||
{
|
||||
$this->listsTransactions = $listsTransactions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function notification():array {
|
||||
return [
|
||||
'title' => 'Retrieved Wallet Transactions',
|
||||
'message' => 'You have successfully retrieved a list of transactions'
|
||||
];
|
||||
}
|
||||
|
||||
/** @var ListsTransactions */
|
||||
private $listsTransactions;
|
||||
|
||||
public function logic(Request $request) : JsonResponse
|
||||
{
|
||||
$query = $this->listsTransactions->execute($this->listsTransactions->deserializeFilters($request->input('filters')));
|
||||
|
||||
if (str_contains($request->input('filters'), "owner_id") && $query->count() > 0) {
|
||||
$wallet_total_incoming = Transaction::where('owner_type', $query->first()->owner_type)
|
||||
->where('owner_id', $query->first()->owner_id)
|
||||
->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])
|
||||
->whereIn('type', [TransactionType::TOP_UP, TransactionType::CREDIT_NOTE, TransactionType::GROUP_PAYMENT])
|
||||
->sum('amount');
|
||||
|
||||
$wallet_total_outgoing = Transaction::where('owner_type', $query->first()->owner_type)
|
||||
->where('owner_id', $query->first()->owner_id)
|
||||
->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])
|
||||
->whereIn('type', [TransactionType::PAYMENT, TransactionType::DEBIT_NOTE])
|
||||
->sum('amount');
|
||||
|
||||
$currentWalletBalance = $wallet_total_incoming - $wallet_total_outgoing;
|
||||
$incoming = Transaction::where('owner_type', $query->first()->owner_type)
|
||||
->where('owner_id', $query->first()->owner_id)
|
||||
->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])
|
||||
->whereIn('type', [TransactionType::TOP_UP, TransactionType::CREDIT_NOTE, TransactionType::GROUP_PAYMENT])
|
||||
->where('id', '>', $query->first()->id)
|
||||
->sum('amount');
|
||||
$outgoing = Transaction::where('owner_type', $query->first()->owner_type)
|
||||
->where('owner_id', $query->first()->owner_id)
|
||||
->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])
|
||||
->whereIn('type', [TransactionType::PAYMENT, TransactionType::DEBIT_NOTE])
|
||||
->where('id', '>', $query->first()->id)
|
||||
->sum('amount');
|
||||
$runningBalanceInReverse = $currentWalletBalance - $incoming + $outgoing;
|
||||
$request['running_balance'] = $runningBalanceInReverse;
|
||||
}
|
||||
|
||||
return $this->collectionResponse(WalletTransactionResource::collection($query));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace App\Classes\Modules\Transactions\ControllersLogic;
|
||||
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\Documents\DataTransferObjects\DocumentObject;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\DocumentType;
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use App\Models\Order;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Mccarlosen\LaravelMpdf\Facades\LaravelMpdf;
|
||||
use App\Classes\Modules\Documents\Services\CreatesDocument;
|
||||
use App\Classes\Modules\Documents\Services\CreatesFiles;
|
||||
use App\Classes\Modules\Transactions\Services\FetchesTransaction;
|
||||
use App\Models\Document;
|
||||
|
||||
class RegenerateSingleShippingInvoiceTransactionLogic extends AbstractControllerLogic
|
||||
{
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function notification():array {
|
||||
return [
|
||||
'title' => 'Regenerate Shipping Invoice',
|
||||
'message' => 'You have successfully regenerated shipping invoice'
|
||||
];
|
||||
}
|
||||
|
||||
/** @var CreatesDocument */
|
||||
private $createsDocument;
|
||||
|
||||
/** @var CreatesFiles */
|
||||
private $createsFiles;
|
||||
|
||||
/** @var FetchesTransaction */
|
||||
private $fetchesTransaction;
|
||||
|
||||
/**
|
||||
* @param CreatesDocument $createsDocument
|
||||
*/
|
||||
public function __construct(CreatesDocument $createsDocument, CreatesFiles $createsFiles, FetchesTransaction $fetchesTransaction)
|
||||
{
|
||||
$this->createsDocument = $createsDocument;
|
||||
$this->createsFiles = $createsFiles;
|
||||
$this->fetchesTransaction = $fetchesTransaction;
|
||||
}
|
||||
|
||||
public function logic(Request $request) : JsonResponse
|
||||
{
|
||||
$invoice = $this->fetchesTransaction->execute(['id' => $request->route('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'
|
||||
);
|
||||
|
||||
$document =$this->createsDocument->execute($invoice, $document_object);
|
||||
|
||||
$this->createsFiles->execute($document, $document_object);
|
||||
|
||||
// dump($document);
|
||||
|
||||
return $this->response([]);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Exports;
|
||||
|
||||
use App\Classes\Modules\Exports\Services\ExportsCustomersWalletTransactionHistory;
|
||||
use App\Models\User;
|
||||
use App\Models\Wallet;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Maatwebsite\Excel\Excel;
|
||||
|
||||
class ExportCustomersWalletTransactionToExcelController
|
||||
{
|
||||
|
||||
/**
|
||||
* ExportCustomersWalletTransactionToExcelController constructor.
|
||||
* @param Request $request
|
||||
*/
|
||||
public function __construct(Request $request)
|
||||
{
|
||||
$token = Auth::fromUser(User::find(1));
|
||||
$request->headers->set('Authorization', 'Bearer ' . $token);
|
||||
}
|
||||
|
||||
public function export(Request $request)
|
||||
{
|
||||
$exportsTransactions = new ExportsCustomersWalletTransactionHistory($request);
|
||||
$wallet = Wallet::find($request->route('wallet_id'));
|
||||
$company_marking = $wallet->owner->connections->first()->invitee_reference;
|
||||
|
||||
$filename = $company_marking . '-wallet-' . ($request->route('is_precise') == 'true' ? 'precise-' : '') . 'transaction-history.xls';
|
||||
$response = $exportsTransactions->download($filename, Excel::XLS, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']);
|
||||
ob_end_clean();
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace App\Http\Controllers\Transactions;
|
||||
|
||||
use App\Classes\Modules\Transactions\ControllersLogic\ListWalletTransactionsLogic;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
|
||||
class ListWalletTransactionsController
|
||||
{
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param ListWalletTransactionsLogic $logic
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function list(Request $request, ListWalletTransactionsLogic $logic) : JsonResponse {
|
||||
return $logic->execute($request);
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace App\Http\Controllers\Transactions;
|
||||
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Classes\Modules\Transactions\ControllersLogic\RegenerateSingleShippingInvoiceTransactionLogic;
|
||||
|
||||
|
||||
class RegenerateSingleShippingInvoiceTransactionController
|
||||
{
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param RegenerateShippingInvoiceTransactionLogic $logic
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function regenerate(Request $request, RegenerateSingleShippingInvoiceTransactionLogic $logic) : JsonResponse {
|
||||
return $logic->execute($request);
|
||||
}
|
||||
}
|
||||
@@ -34,7 +34,7 @@ class HelpMenuQuestionResource extends JsonResource
|
||||
'question_number' => $q->question_number,
|
||||
'question_text' => $q->question_text,
|
||||
'question_type' => $q->question_type,
|
||||
'question_answers' => HelpMenuAnswerOptionsResource::collection(QAAnswerOptions::where('question_number', $q->question_number)->where('questionnaire_set_id', $q->questionnaire_set_id)->get()),
|
||||
'question_answers' => HelpMenuAnswerOptionsResource::collection(QAAnswerOptions::where('question_number', $q->question_number)->where('questionnaire_set_id', $q->questionnaire_set_id)->orderBy('order', 'ASC')->get()),
|
||||
'questionnaire_set_id' => $q->questionnaire_set_id,
|
||||
'next_nested_question' => $q->next_nested_question,
|
||||
'next_main_question' => $q->next_main_question,
|
||||
|
||||
@@ -18,6 +18,7 @@ class HelpMenuQuestionnaireSetsResource extends JsonResource
|
||||
'name' => $this->name,
|
||||
'description' => $this->description,
|
||||
'group' => $this->group,
|
||||
'version' => $this->version,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
use App\Classes\ValueObjects\Constants\QASystemSourceType;
|
||||
use App\Models\QAAnswerOptions;
|
||||
use App\Models\QAQuestions;
|
||||
use Carbon\Carbon;
|
||||
|
||||
@@ -20,6 +21,7 @@ class HelpMenuQuestionsAnswersResource extends JsonResource
|
||||
$question = QAQuestions::where('id', $this->question_id)->first();
|
||||
$source = new HelpMenuUserSourceResource($this->userSource);
|
||||
$user = $this->source_id === 0 ? new UserResource($this->user) : null;
|
||||
$answerOption = QAAnswerOptions::where('id', $this->answer_option_id)->first();
|
||||
|
||||
$user_marking = '';
|
||||
if($user){
|
||||
@@ -31,7 +33,8 @@ class HelpMenuQuestionsAnswersResource extends JsonResource
|
||||
'question_id' => $this->question_id,
|
||||
'questionnaire' => new HelpMenuQuestionnaireSetsResource($this->question->questionnaire),
|
||||
'question_text' => $question ? $question->question_text : null,
|
||||
'free_text_answer' => $this->free_text_answer,
|
||||
'free_text_answer' => $answerOption ? $answerOption->display_text : null,
|
||||
'answer_value' => $answerOption ? $answerOption->value : null,
|
||||
'source_system' => $user ? QASystemSourceType::getText(QASystemSourceType::IZYIM) : QASystemSourceType::getText($source->system),
|
||||
'source_marking' => $user ? $user_marking : $source->marking,
|
||||
'source_email' => $user ? $user->email : $source->email,
|
||||
|
||||
@@ -24,6 +24,7 @@ class TransactionResource extends JsonResource
|
||||
{
|
||||
$order = null;
|
||||
$groupTransactions = null;
|
||||
$packingListReference = null;
|
||||
|
||||
if ($this->owner instanceof Transaction) {
|
||||
if ($this->owner) {
|
||||
@@ -47,6 +48,7 @@ class TransactionResource extends JsonResource
|
||||
'id' => $this->id,
|
||||
'owner_type' => $this->owner_type,
|
||||
'order' => $order,
|
||||
'packing_list_reference' => $packingListReference,
|
||||
'group_transactions' => $groupTransactions,
|
||||
'group_reference' => $groupTransactions ? $group->reference : null,
|
||||
'documents' => $groupTransactions ? DocumentResource::collection($this->documents->where('status', ApprovalStatus::PENDING_VERIFICATION)) : DocumentResource::collection($this->documents),
|
||||
|
||||
@@ -20,33 +20,41 @@ class WalletTransactionResource extends JsonResource
|
||||
public function toArray($request)
|
||||
{
|
||||
$description = '';
|
||||
$current_running_balance = $request['running_balance'];
|
||||
switch((int) $this->type){
|
||||
case TransactionType::TOP_UP:
|
||||
$description = (double) $this->amount.' Credit Top up';
|
||||
$request['running_balance'] = bcsub($request['running_balance'], $this->amount, 5);
|
||||
break;
|
||||
case TransactionType::CREDIT_NOTE:
|
||||
$description = 'Credit Voucher for '.$this->payment_reference;
|
||||
$request['running_balance'] = bcsub($request['running_balance'], $this->amount, 5);
|
||||
break;
|
||||
case TransactionType::PAYMENT:
|
||||
$invoice = Transaction::where('payment_reference', $this->bill_no)->first();
|
||||
if(!$invoice) {
|
||||
Log::channel('paymentUnknownOrderLog')->info('ID: ' . $this->id);
|
||||
$description = 'Payment for unknown invoice, please contact tech support.';
|
||||
break;
|
||||
}
|
||||
|
||||
$order = $invoice->owner->owner->owner;
|
||||
if(!$order) {
|
||||
Log::channel('paymentUnknownOrderLog')->info('ID: ' . $this->id);
|
||||
$description = 'Payment for unknown order, please contact tech support.';
|
||||
break;
|
||||
}
|
||||
|
||||
$request['running_balance'] = bcadd($request['running_balance'], $this->amount, 5);
|
||||
$marking = $order->reference;
|
||||
$description = 'Payment For order refs.'.'<a href="'.route('order.details', $marking).'">'.$marking.'</a>';
|
||||
break;
|
||||
case 11:
|
||||
$request['running_balance'] = bcadd($request['running_balance'], $this->amount, 5);
|
||||
$description = 'Debit Voucher for '.$this->payment_reference;
|
||||
break;
|
||||
case 15:
|
||||
$request['running_balance'] = bcsub($request['running_balance'], $this->amount, 5);
|
||||
$description = (double) $this->amount.' Credit Top up';
|
||||
break;
|
||||
|
||||
@@ -61,6 +69,7 @@ class WalletTransactionResource extends JsonResource
|
||||
'payment_method' => (float) $this->payment_method,
|
||||
// 'issuer_name' => $this->issuerCompany->name,
|
||||
'amount' => (double) $this->amount,
|
||||
'running_balance' => (double) $current_running_balance,
|
||||
'service_charge' => (double) $this->service_charge,
|
||||
'tax' => (double) $this->tax,
|
||||
'status' => (int) $this->status,
|
||||
|
||||
@@ -46,4 +46,13 @@ class QAUserAnswerSelected extends AbstractModel implements Documentable
|
||||
return $this->BelongsTo(QAQuestions::class, 'question_id', 'id');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function answer(): BelongsTo
|
||||
{
|
||||
return $this->BelongsTo(QAAnswerOptions::class, 'answer_option_id', 'id');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -100,6 +100,12 @@ return [
|
||||
'emergency' => [
|
||||
'path' => storage_path('logs/laravel.log'),
|
||||
],
|
||||
|
||||
'paymentUnknownOrderLog' => [
|
||||
'driver' => 'single',
|
||||
'path' => storage_path('logs/paymentUnknownOrderLog.log'),
|
||||
'level' => 'info',
|
||||
],
|
||||
],
|
||||
|
||||
];
|
||||
|
||||
@@ -26,7 +26,12 @@ class DatabaseSeeder extends Seeder
|
||||
// $this->call(QAQuestionsDemoSeeder::class); //DEMO POC
|
||||
// $this->call(QAAnswerOptionsDemoSeeder::class); //DEMO POC
|
||||
|
||||
// 20230928 Set 1 to Set 3
|
||||
// $this->call(QAQuestionsSeeder::class);
|
||||
// $this->call(QAAnswerOptionsSeeder::class);
|
||||
|
||||
// 20231121 Set 4 to Set 6
|
||||
// $this->call(QAQuestions2Seeder::class);
|
||||
// $this->call(QAAnswerOptions2Seeder::class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,395 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use App\Models\QAAnswerOptions;
|
||||
|
||||
class QAAnswerOptions2Seeder extends Seeder
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
// Set 1
|
||||
// Option 1 for Question 10
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Very Dissatisfied";
|
||||
$answerOption->value = "1";
|
||||
$answerOption->order = 1;
|
||||
$answerOption->question_number = 10;
|
||||
$answerOption->questionnaire_set_id = 4;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 2 for Question 10
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Dissatisfied";
|
||||
$answerOption->value = "2";
|
||||
$answerOption->order = 2;
|
||||
$answerOption->question_number = 10;
|
||||
$answerOption->questionnaire_set_id = 4;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 3 for Question 10
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Neutral";
|
||||
$answerOption->value = "3";
|
||||
$answerOption->order = 3;
|
||||
$answerOption->question_number = 10;
|
||||
$answerOption->questionnaire_set_id = 4;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 4 for Question 10
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Satisfied";
|
||||
$answerOption->value = "4";
|
||||
$answerOption->order = 4;
|
||||
$answerOption->question_number = 10;
|
||||
$answerOption->questionnaire_set_id = 4;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 5 for Question 10
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Very Satisfied";
|
||||
$answerOption->value = "5";
|
||||
$answerOption->order = 5;
|
||||
$answerOption->question_number = 10;
|
||||
$answerOption->questionnaire_set_id = 4;
|
||||
$answerOption->save();
|
||||
|
||||
|
||||
|
||||
// Set 1
|
||||
// Option 1 for Question 20
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Yes";
|
||||
$answerOption->value = "3";
|
||||
$answerOption->order = 3;
|
||||
$answerOption->question_number = 20;
|
||||
$answerOption->questionnaire_set_id = 4;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 2 for Question 20
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Partially";
|
||||
$answerOption->value = "2";
|
||||
$answerOption->order = 2;
|
||||
$answerOption->question_number = 20;
|
||||
$answerOption->questionnaire_set_id = 4;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 3 for Question 20
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "No";
|
||||
$answerOption->value = "1";
|
||||
$answerOption->order = 1;
|
||||
$answerOption->question_number = 20;
|
||||
$answerOption->questionnaire_set_id = 4;
|
||||
$answerOption->save();
|
||||
|
||||
|
||||
|
||||
// Set 1
|
||||
// Option 1 for Question 30
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Very Clear";
|
||||
$answerOption->value = "5";
|
||||
$answerOption->order = 5;
|
||||
$answerOption->question_number = 30;
|
||||
$answerOption->questionnaire_set_id = 4;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 2 for Question 30
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Clear";
|
||||
$answerOption->value = "4";
|
||||
$answerOption->order = 4;
|
||||
$answerOption->question_number = 30;
|
||||
$answerOption->questionnaire_set_id = 4;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 3 for Question 30
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Neutral";
|
||||
$answerOption->value = "3";
|
||||
$answerOption->order = 3;
|
||||
$answerOption->question_number = 30;
|
||||
$answerOption->questionnaire_set_id = 4;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 4 for Question 30
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Unclear";
|
||||
$answerOption->value = "2";
|
||||
$answerOption->order = 2;
|
||||
$answerOption->question_number = 30;
|
||||
$answerOption->questionnaire_set_id = 4;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 5 for Question 30
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Very Unclear";
|
||||
$answerOption->value = "1";
|
||||
$answerOption->order = 1;
|
||||
$answerOption->question_number = 30;
|
||||
$answerOption->questionnaire_set_id = 4;
|
||||
$answerOption->save();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Set 2
|
||||
// Option 1 for Question 10
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Yes";
|
||||
$answerOption->value = "3";
|
||||
$answerOption->order = 3;
|
||||
$answerOption->question_number = 10;
|
||||
$answerOption->questionnaire_set_id = 5;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 2 for Question 10
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Somewhat";
|
||||
$answerOption->value = "2";
|
||||
$answerOption->order = 2;
|
||||
$answerOption->question_number = 10;
|
||||
$answerOption->questionnaire_set_id = 5;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 3 for Question 10
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "No";
|
||||
$answerOption->value = "1";
|
||||
$answerOption->order = 1;
|
||||
$answerOption->question_number = 10;
|
||||
$answerOption->questionnaire_set_id = 5;
|
||||
$answerOption->save();
|
||||
|
||||
|
||||
|
||||
// Set 2
|
||||
// Option 1 for Question 20
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Exceeded Expectations";
|
||||
$answerOption->value = "3";
|
||||
$answerOption->order = 3;
|
||||
$answerOption->question_number = 20;
|
||||
$answerOption->questionnaire_set_id = 5;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 2 for Question 20
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Met Expectations";
|
||||
$answerOption->value = "2";
|
||||
$answerOption->order = 2;
|
||||
$answerOption->question_number = 20;
|
||||
$answerOption->questionnaire_set_id = 5;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 3 for Question 20
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Below Expectations";
|
||||
$answerOption->value = "1";
|
||||
$answerOption->order = 1;
|
||||
$answerOption->question_number = 20;
|
||||
$answerOption->questionnaire_set_id = 5;
|
||||
$answerOption->save();
|
||||
|
||||
|
||||
|
||||
// Set 2
|
||||
// Option 1 for Question 30
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Very Dissatisfied";
|
||||
$answerOption->value = "1";
|
||||
$answerOption->order = 1;
|
||||
$answerOption->question_number = 30;
|
||||
$answerOption->questionnaire_set_id = 5;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 2 for Question 30
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Dissatisfied";
|
||||
$answerOption->value = "2";
|
||||
$answerOption->order = 2;
|
||||
$answerOption->question_number = 30;
|
||||
$answerOption->questionnaire_set_id = 5;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 3 for Question 30
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Neutral";
|
||||
$answerOption->value = "3";
|
||||
$answerOption->order = 3;
|
||||
$answerOption->question_number = 30;
|
||||
$answerOption->questionnaire_set_id = 5;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 4 for Question 30
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Satisfied";
|
||||
$answerOption->value = "4";
|
||||
$answerOption->order = 4;
|
||||
$answerOption->question_number = 30;
|
||||
$answerOption->questionnaire_set_id = 5;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 5 for Question 30
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Very Satisfied";
|
||||
$answerOption->value = "5";
|
||||
$answerOption->order = 5;
|
||||
$answerOption->question_number = 30;
|
||||
$answerOption->questionnaire_set_id = 5;
|
||||
$answerOption->save();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Set 3
|
||||
// Option 1 for Question 10
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Immediately";
|
||||
$answerOption->value = "5";
|
||||
$answerOption->order = 5;
|
||||
$answerOption->question_number = 10;
|
||||
$answerOption->questionnaire_set_id = 6;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 2 for Question 10
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Within a few hours";
|
||||
$answerOption->value = "4";
|
||||
$answerOption->order = 4;
|
||||
$answerOption->question_number = 10;
|
||||
$answerOption->questionnaire_set_id = 6;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 3 for Question 10
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Within a day";
|
||||
$answerOption->value = "3";
|
||||
$answerOption->order = 3;
|
||||
$answerOption->question_number = 10;
|
||||
$answerOption->questionnaire_set_id = 6;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 4 for Question 10
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "More than a day";
|
||||
$answerOption->value = "2";
|
||||
$answerOption->order = 2;
|
||||
$answerOption->question_number = 10;
|
||||
$answerOption->questionnaire_set_id = 6;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 5 for Question 10
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Never received a response";
|
||||
$answerOption->value = "1";
|
||||
$answerOption->order = 1;
|
||||
$answerOption->question_number = 10;
|
||||
$answerOption->questionnaire_set_id = 6;
|
||||
$answerOption->save();
|
||||
|
||||
|
||||
|
||||
// Set 3
|
||||
// Option 1 for Question 20
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Very Clear";
|
||||
$answerOption->value = "5";
|
||||
$answerOption->order = 5;
|
||||
$answerOption->question_number = 20;
|
||||
$answerOption->questionnaire_set_id = 6;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 2 for Question 20
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Clear";
|
||||
$answerOption->value = "4";
|
||||
$answerOption->order = 4;
|
||||
$answerOption->question_number = 20;
|
||||
$answerOption->questionnaire_set_id = 6;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 3 for Question 20
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Neutral";
|
||||
$answerOption->value = "3";
|
||||
$answerOption->order = 3;
|
||||
$answerOption->question_number = 20;
|
||||
$answerOption->questionnaire_set_id = 6;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 4 for Question 20
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Unclear";
|
||||
$answerOption->value = "2";
|
||||
$answerOption->order = 2;
|
||||
$answerOption->question_number = 20;
|
||||
$answerOption->questionnaire_set_id = 6;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 5 for Question 20
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Very Unclear";
|
||||
$answerOption->value = "1";
|
||||
$answerOption->order = 1;
|
||||
$answerOption->question_number = 20;
|
||||
$answerOption->questionnaire_set_id = 6;
|
||||
$answerOption->save();
|
||||
|
||||
|
||||
|
||||
// Set 3
|
||||
// Option 1 for Question 30
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Very Likely";
|
||||
$answerOption->value = "5";
|
||||
$answerOption->order = 5;
|
||||
$answerOption->question_number = 30;
|
||||
$answerOption->questionnaire_set_id = 6;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 2 for Question 30
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Likely";
|
||||
$answerOption->value = "4";
|
||||
$answerOption->order = 4;
|
||||
$answerOption->question_number = 30;
|
||||
$answerOption->questionnaire_set_id = 6;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 3 for Question 30
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Neutral";
|
||||
$answerOption->value = "3";
|
||||
$answerOption->order = 3;
|
||||
$answerOption->question_number = 30;
|
||||
$answerOption->questionnaire_set_id = 6;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 4 for Question 30
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Unlikely";
|
||||
$answerOption->value = "2";
|
||||
$answerOption->order = 2;
|
||||
$answerOption->question_number = 30;
|
||||
$answerOption->questionnaire_set_id = 6;
|
||||
$answerOption->save();
|
||||
|
||||
// Option 5 for Question 30
|
||||
$answerOption = new QAAnswerOptions;
|
||||
$answerOption->display_text = "Very Unlikely";
|
||||
$answerOption->value = "1";
|
||||
$answerOption->order = 1;
|
||||
$answerOption->question_number = 30;
|
||||
$answerOption->questionnaire_set_id = 6;
|
||||
$answerOption->save();
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use App\Models\QAQuestionnaireSet;
|
||||
use App\Models\QAQuestions;
|
||||
use App\Classes\ValueObjects\Constants\QAType;
|
||||
|
||||
class QAQuestions2Seeder extends Seeder
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
$questionnaireSets = [
|
||||
[
|
||||
'name' => 'Set 1',
|
||||
'description' => 'Customer Support Satisfaction Survey',
|
||||
'group' => 'feedback',
|
||||
'version' => 2
|
||||
],
|
||||
[
|
||||
'name' => 'Set 2',
|
||||
'description' => 'First Order Experience Feedback',
|
||||
'group' => 'feedback',
|
||||
'version' => 2
|
||||
],
|
||||
[
|
||||
'name' => 'Set 3',
|
||||
'description' => 'Sales Inquiry Experience',
|
||||
'group' => 'feedback',
|
||||
'version' => 2
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($questionnaireSets as $set) {
|
||||
$questionnaireSet = QAQuestionnaireSet::create([
|
||||
'name' => $set['name'],
|
||||
'description' => $set['description'],
|
||||
'group' => $set['group'],
|
||||
'version' => $set['version'],
|
||||
]);
|
||||
|
||||
$questions = [];
|
||||
|
||||
switch ($set['name']) {
|
||||
case 'Set 1':
|
||||
$questions = [
|
||||
[
|
||||
'question_number' => 10,
|
||||
'question_text' => 'How satisfied are you with the time it took to receive a response?',
|
||||
'question_type' => QAType::MULTIPLE_CHOICES,
|
||||
'is_start' => true,
|
||||
'is_end' => false,
|
||||
],
|
||||
[
|
||||
'question_number' => 20,
|
||||
'question_text' => 'Was your issue resolved during this interaction?',
|
||||
'question_type' => QAType::MULTIPLE_CHOICES,
|
||||
'is_start' => false,
|
||||
'is_end' => false,
|
||||
],
|
||||
[
|
||||
'question_number' => 30,
|
||||
'question_text' => 'How clear and understandable was the communication from the support team?',
|
||||
'question_type' => QAType::MULTIPLE_CHOICES,
|
||||
'is_start' => false,
|
||||
'is_end' => true,
|
||||
]
|
||||
];
|
||||
break;
|
||||
case 'Set 2':
|
||||
$questions = [
|
||||
[
|
||||
'question_number' => 10,
|
||||
'question_text' => 'Did you find what you were looking for without any issues?',
|
||||
'question_type' => QAType::MULTIPLE_CHOICES,
|
||||
'is_start' => true,
|
||||
'is_end' => false,
|
||||
],
|
||||
[
|
||||
'question_number' => 20,
|
||||
'question_text' => 'Did the service meet your expectations?',
|
||||
'question_type' => QAType::MULTIPLE_CHOICES,
|
||||
'is_start' => false,
|
||||
'is_end' => false,
|
||||
],
|
||||
[
|
||||
'question_number' => 30,
|
||||
'question_text' => 'How satisfied are you with the delivery time?',
|
||||
'question_type' => QAType::MULTIPLE_CHOICES,
|
||||
'is_start' => false,
|
||||
'is_end' => true,
|
||||
]
|
||||
];
|
||||
break;
|
||||
case 'Set 3':
|
||||
$questions = [
|
||||
[
|
||||
'question_number' => 10,
|
||||
'question_text' => 'How quickly did our sales team respond to your inquiry?',
|
||||
'question_type' => QAType::MULTIPLE_CHOICES,
|
||||
'is_start' => true,
|
||||
'is_end' => false,
|
||||
],
|
||||
[
|
||||
'question_number' => 20,
|
||||
'question_text' => 'Was the information provided by our sales team clear and easy to understand?',
|
||||
'question_type' => QAType::MULTIPLE_CHOICES,
|
||||
'is_start' => false,
|
||||
'is_end' => false,
|
||||
],
|
||||
[
|
||||
'question_number' => 30,
|
||||
'question_text' => 'After interacting with our sales team, how likely are you to use our service?',
|
||||
'question_type' => QAType::MULTIPLE_CHOICES,
|
||||
'is_start' => false,
|
||||
'is_end' => true,
|
||||
]
|
||||
];
|
||||
break;
|
||||
}
|
||||
|
||||
foreach ($questions as $key => $questionData) {
|
||||
$question = new QAQuestions;
|
||||
$question->question_number = $questionData['question_number'];
|
||||
$question->question_text = $questionData['question_text'];
|
||||
$question->question_type = $questionData['question_type'];
|
||||
$question->questionnaire_set_id = $questionnaireSet->id;
|
||||
|
||||
if (isset($questionData['next_nested_question'])) {
|
||||
$question->next_nested_question = $questionData['next_nested_question'];
|
||||
}
|
||||
if (isset($questionData['next_main_question'])) {
|
||||
$question->next_main_question = $questionData['next_main_question'];
|
||||
}
|
||||
|
||||
$question->is_start = $questionData['is_start'];
|
||||
$question->is_end = $questionData['is_end'];
|
||||
if (isset($questionData['end_text'])) {
|
||||
$question->end_text = $questionData['end_text'];
|
||||
}
|
||||
|
||||
$question->order = $key + 1;
|
||||
$question->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div v-if="$store.getters.isAdmin" class="btn btn-sm btn-danger pointer m-t-10 m-b-15 d-none" @click="submit(route('api.transaction.invoice.company.regenerate', company_module_id), 'post', section, true , true)">Regenerate Invoice</div>
|
||||
<div v-if="$store.getters.isAdmin" class="btn btn-sm btn-danger pointer m-t-10 m-b-15" @click="submit(route('api.transaction.invoice.company.regenerate', company_module_id), 'post', section, true , true)">Regenerate Invoice</div>
|
||||
<div class="row flex-nowrap">
|
||||
<div class="col">
|
||||
<div class="row tabsContainer">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<div class="col">
|
||||
<div class="row align-items-center justify-content-center m-b-10">
|
||||
<div class="col-auto p-r-10">
|
||||
<h5 class="light">Welcome Abroad <span class="text-primary">{{$store.getters.getUserName}}</span>, we provide logistics services.</h5>
|
||||
<h5 class="light">Welcome Aboard <span class="text-primary">{{$store.getters.getUserName}}</span>, we provide logistics services.</h5>
|
||||
</div>
|
||||
<div class="col-auto b-a b-thick b-primary padding-5">
|
||||
<h5 class="light no-margin">Powered by technology, delivered by experts.</h5>
|
||||
@@ -99,4 +99,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
<template>
|
||||
<div class="row parentContainer">
|
||||
<div class="col-1">{{ item.questionnaire.version }}</div>
|
||||
<div class="col-1">{{ item.questionnaire.description }}</div>
|
||||
<div class="col-2"> <p>{{ item.question_text }}</p> </div>
|
||||
<div class="col-1">{{ item.free_text_answer }}</div>
|
||||
<div class="col-1">{{ item.answer_value }}</div>
|
||||
<div class="col-1">{{ item.source_system }}</div>
|
||||
<div class="col-1">{{ item.source_marking }}</div>
|
||||
<div class="col-2">{{ item.source_email }}</div>
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
<div class="col-12 col-md-8">
|
||||
<validation-wrapper-component selectable class="m-b-15" :validator="$v.parameters.question_set">
|
||||
<label class="text-primary">Question Set</label>
|
||||
<select-component :options="[{'id': 1, 'text': 'Customer Support Satisfaction Survey'}, {'id': 2, 'text': 'First Order Experience Feedback'}, {'id': 3, 'text': 'Sales Inquiry Experience'}]" v-model="parameters.question_set"></select-component>
|
||||
<select-component :options="[{'id': 4, 'text': 'Customer Support Satisfaction Survey'}, {'id': 5, 'text': 'First Order Experience Feedback'}, {'id': 6, 'text': 'Sales Inquiry Experience'}]" v-model="parameters.question_set"></select-component>
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<p class="bold m-b-5 fs-12">{{item.description}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-b-10 align-items-center" v-if="$store.getters.isAdmin">
|
||||
<div class="row m-b-10 align-items-center">
|
||||
<div class="col-auto">
|
||||
<p class="no-margin all-caps fs-10 lh-10 light">Reference</p>
|
||||
<p class="no-margin fs-12">{{item.reference}}</p>
|
||||
@@ -58,7 +58,7 @@
|
||||
<small class="fs-10 all-caps muted">Status</small>
|
||||
<p class="no-margin bold">{{item.container ? item.container.transport.schedule_complete && status === 'Shipping' ? 'Custom Clearance' : status : status}}</p>
|
||||
</div>
|
||||
<div class="col-auto" v-if="$store.getters.isAdmin">
|
||||
<div class="col-auto">
|
||||
<small class="fs-10 all-caps muted">Container</small>
|
||||
<p class="no-margin bold">{{item.container ? item.container.container_reference : '-'}}</p>
|
||||
</div>
|
||||
@@ -66,7 +66,7 @@
|
||||
<div class="row">
|
||||
<div class="col-auto">
|
||||
<small class="fs-10 all-caps muted">Warehouse</small>
|
||||
<h6 class="no-margin small">{{item.order.warehouse.name}} {{$store.getters.isAdmin ? item.order.warehouse.reference : ''}}</h6>
|
||||
<h6 class="no-margin small">{{item.order.warehouse.name}} {{ item.order.warehouse.reference }}</h6>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<small class="fs-10 all-caps muted">Delivery Address</small>
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<p class="no-margin all-caps fs-10 light">Est. CBM</p>
|
||||
<p class="no-margin">{{((parseFloat(item.cbm) * 1000) / 1000).toFixed(3)}}</p>
|
||||
</div>
|
||||
<div class="col" v-if="$store.getters.isAdmin">
|
||||
<div class="col">
|
||||
<p class="no-margin all-caps fs-10 light">Warehouse</p>
|
||||
<p class="no-margin" v-if="item.order">{{item.order.warehouse.reference}}</p>
|
||||
<span class='text-danger' v-if="!item.order">Unclaimed</span>
|
||||
@@ -75,7 +75,7 @@
|
||||
<p class="no-margin bold text-info fs-12"><a :href="route('customer.profile', item.order.company_module.marking)">{{item.order.company_module.marking}}</a></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-b-5" v-if="$store.getters.isAdmin">
|
||||
<div class="row m-b-5">
|
||||
<div class="col-auto p-r-5">
|
||||
<p class="no-margin all-caps fs-10 light">Reference</p>
|
||||
</div>
|
||||
|
||||
+14
-28
@@ -84,6 +84,20 @@
|
||||
<address-form-component :id="item.order.company_module.id" :section="section" :type=1></address-form-component>
|
||||
</modal-component>
|
||||
</div>
|
||||
<div class="row" v-if="item.order.company_module.billingAddress">
|
||||
<div class="col">
|
||||
<div class="col-auto requestModal pointer" data-type="editBillingAddress">
|
||||
<i class="fa fa-edit pointer fa-fw m-l-5"></i> Edit billing Address
|
||||
</div>
|
||||
<modal-component class="animate__animated animate__fast animate__fadeIn" size="extra-large" styleType="fill-in" type="editBillingAddress">
|
||||
<div class="row">
|
||||
<div class="col bg-white">
|
||||
<address-form-component :id="item.order.company_module.id" :data="item.order.company_module.billingAddress" section="editBillingAddress"></address-form-component>
|
||||
</div>
|
||||
</div>
|
||||
</modal-component>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!item.order.address.post_code_area">
|
||||
<div class="btn btn-xs btn-primary pointer m-t-10 requestModal btn-block" data-type="defineLocation">Define Location</div>
|
||||
<modal-component class="animate_animated animatefast animate_fadeIn" styleType="fill-in" type="defineLocation">
|
||||
@@ -110,34 +124,6 @@
|
||||
</modal-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row text-center parentContainer m-t-10" v-if="['Pending Invoice', 'Pending Approval'].includes(invoice_status)" >
|
||||
<div class="col">
|
||||
<div class="row" v-if="!item.order.company_module.billingAddress">
|
||||
<div class="col">
|
||||
<div>
|
||||
<div class="btn btn-primary btn-xs pointer requestModal btn-block" data-type="billingAddressComponent">Add Billing Address</div>
|
||||
<modal-component class="animate__animated animate__fast animate__fadeIn" size="extra-large" styleType="fill-in" type="billingAddressComponent">
|
||||
<address-form-component :id="item.order.company_module.id" :section="section" :type=1></address-form-component>
|
||||
</modal-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" v-if="item.order.company_module.billingAddress">
|
||||
<div class="col">
|
||||
<div class="col-auto requestModal pointer" data-type="editBillingAddress">
|
||||
<i class="fa fa-edit pointer fa-fw m-l-5"></i> Edit billing Address
|
||||
</div>
|
||||
<modal-component class="animate__animated animate__fast animate__fadeIn" size="extra-large" styleType="fill-in" type="editBillingAddress">
|
||||
<div class="row">
|
||||
<div class="col bg-white">
|
||||
<address-form-component :id="item.order.company_module.id" :data="item.order.company_module.billingAddress" section="editBillingAddress"></address-form-component>
|
||||
</div>
|
||||
</div>
|
||||
</modal-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+63
-24
@@ -4,11 +4,19 @@
|
||||
<div class="row" :class="[{'b-danger': item.status == 5 ||item.status == 6, 'b-a': item.status == 5||item.status == 6}]">
|
||||
<div class="col padding-20">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-2">
|
||||
<p class="no-margin fs-10 all-caps">Invoice No</p>
|
||||
<div> {{ item.bill_no }}</div>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<p class="no-margin fs-10 all-caps">Reference</p>
|
||||
<div> {{ item.packing_list_reference }}</div>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<p class="no-margin fs-10 all-caps">Invoice Date</p>
|
||||
<div> {{ item.updated_at }}</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="col-2">
|
||||
<p class="no-margin fs-10 all-caps">Status</p>
|
||||
<div class="all-caps" v-if="item.status == 3">Payment Completed</div>
|
||||
<div class="all-caps text-danger" v-else-if="item.status == 5">Dispute in progress</div>
|
||||
@@ -19,7 +27,7 @@
|
||||
<p class="no-margin fs-10 all-caps">Amount</p>
|
||||
<div>MYR {{ item.amount.toFixed(2) }}</div>
|
||||
</div>
|
||||
<div class="col-3" v-if="item.remarks.length">
|
||||
<div class="col-2" v-if="item.remarks.length">
|
||||
<p class="no-margin fs-10 all-caps">Billing Question</p>
|
||||
<div>
|
||||
{{ latestComment.content }}
|
||||
@@ -31,39 +39,70 @@
|
||||
<remark-component :section="section" :data="item" module_type="Transaction"></remark-component>
|
||||
</modal-component>
|
||||
</div>
|
||||
<div class="col-3" v-else>
|
||||
<!-- <div class="col-2" >
|
||||
<p class="no-margin fs-10 all-caps invisible">Billing Question</p>
|
||||
<div>
|
||||
<span class="btn requestModal no-border invisible">
|
||||
<i class="fa fa-edit"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto p-l-0 p-r-0 d-flex justify-content-center align-items-center">
|
||||
<div :class="[{'invisible': [5, 6, 3].includes(item.status)}]">
|
||||
<span class="d-inline-block m-r-15 text-primary bold text-underline pointer requestModal" data-type="billingRemark">Billing Question?</span>
|
||||
</div>
|
||||
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="billingRemark">
|
||||
<customer-invoice-remark-form-component module_type="Transaction" :data="item" :section="section"></customer-invoice-remark-form-component>
|
||||
</modal-component>
|
||||
<div v-if="item.documents.length">
|
||||
<div v-for="file in item.documents[0].files" v-bind:key="file.id" class="col-auto no-padding">
|
||||
<document-file-viewer-component :file="file">
|
||||
<template slot="button">
|
||||
<div class="btn bg-grey no-border muted">
|
||||
<i class="fa fa-file-pdf-o"></i>
|
||||
</div>
|
||||
</template>
|
||||
</document-file-viewer-component>
|
||||
</div> -->
|
||||
<div class="col-2">
|
||||
<div class="row p-l-15">
|
||||
<div class="col-auto p-l-0 p-r-0 d-flex justify-content-center align-items-center">
|
||||
<div :class="[{'invisible': [5, 6, 3].includes(item.status)}]">
|
||||
<span class="d-inline-block text-primary bold text-underline pointer requestModal" data-type="billingRemark">Billing Question?</span>
|
||||
</div>
|
||||
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="billingRemark">
|
||||
<customer-invoice-remark-form-component module_type="Transaction" :data="item" :section="section"></customer-invoice-remark-form-component>
|
||||
</modal-component>
|
||||
<div v-if="item.documents.length">
|
||||
<div v-for="file in item.documents[0].files" v-bind:key="file.id" class="col-auto no-padding">
|
||||
<document-file-viewer-component :file="file">
|
||||
<template slot="button">
|
||||
<div class="btn bg-grey no-border muted">
|
||||
<i class="fa fa-file-pdf-o"></i>
|
||||
</div>
|
||||
</template>
|
||||
</document-file-viewer-component>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div class="btn bg-grey no-border muted invisible">
|
||||
<i class="fa fa-file-pdf-o"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div class="btn bg-grey no-border muted invisible">
|
||||
<i class="fa fa-file-pdf-o"></i>
|
||||
<div class="col-auto p-l-0 p-r-0 d-flex justify-content-center align-items-center" v-if="$store.getters.isSuperAdmin">
|
||||
<span class="d-inline-block text-primary bold text-underline pointer requestModal" data-type="deleteInvoice">
|
||||
<i class="fa fa-close"></i>
|
||||
</span>
|
||||
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="deleteInvoice">
|
||||
<delete-invoice-form-component :data="item" :section="section"></delete-invoice-form-component>
|
||||
</modal-component>
|
||||
</div>
|
||||
<div class="col-auto hide">
|
||||
<div class="btn btn-sm all-caps b-rad-none btn-block" :class="{'btn-success': !expanded, 'btn-default': expanded}" @click="expanded = !expanded">
|
||||
{{ expanded ? 'Cancel' : 'Make Payment' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto p-l-0 p-r-0 d-flex justify-content-center align-items-center" v-if="$store.getters.isSuperAdmin">
|
||||
<span class="d-inline-block m-r-15 text-primary bold text-underline pointer requestModal" data-type="regenerateInvoice">
|
||||
<i class="fa fa-repeat"></i>
|
||||
</span>
|
||||
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="regenerateInvoice">
|
||||
<general-confirmation-form-component
|
||||
contentText="Are you sure you want to regenerate this Invoice?"
|
||||
modalType="delete"
|
||||
buttonText="Regenerate"
|
||||
class="text-center"
|
||||
:apiRoute="route('api.transaction.invoice.regenerate', item.id)"
|
||||
apiMethod="post"
|
||||
:section="section"
|
||||
>
|
||||
</general-confirmation-form-component>
|
||||
</modal-component>
|
||||
<span class="d-inline-block m-r-15 text-primary bold text-underline pointer requestModal" data-type="deleteInvoice">
|
||||
<i class="fa fa-close"></i>
|
||||
</span>
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
<div class="col">
|
||||
<p class="no-margin fs-10 all-caps">Invoice No</p>
|
||||
<div>{{ item.bill_no }}</div>
|
||||
<p class="no-margin fs-10 all-caps">Reference</p>
|
||||
<div>{{ item.packing_list_reference }}</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<p class="no-margin fs-10 all-caps">Order</p>
|
||||
|
||||
+83
-20
@@ -9,6 +9,43 @@
|
||||
<h6>Transaction History</h6>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-t-10 m-b-10">
|
||||
<div class="col">
|
||||
<div class="d-flex align-items-center h-100">
|
||||
<span class="btn btn-md fs-11 bg-primary text-white fs-12 m-r-5" :class="[{'bg-primary-darker': showingPreciseAmount}]" @click="showingPreciseAmount=!showingPreciseAmount">{{ showingPreciseAmount ? 'Showing Precise Wallet Transaction' : 'Show Precise Wallet Transaction'}}</span>
|
||||
<a v-if="wallet" :href="route('wallet.details-export', wallet.id, showingPreciseAmount)" target="_blank" class="btn btn-md btn-primary fs-11"><i class="fa fa-download m-r-5"></i>{{ showingPreciseAmount ? 'Download Precise Transaction' : 'Download Transaction'}}</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<validation-wrapper-component selectable :validator="$v.showingTransactionCount">
|
||||
<label>Showing Rows</label>
|
||||
<select-component :options="[5, 10, 20, 30, 50]" v-model="showingTransactionCount"></select-component>
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-b-5" @keyup.enter="submitSearch">
|
||||
<div class="col p-r-0">
|
||||
<validation-wrapper-component :validator="$v.reference_no">
|
||||
<label class="all-caps">Order Reference</label>
|
||||
<input type="text" class="form-control" v-model="reference_no">
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
<div class="col p-r-0">
|
||||
<validation-wrapper-component :validator="$v.startDate">
|
||||
<label class="all-caps">Start Date</label>
|
||||
<date-picker-component v-model.lazy="startDate"></date-picker-component>
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
<div class="col p-r-0">
|
||||
<validation-wrapper-component :validator="$v.endDate">
|
||||
<label class="all-caps">End Date</label>
|
||||
<date-picker-component v-model.lazy="endDate"></date-picker-component>
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
<div class="col col-md-auto d-flex justify-content-center align-items-center">
|
||||
<button type="button" class="btn btn-lg btn-primary fs-11 w-100" @click="submitSearch()">Search</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" v-if="wallet.transactions">
|
||||
<div class="col">
|
||||
<div class="row padding-10">
|
||||
@@ -19,17 +56,15 @@
|
||||
<div class="col-2 fs-10 text-right">Balance</div>
|
||||
</div>
|
||||
|
||||
<div class="row bg-white padding-10 m-b-10 rounded align-items-center" v-for="(item, index) in wallet.transactions" v-bind:key="item.id" :data="item">
|
||||
<div class="col-3 fs-12">{{item.created_at}}</div>
|
||||
<div class="col fs-12"><span v-html="item.description"></span> <a target=”_blank” v-if="[9,11].includes(item.type) " :href="route('transaction.credit_note.download', item.id)"><i class="fa fa-download fs-11 m-l-5 text-secondary hover-primary"></i></a></div>
|
||||
<div class="col-2 text-success text-center">{{[5, 9, 15].includes(parseFloat(item.type)) ? (Math.round((parseFloat(item.amount) + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") : ''}}</div>
|
||||
<div class="col-2 text-danger text-center">{{[2, 11].includes(parseFloat(item.type)) ? '- ' + (Math.round((parseFloat(item.amount) + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") : ''}}</div>
|
||||
<div class="col-2 text-right">{{remainingBalance(index)}}</div>
|
||||
</div>
|
||||
<list-component :key="key" section="walletTransactionSection" :endpoint="route('api.transaction.wallet.list')" :options="options">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<customer-wallet-transaction-component :data="data" :showingPreciseAmount="showingPreciseAmount" ></customer-wallet-transaction-component>
|
||||
</template>
|
||||
</list-component>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row align-items-center justify-content-center p-t-50 p-b-50" v-if="!wallet.transactions || !wallet.transactions.length">
|
||||
<!-- <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>
|
||||
@@ -49,7 +84,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<wallet-component :data="wallet" :company_module_id="id" section="CompanyWalletTransactionSection" :creditable=true></wallet-component>
|
||||
@@ -103,10 +138,22 @@ export default {
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
key: 1,
|
||||
section: 'customerTransactionSection',
|
||||
isLoading: true,
|
||||
wallet: null,
|
||||
attention: false
|
||||
showingPreciseAmount: false,
|
||||
showingTransactionCount: 10,
|
||||
attention: false,
|
||||
reference_no: null,
|
||||
startDate: null,
|
||||
endDate: null,
|
||||
options: {
|
||||
status_in: [2, 3],
|
||||
owner_type: 'App\\Models\\Wallet',
|
||||
owner_id: 0,
|
||||
per_page: this.showingTransactionCount
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -119,8 +166,17 @@ export default {
|
||||
if(inComplete){
|
||||
this.fetchWallet();
|
||||
}
|
||||
},
|
||||
showingTransactionCount() {
|
||||
this.key ++;
|
||||
}
|
||||
},
|
||||
validations: {
|
||||
showingTransactionCount: { },
|
||||
reference_no: { },
|
||||
startDate: { },
|
||||
endDate: { },
|
||||
},
|
||||
created(){
|
||||
this.$store.dispatch('updateListQueue', {'name': this.section});
|
||||
},
|
||||
@@ -130,22 +186,29 @@ export default {
|
||||
var filters = {with_transactions: true};
|
||||
this.submit(route('api.wallet.company_module.show', this.id) + '?filters=' + JSON.stringify(filters), 'get', this.section, false, false);
|
||||
},
|
||||
remainingBalance(index) {
|
||||
let tempBalance = 0;
|
||||
submitSearch() {
|
||||
console.log("searcvhing");
|
||||
delete this.options.with_order_reference_like;
|
||||
delete this.options.created_after_or_equal;
|
||||
delete this.options.created_before_or_equal;
|
||||
|
||||
if(this.wallet){
|
||||
let transactions = this.wallet.transactions.slice().reverse();
|
||||
transactions.slice(0, transactions.length - index).map(function(transaction) {
|
||||
[2, 11].includes(transaction.type) ? tempBalance -= (transaction.amount) : tempBalance += (transaction.amount);
|
||||
return tempBalance
|
||||
}, 0);
|
||||
if (this.reference_no) {
|
||||
this.options.with_order_reference_like = this.reference_no
|
||||
}
|
||||
|
||||
return (Math.round((tempBalance + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
if (this.startDate) {
|
||||
this.options.created_after_or_equal = this.startDate
|
||||
}
|
||||
if (this.endDate) {
|
||||
this.options.created_before_or_equal = this.endDate
|
||||
}
|
||||
|
||||
this.key ++;
|
||||
},
|
||||
successHandler(response){
|
||||
this.isLoading = false;
|
||||
this.wallet = response.payload.data;
|
||||
this.options.owner_id = this.wallet.id
|
||||
this.key ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
<template>
|
||||
<div class="row bg-white padding-10 m-b-10 rounded align-datas-center">
|
||||
<div class="col-3 fs-12">{{data.created_at}}</div>
|
||||
<div class="col fs-12"><span v-html="data.description"></span> <a target=”_blank” v-if="[9,11].includes(data.type) " :href="route('transaction.credit_note.download', data.id)"><i class="fa fa-download fs-11 m-l-5 text-secondary hover-primary"></i></a></div>
|
||||
<div class="col-2 text-success text-center">{{[5, 9, 15].includes(parseFloat(data.type)) ? formatValue(data.amount) : ''}}</div>
|
||||
<div class="col-2 text-danger text-center">{{[2, 11].includes(parseFloat(data.type)) ? '- ' + formatValue(data.amount, ) : ''}}</div>
|
||||
<div class="col-2 text-right">{{formatValue(data.running_balance)}}</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import componentHandler from '../../../general/mixins/componentHandler';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
data: {
|
||||
required: true,
|
||||
type: Object
|
||||
},
|
||||
showingPreciseAmount: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
formatValue(value) {
|
||||
if (this.showingPreciseAmount) {
|
||||
return (Math.round((parseFloat(value) + Number.EPSILON) * 100000) / 100000).toLocaleString('en-US', { minimumFractionDigits: 5, maximumFractionDigits: 5 });
|
||||
}
|
||||
|
||||
return (Math.round((parseFloat(value) + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")
|
||||
}
|
||||
},
|
||||
mixins: [componentHandler],
|
||||
}
|
||||
</script>
|
||||
@@ -10,7 +10,7 @@
|
||||
<div class="col">
|
||||
<div class="row align-items-center justify-content-center m-b-10">
|
||||
<div class="col-auto p-r-10">
|
||||
<h5 class="light">Welcome Abroad, we provide logistics services.</h5>
|
||||
<h5 class="light">Welcome Aboard, we provide logistics services.</h5>
|
||||
</div>
|
||||
<div class="col-auto b-a b-thick b-primary padding-5">
|
||||
<h5 class="light no-margin">Powered by technology, delivered by experts.</h5>
|
||||
@@ -310,4 +310,4 @@
|
||||
</template>
|
||||
</list-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -25,9 +25,11 @@
|
||||
</button>
|
||||
</anchor-link-component>
|
||||
<div class="row align-items-center m-t-10 p-t-10 p-b-10 b-t b-grey muted all-caps fs-10">
|
||||
<div class="col-1">Version</div>
|
||||
<div class="col-1">Question Set</div>
|
||||
<div class="col-2">Question Text</div>
|
||||
<div class="col-1">Answer</div>
|
||||
<div class="col-1">Answer Text</div>
|
||||
<div class="col-1">Answer Value</div>
|
||||
<div class="col-1">Source System</div>
|
||||
<div class="col-1">Source Marking</div>
|
||||
<div class="col-2">Source Email</div>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
@extends('layouts.base_no_login')
|
||||
@section('title', 'Share Your Feedback - CIEF Customer Service')
|
||||
@section('inner_content')
|
||||
<feedback-customer-section-component token="{{$token}}"></feedback-customer-section-component>
|
||||
@endsection
|
||||
|
||||
@@ -42,10 +42,13 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php
|
||||
$packages = $invoice_transaction->owner->packages;
|
||||
@php
|
||||
$billable_packing_list = $invoice_transaction->owner->packingLists()->first();
|
||||
$billable_packing_list = $billable_packing_list ? $billable_packing_list : $invoice_transaction->owner;
|
||||
$packages = $billable_packing_list->packages;
|
||||
$totalCBM = 0;
|
||||
$totalQty = 0;
|
||||
$order_reference = $invoice_transaction->owner->owner ? $invoice_transaction->owner->owner->reference : null;
|
||||
@endphp
|
||||
@foreach ($packages as $key => $package)
|
||||
@php
|
||||
@@ -57,7 +60,8 @@
|
||||
@endphp
|
||||
<tr>
|
||||
<td width="5%" class="center top">{{ $key + 1 }}</td>
|
||||
<td class="description">{!! $package->description !!}</td>
|
||||
<!-- <td class="description">{!! $package->description !!}</td> -->
|
||||
<td class="description">{!! $order_reference . '<br>' . $billable_packing_list->owner->reference !!}</td>
|
||||
<td width="15%" class="center top" style="text-align: center">
|
||||
{!! $measurement !!}
|
||||
</td>
|
||||
|
||||
@@ -129,6 +129,8 @@ $grandSubTotal = 0;
|
||||
@foreach ($invoice_transactions as $transaction)
|
||||
<pagebreak />
|
||||
@include('pages.pdfs.shipping_invoice_inner', ['invoice_transaction' => $transaction])
|
||||
<pagebreak />
|
||||
@include('pages.pdfs.packing_list_measurement', ['invoice_transaction' => $transaction])
|
||||
@endforeach
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@
|
||||
|
||||
<meta http-equiv="content-type" content="text/html;charset=UTF-8"/>
|
||||
<meta charset="utf-8"/>
|
||||
<title>IZYIM Shipping</title>
|
||||
<title>@yield('title', 'IZYIM Shipping')</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no"/>
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="{{asset('images/favicon/apple-icon-57x57.png')}}">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="{{asset('images/favicon/apple-icon-60x60.png')}}">
|
||||
@@ -28,4 +28,4 @@
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
<link href="{{ asset('css/vendor.css') }}" rel="stylesheet" type="text/css"/>
|
||||
<link href="{{ asset('css/site.css') }}" rel="stylesheet" type="text/css"/>
|
||||
<link href="{{ asset('css/site.css') }}" rel="stylesheet" type="text/css"/>
|
||||
|
||||
@@ -9,6 +9,9 @@ Route::group(['prefix' => 'transactions', 'namespace' => 'Transactions', 'as' =>
|
||||
Route::delete('/delete/{id}', 'DeleteTransactionController@delete')->name('delete');
|
||||
Route::delete('/delete-payment/{id}', 'DeletePaymentTransactionController@delete')->name('payment.delete');
|
||||
Route::put('{id}/status/update/{status}', 'UpdateTransactionStatusController@update')->where('status', 'approve|expire|reject')->name('update');
|
||||
route::post('/{invoice_id}/regenerate', 'RegenerateSingleShippingInvoiceTransactionController@regenerate')->name('invoice.regenerate');
|
||||
|
||||
Route::get('wallet/list', 'ListWalletTransactionsController@list')->name('wallet.list');
|
||||
|
||||
Route::group(['prefix' => 'payment', 'as' => 'payment.'], function () {
|
||||
Route::post('/create', 'CreatePaymentTransactionController@create')->name('create');
|
||||
|
||||
+29
-13
@@ -1,11 +1,8 @@
|
||||
<?php
|
||||
|
||||
use App\Classes\Exceptions\InternalServerErrorException;
|
||||
use App\Classes\Jobs\FetchContainersStatusUpdateFromVTPortalJob;
|
||||
use App\Classes\Jobs\FetchDeliveryListFromVTPortalJob;
|
||||
use App\Classes\Jobs\FetchLoadedContainersFromVTPortalJob;
|
||||
use App\Classes\Jobs\FetchOrdersFromYDPortalJob;
|
||||
use App\Classes\Jobs\FetchPackingListFromVTPortalJob;
|
||||
use App\Classes\Jobs\FetchWarehouseReceiveListFromVTPortalJob;
|
||||
use App\Classes\Modules\Documents\DataTransferObjects\DocumentObject;
|
||||
use App\Classes\Modules\Documents\Services\CreatesDocument;
|
||||
@@ -16,12 +13,9 @@ use App\Classes\Modules\PackingLists\Processors\FetchContainersFromYdPortalProce
|
||||
use App\Classes\Modules\PackingLists\Processors\FetchContainersUpdatesFromYdPortalProcessor;
|
||||
use App\Classes\Modules\PackingLists\Processors\FetchDeliveryUpdatesFromYdPortalProcessor;
|
||||
use App\Classes\Modules\PackingLists\Processors\FetchLoadedContainersFromVTPortalProcessor;
|
||||
use App\Classes\Modules\PackingLists\Processors\FetchOrderListsFromYdPortalProcessor;
|
||||
use App\Classes\Modules\PackingLists\Processors\FetchPackingListFromVTPortalProcessor;
|
||||
use App\Classes\Modules\PackingLists\Processors\FetchPackingListsFromYdPortalProcessor;
|
||||
use App\Classes\Modules\PackingLists\Services\ListsPackingLists;
|
||||
use App\Classes\Modules\Transactions\Processors\ApproveShippingInvoiceTransactionProcessor;
|
||||
use App\Classes\Modules\Transactions\Processors\CreateInvoiceTransactionProcessor;
|
||||
use App\Classes\Modules\Transactions\Services\UpdatesTransactionStatus;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Classes\ValueObjects\Constants\BusinessType;
|
||||
use App\Classes\ValueObjects\Constants\DocumentType;
|
||||
@@ -30,7 +24,6 @@ use App\Classes\ValueObjects\Constants\PackageType;
|
||||
use App\Classes\ValueObjects\Constants\PackingListType;
|
||||
use App\Classes\ValueObjects\Constants\PaymentMethodType;
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use App\Http\Resources\CompanyResource;
|
||||
use App\Models\CompanyConnection;
|
||||
use App\Models\CompanyModule;
|
||||
use App\Models\Document;
|
||||
@@ -1069,6 +1062,8 @@ Route::get('/wallet/{marking}/details', function ($marking) {
|
||||
return view('pages.wallet.index', ['id' => $id, 'marking' => $marking]);
|
||||
})->name('wallet.details');
|
||||
|
||||
Route::get('/wallet/{wallet_id}/{is_precise}/export', 'Exports\ExportCustomersWalletTransactionToExcelController@export')->name('wallet.details-export');
|
||||
|
||||
Route::get('/wallet/audit', function (Request $request) {
|
||||
$wallets = \App\Models\Wallet::all();
|
||||
|
||||
@@ -1224,10 +1219,31 @@ Route::get('/wallets/active', function(){
|
||||
echo '</table>';
|
||||
});
|
||||
|
||||
Route::get('/accident-approve-invoice', function(){
|
||||
$invoices = Transaction::where('type', TransactionType::SHIPPING_INVOICE)->whereDate('updated_at', '2023-10-12')->get();
|
||||
Route::get('fix-payment-status-updated-but-failed-update-invoice', function (UpdatesTransactionStatus $updatesTransactionStatus, UpdateDoFromVTPortalProcessor $updateDoFromVTPortalProcessor, UpdateDoFromYDPortalProcessor $updateDoFromYDPortalProcessor) {
|
||||
$invoices = Transaction::where('type', TransactionType::SHIPPING_INVOICE)->whereIn('status', [2])
|
||||
->whereHas('transactions', function ($query) {
|
||||
$query->where('type', TransactionType::PAYMENT)
|
||||
->whereIn('status', [2, 3]);
|
||||
})->get();
|
||||
|
||||
|
||||
foreach ($invoices as $invoice) {
|
||||
$orderMarking = $invoice->owner->owner->reference;
|
||||
echo '<a href="'.route('order.v2.show', $orderMarking).'" target="_blank">'.$orderMarking.'</a><br>';
|
||||
echo "Fixing" . $invoice->owner->owner->reference . '<br>';
|
||||
|
||||
$totalPaidAmount = $invoice->transactions->where('type', TransactionType::PAYMENT)->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->sum('amount');
|
||||
|
||||
if (($invoice->amount - $totalPaidAmount) < 0.01) {
|
||||
$updatesTransactionStatus->execute($invoice, ApprovalStatus::COMPLETED);
|
||||
$packingList = $invoice->owner;
|
||||
$packingList->status = ApprovalStatus::APPROVED;
|
||||
$packingList->save();
|
||||
|
||||
if (app()->environment('production')) {
|
||||
$updateDoFromVTPortalProcessor->execute($packingList);
|
||||
$updateDoFromYDPortalProcessor->execute($packingList);
|
||||
}
|
||||
|
||||
echo 'done fix ' . $invoice->owner->owner->reference . '<br>';
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user