# Conflicts:
#	routes/web.php
This commit is contained in:
glovetleong
2021-09-28 11:33:17 +08:00
17 changed files with 341 additions and 64 deletions
@@ -0,0 +1,83 @@
<?php
namespace App\Classes\Modules\Accounts\ControllersLogic;
use App\Classes\Exceptions\ErrorException;
use App\Classes\Exceptions\ResourceConflictException;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Accounts\DataTransferObjects\RegistrationObject;
use App\Classes\Modules\Accounts\Processors\CreateUserProcessor;
use App\Classes\Modules\Accounts\Processors\GenerateEmailVerificationAttemptProcessor;
use App\Classes\Modules\Companies\DataTransferObjects\EmploymentObject;
use App\Classes\Modules\Companies\Processors\AssignEmployeeProcessor;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\RoleTypes;
use App\Http\Resources\UserResource;
use App\Models\User;
use Carbon\Carbon;
use Illuminate\Database\QueryException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Auth;
class AddNewMemberLogic extends AbstractControllerLogic
{
public function notification(): array
{
return [
'title' => 'Updated Email',
'message' => 'Successfully updated email'
];
}
/**
* @var AssignEmployeeProcessor
*/
private $assignEmployeeProcessor;
/** @var CreateUserProcessor */
private $createUserProcessor;
/**
* @var GenerateEmailVerificationAttemptProcessor
*/
private $generateEmailVerificationAttemptProcessor;
public function __construct(CreateUserProcessor $createUserProcessor, AssignEmployeeProcessor $assignEmployeeProcessor, GenerateEmailVerificationAttemptProcessor $generateEmailVerificationAttemptProcessor)
{
$this->createUserProcessor = $createUserProcessor;
$this->assignEmployeeProcessor = $assignEmployeeProcessor;
$this->generateEmailVerificationAttemptProcessor = $generateEmailVerificationAttemptProcessor;
}
/**
* @param Request $request
* @return JsonResponse
* @throws ResourceConflictException
* @throws \App\Classes\Exceptions\AccessForbiddenException
* @throws \App\Classes\Exceptions\MalformedRequestException
* @throws \App\Classes\Exceptions\RequestValidationException
*/
public function logic(Request $request): JsonResponse
{
try {
$user = Auth::user()->replicate();
$user->email = $request->input('email');
$user->status = ApprovalStatus::PENDING_VERIFICATION;
$user->save();
} catch (QueryException $exception){
throw new ResourceConflictException('Unable to change your email address as it already exists');
}
if($company = Auth::user()->company()->first()){
$Object = new EmploymentObject($company, $user);
$this->assignEmployeeProcessor->execute($Object);
}
$this->generateEmailVerificationAttemptProcessor->execute($user);
return $this->resourceResponse(new UserResource($user));
}
}
@@ -9,19 +9,29 @@ use Carbon\Carbon;
class CalculatesBookingCurrencyAverageRate
{
/** @var CalculatesBookingPayableAmount */
private $calculatesBookingPayableAmount;
/**
* CalculatesBookingCurrencyAverageRate constructor.
* @param CalculatesBookingPayableAmount $calculatesBookingPayableAmount
*/
public function __construct(CalculatesBookingPayableAmount $calculatesBookingPayableAmount)
{
$this->calculatesBookingPayableAmount = $calculatesBookingPayableAmount;
}
public function execute(Booking $booking, $type){
if ($type == TransactionType::PAYMENT) {
return $booking->transactions()
->where('type', TransactionType::PAYMENT)
->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])
->avg('currency_rate');
$totalPayment = $booking->fix_currency_id === 1 ? $booking->transactions()->payments()->complete()->sum('original_amount') :
$booking->transactions()->payments()->complete()->selectRaw('sum(amount - service_charge - tax) as sub_total')->get()->sum('sub_total');
return $this->calculatesBookingPayableAmount->execute($booking, $booking->fix_currency_id) / $totalPayment;
}
else if ($type == TransactionType::BILL) {
return $booking->transactions()
->where('type', TransactionType::BILL)
->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])
->avg('currency_rate');
return $booking->transactions()->bills()->complete()->sum('original_amount') / $booking->transactions()->bills()->complete()->sum('amount');
}
}
@@ -17,9 +17,9 @@ class UserAuthenticationController
*/
public function authenticate(Request $request, AuthenticateUserLogic $logic): JsonResponse {
$response = Http::withToken('eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9zaGlwcGluZy1wb3J0YWwudGVzdFwvYXBpXC92MVwvYWNjb3VudFwvYXV0aGVudGljYXRpb25cL2xvZ2luXC9hdHRlbXB0IiwiaWF0IjoxNjMwNTY4NzU5LCJleHAiOjk5NDY5ODc4Mjk5LCJuYmYiOjE2MzA1Njg3NTksImp0aSI6ImQ0NGZTbnNtdlQ1Z0FrN20iLCJ1c2VyIjp7ImlkIjoyLCJuYW1lIjoiQWRtaW4iLCJlbWFpbCI6ImFkbWluQGNpZWYtbWFsYXlzaWEuY29tIiwidHlwZSI6Miwic3RhdHVzIjoyfSwic3ViIjoyLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.1FM75NcuRA7g-s4uqXP43TY6AeY1e6mkEl3QAk6R0WQ')->get('http://shipping-portal.test/api/v1/account/user/list')->object();
// $response = Http::withToken('eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9zaGlwcGluZy1wb3J0YWwudGVzdFwvYXBpXC92MVwvYWNjb3VudFwvYXV0aGVudGljYXRpb25cL2xvZ2luXC9hdHRlbXB0IiwiaWF0IjoxNjMyNzQ1ODg2LCJleHAiOjk5NjAyNjgzMDQ2LCJuYmYiOjE2MzI3NDU4ODYsImp0aSI6Im5oRHRJUUVEdVhZampVSEIiLCJ1c2VyIjp7ImlkIjozLCJuYW1lIjoiT21haXIgU2FsZWgiLCJlbWFpbCI6InVsZHZzdGFyQGdtYWlsLmNvbSIsInR5cGUiOjMsInN0YXR1cyI6MiwiY29tcGFueV9pZCI6MjQzfSwic3ViIjozLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.OgXq9MFSGM1W3UC2RuhOn571XwbptYAjRP47aNXOaO8')->get('http://shipping-portal.test/api/v1/account/user/list')->object();
dd($response);
// dd($response);
return $logic->execute($request);
}
@@ -0,0 +1,22 @@
<?php
namespace App\Http\Controllers\Companies;
use App\Classes\Modules\Accounts\ControllersLogic\AddNewMemberLogic;
use App\Http\Controllers\Controller;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
class AddNewMemberController
{
/**
* @param Request $request
* @param AddNewMemberLogic $execute
* @return JsonResponse
*/
public function create(Request $request, AddNewMemberLogic $execute) : JsonResponse
{
return $execute->execute($request);
}
}
+4 -1
View File
@@ -3,13 +3,16 @@
namespace App\Http\Resources;
use App\Classes\Modules\Companies\Services\FetchesCompanyServices;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\BankAccountType;
use App\Classes\ValueObjects\Constants\BusinessType;
use App\Classes\ValueObjects\Constants\DocumentType;
use App\Classes\ValueObjects\Constants\RoleTypes;
use App\Classes\ValueObjects\Constants\SegmentConstants;
use App\Models\Currency;
use App\Models\SegmentConstant;
use Illuminate\Http\Resources\Json\JsonResource;
use Illuminate\Support\Facades\Auth;
class CompanyResource extends JsonResource
{
@@ -30,7 +33,7 @@ class CompanyResource extends JsonResource
'status' => (int) $this->status,
'contact' => new ContactResource ($this->when($this->has('contacts'), $this->contacts->first())),
'address' => new AddressResource($this->when($this->has('addresses'), $this->addresses->where('billing', true)->first())),
'employee' => new UserResource($this->employees->first()),
'employee' => new UserResource(Auth::user()->type === RoleTypes::USER ? $this->employees()->where('email', '=', Auth::user()->email)->first() : $this->employees()->where('users.status', '=', ApprovalStatus::APPROVED)->orderBy('id', 'DESC')->first()),
'identification' => new DocumentResource($this->documents->whereIn('document_type', DocumentType::IDENTIFICATION_DOCUMENTS)->first()),
'bookings' => $this->whenLoaded('bookings', $this->bookings()->orderBy('id', 'DESC')->get(), []),
'personal_banks' => BankResource::collection($this->banks->where('type', BankAccountType::PERSONAL)),
@@ -39,7 +39,7 @@
</div>
</div>
<div class="col-auto p-l-5 p-r-5 bg-success requestModal pointer" data-type="paymentProofModal">
<div class="row align-items-center h-100">
<div @click="selectedID(item.id)" class="row align-items-center h-100">
<div class="col">
<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px"
width="30" height="30"
@@ -49,7 +49,7 @@
</div>
</div>
<modal-component type="paymentProofModal">
<payment-proof-form-component section="paymentProofSection" :id="item.id" :data="item"></payment-proof-form-component>
<payment-proof-form-component v-if="selected_id == item.id" section="paymentProofSection" :id="item.id" :data="item"></payment-proof-form-component>
</modal-component>
</div>
</div>
@@ -63,6 +63,16 @@
<script>
import componentHandler from '../../../general/mixins/componentHandler';
export default {
data(){
return {
selected_id: '',
}
},
methods: {
selectedID(id){
this.selected_id = id;
}
},
mixins: [componentHandler]
}
</script>
@@ -326,6 +326,9 @@
<div class="col">
<div class="font-head fs-10 all-caps">Payment History</div>
</div>
<div class="col-auto">
<div class="font-head fs-10 all-caps">of {{booking.marking}}</div>
</div>
</div>
<div class="row ">
<div class="col">
@@ -9,7 +9,8 @@
<div class="row">
<div class="col text-center">
<img :src="src" class="w-100" v-if="type !== 'pdf'">
<div class="btn btn-complete pointer m-b-20" @click="openBase64NewTab()" v-show="type === 'pdf'">Open in new window</div>
<div class="btn btn-info b-rad-none pointer m-b-20" @click="openBase64NewTab()" v-show="type === 'pdf'">Open in new window</div>
<a :href="'data:application/pdf;base64,'+src" :download="file.file.filename" v-show="type === 'pdf'"><div class="btn btn-success b-rad-none pointer m-b-20">Download</div></a>
<iframe v-if="type === 'pdf'" class="pdf-display w-100 scrollable" style="height: 80vh" :src="'data:application/pdf;base64,'+src"></iframe>
</div>
</div>
@@ -37,7 +37,7 @@
<div class="font-heading fs-11 muted" v-text="$store.getters.getUserEmail"></div>
</div>
<div class="col-auto p-r-0">
<div class="btn btn-xs btn-default bg-master-lighter btn-rounded p-r-20 p-l-15">
<div class="btn btn-xs btn-default bg-master-lighter btn-rounded p-r-20 p-l-15 requestModal" data-type="editEmail">
<i class="fa fa-envelope-open-o m-r-10"></i>Request Email Change
</div>
</div>
@@ -50,6 +50,10 @@
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="resetPassword">
<reset-user-password-form-component :data="{email: $store.getters.getUserEmail}" section="resetPassword"></reset-user-password-form-component>
</modal-component>
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="editEmail">
<edit-email-form-component :data="{email: $store.getters.getUserEmail}" section="editEmail"></edit-email-form-component>
</modal-component>
</div>
</template>
@@ -0,0 +1,58 @@
<template>
<div class="row">
<div class="col">
<div class="row">
<div class="col">
<div class="row m-b-10">
<div class="col">
<h5 class="all-caps m-b-5 bold no-margin">Change Email Address</h5>
</div>
</div>
<div class="row m-b-5 animate__animated animate__fadeInUpBig animate__fast" v-if="error">
<div class="col">
<small class="bold fs-10 text-danger">{{error}}</small>
</div>
</div>
<div class="row m-b-10">
<div class="col">
<validation-wrapper-component :validator="$v.parameters.email">
<label>New Email Address</label>
<input type="text" class="form-control" v-model="parameters.email">
</validation-wrapper-component>
</div>
</div>
<div class="row">
<div class="col p-r-5">
<div class="btn btn-sm btn-default bg-master-lightest btn-block b-rad-none" data-dismiss="modal">Cancel</div>
</div>
<div class="col p-l-5">
<div class="btn btn-sm btn-success btn-block b-rad-none" @click="submit(route('api.company.team.create'), 'post', section, true, false)">Update</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import { required, email } from "vuelidate/lib/validators";
import ModalFormHandler from '../../../general/mixins/modalFormHandler';
export default {
data(){
return {
error: '',
parameters: {
email: ''
}
}
},
validations: {
parameters: {
email: { required, email }
}
},
mixins: [ModalFormHandler]
}
</script>
@@ -34,7 +34,7 @@
<div class="ref">REF: {{ $invoice_transaction->payment_reference ?? '-' }}</div>
<div class="date">Date: {{ $invoice_transaction->created_at }}</div>
<div class="date">Date: {{ $po_order_transaction->created_at }}</div>
<div>&nbsp;</div>
</div>
</td>
@@ -77,18 +77,22 @@
<th class="stock-code" width="10%">Stock Code</th>
<th class="description">Description</th>
<th width="10%">Quantity</th>
<th width="12%">Unit Price (RM)</th>
<th width="15%">Unit Price (RM)</th>
<th width="10%">Total Amount<br>(RM)</th>
</tr>
</thead>
<tbody>
@php
$subtotal = 0;
@endphp
@foreach ($po_order_transaction->transactionDetails as $key => $transaction_detail)
<tr>
<td width="5%" class="center top">{{ $key + 1 }}</td>
<td class="stock-code top" width="10%">{{ $transaction_detail->product_code }}</td>
<td class="description">{{ $transaction_detail->product_name }}</td>
<td width="10%" class="center top">{{ $transaction_detail->quantity }}</td>
<td width="12%" class="center top">
<td width="15%" class="center top">
@if($invoice_transaction->booking()->first()->fix_currency_id !== 1)
{{ number_format( (1/$invoice_transaction->currency_rate) * $transaction_detail->price, 2) }}
@else
@@ -97,9 +101,18 @@
</td>
<td width="20%" class="right top">
@if($invoice_transaction->booking()->first()->fix_currency_id !== 1)
{{ number_format( (1/$invoice_transaction->currency_rate) * $transaction_detail->amount, 2) }}
@else
{{ number_format($transaction_detail->amount, 2) }}
{{ number_format((float)number_format( (1/$invoice_transaction->currency_rate) * $transaction_detail->price, 2,'.','')*$transaction_detail->quantity,2) }}
@php
$subtotal += number_format((float)number_format( (1/$invoice_transaction->currency_rate) * $transaction_detail->price, 2,'.','')*$transaction_detail->quantity,2,'.','');
@endphp
@else
{{ number_format((float)number_format($transaction_detail->price, 2,'.','')*$transaction_detail->quantity,2) }}
@php
$subtotal += number_format((float)number_format($transaction_detail->price, 2,'.','')*$transaction_detail->quantity,2,'.','');
@endphp
@endif
</td>
</tr>
@@ -110,11 +123,7 @@
<td colspan="4"></td>
<td class="right middle">Subtotal</td>
<td class="right middle">
@if($invoice_transaction->booking()->first()->fix_currency_id !== 1)
{{ number_format( (1/$invoice_transaction->currency_rate) * $invoice_transaction->amount, 2) }}
@else
{{ number_format($invoice_transaction->amount, 2) }}
@endif
{{ number_format($subtotal, 2) }}
</td>
</tr>
<tr class="billingcharges">
@@ -124,6 +133,17 @@
{{ number_format($invoice_transaction->service_charge, 2) }}
</td>
</tr>
<tr class="billingcharges">
<td colspan="4"></td>
<td class="right">Adjustment</td>
<td class="right">
@if($invoice_transaction->booking()->first()->fix_currency_id !== 1)
{{ number_format((float)number_format( (1/$invoice_transaction->currency_rate) * $invoice_transaction->amount, 2,'.','') - (float)number_format($subtotal, 2,'.',''),2) }}
@else
{{ number_format((float)number_format($invoice_transaction->amount, 2,'.','') - (float)number_format($subtotal, 2,'.',''),2) }}
@endif
</td>
</tr>
@if($invoice_transaction->tax > 0)
<tr class="billingcharges">
<td colspan="4"></td>
+31 -11
View File
@@ -33,7 +33,7 @@
<div class="ref">Ref# {{ $invoice_transaction->payment_reference ?? '-' }}</div>
<div class="date">Date: {{ $invoice_transaction->created_at }}</div>
<div class="date">Date: {{ $po_order_transaction->created_at }}</div>
<div>&nbsp;</div>
</div>
</td>
@@ -76,18 +76,22 @@
<th class="stock-code" width="10%">Stock Code</th>
<th class="description">Description</th>
<th width="10%">Quantity</th>
<th width="12%">Unit Price (RM)</th>
<th width="15%">Unit Price (RM)</th>
<th width="10%">Total Amount<br>(RM)</th>
</tr>
</thead>
<tbody>
@php
$subtotal = 0;
@endphp
@foreach ($po_order_transaction->transactionDetails as $key => $transaction_detail)
<tr>
<td width="5%" class="center top">{{ $key + 1 }}</td>
<td class="stock-code top" width="10%">{{ $transaction_detail->product_code }}</td>
<td class="description">{{ $transaction_detail->product_name }}</td>
<td width="10%" class="center top">{{ $transaction_detail->quantity }}</td>
<td width="12%" class="center top">
<td width="15%" class="center top">
@if($invoice_transaction->booking()->first()->fix_currency_id !== 1)
{{ number_format( (1/$invoice_transaction->currency_rate) * $transaction_detail->price, 2) }}
@else
@@ -96,9 +100,18 @@
</td>
<td width="20%" class="right top">
@if($invoice_transaction->booking()->first()->fix_currency_id !== 1)
{{ number_format( (1/$invoice_transaction->currency_rate) * $transaction_detail->amount, 2) }}
@else
{{ number_format($transaction_detail->amount, 2) }}
{{ number_format((float)number_format( (1/$invoice_transaction->currency_rate) * $transaction_detail->price, 2,'.','')*$transaction_detail->quantity,2) }}
@php
$subtotal += number_format((float)number_format( (1/$invoice_transaction->currency_rate) * $transaction_detail->price, 2,'.','')*$transaction_detail->quantity,2,'.','');
@endphp
@else
{{ number_format((float)number_format($transaction_detail->price, 2,'.','')*$transaction_detail->quantity,2) }}
@php
$subtotal += number_format((float)number_format($transaction_detail->price, 2,'.','')*$transaction_detail->quantity,2,'.','');
@endphp
@endif
</td>
</tr>
@@ -109,11 +122,7 @@
<td colspan="4"></td>
<td class="right middle">Subtotal</td>
<td class="right middle">
@if($invoice_transaction->booking()->first()->fix_currency_id !== 1)
{{ number_format( (1/$invoice_transaction->currency_rate) * $invoice_transaction->amount, 2) }}
@else
{{ number_format($invoice_transaction->amount, 2) }}
@endif
{{ number_format($subtotal, 2) }}
</td>
</tr>
<tr class="billingcharges">
@@ -123,6 +132,17 @@
{{ number_format($invoice_transaction->service_charge, 2) }}
</td>
</tr>
<tr class="billingcharges">
<td colspan="4"></td>
<td class="right">Adjustment</td>
<td class="right">
@if($invoice_transaction->booking()->first()->fix_currency_id !== 1)
{{ number_format((float)number_format( (1/$invoice_transaction->currency_rate) * $invoice_transaction->amount, 2,'.','') - (float)number_format($subtotal, 2,'.',''),2) }}
@else
{{ number_format((float)number_format($invoice_transaction->amount, 2,'.','') - (float)number_format($subtotal, 2,'.',''),2) }}
@endif
</td>
</tr>
@if($invoice_transaction->tax > 0)
<tr class="billingcharges">
<td colspan="4"></td>
@@ -81,18 +81,22 @@
<th class="stock-code" width="10%">Stock Code</th>
<th class="description">Description</th>
<th width="10%">Quantity</th>
<th width="12%">Unit Price (RM)</th>
<th width="15%">Unit Price (RM)</th>
<th width="10%">Total Amount<br>(RM)</th>
</tr>
</thead>
<tbody>
@php
$subtotal = 0;
@endphp
@foreach ($po_order_transaction->transactionDetails as $key => $transaction_detail)
<tr>
<td width="5%" class="center top">{{ $key + 1 }}</td>
<td class="stock-code top" width="10%">{{ $transaction_detail->product_code }}</td>
<td class="description">{{ $transaction_detail->product_name }}</td>
<td width="10%" class="center top">{{ $transaction_detail->quantity }}</td>
<td width="12%" class="center top">
<td width="15%" class="center top">
@if($invoice_transaction->booking()->first()->fix_currency_id !== 1)
{{ number_format( (1/$invoice_transaction->currency_rate) * $transaction_detail->price, 2) }}
@else
@@ -101,9 +105,18 @@
</td>
<td width="20%" class="right top">
@if($invoice_transaction->booking()->first()->fix_currency_id !== 1)
{{ number_format( (1/$invoice_transaction->currency_rate) * $transaction_detail->amount, 2) }}
@else
{{ number_format($transaction_detail->amount, 2) }}
{{ number_format((float)number_format( (1/$invoice_transaction->currency_rate) * $transaction_detail->price, 2,'.','')*$transaction_detail->quantity,2) }}
@php
$subtotal += number_format((float)number_format( (1/$invoice_transaction->currency_rate) * $transaction_detail->price, 2,'.','')*$transaction_detail->quantity,2,'.','');
@endphp
@else
{{ number_format((float)number_format($transaction_detail->price, 2,'.','')*$transaction_detail->quantity,2) }}
@php
$subtotal += number_format((float)number_format($transaction_detail->price, 2,'.','')*$transaction_detail->quantity,2,'.','');
@endphp
@endif
</td>
</tr>
@@ -112,13 +125,9 @@
<tfoot>
<tr class="subtotal">
<td colspan="4"></td>
<td class="right middle">Subtotal</td>
<td class="right middle">Subtotal</td>
<td class="right middle">
@if($invoice_transaction->booking()->first()->fix_currency_id !== 1)
{{ number_format( (1/$invoice_transaction->currency_rate) * $invoice_transaction->amount, 2) }}
@else
{{ number_format($invoice_transaction->amount, 2) }}
@endif
{{ number_format($subtotal, 2) }}
</td>
</tr>
<tr class="billingcharges">
@@ -128,6 +137,17 @@
{{ number_format($invoice_transaction->service_charge, 2) }}
</td>
</tr>
<tr class="billingcharges">
<td colspan="4"></td>
<td class="right">Adjustment</td>
<td class="right">
@if($invoice_transaction->booking()->first()->fix_currency_id !== 1)
{{ number_format((float)number_format( (1/$invoice_transaction->currency_rate) * $invoice_transaction->amount, 2,'.','') - (float)number_format($subtotal, 2,'.',''),2) }}
@else
{{ number_format((float)number_format($invoice_transaction->amount, 2,'.','') - (float)number_format($subtotal, 2,'.',''),2) }}
@endif
</td>
</tr>
@if($invoice_transaction->tax > 0)
<tr class="billingcharges">
<td colspan="4"></td>
@@ -20,7 +20,7 @@
<td class="document-detail">
PO#: {{ $supplier_deliver_order_transaction->bill_no }} <br>
Ref#: {{ $supplier_deliver_order_transaction->payment_reference ?? '-' }} <br>
Date: {{ $supplier_deliver_order_transaction->created_at }}
Date: {{ $po_order_transaction->created_at }}
</td>
</tr>
</table>
@@ -66,18 +66,22 @@
<th class="stock-code" width="10%">Stock Code</th>
<th class="description">Description</th>
<th width="10%">Quantity</th>
<th width="12%">Unit Price (RM)</th>
<th width="15%">Unit Price (RM)</th>
<th width="10%">Total Amount<br>(RM)</th>
</tr>
</thead>
<tbody>
@php
$subtotal = 0;
@endphp
@foreach ($po_order_transaction->transactionDetails as $key => $transaction_detail)
<tr>
<td width="5%" class="center top">{{ $key + 1 }}</td>
<td class="stock-code top" width="10%">{{ $transaction_detail->product_code }}</td>
<td class="description">{{ $transaction_detail->product_name }}</td>
<td width="10%" class="center top">{{ $transaction_detail->quantity }}</td>
<td width="12%" class="center top">
<td width="15%" class="center top">
@if($supplier_deliver_order_transaction->booking()->first()->fix_currency_id !== 1)
{{ number_format( (1/$supplier_deliver_order_transaction->currency_rate) * $transaction_detail->price, 2) }}
@else
@@ -86,9 +90,18 @@
</td>
<td width="20%" class="right top">
@if($supplier_deliver_order_transaction->booking()->first()->fix_currency_id !== 1)
{{ number_format( (1/$supplier_deliver_order_transaction->currency_rate) * $transaction_detail->amount, 2) }}
@else
{{ number_format($transaction_detail->amount, 2) }}
{{ number_format((float)number_format( (1/$supplier_deliver_order_transaction->currency_rate) * $transaction_detail->price, 2,'.','')*$transaction_detail->quantity,2) }}
@php
$subtotal += number_format((float)number_format( (1/$supplier_deliver_order_transaction->currency_rate) * $transaction_detail->price, 2,'.','')*$transaction_detail->quantity,2,'.','');
@endphp
@else
{{ number_format((float)number_format($transaction_detail->price, 2,'.','')*$transaction_detail->quantity,2) }}
@php
$subtotal += number_format((float)number_format($transaction_detail->price, 2,'.','')*$transaction_detail->quantity,2,'.','');
@endphp
@endif
</td>
</tr>
@@ -99,10 +112,17 @@
<td colspan="4"></td>
<td class="right middle">Subtotal</td>
<td class="right middle">
@if($supplier_deliver_order_transaction->booking()->first()->fix_currency_id !== 1)
{{ number_format( (1/$supplier_deliver_order_transaction->currency_rate) * $supplier_deliver_order_transaction->amount, 2) }}
@else
{{ number_format($supplier_deliver_order_transaction->amount, 2) }}
{{ number_format($subtotal, 2) }}
</td>
</tr>
<tr class="billingcharges">
<td colspan="4"></td>
<td class="right">Adjustment</td>
<td class="right">
@if($supplier_deliver_order_transaction->booking()->first()->fix_currency_id !== 1)
{{ number_format((float)number_format( (1/$supplier_deliver_order_transaction->currency_rate) * $supplier_deliver_order_transaction->amount, 2,'.','') - (float)number_format($subtotal, 2,'.',''),2) }}
@else
{{ number_format((float)number_format($supplier_deliver_order_transaction->amount, 2,'.','') - (float)number_format($subtotal, 2,'.',''),2) }}
@endif
</td>
</tr>
+2 -2
View File
@@ -515,7 +515,7 @@
<div class="col-4 p-r-0">
<div class="row">
<div class="col">
<div class="row tabsContainer" v-if="$store.getters.isAdmin">
<div class="row tabsContainer">
<div class="col">
<div class="row m-l-0 m-r-0 d-none d-md-flex">
<div class="col" v-if="$store.getters.isAdmin">
@@ -570,7 +570,7 @@
<div class="row tabsContainer tabContent" tab-name="customer-list" v-if="$store.getters.isAdmin">
<company-quick-view-section-component></company-quick-view-section-component>
</div>
<div class="row tabsContainer tabContent hide" tab-name="announcement-list">
<div class="row tabsContainer tabContent hide" v-else tab-name="announcement-list">
<announcement-quick-view-section-component></announcement-quick-view-section-component>
</div>
<div class="row tabsContainer hide tabContent" tab-name="PO">
+3 -1
View File
@@ -9,6 +9,8 @@ Route::group(['prefix' => 'company', 'as' => 'company.', 'namespace' => 'Compani
Route::put('/update/{id}', 'UpdateCompanyController@update')->name('update');
Route::delete('/delete/{id}', 'DeleteCompanyController@destroy')->name('delete');
Route::post('/team/create', 'AddNewMemberController@create')->name('team.create');
Route::group(['prefix' => '{id}/segment', 'as' => 'segment.'], function () {
Route::post('/assign', 'AssignCompanyToSegmentController@assign')->name('assign');
Route::delete('/detach/{segment_id}', 'RemoveCompanyFromSegmentController@detach')->name('detach');
@@ -25,4 +27,4 @@ Route::group(['prefix' => 'company', 'as' => 'company.', 'namespace' => 'Compani
Route::put('/{document_id}/approval/{status}', 'ApproveIdentificationDocumentController@approve')->where('status', 'approve|reject')->name('approval');
});
});
});
+4 -3
View File
@@ -1,6 +1,10 @@
<?php
use App\Models\User;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\Route;
@@ -65,9 +69,6 @@ Route::get('/transfer/merge/{marking}', function ($marking) {
return view('pages.booking_merge', ['marking' => $marking]);
})->name('booking.merge');
Route::get('/mail', function () {
echo route('login');
});
Route::get('/cross-login', function () {
return view('pages.accounts.cross_iframe_login');