mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 12:34:18 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 769b5dd050 | |||
| 851e2e1815 |
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,14 +4,9 @@ namespace App\Classes\Modules\Companies\ControllersLogic;
|
||||
|
||||
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\PackingLists\Services\ListsPackingLists;
|
||||
use App\Classes\Modules\Transactions\Services\ListsTransactions;
|
||||
use App\Classes\Modules\PackingLists\Standards\Rules\CanListPackingLists;
|
||||
use App\Classes\ValueObjects\Constants\DocumentType;
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use App\Http\Resources\PackingListResource;
|
||||
use App\Http\Resources\TransactionResource;
|
||||
use ErrorException;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
@@ -29,21 +24,15 @@ class ListCompanyModuleInvoicesLogic extends AbstractControllerLogic
|
||||
];
|
||||
}
|
||||
|
||||
/** @var CanListPackingLists */
|
||||
private $canListPackingLists;
|
||||
|
||||
/** @var ListsPackingLists */
|
||||
private $listsPackingLists;
|
||||
/** @var ListsTransactions */
|
||||
private $listsTransactions;
|
||||
|
||||
/**
|
||||
* ListCompanyModuleInvoicesLogic constructor.
|
||||
* @param CanListPackingLists $canListPackingLists
|
||||
* @param ListsPackingLists $listsPackingLists
|
||||
* @param ListsTransactions $listsTransactions
|
||||
*/
|
||||
public function __construct(CanListPackingLists $canListPackingLists, ListsPackingLists $listsPackingLists, ListsTransactions $listsTransactions)
|
||||
public function __construct(ListsTransactions $listsTransactions)
|
||||
{
|
||||
$this->canListPackingLists = $canListPackingLists;
|
||||
$this->listsPackingLists = $listsPackingLists;
|
||||
$this->listsTransactions = $listsTransactions;
|
||||
}
|
||||
|
||||
@@ -63,26 +52,15 @@ class ListCompanyModuleInvoicesLogic extends AbstractControllerLogic
|
||||
"column" => 'id',
|
||||
"DESC" => true,
|
||||
],
|
||||
"status_in" => [2],
|
||||
"receiver" => intval($request->route('company_module_id')),
|
||||
"type" => TransactionType::SHIPPING_INVOICE
|
||||
];
|
||||
|
||||
// // dd($request->route('id'));
|
||||
|
||||
// $this->canListPackingLists->passes();
|
||||
|
||||
// $query = $this->listsPackingLists->execute($filterArray);
|
||||
|
||||
// return $this->collectionResponse(PackingListResource::collection($query));
|
||||
// $this->canListTransactions->passes();
|
||||
|
||||
$query = $this->listsTransactions->execute($filterArray);
|
||||
|
||||
return $this->collectionResponse(TransactionResource::collection($query));
|
||||
|
||||
// transaction -> type shipping invoice -> invoice belongs to company id
|
||||
|
||||
// transaction
|
||||
|
||||
// order has packing_list has transaction
|
||||
// inside order can find (company_module_id)
|
||||
}
|
||||
}
|
||||
|
||||
+110
-7
@@ -1,23 +1,110 @@
|
||||
<template>
|
||||
<div class="row" v-if="company">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<p>ok</p>
|
||||
<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_id: {
|
||||
company_module_id: {
|
||||
type: Number,
|
||||
required: true,
|
||||
}
|
||||
},
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
section: 'customerPaymentBillingSectionComponent',
|
||||
isLoading: true,
|
||||
company: null
|
||||
invoices: null,
|
||||
selectedInvoice: [],
|
||||
selectAllInvoice: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -38,12 +125,28 @@
|
||||
methods: {
|
||||
fetchInvoice(){
|
||||
this.isLoading = true;
|
||||
this.submit(route('api.company.invoice.list', this.company_id), 'get', this.section, false, false)
|
||||
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.company = response.payload.data;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+40
-91
@@ -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]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@extends('layouts.base_portal')
|
||||
@section('inner_content')
|
||||
<customer-payment-billing-section-component :company_id={{$id}}></customer-payment-billing-section-component>
|
||||
<customer-payment-billing-section-component :company_module_id={{$company_module_id}}></customer-payment-billing-section-component>
|
||||
@endsection
|
||||
+1
-1
@@ -34,5 +34,5 @@ Route::group(['prefix' => 'company', 'as' => 'company.', 'namespace' => 'Compani
|
||||
|
||||
Route::get('/module/list', 'ListCompanyModulesController@list')->name('module.list');
|
||||
|
||||
Route::get('/{id}/invoice/list', 'ListCompanyModuleInvoicesController@list')->name('invoice.list');
|
||||
Route::get('/{company_module_id}/invoice/list', 'ListCompanyModuleInvoicesController@list')->name('invoice.list');
|
||||
});
|
||||
|
||||
+2
-2
@@ -162,8 +162,8 @@ Route::get('/customer/{marking}/details', function ($marking) {
|
||||
|
||||
Route::get('/customer/{marking}/payment-and-billing', function ($marking) {
|
||||
$connection = CompanyConnection::where('invitee_reference', $marking)->first();
|
||||
$id = $connection->invitee->company->id;
|
||||
return view('pages.customers.paymentsBilling', ['id' => $id]);
|
||||
$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){
|
||||
|
||||
Reference in New Issue
Block a user