Compare commits

..

10 Commits

Author SHA1 Message Date
edmondlang 82568269a6 Merge branch 'multiple-payment-ui' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into multiple-invoice-one-payment 2023-01-09 23:23:57 +08:00
edmondlang 01925913fa Merge branch 'staging' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into multiple-invoice-one-payment 2023-01-09 23:23:46 +08:00
edmondlang 769b5dd050 multi payment ui 2023-01-09 22:57:30 +08:00
WAKOYA_KUMSA\waqo1 1e7060c111 cleanup the code 2022-12-28 19:05:14 +03:00
edmondlang d4bc3c55b6 update create billPlz service, if environment is local, use withoutVerifying() 2022-12-28 23:25:36 +08:00
WAKOYA_KUMSA\waqo1 fa82b6f185 Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal into multiple-invoice-one-payment 2022-12-28 12:45:42 +03:00
WAKOYA_KUMSA\waqo1 5ac234cb34 migrate wallet from exchange to shipping portal 2022-12-27 17:05:46 +03:00
Omair Saleh 4ff5c6df80 update gz warehouse notice 2022-12-26 21:21:00 +08:00
edmondlang 851e2e1815 multi payment ui 2022-12-24 16:39:17 +08:00
edmondlang 503bc90556 multiple payment ui 2022-12-23 16:37:06 +08:00
32 changed files with 531 additions and 314 deletions
@@ -0,0 +1,20 @@
<?php
namespace App\Classes\General\Eloquent\Filters;
use Illuminate\Database\Eloquent\Builder;
class Receiver implements Filter
{
/**
* @param Builder $builder
* @param $value
* @return Builder|mixed
*/
public static function apply(Builder $builder, $value)
{
return $builder->where('receiver', '=', $value);
}
}
@@ -22,10 +22,8 @@ class CreatesBillplzBill
public function execute(string $name, string $email, string $description, float $amount, string $billNumber, ?string $bankCode = null, ?bool $wallet = null) {
try{
// config('billplz.maybank')
// $response = Http::withBasicAuth(config('billplz.api_key').':', '')->post(config('billplz.base_url').'/api/v3/bills', [
$response = Http::withoutVerifying(config('billplz.api_key').':', '')->post(config('billplz.base_url').'/api/v3/bills', [
// 'collection_id' => config('billplz.collection_id'),
'collection_id' => $wallet ? config('billplz.wallet_collection_id') : config('billplz.collection_id'),
$requestBody = [
'collection_id' => config('billplz.collection_id'),
'name' => $name,
'email' => $email,
'description' => $description,
@@ -36,7 +34,13 @@ class CreatesBillplzBill
'reference_1' => $bankCode ? $bankCode : '',
'reference_2_label' => 'Bill Number',
'reference_2' => $billNumber
]);
];
if (in_array(app()->environment(), ['development', 'staging', 'production'])) {
$response = Http::withBasicAuth(config('billplz.api_key') . ':', '')->post(config('billplz.base_url') . '/api/v3/bills', $requestBody);
} else {
$response = Http::withoutVerifying()->withBasicAuth(config('billplz.api_key') . ':', '')->post(config('billplz.base_url') . '/api/v3/bills', $requestBody);
}
if($response->successful()){
$data = $response->json();
@@ -0,0 +1,66 @@
<?php
namespace App\Classes\Modules\Companies\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Transactions\Services\ListsTransactions;
use App\Classes\ValueObjects\Constants\TransactionType;
use App\Http\Resources\TransactionResource;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class ListCompanyModuleInvoicesLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification(): array
{
return [
'title' => 'Retrieved Company Module Invoices',
'message' => 'You have successfully retrieved a list of Invoices'
];
}
/** @var ListsTransactions */
private $listsTransactions;
/**
* ListCompanyModuleInvoicesLogic constructor.
* @param ListsTransactions $listsTransactions
*/
public function __construct(ListsTransactions $listsTransactions)
{
$this->listsTransactions = $listsTransactions;
}
/**
* @param Request $request
* @return JsonResponse
* @throws \App\Classes\Exceptions\AccessForbiddenException
* @throws \App\Classes\Exceptions\MalformedRequestException
* @throws \App\Classes\Exceptions\RequestValidationException
*/
public function logic(Request $request): JsonResponse
{
$filterArray = [
"per_page" => 10,
"order_by" => (object)[
"column" => 'id',
"DESC" => true,
],
"status_in" => [2],
"receiver" => intval($request->route('company_module_id')),
"type" => TransactionType::SHIPPING_INVOICE
];
// $this->canListTransactions->passes();
$query = $this->listsTransactions->execute($filterArray);
return $this->collectionResponse(TransactionResource::collection($query));
}
}
@@ -49,8 +49,6 @@ use App\Classes\Modules\Wallets\Services\GeneratesWalletCode;
use App\Classes\Modules\Wallets\Services\CreatesWallet;
use APP\models\PackingList;
use App\Classes\Exceptions\MalformedRequestException;
class multipleInvoicesWithOnePaymentLogic extends AbstractControllerLogic
@@ -140,11 +138,9 @@ class multipleInvoicesWithOnePaymentLogic extends AbstractControllerLogic
public function logic( $transactionsArray) : JsonResponse
{
// dd($request);
try {
// dd(json_decode($transactionsArray));
$transactions = Transaction::whereIn('id', json_decode($transactionsArray))->where('type', TransactionType::SHIPPING_INVOICE)->get();
$total = $transactions->sum('amount');
$packingList =$transactions[1]->owner;
@@ -168,8 +164,7 @@ class multipleInvoicesWithOnePaymentLogic extends AbstractControllerLogic
$transaction_object = new TransactionObject($billNumber, TransactionType::TOP_UP, 1, $company->id, 1, PaymentMethodType::PAYMENT_GATEWAY, $total, $total, 1, 1, 1, 0, 0, null, ApprovalStatus::PENDING_SUBMISSION, [], 'test');
// $transaction = $this->createsTransaction->execute($wallet, $transaction_object);
$transaction = (App()->make(CreatesTransaction::class))->execute($wallet, $transaction_object);
$result= (App()->make(UpdatesWalletBalance::class))->execute($wallet, $total);
@@ -177,6 +172,9 @@ class multipleInvoicesWithOnePaymentLogic extends AbstractControllerLogic
multipleInvoicesWithOnePayment::create([ 'topUp_request_id' => $transaction->id, 'transaction_id' => $value->id ]);
}
// payment gateway api call
return $this->response([]); ;
@@ -15,7 +15,7 @@ class CreatesTransaction extends AbstractUpdateRelationshipRecord
* @return \Illuminate\Database\Eloquent\Model
* @throws \App\Classes\Exceptions\MalformedRequestException
*/
public function execute(PackingList $packing_list, TransactionObject $object) {
public function execute( $packing_list, TransactionObject $object) {
$model = new Transaction();
$model->bill_no = $object->getBillNo();
$model->type = $object->getTransactionType();
@@ -0,0 +1,20 @@
<?php
namespace App\Http\Controllers\Companies;
use App\Classes\Modules\Companies\ControllersLogic\ListCompanyModuleInvoicesLogic;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class ListCompanyModuleInvoicesController
{
/**
* @param Request $request
* @param ListCompanyModulesLogic $logic
* @return JsonResponse
*/
public function list(Request $request, ListCompanyModuleInvoicesLogic $logic): JsonResponse {
return $logic->execute($request);
}
}
@@ -1,76 +0,0 @@
<?php
namespace App\Http\Controllers\Invoice;
use App\Http\Controllers\Controller;
use App\Classes\Modules\Transactions\ControllersLogic\multipleInvoicesWithOnePaymentLogic;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use App\Models\Transaction;
use App\Classes\ValueObjects\Constants\TransactionType;
use App\Classes\Modules\Wallets\Services\UpdatesWalletBalance;
use App\Classes\ValueObjects\Constants\PaymentMethodType;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\Modules\Transactions\DataTransferObjects\TransactionObject;
use App\Classes\Modules\Transactions\Services\CreatesTransaction;
use App\Classes\Modules\Transactions\Services\GeneratesTransactionBillNumber;
use App\Classes\Modules\Billplzs\Services\CreatesBillplzBill;
use App\Classes\Modules\Wallets\DataTransferObjects\WalletObject;
use App\Classes\Modules\Wallets\Services\GeneratesWalletCode;
use App\Classes\Modules\Wallets\Services\CreatesWallet;
use APP\models\PackingList;
use App\Models\multipleInvoicesWithOnePayment;
use DB;
class MultipleInvoiceOnePaymentController extends Controller
{
public function getallivoiceid($transactionsArray, multipleInvoicesWithOnePaymentLogic $logic): JsonResponse {
return $logic->logic($transactionsArray);
}
public function getallivoiceid1( $transactionsArray)
{
// dd(json_decode($transactionsArray));
$transactions = Transaction::whereIn('id', json_decode($transactionsArray))->where('type', TransactionType::SHIPPING_INVOICE)->get();
$total = $transactions->sum('amount');
$packingList =$transactions[1]->owner;
$order = $packingList->owner;
$companyModule = $order->companyModule;
$company = $companyModule->company;
$wallet = $company->wallets()->first();
if (!$wallet) {
$object = new WalletObject($company->id, 1, $this->generatesWalletCode->execute());
/** @var Wallet $wallet */
$wallet = $this->createsWallet->execute($object, $company);
}
$billNumber = (App()->make(GeneratesTransactionBillNumber::class))->execute('TOPUP-');
if($total < 0) {
throw new MalformedRequestException('Top up credit value must be greater than zero.');
}
$billPlzBill = (App()->make(CreatesBillplzBill::class))->execute($company->name, 'example@gmail.com', 'This payment is credit topup for company ref. ' . $company->reference, $total, $billNumber, 'bank code', true);
$transaction_object = new TransactionObject($billNumber, TransactionType::TOP_UP, 1, $company->id, 1, PaymentMethodType::PAYMENT_GATEWAY, $total, $total, 1, 1, 1, 0, 0, null, ApprovalStatus::PENDING_SUBMISSION, [], 'test');
// $transaction = $this->createsTransaction->execute($wallet, $transaction_object);
$transaction = (App()->make(CreatesTransaction::class))->execute($wallet, $transaction_object);
$result= (App()->make(UpdatesWalletBalance::class))->execute($wallet, $total);
foreach ($transactions as $key => $value) {
multipleInvoicesWithOnePayment::create([ 'topUp_request_id' => $transaction->id, 'transaction_id' => $value->id ]);
}
dd($transaction->id);
}
}
@@ -1,6 +1,6 @@
<?php
namespace App\Http\Controllers\Invoice;
namespace App\Http\Controllers\Transactions;
use App\Http\Controllers\Controller;
use App\Classes\Modules\Transactions\ControllersLogic\multipleInvoicesWithOnePaymentLogic;
@@ -19,6 +19,7 @@ use App\Classes\Modules\Billplzs\Services\CreatesBillplzBill;
use App\Classes\Modules\Wallets\DataTransferObjects\WalletObject;
use App\Classes\Modules\Wallets\Services\GeneratesWalletCode;
use App\Classes\Modules\Wallets\Services\CreatesWallet;
use APP\models\PackingList;
use App\Models\multipleInvoicesWithOnePayment;
use DB;
@@ -32,45 +33,6 @@ class MultipleInvoiceOnePaymentController extends Controller
return $logic->logic($transactionsArray);
}
public function getallivoiceid( $transactionsArray)
{
// dd(json_decode($transactionsArray));
$transactions = Transaction::whereIn('id', json_decode($transactionsArray))->where('type', TransactionType::SHIPPING_INVOICE)->get();
$total = $transactions->sum('amount');
$packingList =$transactions[1]->owner;
$order = $packingList->owner;
$companyModule = $order->companyModule;
$company = $companyModule->company;
$wallet = $company->wallets()->first();
if (!$wallet) {
$object = new WalletObject($company->id, 1, $this->generatesWalletCode->execute());
/** @var Wallet $wallet */
$wallet = $this->createsWallet->execute($object, $company);
}
$billNumber = (App()->make(GeneratesTransactionBillNumber::class))->execute('TOPUP-');
if($total < 0) {
throw new MalformedRequestException('Top up credit value must be greater than zero.');
}
$billPlzBill = (App()->make(CreatesBillplzBill::class))->execute($company->name, 'example@gmail.com', 'This payment is credit topup for company ref. ' . $company->reference, $total, $billNumber, 'bank code', true);
$transaction_object = new TransactionObject($billNumber, TransactionType::TOP_UP, 1, $company->id, 1, PaymentMethodType::PAYMENT_GATEWAY, $total, $total, 1, 1, 1, 0, 0, null, ApprovalStatus::PENDING_SUBMISSION, [], 'test');
// $transaction = $this->createsTransaction->execute($wallet, $transaction_object);
$transaction = (App()->make(CreatesTransaction::class))->execute($wallet, $transaction_object);
$result= (App()->make(UpdatesWalletBalance::class))->execute($wallet, $total);
foreach ($transactions as $key => $value) {
multipleInvoicesWithOnePayment::create([ 'topUp_request_id' => $transaction->id, 'transaction_id' => $value->id ]);
}
dd($transaction->id);
}
}
@@ -0,0 +1,15 @@
<?php
namespace App\Http\Controllers\Wallets;
use App\Classes\Modules\Wallets\ControllersLogic\CreateWalletLogic;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class CreateWalletController
{
public function create(Request $request, CreateWalletLogic $logic): JsonResponse {
return $logic->execute($request);
}
}
@@ -0,0 +1,15 @@
<?php
namespace App\Http\Controllers\Wallets;
use App\Classes\Modules\Wallets\ControllersLogic\CreateWalletTransactionLogic;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class CreateWalletTransactionController
{
public function create(Request $request, CreateWalletTransactionLogic $logic): JsonResponse {
return $logic->execute($request);
}
}
@@ -0,0 +1,15 @@
<?php
namespace App\Http\Controllers\Wallets;
use App\Classes\Modules\Wallets\ControllersLogic\CreditWalletLogic;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class CreditWalletController
{
public function credit(Request $request, CreditWalletLogic $logic): JsonResponse {
return $logic->execute($request);
}
}
@@ -0,0 +1,15 @@
<?php
namespace App\Http\Controllers\Wallets;
use App\Classes\Modules\Wallets\ControllersLogic\DebitWalletLogic;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class DebitWalletController
{
public function debit(Request $request, DebitWalletLogic $logic): JsonResponse {
return $logic->execute($request);
}
}
@@ -0,0 +1,14 @@
<?php
namespace App\Http\Controllers\Wallets;
use App\Classes\Modules\Wallets\ControllersLogic\ListWalletLogic;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class ListWalletController
{
public function list(Request $request, ListWalletLogic $logic): JsonResponse {
return $logic->execute($request);
}
}
@@ -0,0 +1,15 @@
<?php
namespace App\Http\Controllers\Wallets;
use App\Classes\Modules\Wallets\ControllersLogic\TopUpWalletLogic;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class TopUpWalletController
{
public function topUp(Request $request, TopUpWalletLogic $logic): JsonResponse {
return $logic->execute($request);
}
}
@@ -0,0 +1,14 @@
<?php
namespace App\Http\Controllers\Wallets;
use App\Classes\Modules\Wallets\ControllersLogic\UpdateStatusWalletLogic;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class UpdateStatusWalletController
{
public function updateStatus(Request $request, UpdateStatusWalletLogic $logic): JsonResponse {
return $logic->execute($request);
}
}
@@ -0,0 +1,29 @@
<?php
namespace App\Http\Controllers\Wallets;
use App\Classes\ValueObjects\Response\ApiResponseObject;
use App\Classes\ValueObjects\Constants\HttpStatus;
use App\Classes\ValueObjects\Constants\TransactionType;
use App\Models\Transaction;
use App\Models\Wallet;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class WalletReportController
{
public function walletsReport(Request $request): JsonResponse
{
return (new ApiResponseObject(
'fetch service report Successful',
'',
HttpStatus::OK_WITH_MESSAGE,
['data' => [
'walletSum' => (float) Wallet::all()->sum('amount'),
'outgoingSum' => (float) Transaction::where('type', TransactionType::PAYMENT)->where('owner_type', Wallet::class)->sum('amount'),
'incomingSum' => (float) Transaction::whereIn('type', [TransactionType::TOP_UP, TransactionType::CREDIT_NOTE])->where('owner_type', Wallet::class)->sum('amount'),
]]
))->handler();
}
}
@@ -0,0 +1,15 @@
<?php
namespace App\Http\Controllers\Wallets;
use App\Classes\Modules\Wallets\ControllersLogic\WithdrawWalletLogic;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class WithdrawWalletController
{
public function withdraw(Request $request, WithdrawWalletLogic $logic): JsonResponse {
return $logic->execute($request);
}
}
+2
View File
@@ -3,6 +3,7 @@
namespace App\Models;
use App\Classes\General\Interfaces\Transactionable;
use App\Classes\General\Traits\LogData;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphTo;
use Illuminate\Database\Eloquent\SoftDeletes;
@@ -12,6 +13,7 @@ use Illuminate\Database\Eloquent\Relations\MorphMany;
class Wallet extends AbstractModel implements Transactionable
{
use SoftDeletes;
use LogData;
protected $table = 'wallets';
/**
+32
View File
@@ -0,0 +1,32 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Relations\HasOne;
class WalletTransaction extends AbstractModel
{
protected $table = 'wallet_transaction';
public function wallet(): HasOne
{
return $this->hasOne(Wallet::class, 'wallet_id', 'id');
}
public function transaction(): HasOne
{
return $this->hasOne(Transaction::class, 'transaction_id', 'id');
}
public function currency(): HasOne
{
return $this->hasOne(Currency::class, 'currency_id', 'id');
}
public function original_currency(): HasOne
{
return $this->hasOne(Currency::class, 'original_currency_id', 'id');
}
}
@@ -38,4 +38,3 @@ class CreateCompaniesWalletTable extends Migration
Schema::dropIfExists('wallets');
}
}
@@ -1,35 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateMultipleInvoiceOnePaymentsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('multiple_invoice_one_payments', function (Blueprint $table) {
$table->id();
$table->foreignId('topUp_request_id')->unsigned();
$table->foreignId('transaction_id')->unsigned();
$table->timestamps();
$table->foreign('topUp_request_id')->references('id')->on('transactions');
$table->foreign('transaction_id')->references('id')->on('transactions');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('multiple_invoice_one_payments');
}
}
@@ -1,44 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AlterWalletCompanyId extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
if (Schema::hasColumn('wallets', 'company_id')) {
Schema::table('wallets', function (Blueprint $table) {
$table->dropForeign('wallets_company_id_foreign');
$table->dropColumn('company_id');
});
}
if (!Schema::hasColumn('wallets', 'owner_id')) {
Schema::table('wallets', function (Blueprint $table) {
$table->morphs('owner');
});
//In-case the model name lengthy
Schema::table('wallets', function (Blueprint $table) {
$table->string('owner_type', 250)->change();
});
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
@@ -0,0 +1,153 @@
<template>
<div class="row">
<div class="col">
<div class="row">
<div class="col-12 col-sm-12 col-md-9">
<div class="row m-b-15 m-l-5 m-r-10">
<div class="col b-a b-grey rounded bg-master-light">
<div class="row">
<div class="col padding-20">
<div class="row align-items-center justify-conten-center" @click="chooseAllInvoice()">
<div class="col-auto pointer">
<i class="fa fs-30 fa-fw" :class="{'fa-square-o': !selectAllInvoice, 'fa-check-square': selectAllInvoice, 'text-primary':selectAllInvoice}" ></i>
</div>
<div class="col">
<h5 class="no-margin font-heading">Invoice No</h5>
</div>
<div class="col">
<h5 class="no-margin">Invoice Date</h5>
</div>
<div class="col">
<h5 class="no-margin">Status</h5>
</div>
<div class="col">
<h5 class="no-margin">Amount</h5>
</div>
<div class="col-auto">
<div class="btn bg-grey no-border muted invisible">
<i class="fa fa-file-pdf-o"></i>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row" v-for="invoice in invoices">
<div class="col">
<payments-billing-components :data="invoice" :selectedInvoice="selectedInvoice" v-on:input="updateList($event)"></payments-billing-components>
</div>
</div>
</div>
<div class="col-12 col-sm-12 col-md-3">
<div class="row align-items-center">
<div class="col b-a b-grey rounded padding-25">
<div class="row">
<div class="col">
<h6 class="semi-bold muted">Payment Summary</h6>
</div>
</div>
<div class="row align-items-center justify-content-center">
<div class="col-auto">
<div class="padding-5">
<i class="fa fa-angle-up"></i>
</div>
</div>
<div class="col p-l-0">
<h6 class="semi-bold text-primary">{{selectedInvoice.length}} Invoice Selected</h6>
</div>
</div>
<div class="row">
<div class="col">
<div class="row" v-for="invoice in selectedInvoice">
<div class="col">
<h6 class="no-margin">lorem ipsum</h6>
</div>
<div class="col-auto">
<h6 class="no-margin">52x62x635 CM</h6>
</div>
</div>
</div>
</div>
<hr>
<div class="row">
<div class="col">
<h6 class="normal">Total Payments</h6>
</div>
<div class="col-auto">
<h6 class="text-primary bold">RM 3300.00</h6>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="btn btn-xl btn-success pointer m-t-10 w-100" @click='makePayment'>Make Payments</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
props: {
company_module_id: {
type: Number,
required: true,
},
},
data(){
return {
section: 'customerPaymentBillingSectionComponent',
isLoading: true,
invoices: null,
selectedInvoice: [],
selectAllInvoice: false,
}
},
computed: {
pendingQueue () {
return this.$store.getters.isInCompleteQueue(this.section);
}
},
watch: {
pendingQueue(inComplete){
if(inComplete){
this.fetchInvoice();
}
}
},
created(){
this.$store.dispatch('updateListQueue', {'name': this.section});
},
methods: {
fetchInvoice(){
this.isLoading = true;
this.submit(route('api.company.invoice.list', this.company_module_id), 'get', this.section, false, false)
},
successHandler(response){
this.$store.dispatch('completeList', {'name': this.section, 'data': []});
this.isLoading = false;
this.invoices = response.payload.data;
},
makePayment(){
var selectedId = this.selectedInvoice.map(s=>s.id);
console.log(selectedId);
},
updateList(packageList){
this.selectedInvoice.includes(packageList) ? this.selectedInvoice.splice(this.selectedInvoice.indexOf(packageList), 1) : this.selectedInvoice.push(packageList);
this.selectedInvoice.length === this.invoices.length ? this.selectAllInvoice = true : this.selectAllInvoice = false;
},
chooseAllInvoice(){
this.selectAllInvoice = !this.selectAllInvoice;
this.selectedInvoice = [];
if (this.selectAllInvoice) {
this.selectedInvoice = this.invoices;
}
}
}
}
</script>
@@ -53,7 +53,7 @@
</div>
<div class="row text-center justify-content-center">
<div class="col-8">
<p class="m-b-0 text-danger m-t-15" v-if="parameters.warehouse_id === 3">近期由于船期的安排和马来西亚海关的运作等一些不可控因数导致船期延迟请大家提前做好采购安排若有不便之处敬请谅解 <br>Due to inevitable circumstances, shipping arrangements and Malaysia custom clearance may have delays. Kindly plan your purchases in advance, thank you for your cooperation.</p>
<p class="m-b-0 text-danger m-t-15" v-if="parameters.warehouse_id === 3">疫情因管控松动飙升其中几位仓库人员也不幸感染整个操作可能会受到影响我们会尽快跟进并恢复<br>The pandemic spread due to the loosening of movement controls. Some warehouse employees were unfortunately infected and the entire operation may be disrupted. We will do our best to follow up and revert as soon as possible.</p>
<p class="m-b-0 text-danger m-t-15" v-if="false">由于义乌船期不稳定建议发广州仓库<br>Due to unexpected shipping delays for Yiwu warehouse, you may select an alternative warehouse.</p>
<p class="m-b-0 text-danger m-t-15" v-if="parameters.warehouse_id === 4">由于义乌船期不稳定建议发广州仓库<br>Due to unexpected shipping delays for Yiwu warehouse, you may select an alternative warehouse.</p>
</div>
@@ -4,110 +4,36 @@
<div class="row">
<div class="col padding-20">
<div class="row align-items-center">
<div class="col-auto pointer align-items-center" @click="selected = !selected">
<div class="col-auto pointer align-items-center" @click="activate()">
<i class="fa fs-30 fa-fw" :class="{'fa-square-o': !selected, 'fa-check-square': selected, 'text-primary':selected}" ></i>
</div>
<div class="col">
<h5 class="no-margin">{{item.country.id}}05052021</h5>
<h5 class="no-margin">{{ item.bill_no }}</h5>
</div>
<div class="col">
<h5 class="no-margin">Invoice Date Invoice Date</h5>
<h5 class="no-margin">{{ item.created_at }}</h5>
</div>
<div class="col">
<h5 class="no-margin">Status</h5>
</div>
<div class="col">
<h5 class="no-margin">Amount</h5>
<h5 class="no-margin">MYR {{ item.amount.toFixed(2) }}</h5>
</div>
<div class="col-auto">
<div class="btn bg-grey no-border" @click="expanded = !expanded">
<i class="fa" :class="{'fa-angle-down': !expanded, 'fa-angle-up': expanded}" ></i>
</div>
</div>
</div>
</div>
</div>
<div class="row b-t b-grey p-t-10" v-show="expanded">
<div class="col p-b-10">
<div class="row">
<div class="col p-l-20 p-r-20 p-t-10 p-b-10">
<div class="row align-items-center">
<div class="col-auto invisible">
<i class="fa fs-30 fa-fw" :class="{'fa-square-o': !selected, 'fa-check-square': selected, 'text-primary':selected}" ></i>
</div>
<div class="col">
<div class="row">
<div class="col">
<h5 class="m-b-0">Carrier Tracking Number</h5>
</div>
</div>
<div class="row">
<div class="col">
<h5 class="semi-bold m-t-0 m-b-0 large-text">#1zbr06tw403742920</h5>
</div>
</div>
</div>
<div class="col">
<div class="row">
<div class="col">
<h5 class="m-b-0">Due Date</h5>
</div>
</div>
<div class="row">
<div class="col">
<h5 class="semi-bold m-t-0 m-b-0 large-text">11.04.2021</h5>
</div>
</div>
</div>
<div class="col">
<div class="row">
<div class="col">
<h5 class="semi-bold m-t-0 m-b-0 large-text">Outstanding</h5>
</div>
</div>
<div class="row">
<div class="col">
<h5 class="semi-bold m-t-0 m-b-0 large-text">RM0.00</h5>
</div>
</div>
<div v-if="item.documents.length">
<div v-for="file in item.documents[0].files" v-bind:key="file.id" class="col-auto no-padding">
<document-file-viewer-component :file="file">
<template slot="button">
<div class="btn bg-grey no-border muted">
<i class="fa fa-file-pdf-o"></i>
</div>
</template>
</document-file-viewer-component>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col p-l-20 p-r-20 p-t-10 p-b-10">
<div class="row align-items-center">
<div class="col-auto invisible">
<i class="fa fs-30 fa-fw" :class="{'fa-square-o': !selected, 'fa-check-square': selected, 'text-primary':selected}" ></i>
</div>
<div class="col">
<div class="row">
<div class="col">
<h5 class="m-b-0 normal-text">This package was delivered by</h5>
</div>
</div>
<div class="row">
<div class="col">
<h5 class="semi-bold m-t-0 m-b-0 large-text">#1zbr06tw403742920</h5>
</div>
</div>
</div>
<div class="col">
<div class="row">
<div class="col">
<h5 class="m-b-0">Date Paid</h5>
</div>
</div>
<div class="row">
<div class="col">
<h5 class="semi-bold m-t-0 m-b-0 large-text">21.01.2021</h5>
</div>
</div>
</div>
<div class="col">
<div class="btn btn-outline-complete btn-lg">
Invoice Detail
</div>
<div v-else>
<div class="btn bg-grey no-border muted invisible">
<i class="fa fa-file-pdf-o"></i>
</div>
</div>
</div>
@@ -120,10 +46,33 @@
<script>
import componentHandler from '../../../general/mixins/componentHandler';
export default {
props: {
selectedInvoice: {
type: Array,
required: false,
}
},
data(){
return {
expanded: false,
selected: false,
selectedValue: false,
}
},
methods: {
activate(){
this.select = !this.select;
this.$emit('input', this.data);
}
},
computed: {
selected() {
var response = false;
this.selectedInvoice.forEach((value, index) => {
if (value.id == this.item.id) {
response = true;
}
});
return response;
}
},
mixins: [componentHandler]
@@ -0,0 +1,4 @@
@extends('layouts.base_portal')
@section('inner_content')
<customer-payment-billing-section-component :company_module_id={{$company_module_id}}></customer-payment-billing-section-component>
@endsection
File diff suppressed because one or more lines are too long
+2
View File
@@ -62,6 +62,8 @@ Route::group(['middleware' => 'api', 'prefix' => 'v1', 'as' => 'api.'], function
require __DIR__ . '/report.php';
require __DIR__ . '/wallet.php';
});
require __DIR__ . '/invoice.php';
+2
View File
@@ -33,4 +33,6 @@ Route::group(['prefix' => 'company', 'as' => 'company.', 'namespace' => 'Compani
});
Route::get('/module/list', 'ListCompanyModulesController@list')->name('module.list');
Route::get('/{company_module_id}/invoice/list', 'ListCompanyModuleInvoicesController@list')->name('invoice.list');
});
+1 -10
View File
@@ -6,13 +6,4 @@ use Illuminate\Support\Facades\Route;
Route::get('/group/paymenttransaction/{transactionsArray?}', 'Invoice\MultipleInvoiceOnePaymentController@getallivoiceid')->name('grouppayment');
// Route::get('/refresh', 'RefreshAuthenticationTokenController@refresh')->name('refresh');
Route::get('/testgrouppayment', function () {
$ids = array(1,2,9);
return redirect()->route('api.grouppayment',['transactionsArray' => json_encode($ids)]);
});
Route::get('/group/paymenttransaction/{transactionsArray?}', 'Transactions\MultipleInvoiceOnePaymentController@getallivoiceid')->name('grouppayment');
+15
View File
@@ -0,0 +1,15 @@
<?php
use Illuminate\Support\Facades\Route;
Route::group(['prefix' => 'wallets', 'namespace' => 'Wallets', 'as' => 'wallet.'], function () {
Route::get('/', 'ListWalletController@list')->name('list');
Route::post('/create', 'CreateWalletController@create')->name('create');
Route::post('/topup', 'TopUpWalletController@topUp')->name('topup'); // user
Route::post('/credit', 'CreditWalletController@credit')->name('credit'); // admin +
Route::put('/{transaction_id}/update-status/{status}', 'UpdateStatusWalletController@updateStatus')->where('status', 'approve|reject')->name('approval');
Route::get('/reports', 'WalletReportController@walletsReport')->name('reports');
});
+8 -2
View File
@@ -160,6 +160,12 @@ Route::get('/customer/{marking}/details', function ($marking) {
return view('pages.customers.profile_details', ['id' => $id]);
})->name('customer.profile.details');
Route::get('/customer/{marking}/payment-and-billing', function ($marking) {
$connection = CompanyConnection::where('invitee_reference', $marking)->first();
$company_module_id = $connection->invitee->id;
return view('pages.customers.paymentsBilling', ['company_module_id' => $company_module_id]);
})->name('customer.payment-and-billing');
Route::get('/orders/refresh', function(\Illuminate\Http\Request $request){
$packingLists = \App\Models\PackingList::where('type', \App\Classes\ValueObjects\Constants\PackingListType::WAREHOUSE_RECEIVE_LIST)->has('containers')->get();
dd($packingLists);
@@ -198,9 +204,9 @@ Route::get('/order/{id}/download', 'Orders\DownloadOrderQrPdfController@download
Route::get('/report/customclearance/{orderid}', 'Reports\CustomcClearanceReportController@download')->name('report.customclearance');
Route::group(['prefix' => 'template', 'as' => 'template.'], function () {
Route::get('/payments-and-billing', function () {
Route::get('/payment-and-billing', function () {
return view('pages.templates.paymentsBilling');
})->name('payments-and-billing');
})->name('payment-and-billing');
Route::get('/shipping-queue', function () {
return view('pages.templates.shippingQueue');