mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into show_extra_parcel_information
# Conflicts: # app/Http/Resources/TransactionResource.php # resources/assets/vue/components/paymentsBilling/elements/CustomerPaymentsBillingComponent.vue
This commit is contained in:
@@ -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)
|
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)
|
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,30 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Classes\General\Eloquent\Filters;
|
||||||
|
|
||||||
|
use Carbon\Carbon;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
|
||||||
|
class WithAgingColumn implements Filter
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Builder $builder
|
||||||
|
* @param $value
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public static function apply(Builder $builder, $value)
|
||||||
|
{
|
||||||
|
$today = Carbon::now();
|
||||||
|
return $builder->select('packing_lists.*')
|
||||||
|
->addSelect(DB::raw("DATEDIFF('$today', transactions.updated_at) as days_over_duedate"))
|
||||||
|
->addSelect(DB::raw("CASE
|
||||||
|
WHEN DATEDIFF('$today', transactions.updated_at) <= 0 THEN 0
|
||||||
|
WHEN DATEDIFF('$today', transactions.updated_at) > 0 AND DATEDIFF('$today', transactions.updated_at) <= 30 THEN 1
|
||||||
|
WHEN DATEDIFF('$today', transactions.updated_at) > 30 AND DATEDIFF('$today', transactions.updated_at) <= 60 THEN 2
|
||||||
|
WHEN DATEDIFF('$today', transactions.updated_at) > 60 AND DATEDIFF('$today', transactions.updated_at) <= 90 THEN 3
|
||||||
|
ELSE 4
|
||||||
|
END AS due_date_number"));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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,98 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Classes\Modules\Exports\Services;
|
||||||
|
|
||||||
|
use App\Models\Order;
|
||||||
|
use App\Models\PackingList;
|
||||||
|
use Maatwebsite\Excel\Concerns\FromQuery;
|
||||||
|
use Maatwebsite\Excel\Concerns\Exportable;
|
||||||
|
use Maatwebsite\Excel\Concerns\WithMapping;
|
||||||
|
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||||
|
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
|
||||||
|
use Maatwebsite\Excel\Concerns\WithHeadingRow;
|
||||||
|
use App\Classes\General\Eloquent\ApplyFiltersToQuery;
|
||||||
|
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||||
|
use DateTime;
|
||||||
|
|
||||||
|
class ExportsAgingList implements WithHeadings, WithHeadingRow, WithMapping, ShouldAutoSize, FromQuery
|
||||||
|
{
|
||||||
|
use Exportable;
|
||||||
|
|
||||||
|
private $filters;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->filters = [
|
||||||
|
"has_invoice_status_in" => [2],
|
||||||
|
"packing_list_ordered_by_invoice_date" => true,
|
||||||
|
"with_aging_column" => true
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function headings(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'Company Name',
|
||||||
|
'Customer Marking',
|
||||||
|
'Order Number',
|
||||||
|
'Invoice No',
|
||||||
|
'Invoice Date',
|
||||||
|
'Days',
|
||||||
|
'Amount',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function query()
|
||||||
|
{
|
||||||
|
return (new ApplyFiltersToQuery())->execute(PackingList::query(), $this->filters);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function map($list): array
|
||||||
|
{
|
||||||
|
$marking = null;
|
||||||
|
$orderNo = null;
|
||||||
|
$name = null;
|
||||||
|
$invDate = 'n/a';
|
||||||
|
$invNo = 'n/a';
|
||||||
|
$days = 'n/a';
|
||||||
|
|
||||||
|
if ($list->owner instanceof Order) {
|
||||||
|
$inviterPivotInviteeReference = $list->owner->companyModule->inviters()->withPivot('invitee_reference')->first();
|
||||||
|
|
||||||
|
if ($inviterPivotInviteeReference) {
|
||||||
|
$marking = $inviterPivotInviteeReference->pivot->invitee_reference;
|
||||||
|
$orderNo = $list->owner->reference;
|
||||||
|
}
|
||||||
|
$name = $list->owner->companyModule->company->name;
|
||||||
|
}
|
||||||
|
|
||||||
|
$transaction = $list->transactions()->whereIn('status', [ApprovalStatus::APPROVED])->first();
|
||||||
|
if ($transaction) {
|
||||||
|
|
||||||
|
$invoiceDate = $transaction->created_at;
|
||||||
|
$invDate = date_format($invoiceDate, 'd-m-Y');
|
||||||
|
$invNo = $transaction->bill_no;
|
||||||
|
$amt = number_format($transaction->amount, 2);
|
||||||
|
|
||||||
|
$currentDate = new DateTime();
|
||||||
|
$interval = $currentDate->diff($invoiceDate);
|
||||||
|
$days = $interval->format('%a');
|
||||||
|
}
|
||||||
|
|
||||||
|
return [
|
||||||
|
$name,
|
||||||
|
$marking,
|
||||||
|
$orderNo,
|
||||||
|
$invNo,
|
||||||
|
$invDate,
|
||||||
|
$days,
|
||||||
|
$amt,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
private function dueDateColumn($colNum, $dueDateNumber, $amt)
|
||||||
|
{
|
||||||
|
if ($colNum == $dueDateNumber) return $amt;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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
|
public function headings(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
'Version',
|
||||||
'Question Set',
|
'Question Set',
|
||||||
'Question Text',
|
'Question Text',
|
||||||
'Answer',
|
'Answer Text',
|
||||||
|
'Answer Value',
|
||||||
'Source System',
|
'Source System',
|
||||||
'Source Marking',
|
'Source Marking',
|
||||||
'Source Email',
|
'Source Email',
|
||||||
@@ -38,7 +40,7 @@ class ExportsFeedback implements FromQuery, WithHeadings, WithHeadingRow, WithMa
|
|||||||
return QAUserAnswerSelected::whereHas('question', function ($query) {
|
return QAUserAnswerSelected::whereHas('question', function ($query) {
|
||||||
$query->whereHas('questionnaire', function ($innerQuery) {
|
$query->whereHas('questionnaire', function ($innerQuery) {
|
||||||
$innerQuery->where('group', 'feedback');
|
$innerQuery->where('group', 'feedback');
|
||||||
})->where('created_at', '>', Carbon::now()->subMonths(1));
|
}); //->where('created_at', '>', Carbon::now()->subMonths(1));
|
||||||
})->orderBy('created_at', 'desc');
|
})->orderBy('created_at', 'desc');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,11 +58,14 @@ class ExportsFeedback implements FromQuery, WithHeadings, WithHeadingRow, WithMa
|
|||||||
$companyModule = $user->companyModule()->first();
|
$companyModule = $user->companyModule()->first();
|
||||||
$user_marking = $companyModule ? $companyModule->inviters()->withPivot('invitee_reference')->first()->pivot->invitee_reference : "";
|
$user_marking = $companyModule ? $companyModule->inviters()->withPivot('invitee_reference')->first()->pivot->invitee_reference : "";
|
||||||
}
|
}
|
||||||
|
$answer = $userAnswer->answer;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
$userAnswer->question->questionnaire->version,
|
||||||
$userAnswer->question->questionnaire->description,
|
$userAnswer->question->questionnaire->description,
|
||||||
$userAnswer->question->question_text,
|
$userAnswer->question->question_text,
|
||||||
$userAnswer->free_text_answer,
|
$answer->display_text,
|
||||||
|
$answer->value,
|
||||||
$user ? QASystemSourceType::getText(QASystemSourceType::IZYIM) : QASystemSourceType::getText($source->system),
|
$user ? QASystemSourceType::getText(QASystemSourceType::IZYIM) : QASystemSourceType::getText($source->system),
|
||||||
$user ? $user_marking : $source->marking,
|
$user ? $user_marking : $source->marking,
|
||||||
$user ? $user->email : $source->email,
|
$user ? $user->email : $source->email,
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ class ListQuestionsQALogic extends AbstractControllerLogic
|
|||||||
$delimiter = "|";
|
$delimiter = "|";
|
||||||
$parts = explode($delimiter, $decriptedToken);
|
$parts = explode($delimiter, $decriptedToken);
|
||||||
$questionSet = $parts[3];
|
$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));
|
return $this->collectionResponse(HelpMenuQuestionResource::collection($query));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ class UpdateDoFromYDPortalProcessor
|
|||||||
|
|
||||||
|
|
||||||
} catch (\Exception $exception){
|
} catch (\Exception $exception){
|
||||||
|
log::debug($exception);
|
||||||
throw new InternalServerErrorException('failed to approve address due to an error related to YD portal');
|
throw new InternalServerErrorException('failed to approve address due to an error related to YD portal');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,6 +84,25 @@ class CreateGroupsLogic extends AbstractControllerLogic
|
|||||||
// $invoices = $this->fetchesTransaction->execute(['id_in' => $invoice_ids]);
|
// $invoices = $this->fetchesTransaction->execute(['id_in' => $invoice_ids]);
|
||||||
$invoices = Transaction::whereIn('id', $invoice_ids)->get();
|
$invoices = Transaction::whereIn('id', $invoice_ids)->get();
|
||||||
|
|
||||||
|
foreach ($invoices as $invoice) {
|
||||||
|
$order = null;
|
||||||
|
if ($invoice->owner instanceof Transaction) {
|
||||||
|
if ($invoice->owner) {
|
||||||
|
if ($invoice->owner->owner) {
|
||||||
|
$order = $invoice->owner->owner->owner;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (!($invoice->owner instanceof Transaction) && !($invoice->owner instanceof Wallet)) {
|
||||||
|
if ($invoice->owner) {
|
||||||
|
$order = $invoice->owner->owner;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$order) {
|
||||||
|
throw new MalformedRequestException("There is an error while paying for invoice {$invoice->bill_no}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($payment_method == PaymentMethodType::WALLET) {
|
if ($payment_method == PaymentMethodType::WALLET) {
|
||||||
|
|
||||||
$companyModuleId = $invoices->first()->receiver;
|
$companyModuleId = $invoices->first()->receiver;
|
||||||
|
|||||||
@@ -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([]);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -9,6 +9,7 @@ use App\Models\User;
|
|||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Maatwebsite\Excel\Excel;
|
use Maatwebsite\Excel\Excel;
|
||||||
|
use App\Classes\Modules\Exports\Services\ExportsAgingList;
|
||||||
|
|
||||||
class ExportArrivedParcelController
|
class ExportArrivedParcelController
|
||||||
{
|
{
|
||||||
@@ -46,4 +47,11 @@ class ExportArrivedParcelController
|
|||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function aging(Request $request) {
|
||||||
|
$data = new ExportsAgingList();
|
||||||
|
$response = $data->download('aging_report.xls', Excel::XLS, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']);
|
||||||
|
ob_end_clean();
|
||||||
|
return $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_number' => $q->question_number,
|
||||||
'question_text' => $q->question_text,
|
'question_text' => $q->question_text,
|
||||||
'question_type' => $q->question_type,
|
'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,
|
'questionnaire_set_id' => $q->questionnaire_set_id,
|
||||||
'next_nested_question' => $q->next_nested_question,
|
'next_nested_question' => $q->next_nested_question,
|
||||||
'next_main_question' => $q->next_main_question,
|
'next_main_question' => $q->next_main_question,
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ class HelpMenuQuestionnaireSetsResource extends JsonResource
|
|||||||
'name' => $this->name,
|
'name' => $this->name,
|
||||||
'description' => $this->description,
|
'description' => $this->description,
|
||||||
'group' => $this->group,
|
'group' => $this->group,
|
||||||
|
'version' => $this->version,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ namespace App\Http\Resources;
|
|||||||
|
|
||||||
use Illuminate\Http\Resources\Json\JsonResource;
|
use Illuminate\Http\Resources\Json\JsonResource;
|
||||||
use App\Classes\ValueObjects\Constants\QASystemSourceType;
|
use App\Classes\ValueObjects\Constants\QASystemSourceType;
|
||||||
|
use App\Models\QAAnswerOptions;
|
||||||
use App\Models\QAQuestions;
|
use App\Models\QAQuestions;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
|
||||||
@@ -20,6 +21,7 @@ class HelpMenuQuestionsAnswersResource extends JsonResource
|
|||||||
$question = QAQuestions::where('id', $this->question_id)->first();
|
$question = QAQuestions::where('id', $this->question_id)->first();
|
||||||
$source = new HelpMenuUserSourceResource($this->userSource);
|
$source = new HelpMenuUserSourceResource($this->userSource);
|
||||||
$user = $this->source_id === 0 ? new UserResource($this->user) : null;
|
$user = $this->source_id === 0 ? new UserResource($this->user) : null;
|
||||||
|
$answerOption = QAAnswerOptions::where('id', $this->answer_option_id)->first();
|
||||||
|
|
||||||
$user_marking = '';
|
$user_marking = '';
|
||||||
if($user){
|
if($user){
|
||||||
@@ -31,7 +33,8 @@ class HelpMenuQuestionsAnswersResource extends JsonResource
|
|||||||
'question_id' => $this->question_id,
|
'question_id' => $this->question_id,
|
||||||
'questionnaire' => new HelpMenuQuestionnaireSetsResource($this->question->questionnaire),
|
'questionnaire' => new HelpMenuQuestionnaireSetsResource($this->question->questionnaire),
|
||||||
'question_text' => $question ? $question->question_text : null,
|
'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_system' => $user ? QASystemSourceType::getText(QASystemSourceType::IZYIM) : QASystemSourceType::getText($source->system),
|
||||||
'source_marking' => $user ? $user_marking : $source->marking,
|
'source_marking' => $user ? $user_marking : $source->marking,
|
||||||
'source_email' => $user ? $user->email : $source->email,
|
'source_email' => $user ? $user->email : $source->email,
|
||||||
|
|||||||
@@ -27,11 +27,15 @@ class TransactionResource extends JsonResource
|
|||||||
$packingListReference = null;
|
$packingListReference = null;
|
||||||
|
|
||||||
if ($this->owner instanceof Transaction) {
|
if ($this->owner instanceof Transaction) {
|
||||||
$order = new OrderResource($this->owner->owner->owner);
|
if ($this->owner) {
|
||||||
$packingListReference = $this->owner->owner->reference;
|
if ($this->owner->owner) {
|
||||||
|
$order = new OrderResource($this->owner->owner->owner);
|
||||||
|
}
|
||||||
|
}
|
||||||
} else if (!($this->owner instanceof Transaction) && !($this->owner instanceof Wallet)) {
|
} else if (!($this->owner instanceof Transaction) && !($this->owner instanceof Wallet)) {
|
||||||
$order = new OrderResource($this->owner->owner);
|
if ($this->owner) {
|
||||||
$packingListReference = $this->owner->reference;
|
$order = new OrderResource($this->owner->owner);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$group = Group::where('reference', $this->payment_reference)->first();
|
$group = Group::where('reference', $this->payment_reference)->first();
|
||||||
if ($group) {
|
if ($group) {
|
||||||
|
|||||||
@@ -20,28 +20,41 @@ class WalletTransactionResource extends JsonResource
|
|||||||
public function toArray($request)
|
public function toArray($request)
|
||||||
{
|
{
|
||||||
$description = '';
|
$description = '';
|
||||||
|
$current_running_balance = $request['running_balance'];
|
||||||
switch((int) $this->type){
|
switch((int) $this->type){
|
||||||
case TransactionType::TOP_UP:
|
case TransactionType::TOP_UP:
|
||||||
$description = (double) $this->amount.' Credit Top up';
|
$description = (double) $this->amount.' Credit Top up';
|
||||||
|
$request['running_balance'] = bcsub($request['running_balance'], $this->amount, 5);
|
||||||
break;
|
break;
|
||||||
case TransactionType::CREDIT_NOTE:
|
case TransactionType::CREDIT_NOTE:
|
||||||
$description = 'Credit Voucher for '.$this->payment_reference;
|
$description = 'Credit Voucher for '.$this->payment_reference;
|
||||||
|
$request['running_balance'] = bcsub($request['running_balance'], $this->amount, 5);
|
||||||
break;
|
break;
|
||||||
case TransactionType::PAYMENT:
|
case TransactionType::PAYMENT:
|
||||||
$order = Transaction::where('payment_reference', $this->bill_no)->first()->owner->owner->owner;
|
$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) {
|
if(!$order) {
|
||||||
|
Log::channel('paymentUnknownOrderLog')->info('ID: ' . $this->id);
|
||||||
$description = 'Payment for unknown order, please contact tech support.';
|
$description = 'Payment for unknown order, please contact tech support.';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$request['running_balance'] = bcadd($request['running_balance'], $this->amount, 5);
|
||||||
$marking = $order->reference;
|
$marking = $order->reference;
|
||||||
$description = 'Payment For order refs.'.'<a href="'.route('order.details', $marking).'">'.$marking.'</a>';
|
$description = 'Payment For order refs.'.'<a href="'.route('order.details', $marking).'">'.$marking.'</a>';
|
||||||
break;
|
break;
|
||||||
case 11:
|
case 11:
|
||||||
|
$request['running_balance'] = bcadd($request['running_balance'], $this->amount, 5);
|
||||||
$description = 'Debit Voucher for '.$this->payment_reference;
|
$description = 'Debit Voucher for '.$this->payment_reference;
|
||||||
break;
|
break;
|
||||||
case 15:
|
case 15:
|
||||||
|
$request['running_balance'] = bcsub($request['running_balance'], $this->amount, 5);
|
||||||
$description = (double) $this->amount.' Credit Top up';
|
$description = (double) $this->amount.' Credit Top up';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -56,6 +69,7 @@ class WalletTransactionResource extends JsonResource
|
|||||||
'payment_method' => (float) $this->payment_method,
|
'payment_method' => (float) $this->payment_method,
|
||||||
// 'issuer_name' => $this->issuerCompany->name,
|
// 'issuer_name' => $this->issuerCompany->name,
|
||||||
'amount' => (double) $this->amount,
|
'amount' => (double) $this->amount,
|
||||||
|
'running_balance' => (double) $current_running_balance,
|
||||||
'service_charge' => (double) $this->service_charge,
|
'service_charge' => (double) $this->service_charge,
|
||||||
'tax' => (double) $this->tax,
|
'tax' => (double) $this->tax,
|
||||||
'status' => (int) $this->status,
|
'status' => (int) $this->status,
|
||||||
|
|||||||
@@ -46,4 +46,13 @@ class QAUserAnswerSelected extends AbstractModel implements Documentable
|
|||||||
return $this->BelongsTo(QAQuestions::class, 'question_id', 'id');
|
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' => [
|
'emergency' => [
|
||||||
'path' => storage_path('logs/laravel.log'),
|
'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(QAQuestionsDemoSeeder::class); //DEMO POC
|
||||||
// $this->call(QAAnswerOptionsDemoSeeder::class); //DEMO POC
|
// $this->call(QAAnswerOptionsDemoSeeder::class); //DEMO POC
|
||||||
|
|
||||||
|
// 20230928 Set 1 to Set 3
|
||||||
// $this->call(QAQuestionsSeeder::class);
|
// $this->call(QAQuestionsSeeder::class);
|
||||||
// $this->call(QAAnswerOptionsSeeder::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>
|
<template>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<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="row flex-nowrap">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="row tabsContainer">
|
<div class="row tabsContainer">
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="row align-items-center justify-content-center m-b-10">
|
<div class="row align-items-center justify-content-center m-b-10">
|
||||||
<div class="col-auto p-r-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>
|
||||||
<div class="col-auto b-a b-thick b-primary padding-5">
|
<div class="col-auto b-a b-thick b-primary padding-5">
|
||||||
<h5 class="light no-margin">Powered by technology, delivered by experts.</h5>
|
<h5 class="light no-margin">Powered by technology, delivered by experts.</h5>
|
||||||
@@ -99,4 +99,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="row parentContainer">
|
<div class="row parentContainer">
|
||||||
|
<div class="col-1">{{ item.questionnaire.version }}</div>
|
||||||
<div class="col-1">{{ item.questionnaire.description }}</div>
|
<div class="col-1">{{ item.questionnaire.description }}</div>
|
||||||
<div class="col-2"> <p>{{ item.question_text }}</p> </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.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_system }}</div>
|
||||||
<div class="col-1">{{ item.source_marking }}</div>
|
<div class="col-1">{{ item.source_marking }}</div>
|
||||||
<div class="col-2">{{ item.source_email }}</div>
|
<div class="col-2">{{ item.source_email }}</div>
|
||||||
|
|||||||
+1
-1
@@ -13,7 +13,7 @@
|
|||||||
<div class="col-12 col-md-8">
|
<div class="col-12 col-md-8">
|
||||||
<validation-wrapper-component selectable class="m-b-15" :validator="$v.parameters.question_set">
|
<validation-wrapper-component selectable class="m-b-15" :validator="$v.parameters.question_set">
|
||||||
<label class="text-primary">Question Set</label>
|
<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>
|
</validation-wrapper-component>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
+14
-28
@@ -84,6 +84,20 @@
|
|||||||
<address-form-component :id="item.order.company_module.id" :section="section" :type=1></address-form-component>
|
<address-form-component :id="item.order.company_module.id" :section="section" :type=1></address-form-component>
|
||||||
</modal-component>
|
</modal-component>
|
||||||
</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 v-if="!item.order.address.post_code_area">
|
<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>
|
<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">
|
<modal-component class="animate_animated animatefast animate_fadeIn" styleType="fill-in" type="defineLocation">
|
||||||
@@ -110,34 +124,6 @@
|
|||||||
</modal-component>
|
</modal-component>
|
||||||
</div>
|
</div>
|
||||||
</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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+27
@@ -87,6 +87,33 @@
|
|||||||
</div>
|
</div>
|
||||||
</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>
|
||||||
|
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+3
-2
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="row m-b-15 m-l-5 m-r-10">
|
<div class="row m-b-15 m-l-5 m-r-10" v-if="$store.getters.isAdmin || item.order">
|
||||||
<div class="col bg-white rounded b-a" :class="{'b-white': !selected, 'b-primary': selected, 'bg-primary-lighter': selected}">
|
<div class="col bg-white rounded b-a" :class="{'b-white': !selected, 'b-primary': selected, 'bg-primary-lighter': selected}">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col padding-20">
|
<div class="col padding-20">
|
||||||
@@ -15,7 +15,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<p class="no-margin fs-10 all-caps">Order</p>
|
<p class="no-margin fs-10 all-caps">Order</p>
|
||||||
<div><a :href="route('order.show', item.order.reference)">{{item.order.reference}}</a></div>
|
<div v-if="item.order"><a :href="route('order.show', item.order.reference)">{{item.order.reference}}</a></div>
|
||||||
|
<div class="text-danger" v-else>Error in retrieving order</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<p class="no-margin fs-10 all-caps">Invoice Date</p>
|
<p class="no-margin fs-10 all-caps">Invoice Date</p>
|
||||||
|
|||||||
+83
-20
@@ -9,6 +9,43 @@
|
|||||||
<h6>Transaction History</h6>
|
<h6>Transaction History</h6>
|
||||||
</div>
|
</div>
|
||||||
</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="row" v-if="wallet.transactions">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="row padding-10">
|
<div class="row padding-10">
|
||||||
@@ -19,17 +56,15 @@
|
|||||||
<div class="col-2 fs-10 text-right">Balance</div>
|
<div class="col-2 fs-10 text-right">Balance</div>
|
||||||
</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">
|
<list-component :key="key" section="walletTransactionSection" :endpoint="route('api.transaction.wallet.list')" :options="options">
|
||||||
<div class="col-3 fs-12">{{item.created_at}}</div>
|
<template slot="list" slot-scope="{data}">
|
||||||
<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>
|
<customer-wallet-transaction-component :data="data" :showingPreciseAmount="showingPreciseAmount" ></customer-wallet-transaction-component>
|
||||||
<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>
|
</template>
|
||||||
<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>
|
</list-component>
|
||||||
<div class="col-2 text-right">{{remainingBalance(index)}}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</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="col-12">
|
||||||
<div class="row align-items-center justify-content-center hint-text">
|
<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="/images/not-found-illustration.png" class="w-100 hint-text"></div>
|
||||||
@@ -49,7 +84,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<wallet-component :data="wallet" :company_module_id="id" section="CompanyWalletTransactionSection" :creditable=true></wallet-component>
|
<wallet-component :data="wallet" :company_module_id="id" section="CompanyWalletTransactionSection" :creditable=true></wallet-component>
|
||||||
@@ -103,10 +138,22 @@ export default {
|
|||||||
},
|
},
|
||||||
data(){
|
data(){
|
||||||
return {
|
return {
|
||||||
|
key: 1,
|
||||||
section: 'customerTransactionSection',
|
section: 'customerTransactionSection',
|
||||||
isLoading: true,
|
isLoading: true,
|
||||||
wallet: null,
|
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: {
|
computed: {
|
||||||
@@ -119,8 +166,17 @@ export default {
|
|||||||
if(inComplete){
|
if(inComplete){
|
||||||
this.fetchWallet();
|
this.fetchWallet();
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
showingTransactionCount() {
|
||||||
|
this.key ++;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
validations: {
|
||||||
|
showingTransactionCount: { },
|
||||||
|
reference_no: { },
|
||||||
|
startDate: { },
|
||||||
|
endDate: { },
|
||||||
|
},
|
||||||
created(){
|
created(){
|
||||||
this.$store.dispatch('updateListQueue', {'name': this.section});
|
this.$store.dispatch('updateListQueue', {'name': this.section});
|
||||||
},
|
},
|
||||||
@@ -130,22 +186,29 @@ export default {
|
|||||||
var filters = {with_transactions: true};
|
var filters = {with_transactions: true};
|
||||||
this.submit(route('api.wallet.company_module.show', this.id) + '?filters=' + JSON.stringify(filters), 'get', this.section, false, false);
|
this.submit(route('api.wallet.company_module.show', this.id) + '?filters=' + JSON.stringify(filters), 'get', this.section, false, false);
|
||||||
},
|
},
|
||||||
remainingBalance(index) {
|
submitSearch() {
|
||||||
let tempBalance = 0;
|
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){
|
if (this.reference_no) {
|
||||||
let transactions = this.wallet.transactions.slice().reverse();
|
this.options.with_order_reference_like = this.reference_no
|
||||||
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.startDate) {
|
||||||
return (Math.round((tempBalance + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
this.options.created_after_or_equal = this.startDate
|
||||||
|
}
|
||||||
|
if (this.endDate) {
|
||||||
|
this.options.created_before_or_equal = this.endDate
|
||||||
|
}
|
||||||
|
|
||||||
|
this.key ++;
|
||||||
},
|
},
|
||||||
successHandler(response){
|
successHandler(response){
|
||||||
this.isLoading = false;
|
this.isLoading = false;
|
||||||
this.wallet = response.payload.data;
|
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="col">
|
||||||
<div class="row align-items-center justify-content-center m-b-10">
|
<div class="row align-items-center justify-content-center m-b-10">
|
||||||
<div class="col-auto p-r-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>
|
||||||
<div class="col-auto b-a b-thick b-primary padding-5">
|
<div class="col-auto b-a b-thick b-primary padding-5">
|
||||||
<h5 class="light no-margin">Powered by technology, delivered by experts.</h5>
|
<h5 class="light no-margin">Powered by technology, delivered by experts.</h5>
|
||||||
@@ -310,4 +310,4 @@
|
|||||||
</template>
|
</template>
|
||||||
</list-component>
|
</list-component>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -25,9 +25,11 @@
|
|||||||
</button>
|
</button>
|
||||||
</anchor-link-component>
|
</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="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-1">Question Set</div>
|
||||||
<div class="col-2">Question Text</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 System</div>
|
||||||
<div class="col-1">Source Marking</div>
|
<div class="col-1">Source Marking</div>
|
||||||
<div class="col-2">Source Email</div>
|
<div class="col-2">Source Email</div>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
@extends('layouts.base_no_login')
|
@extends('layouts.base_no_login')
|
||||||
|
@section('title', 'Share Your Feedback - CIEF Customer Service')
|
||||||
@section('inner_content')
|
@section('inner_content')
|
||||||
<feedback-customer-section-component token="{{$token}}"></feedback-customer-section-component>
|
<feedback-customer-section-component token="{{$token}}"></feedback-customer-section-component>
|
||||||
@endsection
|
@endsection
|
||||||
|
|||||||
@@ -42,10 +42,13 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@php
|
@php
|
||||||
$packages = $invoice_transaction->owner->packages;
|
$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;
|
$totalCBM = 0;
|
||||||
$totalQty = 0;
|
$totalQty = 0;
|
||||||
|
$order_reference = $invoice_transaction->owner->owner ? $invoice_transaction->owner->owner->reference : null;
|
||||||
@endphp
|
@endphp
|
||||||
@foreach ($packages as $key => $package)
|
@foreach ($packages as $key => $package)
|
||||||
@php
|
@php
|
||||||
@@ -57,7 +60,8 @@
|
|||||||
@endphp
|
@endphp
|
||||||
<tr>
|
<tr>
|
||||||
<td width="5%" class="center top">{{ $key + 1 }}</td>
|
<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">
|
<td width="15%" class="center top" style="text-align: center">
|
||||||
{!! $measurement !!}
|
{!! $measurement !!}
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -129,6 +129,8 @@ $grandSubTotal = 0;
|
|||||||
@foreach ($invoice_transactions as $transaction)
|
@foreach ($invoice_transactions as $transaction)
|
||||||
<pagebreak />
|
<pagebreak />
|
||||||
@include('pages.pdfs.shipping_invoice_inner', ['invoice_transaction' => $transaction])
|
@include('pages.pdfs.shipping_invoice_inner', ['invoice_transaction' => $transaction])
|
||||||
|
<pagebreak />
|
||||||
|
@include('pages.pdfs.packing_list_measurement', ['invoice_transaction' => $transaction])
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<meta http-equiv="content-type" content="text/html;charset=UTF-8"/>
|
<meta http-equiv="content-type" content="text/html;charset=UTF-8"/>
|
||||||
<meta 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"/>
|
<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="57x57" href="{{asset('images/favicon/apple-icon-57x57.png')}}">
|
||||||
<link rel="apple-touch-icon" sizes="60x60" href="{{asset('images/favicon/apple-icon-60x60.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="theme-color" content="#ffffff">
|
||||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||||
<link href="{{ asset('css/vendor.css') }}" rel="stylesheet" type="text/css"/>
|
<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/{id}', 'DeleteTransactionController@delete')->name('delete');
|
||||||
Route::delete('/delete-payment/{id}', 'DeletePaymentTransactionController@delete')->name('payment.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::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::group(['prefix' => 'payment', 'as' => 'payment.'], function () {
|
||||||
Route::post('/create', 'CreatePaymentTransactionController@create')->name('create');
|
Route::post('/create', 'CreatePaymentTransactionController@create')->name('create');
|
||||||
|
|||||||
+30
-13
@@ -1,11 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use App\Classes\Exceptions\InternalServerErrorException;
|
|
||||||
use App\Classes\Jobs\FetchContainersStatusUpdateFromVTPortalJob;
|
|
||||||
use App\Classes\Jobs\FetchDeliveryListFromVTPortalJob;
|
use App\Classes\Jobs\FetchDeliveryListFromVTPortalJob;
|
||||||
use App\Classes\Jobs\FetchLoadedContainersFromVTPortalJob;
|
use App\Classes\Jobs\FetchLoadedContainersFromVTPortalJob;
|
||||||
use App\Classes\Jobs\FetchOrdersFromYDPortalJob;
|
use App\Classes\Jobs\FetchOrdersFromYDPortalJob;
|
||||||
use App\Classes\Jobs\FetchPackingListFromVTPortalJob;
|
|
||||||
use App\Classes\Jobs\FetchWarehouseReceiveListFromVTPortalJob;
|
use App\Classes\Jobs\FetchWarehouseReceiveListFromVTPortalJob;
|
||||||
use App\Classes\Modules\Documents\DataTransferObjects\DocumentObject;
|
use App\Classes\Modules\Documents\DataTransferObjects\DocumentObject;
|
||||||
use App\Classes\Modules\Documents\Services\CreatesDocument;
|
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\FetchContainersUpdatesFromYdPortalProcessor;
|
||||||
use App\Classes\Modules\PackingLists\Processors\FetchDeliveryUpdatesFromYdPortalProcessor;
|
use App\Classes\Modules\PackingLists\Processors\FetchDeliveryUpdatesFromYdPortalProcessor;
|
||||||
use App\Classes\Modules\PackingLists\Processors\FetchLoadedContainersFromVTPortalProcessor;
|
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\Processors\FetchPackingListsFromYdPortalProcessor;
|
||||||
use App\Classes\Modules\PackingLists\Services\ListsPackingLists;
|
|
||||||
use App\Classes\Modules\Transactions\Processors\ApproveShippingInvoiceTransactionProcessor;
|
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\ApprovalStatus;
|
||||||
use App\Classes\ValueObjects\Constants\BusinessType;
|
use App\Classes\ValueObjects\Constants\BusinessType;
|
||||||
use App\Classes\ValueObjects\Constants\DocumentType;
|
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\PackingListType;
|
||||||
use App\Classes\ValueObjects\Constants\PaymentMethodType;
|
use App\Classes\ValueObjects\Constants\PaymentMethodType;
|
||||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||||
use App\Http\Resources\CompanyResource;
|
|
||||||
use App\Models\CompanyConnection;
|
use App\Models\CompanyConnection;
|
||||||
use App\Models\CompanyModule;
|
use App\Models\CompanyModule;
|
||||||
use App\Models\Document;
|
use App\Models\Document;
|
||||||
@@ -440,6 +433,7 @@ Route::get('/export/pending-arrangement-delivery-list', 'Exports\ExportPendingAr
|
|||||||
Route::get('/export/on-hold-packing-list', 'Exports\ExportPendingArrangementPackingListController@onHold')->name('packaging_list.on_hold.export');
|
Route::get('/export/on-hold-packing-list', 'Exports\ExportPendingArrangementPackingListController@onHold')->name('packaging_list.on_hold.export');
|
||||||
Route::get('/export/arrived-parcel', 'Exports\ExportArrivedParcelController@export')->name('packing_list.arrived_parcel.export');
|
Route::get('/export/arrived-parcel', 'Exports\ExportArrivedParcelController@export')->name('packing_list.arrived_parcel.export');
|
||||||
Route::get('/export/parcel-summary', 'Exports\ExportArrivedParcelController@summary');
|
Route::get('/export/parcel-summary', 'Exports\ExportArrivedParcelController@summary');
|
||||||
|
Route::get('/export/aging-list', 'Exports\ExportArrivedParcelController@aging')->name('aging-listing.export');
|
||||||
Route::get('/export/parcel-postcode', 'Exports\ExportParcelPostcodesController@export');
|
Route::get('/export/parcel-postcode', 'Exports\ExportParcelPostcodesController@export');
|
||||||
Route::get('/export/{year}/customer-total-order', 'Exports\ExportCustomersToExcelController@totalOrders');
|
Route::get('/export/{year}/customer-total-order', 'Exports\ExportCustomersToExcelController@totalOrders');
|
||||||
Route::get('/export/packing-list-warehouse/guangzhou2-to-johor', 'Exports\ExportArrivedParcelController@guangZhou2ToJohor');
|
Route::get('/export/packing-list-warehouse/guangzhou2-to-johor', 'Exports\ExportArrivedParcelController@guangZhou2ToJohor');
|
||||||
@@ -1068,6 +1062,8 @@ Route::get('/wallet/{marking}/details', function ($marking) {
|
|||||||
return view('pages.wallet.index', ['id' => $id, 'marking' => $marking]);
|
return view('pages.wallet.index', ['id' => $id, 'marking' => $marking]);
|
||||||
})->name('wallet.details');
|
})->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) {
|
Route::get('/wallet/audit', function (Request $request) {
|
||||||
$wallets = \App\Models\Wallet::all();
|
$wallets = \App\Models\Wallet::all();
|
||||||
|
|
||||||
@@ -1223,10 +1219,31 @@ Route::get('/wallets/active', function(){
|
|||||||
echo '</table>';
|
echo '</table>';
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::get('/accident-approve-invoice', function(){
|
Route::get('fix-payment-status-updated-but-failed-update-invoice', function (UpdatesTransactionStatus $updatesTransactionStatus, UpdateDoFromVTPortalProcessor $updateDoFromVTPortalProcessor, UpdateDoFromYDPortalProcessor $updateDoFromYDPortalProcessor) {
|
||||||
$invoices = Transaction::where('type', TransactionType::SHIPPING_INVOICE)->whereDate('updated_at', '2023-10-12')->get();
|
$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) {
|
foreach ($invoices as $invoice) {
|
||||||
$orderMarking = $invoice->owner->owner->reference;
|
echo "Fixing" . $invoice->owner->owner->reference . '<br>';
|
||||||
echo '<a href="'.route('order.v2.show', $orderMarking).'" target="_blank">'.$orderMarking.'</a><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