mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-26 16:04:05 +00:00
Merge branch 'dillon/34.6-jenkins-vapor' into vapor/development
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
use App\Classes\ValueObjects\Constants\RoleTypes;
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class HasVouchersAllWithCompany implements Filter
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
if(in_array(Auth::user()->type, RoleTypes::ADMIN_ROLES)){
|
||||
// $userId = $value !== 1 ? $value : Auth::user()->id;
|
||||
$userId = $value;
|
||||
$user = User::where('id', $userId)->first();
|
||||
$users = $user->company()->first()->employees;
|
||||
$userIds = $users->pluck('id');
|
||||
|
||||
return $builder->whereIn('user_id', $userIds)
|
||||
->where(function ($query) {
|
||||
$query->whereHas('reward', function ($subquery) {
|
||||
$subquery->where('is_active', true);
|
||||
})
|
||||
->orWhereDoesntHave('reward');
|
||||
})
|
||||
->whereDoesntHave('voucher.redemptions.transaction.booking.company.employees', function ($query) use ($userId) {
|
||||
$query->where('user_id', $userId);
|
||||
});
|
||||
}
|
||||
else{
|
||||
$user = User::where('id', Auth::user()->id)->first();
|
||||
$users = $user->company()->first()->employees;
|
||||
$userIds = $users->pluck('id');
|
||||
|
||||
return $builder->whereIn('user_id', $userIds)
|
||||
->where(function ($query) {
|
||||
$query->whereHas('reward', function ($subquery) {
|
||||
$subquery->where('is_active', true);
|
||||
})
|
||||
->orWhereDoesntHave('reward');
|
||||
})
|
||||
->whereDoesntHave('voucher.redemptions.transaction.owner');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
use App\Classes\ValueObjects\Constants\RoleTypes;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class HasVouchersAllWithUser implements Filter
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
if(in_array(Auth::user()->type, RoleTypes::ADMIN_ROLES)){
|
||||
// $userId = $value !== 1 ? $value : Auth::user()->id;
|
||||
$userId = $value;
|
||||
return $builder->where('user_id', $userId)
|
||||
->where(function ($query) {
|
||||
$query->whereHas('reward', function ($subquery) {
|
||||
$subquery->where('is_active', true);
|
||||
})
|
||||
->orWhereDoesntHave('reward');
|
||||
})
|
||||
->whereDoesntHave('voucher.redemptions.transaction.booking.company.employees', function ($query) use ($userId) {
|
||||
$query->where('user_id', $userId);
|
||||
});
|
||||
}
|
||||
else{
|
||||
return $builder->where('user_id', Auth::user()->id)
|
||||
->where(function ($query) {
|
||||
$query->whereHas('reward', function ($subquery) {
|
||||
$subquery->where('is_active', true);
|
||||
})
|
||||
->orWhereDoesntHave('reward');
|
||||
})
|
||||
->whereDoesntHave('voucher.redemptions.transaction.owner');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -70,8 +70,24 @@ class FetchesBookingQuotation
|
||||
|
||||
//Voucherify
|
||||
if($voucherCode){
|
||||
$employee = $company->employees()->first();
|
||||
$validateVoucherifyVoucherObject = new ValidateVoucherifyVoucherObject($company->id, $voucherCode, $calculationObject->getSubTotal(), $employee);
|
||||
$employeeWhoOwnsTheVoucher = null;
|
||||
|
||||
$employees = $company->first()->employees;
|
||||
foreach($employees as $singleEmployee){
|
||||
$userRewards = $singleEmployee->rewards;
|
||||
foreach($userRewards as $userReward){
|
||||
if ($userReward->voucher && $userReward->voucher->code === $voucherCode) {
|
||||
Log::info('1. Company with multiple employees: ' . json_encode($singleEmployee) . ", voucher: " . $voucherCode);
|
||||
$employeeWhoOwnsTheVoucher = $singleEmployee;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!$employeeWhoOwnsTheVoucher){
|
||||
$employeeWhoOwnsTheVoucher = $company->employees()->first();
|
||||
}
|
||||
|
||||
$validateVoucherifyVoucherObject = new ValidateVoucherifyVoucherObject($company->id, $voucherCode, $calculationObject->getSubTotal(), $employeeWhoOwnsTheVoucher);
|
||||
$result = $this->validatesVoucherifyVoucher->execute($validateVoucherifyVoucherObject);
|
||||
$voucher = [
|
||||
"code" => $result->code,
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Transactions\ControllersLogic;
|
||||
|
||||
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\Transactions\Services\FetchesTransaction;
|
||||
use App\Classes\Modules\Transactions\Services\DeletesTransaction;
|
||||
use App\Classes\Modules\Transactions\Services\UpdatesTransactionStatus;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use App\Models\Transaction;
|
||||
use App\Classes\Modules\Bookings\ControllersLogic\UpdateBookingAmountLogic;
|
||||
use App\Classes\Modules\Bookings\Services\CalculatesBookingRefundAmount;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use App\Classes\Modules\Bookings\Services\CalculatesBookingPaidAmount;
|
||||
|
||||
class DeleteRefundTransactionLogic extends AbstractControllerLogic
|
||||
{
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function notification(): array
|
||||
{
|
||||
return [
|
||||
'title' => 'Deleted Refund Transaction',
|
||||
'message' => 'You have successfully deleted a transaction'
|
||||
];
|
||||
}
|
||||
|
||||
/** @var FetchesTransaction */
|
||||
private $fetchesTransaction;
|
||||
|
||||
/** @var DeletesTransaction */
|
||||
private $deletesTransaction;
|
||||
|
||||
/** @var UpdatesTransactionStatus */
|
||||
private $updatesTransactionStatus;
|
||||
|
||||
/** @var CalculatesBookingRefundAmount */
|
||||
private $calculatesBookingRefundAmount;
|
||||
|
||||
/** @var CalculatesBookingPaidAmount */
|
||||
private $calculatesBookingPaidAmount;
|
||||
|
||||
/** @var UpdateBookingAmountLogic */
|
||||
private $updateBookingAmountLogic;
|
||||
|
||||
/**
|
||||
* CreatePaymentVerificationDocumentLogic constructor.
|
||||
* @param FetchesTransaction $fetchesTransaction
|
||||
* @param DeletesTransaction $deletesTransaction
|
||||
* @param CalculatesBookingRefundAmount $calculatesBookingRefundAmount
|
||||
* @param UpdateBookingAmountLogic $updateBookingAmountLogic
|
||||
* @param calculatesBookingPaidAmount $calculatesBookingPaidAmount
|
||||
*/
|
||||
public function __construct(FetchesTransaction $fetchesTransaction, DeletesTransaction $deletesTransaction, UpdatesTransactionStatus $updatesTransactionStatus, CalculatesBookingRefundAmount $calculatesBookingRefundAmount, UpdateBookingAmountLogic $updateBookingAmountLogic, CalculatesBookingPaidAmount $calculatesBookingPaidAmount)
|
||||
{
|
||||
$this->fetchesTransaction = $fetchesTransaction;
|
||||
$this->deletesTransaction = $deletesTransaction;
|
||||
$this->updatesTransactionStatus = $updatesTransactionStatus;
|
||||
$this->calculatesBookingRefundAmount = $calculatesBookingRefundAmount;
|
||||
$this->updateBookingAmountLogic = $updateBookingAmountLogic;
|
||||
$this->calculatesBookingPaidAmount = $calculatesBookingPaidAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return JsonResponse
|
||||
* @throws \App\Classes\Exceptions\MalformedRequestException
|
||||
*/
|
||||
public function logic(Request $request): JsonResponse
|
||||
{
|
||||
// delete refund transaction
|
||||
$transaction = $this->fetchesTransaction->execute(['id' => $request->route('id')]);
|
||||
$this->deletesTransaction->execute($transaction);
|
||||
|
||||
// Update payment_transaction status
|
||||
$payment_transaction = $transaction->owner;
|
||||
$this->updatesTransactionStatus->execute($payment_transaction, ApprovalStatus::APPROVED);
|
||||
|
||||
// delete wallet top up transaction
|
||||
$booking = $transaction->owner->owner;
|
||||
Transaction::where('type', TransactionType::CREDIT_NOTE)
|
||||
->where('amount', $transaction->amount)
|
||||
->where('payment_reference', 'like', '%' . $booking->marking . '%')
|
||||
->delete();
|
||||
|
||||
// update back the latest booking amount
|
||||
$request['fix_amount'] = $this->calculatesBookingPaidAmount->execute($booking);
|
||||
$request->route()->setParameter('id', $booking->id);
|
||||
$this->updateBookingAmountLogic->execute($request);
|
||||
|
||||
// if have SUPPLIER_REFUND transaction
|
||||
$bookingInWhiteForm = $payment_transaction->transactions()->bills()->first();
|
||||
if ($bookingInWhiteForm) {
|
||||
|
||||
$whiteFormTransaction = Transaction::where('type', TransactionType::SUPPLIER_REFUND)
|
||||
->where('payment_reference', $transaction->payment_reference)
|
||||
->first();
|
||||
|
||||
// Log::info($whiteFormTransaction->id);
|
||||
|
||||
$whiteFormTransaction->delete();
|
||||
}
|
||||
|
||||
return $this->response([]);
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@ use App\Classes\Modules\Vouchers\Services\Voucherify\ValidatesVoucherifyVoucher;
|
||||
use App\Classes\Modules\Vouchers\Services\Voucherify\CreatesVoucherifyVoucherInACampaign;
|
||||
use App\Classes\Modules\Vouchers\Services\Voucherify\ListsVoucherifyVouchers;
|
||||
use App\Classes\Modules\Vouchers\Services\Voucherify\FetchesVoucherifyCampaign;
|
||||
use App\Classes\Modules\Vouchers\Processors\Voucherify\NewCustomerToVoucherifyProcessor;
|
||||
use App\Classes\Modules\Vouchers\Services\CreatesVoucher;
|
||||
use App\Classes\Modules\Vouchers\Services\FetchesVoucher;
|
||||
use App\Classes\Modules\Vouchers\Services\UpdatesVoucherCampaign;
|
||||
@@ -75,6 +76,9 @@ class CreateVoucherLogic extends AbstractControllerLogic
|
||||
/** @var UpdatesVoucherCampaign */
|
||||
private $updatesVoucherCampaign;
|
||||
|
||||
/** @var NewCustomerToVoucherifyProcessor */
|
||||
private $newCustomerToVoucherifyProcessor;
|
||||
|
||||
/**
|
||||
* CreateVoucherLogic constructor.
|
||||
* @param ValidatesVoucherifyVoucher $validatesVoucherifyVoucher
|
||||
@@ -87,8 +91,9 @@ class CreateVoucherLogic extends AbstractControllerLogic
|
||||
* @param CreatesKeyValuePair $createsKeyValuePair
|
||||
* @param UpdatesKeyValuePair $updatesKeyValuePair
|
||||
* @param UpdatesVoucherCampaign $updatesVoucherCampaign
|
||||
* @param NewCustomerToVoucherifyProcessor $newCustomerToVoucherifyProcessor
|
||||
*/
|
||||
public function __construct(CreatesUserReward $createsUserReward, ValidatesVoucherifyVoucher $validatesVoucherifyVoucher, CreateVoucherProcessor $createVoucherProcessor, CreatesVoucherifyVoucherInACampaign $createsVoucherifyVoucherInACampaign, CanCreateVoucher $canCreateVoucher, ListsVoucherifyVouchers $listsVoucherifyVouchers, FetchesVoucherifyCampaign $fetchesVoucherifyCampaign, CreatesKeyValuePair $createsKeyValuePair, UpdatesKeyValuePair $updatesKeyValuePair, UpdatesVoucherCampaign $updatesVoucherCampaign)
|
||||
public function __construct(CreatesUserReward $createsUserReward, ValidatesVoucherifyVoucher $validatesVoucherifyVoucher, CreateVoucherProcessor $createVoucherProcessor, CreatesVoucherifyVoucherInACampaign $createsVoucherifyVoucherInACampaign, CanCreateVoucher $canCreateVoucher, ListsVoucherifyVouchers $listsVoucherifyVouchers, FetchesVoucherifyCampaign $fetchesVoucherifyCampaign, CreatesKeyValuePair $createsKeyValuePair, UpdatesKeyValuePair $updatesKeyValuePair, UpdatesVoucherCampaign $updatesVoucherCampaign, NewCustomerToVoucherifyProcessor $newCustomerToVoucherifyProcessor)
|
||||
{
|
||||
$this->createsUserReward = $createsUserReward;
|
||||
$this->validatesVoucherifyVoucher = $validatesVoucherifyVoucher;
|
||||
@@ -100,6 +105,7 @@ class CreateVoucherLogic extends AbstractControllerLogic
|
||||
$this->createsKeyValuePair = $createsKeyValuePair;
|
||||
$this->updatesKeyValuePair = $updatesKeyValuePair;
|
||||
$this->updatesVoucherCampaign = $updatesVoucherCampaign;
|
||||
$this->newCustomerToVoucherifyProcessor = $newCustomerToVoucherifyProcessor;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -129,6 +135,12 @@ class CreateVoucherLogic extends AbstractControllerLogic
|
||||
$user = $userParam ? $userParam : $user;
|
||||
}
|
||||
|
||||
//Voucherify - To check if user exist at Voucherify, create if not exist
|
||||
$voucherify_entity = $user->voucherifyEntities()->first();
|
||||
if(!$voucherify_entity){
|
||||
$this->newCustomerToVoucherifyProcessor->execute($user->company()->first()->id, $user, false);
|
||||
}
|
||||
|
||||
//Voucherify - creates new voucher at voucherify
|
||||
if ($voucherCodeInput === Vouchers::SORRY_50 || $voucherCodeInput === Vouchers::SORRY_100 || $voucherCodeInput === Vouchers::SORRY_200 ) {
|
||||
$result = $this->newVoucherifyVoucherIssuanceHandler($voucherCodeInput);
|
||||
|
||||
@@ -10,6 +10,7 @@ use App\Classes\Modules\Vouchers\DataTransferObjects\ValidateVoucherifyVoucherOb
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\Booking;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class ValidateVoucherLogic extends AbstractControllerLogic
|
||||
{
|
||||
@@ -42,11 +43,27 @@ class ValidateVoucherLogic extends AbstractControllerLogic
|
||||
*/
|
||||
public function logic(Request $request) : JsonResponse
|
||||
{
|
||||
$employeeWhoOwnsTheVoucher = null;
|
||||
$booking = Booking::find($request->input('itemId'));
|
||||
$employee = $booking->company->employees()->first();
|
||||
$employees = $booking->company->employees()->get();
|
||||
|
||||
foreach($employees as $singleEmployee){
|
||||
$userRewards = $singleEmployee->rewards;
|
||||
foreach($userRewards as $userReward){
|
||||
if ($userReward->voucher && $userReward->voucher->code === $request->input('voucherCode')) {
|
||||
Log::info('2. Company with multiple employees: ' . json_encode($singleEmployee) . ", voucher: " . $request->input('voucherCode'));
|
||||
$employeeWhoOwnsTheVoucher = $singleEmployee;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!$employeeWhoOwnsTheVoucher){
|
||||
$employeeWhoOwnsTheVoucher = $booking->company->employees()->first();
|
||||
}
|
||||
|
||||
$amount = $this->floatvalue($request->input('amount'));
|
||||
|
||||
$validateVoucherifyVoucherObject = new ValidateVoucherifyVoucherObject($booking->company_id, $request->input('voucherCode'), $amount, $employee);
|
||||
$validateVoucherifyVoucherObject = new ValidateVoucherifyVoucherObject($booking->company_id, $request->input('voucherCode'), $amount, $employeeWhoOwnsTheVoucher);
|
||||
$result = $this->validatesVoucherifyVoucher->execute($validateVoucherifyVoucherObject);
|
||||
return $this->response(['data' => $result]);
|
||||
}
|
||||
|
||||
@@ -65,9 +65,9 @@ class CreateVoucherifyCustomerObject implements DataTransferObject
|
||||
*/
|
||||
public function getAcquisitionChannel(): string
|
||||
{
|
||||
if(!$this->isNew){
|
||||
return "";
|
||||
}
|
||||
// if(!$this->isNew){
|
||||
// return "";
|
||||
// }
|
||||
return $this->acquisitionChannel;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -17,8 +17,8 @@ class ValidateVoucherifyVoucherObject implements DataTransferObject
|
||||
/** @var float */
|
||||
private $amount;
|
||||
|
||||
/** @var User */
|
||||
private $user;
|
||||
/** @var User */
|
||||
private $user; //this will affect certain voucher that limit user redemption e.g. one user one redemption per campaign
|
||||
|
||||
/**
|
||||
* ValidateVoucherifyVoucherObject constructor.
|
||||
|
||||
+19
-2
@@ -83,7 +83,24 @@ class BookingToVoucherifyProcessor
|
||||
$voucherify_customer_id = "";
|
||||
$voucherify_order_id = "";
|
||||
if($voucherCode){
|
||||
$redeemVoucherifyVoucherObject = new RedeemVoucherifyVoucherObject($companyId, $transaction->id, $voucherCode, $amount, $user);
|
||||
$employeeWhoOwnsTheVoucher = null;
|
||||
|
||||
$employees = $user->company()->first()->employees;
|
||||
foreach($employees as $singleEmployee){
|
||||
$userRewards = $singleEmployee->rewards;
|
||||
foreach($userRewards as $userReward){
|
||||
if ($userReward->voucher && $userReward->voucher->code === $voucherCode) {
|
||||
Log::info('3. Company with multiple employees: ' . json_encode($singleEmployee) . ", voucher: " . $voucherCode);
|
||||
$employeeWhoOwnsTheVoucher = $singleEmployee;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!$employeeWhoOwnsTheVoucher){
|
||||
$employeeWhoOwnsTheVoucher = $user;
|
||||
}
|
||||
|
||||
$redeemVoucherifyVoucherObject = new RedeemVoucherifyVoucherObject($companyId, $transaction->id, $voucherCode, $amount, $employeeWhoOwnsTheVoucher);
|
||||
$redeemVoucherResult = $this->redeemsVoucherifyVoucher->execute($redeemVoucherifyVoucherObject);
|
||||
|
||||
// Log::info('redeemVoucherResult: '.json_encode($redeemVoucherResult));
|
||||
@@ -101,7 +118,7 @@ class BookingToVoucherifyProcessor
|
||||
|
||||
$voucher = $this->recordVoucherInfo($redeemedVoucher);
|
||||
$this->createsVoucherRedemption->execute($transaction, $voucher, $redemptionId, $voucherDiscountAmount);
|
||||
$this->recordVoucherForUserInfo($user, $voucher);
|
||||
$this->recordVoucherForUserInfo($employeeWhoOwnsTheVoucher, $voucher);
|
||||
}
|
||||
else{
|
||||
$createVoucherifyOrderObject = new CreateVoucherifyOrderObject($user, $companyId, $transaction->id, $amount, true, $transaction->type == TransactionType::TOP_UP);
|
||||
|
||||
+3
-1
@@ -44,7 +44,9 @@ class NewCustomerToVoucherifyProcessor
|
||||
$createVoucherifyCustomerObject = new CreateVoucherifyCustomerObject($companyId, $user, $isNew);
|
||||
$result = $this->createsVoucherifyCustomer->execute($createVoucherifyCustomerObject);
|
||||
|
||||
if($result && isset($result->id)){
|
||||
$voucherify_entity = $user->voucherifyEntities()->get();
|
||||
|
||||
if($result && isset($result->id) && count($voucherify_entity) === 0){
|
||||
$voucherEntityObject = new VoucherEntityObject($result->id, VoucherifyEntityType::CUSTOMER);
|
||||
$this->createsVoucherEntityMapping->execute($createVoucherifyCustomerObject->getUser(), $voucherEntityObject);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Transactions;
|
||||
|
||||
use App\Classes\Modules\Transactions\ControllersLogic\DeleteRefundTransactionLogic;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class DeleteRefundTransactionController
|
||||
{
|
||||
public function delete(Request $request, DeleteRefundTransactionLogic $logic): JsonResponse {
|
||||
return $logic->execute($request);
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ namespace App\Http\Resources;
|
||||
|
||||
use ArrayObject;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class VoucherResource extends JsonResource
|
||||
{
|
||||
@@ -16,7 +17,8 @@ class VoucherResource extends JsonResource
|
||||
public function toArray($request)
|
||||
{
|
||||
$filteredRedemptions = new ArrayObject([]);
|
||||
if ($request->has('filters') && str_contains($request->input('filters'), "has_vouchers_all")) {
|
||||
if ($request->has('filters') && (str_contains($request->input('filters'), "has_vouchers_all_with_user") )) {
|
||||
//|| str_contains($request->input('filters'), "has_vouchers_all_with_company")
|
||||
$filteredRedemptions = new ArrayObject([]);
|
||||
}
|
||||
else{
|
||||
|
||||
@@ -14,15 +14,46 @@
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="row">
|
||||
<span v-if="item.voucher.end_date && new Date() > new Date(item.voucher.end_date)">
|
||||
This voucher has expired.
|
||||
</span>
|
||||
<span v-else-if="item.voucher.end_date">
|
||||
Valid till {{ item.voucher.end_date }}
|
||||
</span>
|
||||
<span v-else>
|
||||
Non-expired
|
||||
</span>
|
||||
<div class="col-12 col-md-8 text-left no-padding">
|
||||
<span v-if="item.voucher.end_date && new Date() > new Date(item.voucher.end_date)">
|
||||
This voucher has expired.
|
||||
</span>
|
||||
<span v-else-if="item.voucher.end_date">
|
||||
Valid till {{ item.voucher.end_date }}
|
||||
</span>
|
||||
<span v-else>
|
||||
Non-expired
|
||||
</span>
|
||||
</div>
|
||||
<div class="col-12 col-md-4 text-right no-padding">
|
||||
<a class="requestModal" :data-type="'showVoucherTnC-' + item.id">Terms</a>
|
||||
</div>
|
||||
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" size="extra-large" :type="'showVoucherTnC-' + item.id">
|
||||
<div class="container">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
Terms & Conditions
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<ol>
|
||||
<li>Vouchers are only valid for purchases made on <a href="https://exchange.cief-malaysia.com/" target="_blank">https://exchange.cief-malaysia.com/</a>.</li>
|
||||
<li>Each voucher is applicable for a single transaction (unless stated otherwise).</li>
|
||||
<li>Each voucher is only applicable for new orders.</li>
|
||||
<li>Voucher codes are to be entered at the checkout or cart page (unless stated otherwise).</li>
|
||||
<li>Vouchers are not valid for promotions or discounted products (unless stated otherwise).</li>
|
||||
<li>Customers should take note of the expiry dates of the voucher(s) that they wish to redeem. Any voucher(s) which have expired will be invalid.</li>
|
||||
<li>Individual vouchers are only valid during its respective promotion period. This guideline overrides any individual voucher policy (unless stated otherwise).</li>
|
||||
<li>CIEF reserves the right to cancel any order if a customer’s purchasing behavior appears to be suspicious or potentially fraudulent.</li>
|
||||
<li>CIEF vouchers are not exchangeable for cash at <a href="https://exchange.cief-malaysia.com/" target="_blank">https://exchange.cief-malaysia.com/</a>.</li>
|
||||
<li>This voucher can only be used and redeemed by a registered customer who has already logged into their account during purchase.</li>
|
||||
<li>CIEF reserves the right to amend the terms & conditions or cancel any vouchers/promotions without prior notice.</li>
|
||||
<li>Additional terms & conditions are stated on the respective promotion banners (e.g., duration, discount amounts, validity for campaigns/promotions or certain services).</li>
|
||||
</ol>
|
||||
<button type="button" class="btn btn-primary" data-dismiss="modal">OK</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</modal-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -67,7 +98,7 @@
|
||||
fetchVouchers(){
|
||||
this.isLoading = true;
|
||||
if(this.employee){
|
||||
this.submit(route('api.voucher.user.list') + '?filters=' + JSON.stringify( { 'has_vouchers_all': this.employee.id} ), 'get', this.section, false, false);
|
||||
this.submit(route('api.voucher.user.list') + '?filters=' + JSON.stringify( { 'has_vouchers_all_with_company': this.employee.id} ), 'get', this.section, false, false);
|
||||
}
|
||||
},
|
||||
successHandler(response){
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
fetchVouchers(){
|
||||
this.isLoading = true;
|
||||
if(this.employee){
|
||||
this.submit(route('api.voucher.user.list') + '?filters=' + JSON.stringify( { 'has_vouchers_all': this.employee.id} ), 'get', this.section, false, false);
|
||||
this.submit(route('api.voucher.user.list') + '?filters=' + JSON.stringify( { 'has_vouchers_all_with_company': this.employee.id} ), 'get', this.section, false, false);
|
||||
}
|
||||
},
|
||||
successHandler(response){
|
||||
|
||||
@@ -403,6 +403,24 @@
|
||||
</modal-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-b-15 text-right parentContainer" v-if="$store.getters.isSuperAdmin && refund.status === 2">
|
||||
<div class="col">
|
||||
<button class="btn btn-xs btn-outline-danger b-rad-none m-r-5 requestModal" data-type="deleteRefund">
|
||||
<i class="fa fa-times fa-fw"></i>
|
||||
</button>
|
||||
<modal-component class="animate__animated animate__fast animate__fadeIn" type="deleteRefund">
|
||||
<general-confirmation-form-component
|
||||
contentText="Are you sure you want to delete this refund?"
|
||||
modalType="delete"
|
||||
class="text-center"
|
||||
:apiRoute="route('api.transaction.refund.delete', refund.id)"
|
||||
apiMethod="delete"
|
||||
:section="section"
|
||||
>
|
||||
</general-confirmation-form-component>
|
||||
</modal-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col" v-if="this.$store.getters.getUserId">
|
||||
<list-component section="customerVouchersListSection" :endpoint="route('api.voucher.user.list')" :options="{ 'has_vouchers_all': id }">
|
||||
<list-component section="customerVouchersListSection" :endpoint="route('api.voucher.user.list')" :options="{ 'has_vouchers_all_with_user': id }">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<single-user-reward-item-component :data="data"></single-user-reward-item-component>
|
||||
</template>
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col" v-if="this.$store.getters.getUserId">
|
||||
<list-component section="customerVouchersListSection" :endpoint="route('api.voucher.user.list')" :options="{ 'has_vouchers_all': true }">
|
||||
<list-component section="customerVouchersListSection" :endpoint="route('api.voucher.user.list')" :options="{ 'has_vouchers_all_with_user': true }">
|
||||
<template slot="list" slot-scope="{data}">
|
||||
<single-user-reward-item-component :data="data"></single-user-reward-item-component>
|
||||
</template>
|
||||
|
||||
@@ -15,6 +15,8 @@ Route::group(['prefix' => 'transactions', 'namespace' => 'Transactions', 'as' =>
|
||||
Route::put('/{id}/bill/{status}', 'UpdatePaymentTransactionStatusController@update')->where('status', 'pending|complete')->name('bill.status');
|
||||
Route::put('/{id}/refund/status/update/{status}', 'UpdateRefundTransactionStatusController@update')->name('refund.status.update');
|
||||
|
||||
Route::delete('/refund/{id}/delete', 'DeleteRefundTransactionController@delete')->name('refund.delete');
|
||||
|
||||
route::delete('{id}/bill/delete', 'DeletePaymentProofDocumentController@delete')->name('bill.delete');
|
||||
|
||||
Route::post('booking/{id}/details/update', 'CreatePurchaseOrderTransactionController@create')->name('po.create');
|
||||
|
||||
Reference in New Issue
Block a user