Merge remote-tracking branch 'origin/development' into development

# Conflicts:
#	app/Classes/ValueObjects/Constants/TransactionType.php
This commit is contained in:
omair saleh
2022-05-03 13:40:03 +08:00
68 changed files with 1965 additions and 198 deletions
@@ -0,0 +1,15 @@
<?php
namespace App\Classes\General\Interfaces;
use Illuminate\Database\Eloquent\Relations\MorphTo;
interface Notifiable
{
public function subject(): MorphTo;
public function target(): MorphTo;
public function causer(): MorphTo;
}
@@ -139,8 +139,6 @@ class CreateBookingPaymentLogic extends AbstractControllerLogic
$paymentReference = $billNumber;
$this->updatesWalletBalance->execute($wallet, ($amount * -1));
$cash_back_transaction = $this->createCashBackTransactionProcessor->execute($transaction);
}
$billNumber = $this->generatesTransactionBillNumber->execute('PYMT-');
@@ -153,6 +151,7 @@ class CreateBookingPaymentLogic extends AbstractControllerLogic
/** @var Transaction $transaction */
$transaction = $this->createsTransaction->execute($booking, $object);
$cash_back_transaction = $this->createCashBackTransactionProcessor->execute($transaction);
if(PaymentMethodType::PAYMENT_METHODS[$request->input('payment_method')] == PaymentMethodType::WALLET){
$this->updatesTransactionStatus->execute($transaction, ApprovalStatus::APPROVED);
@@ -84,12 +84,14 @@ class CreateBookingRefundLogic extends AbstractControllerLogic
$billNumber = $this->generatesTransactionBillNumber->execute('RFD-');
$refund = $transaction->transactions()->refunds()->sum('amount');
if($refund + $request->input('amount') > $transaction->original_amount) throw new MalformedRequestException('Your refund must not be greater than '. $transaction->original_amount .'.');
$transactionRefundCalculationObject = new TransactionRefundCalculationObject($booking, $transaction, $request->input('amount'));
$amount = $transaction->booking->fix_currency_id == 1 ? $request->input('amount') : $request->input('amount') / $transaction->currency_rate;
$transactionRefundCalculationObject = new TransactionRefundCalculationObject($booking, $transaction, $amount);
$transactionRefundCalculationObject->init();
$object = new TransactionObject($billNumber, TransactionType::REFUND, 1, $booking->company->id,
@@ -14,6 +14,7 @@ use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Storage;
use App\Classes\Exceptions\MalformedRequestException;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\DocumentType;
class DownloadBookingDocumentLogic
{
@@ -26,9 +27,9 @@ class DownloadBookingDocumentLogic
*/
public function execute(Request $request)
{
Auth::login(User::findOrFail(1));
$zip_file = $request->input('type').'.zip';
$document_type = str_replace(' ', '', $request->input('type'));
$zip_file = $document_type.'.zip';
$attachment = storage_path().'/app/documents/collections/' . $zip_file;
$zip = new ZipArchive();
@@ -36,19 +37,42 @@ class DownloadBookingDocumentLogic
$bookings = Booking::where('status', ApprovalStatus::COMPLETED)
->whereDate('created_at', '>=', Carbon::parse($request->input('startDate')))
->whereDate('created_at', '<=', Carbon::parse($request->input('endDate')))->whereHas('transactions', function ($query) use ($request){
->whereDate('created_at', '<=', Carbon::parse($request->input('endDate')))
->whereHas('transactions', function ($query) use ($request){
return $query->where('type', TransactionType::PAYMENT)->whereHas('transactions', function ($query) use ($request){
return $query->where('type', TransactionType::BILL)->where('issuer', $request->input('supplier'));
});
})->get();
if (!count($bookings)) throw new MalformedRequestException('No available file to download');
foreach ($bookings as $booking) {
$file = $booking->documents()->where('document_type', $request->input('type'))->first()->files()->first();
$zip->addFile(Storage::disk('documents')->path($file->file->file_info->original->file), $booking->created_at->format('d_m_Y') . '_' . $booking->marking . '.pdf');
if (!count($bookings)) {
return response()->json(['no file to download']);
}
foreach ($bookings as $booking) {
if ($document_type == 'INVOICEPODO' || $document_type == 'INVOICEPODOSDO') {
$invoice_file = $booking->documents()->where('document_type', DocumentType::INVOICE)->first()->files()->first();
$purchase_file = $booking->documents()->where('document_type', DocumentType::PURCHASE_ORDER)->first()->files()->first();
$deliver_file = $booking->documents()->where('document_type', DocumentType::DELIVER_ORDER)->first()->files()->first();
if ($document_type == 'INVOICEPODOSDO') {
$supplier_deliver_order_file = $booking->documents()->where('document_type', DocumentType::SUPPLIER_DELIVER_ORDER)->first()->files()->first();
}
$zip->addFile(Storage::disk('documents')->path($invoice_file->file->file_info->original->file), 'invoice-' . $booking->created_at->format('d_m_Y') . '_' . $booking->marking . '.pdf');
$zip->addFile(Storage::disk('documents')->path($purchase_file->file->file_info->original->file), 'purchase-order-' . $booking->created_at->format('d_m_Y') . '_' . $booking->marking . '.pdf');
$zip->addFile(Storage::disk('documents')->path($deliver_file->file->file_info->original->file), 'deliver-' . $booking->created_at->format('d_m_Y') . '_' . $booking->marking . '.pdf');
$zip->addFile(Storage::disk('documents')->path($supplier_deliver_order_file->file->file_info->original->file), 'supplier-deliver-order-' . $booking->created_at->format('d_m_Y') . '_' . $booking->marking . '.pdf');
}
else {
$file = $booking->documents()->where('document_type', $document_type)->first()->files()->first();
$zip->addFile(Storage::disk('documents')->path($file->file->file_info->original->file), $booking->created_at->format('d_m_Y') . '_' . $booking->marking . '.pdf');
}
}
$zip->close();
while (ob_get_level()) {
ob_end_clean();
@@ -13,6 +13,9 @@ use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Documents\Services\FetchesDocument;
use App\Classes\Modules\Documents\Services\ApprovesDocument;
use App\Classes\Modules\Notifications\DataTransferObjects\NotificationObject;
Use App\Classes\Modules\Notifications\Processors\CreateNotificationProcessor;
use App\Classes\General\Interfaces\Notifiable;
use App\Models\Document;
use Illuminate\Http\JsonResponse;
@@ -46,6 +49,9 @@ class ApproveIdentificationDocumentLogic extends AbstractControllerLogic
/** @var UpdatesCompanyStatus */
private $updatesCompanyStatus;
/** @var CreateNotificationProcessor */
private $createNotificationProcessor;
/**
* ApproveIdentificationDocumentLogic constructor.
* @param CanApproveDocument $canApproveDocument
@@ -53,14 +59,16 @@ class ApproveIdentificationDocumentLogic extends AbstractControllerLogic
* @param RejectsDocument $rejectsDocument
* @param FetchesDocument $fetchesDocument
* @param UpdatesCompanyStatus $updatesCompanyStatus
* @param CreateNotificationProcessor $createNotificationProcessor
*/
public function __construct(CanApproveDocument $canApproveDocument, ApprovesDocument $approvesDocument, RejectsDocument $rejectsDocument, FetchesDocument $fetchesDocument, UpdatesCompanyStatus $updatesCompanyStatus)
public function __construct(CanApproveDocument $canApproveDocument, ApprovesDocument $approvesDocument, RejectsDocument $rejectsDocument, FetchesDocument $fetchesDocument, UpdatesCompanyStatus $updatesCompanyStatus, CreateNotificationProcessor $createNotificationProcessor)
{
$this->canApproveDocument = $canApproveDocument;
$this->approvesDocument = $approvesDocument;
$this->rejectsDocument = $rejectsDocument;
$this->fetchesDocument = $fetchesDocument;
$this->updatesCompanyStatus = $updatesCompanyStatus;
$this->createNotificationProcessor = $createNotificationProcessor;
}
/**
@@ -84,6 +92,16 @@ class ApproveIdentificationDocumentLogic extends AbstractControllerLogic
$this->updatesCompanyStatus->execute($document->owner, $status === 'approve' ? ApprovalStatus::APPROVED : ApprovalStatus::REJECTED);
$object = new NotificationObject(
'ID Verification ' . ( $status === 'approve' ? 'Approved' : 'Rejected' ),
( $status === 'approve' ? 'Dear user, congratulations that your ' : 'Dear user, we are sorry to inform you that your ' ) . ( $document->type === 'IDENTITY_CARD' ? 'IC' : 'SSM' ) . ( $status === 'approve' ? ' has been approved. Start your first order now!' : ' has been rejected due to ' . ( $request->input('rejectRemark') ?? '' ) . ', please resubmit it for further action.' ),
$document->owner,
$document->owner->employees()->first(),
$document,
);
$this->createNotificationProcessor->execute($object);
return $this->resourceResponse(new DocumentResource($document));
}
@@ -0,0 +1,62 @@
<?php
namespace App\Classes\Modules\Companies\ControllersLogic;
use App\Http\Resources\CompanyResource;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Companies\Services\FetchesCompany;
use App\Classes\Modules\Companies\Services\UpdatesCompanyStatus;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class UpdateCompanyStatusLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Update Company Account Status',
'message' => 'You have successfully updated the Company Account Status'
];
}
/** @var FetchesCompany */
private $fetchesCompany;
/** @var UpdatesCompanyStatus */
private $updatesCompanyStatus;
/**
* UpdateCompanyStatusLogic constructor.
* @param FetchesCompany $fetchesCompany
* @param UpdatesCompanyStatus $updatesCompanyStatus
*/
public function __construct(
FetchesCompany $fetchesCompany,
UpdatesCompanyStatus $updatesCompanyStatus
)
{
$this->fetchesCompany = $fetchesCompany;
$this->updatesCompanyStatus = $updatesCompanyStatus;
}
/**
* @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
{
$company = $this->fetchesCompany->execute(['id' => $request->route('id')]);
$company_query = $this->updatesCompanyStatus->execute($company, $request->input('status'));
return $this->resourceResponse(new CompanyResource($company_query));
}
}
@@ -46,9 +46,10 @@ class CreateCompanyProcessor
public function execute(Request $request, int $businessType = BusinessType::IMPORTER, ?int $companyType = CompanyType::COMPANY_BUSINESS, ?int $status = ApprovalStatus::PENDING_SUBMISSION): Model {
$companyName = $companyType === CompanyType::COMPANY_BUSINESS ? $request->input('company_name') : $request->input('name');
$companyReference = $request->input('company_reference') ? $request->input('company_reference') : mt_rand(1000, 9999).(new GeneratesInitials())->name($companyName)->length(3)->generate();
$company_object = new CompanyObject(
$companyName,
mt_rand(1000, 9999).(new GeneratesInitials())->name($companyName)->length(3)->generate(),
$companyReference,
$businessType, $companyType, $status);
$this->canCreateCompany->passes($company_object);
@@ -0,0 +1,74 @@
<?php
namespace App\Classes\Modules\Exports\Services;
use App\Models\Company;
use App\Models\Transaction;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\FromQuery;
use Maatwebsite\Excel\Concerns\WithHeadingRow;
use Maatwebsite\Excel\Concerns\WithMapping;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
use Illuminate\Http\Request;
use Carbon\Carbon;
class ExportsBookingTransactions implements FromQuery, WithHeadings, WithHeadingRow, WithMapping, ShouldAutoSize
{
use Exportable;
private $request;
public function __construct(Request $request)
{
$this->request = $request;
}
public function headings(): array
{
return [
'Ref No',
'Creted Date',
'Amount',
'Rate',
'Supplier'
];
}
/**
* @return \Illuminate\Support\Collection|mixed
*/
public function query()
{
$supplierIds = array_map(function($value){
return ['id' => $value];
}, json_decode($this->request->input('supplierIds')));
$dateFrom =Carbon::parse($this->request->input('startDate'))->format('Y-m-d');
$dateTo =Carbon::parse($this->request->input('endDate'))->format('Y-m-d');
return Transaction::where('type', 3)->whereIn('issuer', $supplierIds)->whereBetween('created_at', [$dateFrom, $dateTo]);
}
/**
* @param $transaction
* @return array
*/
public function map($transaction): array
{
$supplierName = Company::where('id', $transaction->issuer)->get()->first()->name;
$refNo = $transaction->owner->owner == null ? $transaction->owner->marking : $transaction->owner->owner->marking;
$createdAt = $transaction->created_at->format('d-m-Y');
$amount = $transaction->amount;
$rate = $transaction->currency_rate;
return [
$refNo,
$createdAt,
$amount,
$rate,
$supplierName
];
}
}
@@ -13,8 +13,9 @@ use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\FromQuery;
use Maatwebsite\Excel\Concerns\WithHeadingRow;
use Maatwebsite\Excel\Concerns\WithMapping;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping
class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping, ShouldAutoSize
{
use Exportable;
@@ -80,6 +81,7 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping
$transactionStatus[$transaction->status],
\PhpOffice\PhpSpreadsheet\Shared\Date::dateTimeToExcel($transaction->created_at),
\PhpOffice\PhpSpreadsheet\Shared\Date::dateTimeToExcel($transaction->updated_at),
$marking
];
}
}
@@ -0,0 +1,61 @@
<?php
namespace App\Classes\Modules\Notifications\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Notifications\Services\ListsNotification;
use App\Http\Resources\NotificationResource;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class ListNotificationsLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Retrieve Notifications',
'message' => 'You have successfully retrieved a list of Notifications'
];
}
/** @var ListsNotification */
private $listsNotification;
/**
* ListNotificationsLogic constructor.
* @param ListsNotification $listsNotification
*/
public function __construct(
ListsNotification $listsNotification
)
{
$this->listsNotification = $listsNotification;
}
/**
* @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
{
$filters = [
// 'target_id'=>auth()->user()->id,
// 'per_page'=>$request->route('per_page')
];
$notifications = $this->listsNotification->execute($filters);
return $this->collectionResponse(NotificationResource::collection($notifications));
}
}
@@ -0,0 +1,101 @@
<?php
namespace App\Classes\Modules\Notifications\DataTransferObjects;
use App\Classes\General\Interfaces\Notifiable;
use App\Classes\General\Interfaces\DataTransferObject;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
class NotificationObject implements DataTransferObject
{
/** @var string */
private $title;
/** @var string */
private $description;
/** @var Notifiable */
private $subject;
/** @var Notifiable */
private $target;
/** @var Notifiable */
private $causer;
/** @var int|null */
private $status;
/**
* OrderObject constructor.
* @param string $reference
* @param int $type
* @param int|null $status
*/
public function __construct(
string $title,
string $description,
Notifiable $subject,
Notifiable $target,
Notifiable $causer,
?int $status = ApprovalStatus::PENDING_VERIFICATION
)
{
$this->title = $title;
$this->description = $description;
$this->subject = $subject;
$this->target = $target;
$this->causer = $causer;
$this->status = $status;
}
/**
* @return int
*/
public function getTitle(): string
{
return $this->title;
}
/**
* @return int
*/
public function getDescription(): string
{
return $this->description;
}
/**
* @return Notifiable
*/
public function getSubject(): Notifiable
{
return $this->subject;
}
/**
* @return Notifiable
*/
public function getTarget(): Notifiable
{
return $this->target;
}
/**
* @return Notifiable
*/
public function getCauser(): Notifiable
{
return $this->causer;
}
/**
* @return int
*/
public function getStatus(): int
{
return $this->status;
}
}
@@ -0,0 +1,27 @@
<?php
namespace App\Classes\Modules\Notifications\Processors;
use App\Classes\Modules\Notifications\DataTransferObjects\NotificationObject;
use App\Classes\Modules\Notifications\Services\CreatesNotification;
class CreateNotificationProcessor
{
/** @var CreatesNotification */
private $createsNotification;
/**
* CreateNotificationProcessor constructor.
* @param CreatesNotification $createsNotification
*/
public function __construct(CreatesNotification $createsNotification)
{
$this->createsNotification = $createsNotification;
}
public function execute(NotificationObject $object)
{
$notification = $this->createsNotification->execute($object);
return $notification;
}
}
@@ -0,0 +1,30 @@
<?php
namespace App\Classes\Modules\Notifications\Services;
use App\Classes\Modules\Notifications\DataTransferObjects\NotificationObject;
use App\Models\Notification;
class CreatesNotification
{
/**
* @param NotificationObject $object
* @return \Illuminate\Database\Eloquent\Model
* @throws \App\Classes\Exceptions\MalformedRequestException
*/
public function execute(NotificationObject $object) {
$model = new Notification();
$model->title = $object->getTitle();
$model->description = $object->getDescription();
$model->status = $object->getStatus();
$model->subject_type = get_class($object->getSubject());
$model->subject_id = $object->getSubject()->id;
$model->target_type = get_class($object->getTarget());
$model->target_id = $object->getTarget()->id;
$model->causer_type = get_class($object->getCauser());
$model->causer_id = $object->getCauser()->id;
$model->save();
return $model;
}
}
@@ -0,0 +1,33 @@
<?php
namespace App\Classes\Modules\Notifications\Services;
use App\Classes\General\Eloquent\AbstractListRecord;
use Illuminate\Database\Eloquent\Builder;
use App\Models\Notification;
class ListsNotification extends AbstractListRecord
{
/** @var Bank */
private $repository;
/**
* ListsBank constructor.
* @param Notification $repository
*/
public function __construct(Notification $repository)
{
$this->repository = $repository;
}
/**
* @return Builder
*/
function getRepository(): Builder
{
return $this->repository->newQuery();
}
}
@@ -87,7 +87,7 @@ class CreateSupplierTransactionLogic extends AbstractControllerLogic
$service_charge = 0;
foreach ($this->createSupplierTransactionProcessor->getBills() as $key => $row) {
$group->transaction()->sync($row->id, false);
$group->transactions()->sync($row->id, false);
$issuer = $row->issuer;
$receiver = $row->receiver;
$amount += $row->amount;
@@ -0,0 +1,72 @@
<?php
namespace App\Classes\Modules\Transactions\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Transactions\Services\FetchesGroup;
use App\Classes\Modules\Transactions\Services\DeletesTransaction;
use App\Classes\Modules\Transactions\Services\updatesTransactionStatus;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Http\Resources\GroupResource;
use ErrorException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class DeleteGroupLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Delete Group Transaction',
'message' => 'You have successfully deleted this Group Transaction'
];
}
/** @var UpdatesTransactionStatus */
private $updatesTransactionStatus;
/** @var FetchesGroup */
private $fetchesGroup;
/** @var DeletesTransaction */
private $deletesTransaction;
public function __construct(
UpdatesTransactionStatus $updatesTransactionStatus,
FetchesGroup $fetchesGroup,
DeletesTransaction $deletesTransaction
)
{
$this->updatesTransactionStatus = $updatesTransactionStatus;
$this->fetchesGroup = $fetchesGroup;
$this->deletesTransaction = $deletesTransaction;
}
/**
* @param Request $request
* @return JsonResponse
* @throws ErrorException
*/
public function logic(Request $request) : JsonResponse
{
$group = $this->fetchesGroup->execute(['id' => $request->route('id')]);
$items = $group->transactions()->get();
foreach($items as $item) {
$bill = $item;
$payment = $bill->owner;
$group->transactions()->detach($bill->id);
$this->updatesTransactionStatus->execute($payment, ApprovalStatus::APPROVED);
$this->deletesTransaction->execute($bill);
}
$group->delete();
return $this->resourceResponse(new GroupResource($group));
}
}
@@ -0,0 +1,42 @@
<?php
namespace App\Classes\Modules\Transactions\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Transactions\Services\ListsGroups;
use App\Http\Resources\GroupResource;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class ListGroupsLogic extends AbstractControllerLogic
{
/**
* ListTransactionsLogic constructor.
* @param ListsGroups $listsGroups
*/
public function __construct(ListsGroups $listsGroups)
{
$this->listsGroups = $listsGroups;
}
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Retrieved Groups',
'message' => 'You have successfully retrieved a list of groups'
];
}
/** @var ListsGroups */
private $listsGroups;
public function logic(Request $request) : JsonResponse
{
$query = $this->listsGroups->execute($this->listsGroups->deserializeFilters($request->input('filters')));
return $this->collectionResponse(GroupResource::collection($query));
}
}
@@ -0,0 +1,141 @@
<?php
namespace App\Classes\Modules\Transactions\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Http\Resources\GroupResource;
use App\Models\SegmentConstant;
use App\Classes\Modules\Companies\Services\FetchesCompany;
use App\Classes\Modules\Transactions\Services\CalculatesTransactionServiceCharge;
use App\Classes\Modules\Transactions\DataTransferObjects\TransactionObject;
use App\Classes\Modules\Transactions\Services\FetchesGroup;
use App\Classes\Modules\Transactions\Services\UpdatesTransaction;
use App\Classes\Modules\Transactions\Services\CalculatesTransactionTransferFee;
use App\Classes\ValueObjects\Constants\TransactionType;
use App\Classes\ValueObjects\Constants\PaymentMethodType;
use App\Classes\ValueObjects\Constants\SegmentConstants;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use ErrorException;
class UpdateGroupLogic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Update Group Transaction',
'message' => 'You have successfully updated this Group Transaction'
];
}
/** @var FetchesGroup */
private $fetchesGroup;
/** @var FetchesCompany */
private $fetchesCompany;
/** @var CalculatesTransactionServiceCharge */
private $calculatesTransactionServiceCharge;
/** @var UpdatesTransaction */
private $updatesTransaction;
/** @var CalculatesTransactionTransferFee */
private $calculatesTransactionTransferFee;
public function __construct(
FetchesGroup $fetchesGroup,
FetchesCompany $fetchesCompany,
CalculatesTransactionServiceCharge $calculatesTransactionServiceCharge,
UpdatesTransaction $updatesTransaction,
CalculatesTransactionTransferFee $calculatesTransactionTransferFee
)
{
$this->fetchesGroup = $fetchesGroup;
$this->fetchesCompany = $fetchesCompany;
$this->calculatesTransactionServiceCharge = $calculatesTransactionServiceCharge;
$this->updatesTransaction = $updatesTransaction;
$this->calculatesTransactionTransferFee = $calculatesTransactionTransferFee;
}
/**
* @param Request $request
* @return JsonResponse
* @throws ErrorException
*/
public function logic(Request $request) : JsonResponse
{
$group = $this->fetchesGroup->execute(['id' => $request->route('id')]);
$transactions = $group->transactions()->get();
$rate = $request->input('rate');
$supplier = $this->fetchesCompany->execute(['id' => $request->input('supplier_id')]);
foreach($transactions as $transaction) {
$constant = SegmentConstant::where('reference', SegmentConstants::SERVICE_CHARGE)->where('detail->id', $supplier->id)->first();
$serviceCharge = $this->calculatesTransactionServiceCharge->execute($transaction->original_amount, $rate, $constant);
$object = new TransactionObject(
$transaction->bill_no,
TransactionType::BILL,
$supplier->id,
1,
$supplier->banks()->where('default', true)->first()->id,
PaymentMethodType::CASH,
$transaction->original_amount * (1 / $rate),
$transaction->original_amount,
1,
$transaction->original_currency_id,
$rate,
0,
$serviceCharge,
null,
ApprovalStatus::PENDING_VERIFICATION
);
$billTransaction = $this->updatesTransaction->execute($transaction, $object);
$transferTransaction = $transaction->transactions()->where('type', TransactionType::TRANSFER_FEE)->first();
$transferFee = $this->calculatesTransactionTransferFee->execute($billTransaction->amount, $constant);
$object = new TransactionObject(
$transferTransaction->bill_no,
TransactionType::TRANSFER_FEE,
1,
$supplier->id,
$supplier->banks()->where('default', true)->first()->id,
PaymentMethodType::CASH,
$transaction->original_amount,
$transaction->original_amount,
$transaction->original_currency_id,
$transaction->original_currency_id,
1,
0,
$transferFee,
null,
ApprovalStatus::PENDING_VERIFICATION
);
$this->updatesTransaction->execute($transferTransaction, $object);
}
$group->issuer = $supplier;
$group->amount = $group->transactions()->sum('amount');
$group->currency_rate = $rate;
$group->tax = $group->transactions()->sum('tax');
$group->service_charge = $group->transactions()->sum('service_charge');
$group->save();
return $this->resourceResponse(new GroupResource($group));
}
}
@@ -0,0 +1,49 @@
<?php
namespace App\Classes\Modules\Transactions\Processors;
use App\Classes\Modules\Documents\Services\CreatesDocument;
use App\Classes\Modules\Documents\Services\CreatesFiles;
use App\Classes\Modules\Documents\DataTransferObjects\DocumentObject;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use Meneses\LaravelMpdf\Facades\LaravelMpdf;
class CreateInvoiceDocumentProcessor
{
/** @var CreatesDocument */
private $createsDocument;
/** @var CreatesFiles */
private $createsFile;
/**
* CreateInvoiceDocumentProcessor constructor.
* @param CreatesDocument $createsDocument
* @param CreatesFiles $createsFile
*/
public function __construct(CreatesDocument $createsDocument, CreatesFiles $createsFile)
{
$this->createsDocument = $createsDocument;
$this->createsFile = $createsFile;
}
/**
* @return void
*/
public function execute($transaction, $purchaseOrder, $supplier, $document_type)
{
$lowercaseDocumentType = strtolower($document_type);
$order_pdf = LaravelMpdf::loadView('pages.pdfs.' . $lowercaseDocumentType, ['transaction' => $transaction, 'po_order_transaction' => $purchaseOrder, 'supplier' => $supplier]);
$document_object = new DocumentObject(
$document_type,
[chunk_split('data:application/pdf;base64,' . base64_encode($order_pdf->output()))],
'',
ApprovalStatus::COMPLETED,
$lowercaseDocumentType . 's'
);
$document = $this->createsDocument->execute($purchaseOrder->booking, $document_object);
$this->createsFile->execute($document, $document_object);
}
}
@@ -11,20 +11,14 @@ use App\Classes\Modules\Transactions\Services\GeneratesTransactionBillNumber;
use App\Classes\Modules\Bookings\Services\CalculatesBookingPaidAmount;
use App\Classes\Modules\Bookings\Services\CalculatesBookingCurrencyAverageRate;
use App\Classes\Modules\Companies\Services\FetchesCompany;
use App\Classes\Modules\Documents\Services\CreatesDocument;
use App\Classes\Modules\Documents\Services\CreatesFiles;
use App\Classes\Modules\Bookings\Services\UpdatesBookingStatus;
use App\Classes\Modules\Transactions\DataTransferObjects\TransactionObject;
use App\Classes\Modules\Documents\DataTransferObjects\DocumentObject;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\SegmentConstants;
use App\Classes\ValueObjects\Constants\TransactionType;
use App\Classes\ValueObjects\Constants\DocumentType;
use App\Models\Booking;
use App\Models\Document;
use App\Models\SegmentConstant;
use Meneses\LaravelMpdf\Facades\LaravelMpdf;
class CreateInvoiceTransactionProcessor
{
@@ -55,15 +49,12 @@ class CreateInvoiceTransactionProcessor
/** @var FetchesCompany */
private $fetchesCompany;
/** @var CreatesDocument */
private $createsDocument;
/** @var CreatesFiles */
private $createsFile;
/** @var UpdatesBookingStatus */
private $updatesBookingStatus;
/** @var CreateInvoiceDocumentProcessor */
private $invoiceDocumentProcessor;
/**
* CreateInvoiceTransactionProcessor constructor.
* @param ListsTransactions $listsTransactions
@@ -75,11 +66,10 @@ class CreateInvoiceTransactionProcessor
* @param FetchesServiceConfigurations $fetchesServiceConfigurations
* @param CalculatesBookingCurrencyAverageRate $calculatesBookingCurrencyAverageRate
* @param FetchesCompany $fetchesCompany
* @param CreatesDocument $createsDocument
* @param CreatesFiles $createsFile
* @param UpdatesBookingStatus $updatesBookingStatus
* @param CreateInvoiceDocumentProcessor $invoiceDocumentProcessor
*/
public function __construct(ListsTransactions $listsTransactions, CreatesTransaction $createsTransaction, GeneratesTransactionBillNumber $generatesTransactionBillNumber, CalculatesBookingPaidAmount $calculatesBookingPaidAmount, CalculatesBookingPayableAmount $calculatesBookingPayableAmount, CalculatesBookingTransferredAmount $calculatesBookingTransferredAmount, FetchesServiceConfigurations $fetchesServiceConfigurations, CalculatesBookingCurrencyAverageRate $calculatesBookingCurrencyAverageRate, FetchesCompany $fetchesCompany, CreatesDocument $createsDocument, CreatesFiles $createsFile, UpdatesBookingStatus $updatesBookingStatus)
public function __construct(ListsTransactions $listsTransactions, CreatesTransaction $createsTransaction, GeneratesTransactionBillNumber $generatesTransactionBillNumber, CalculatesBookingPaidAmount $calculatesBookingPaidAmount, CalculatesBookingPayableAmount $calculatesBookingPayableAmount, CalculatesBookingTransferredAmount $calculatesBookingTransferredAmount, FetchesServiceConfigurations $fetchesServiceConfigurations, CalculatesBookingCurrencyAverageRate $calculatesBookingCurrencyAverageRate, FetchesCompany $fetchesCompany, UpdatesBookingStatus $updatesBookingStatus, CreateInvoiceTransactionProcessor $invoiceDocumentProcessor)
{
$this->listsTransactions = $listsTransactions;
$this->createsTransaction = $createsTransaction;
@@ -90,18 +80,16 @@ class CreateInvoiceTransactionProcessor
$this->fetchesServiceConfigurations = $fetchesServiceConfigurations;
$this->calculatesBookingCurrencyAverageRate = $calculatesBookingCurrencyAverageRate;
$this->fetchesCompany = $fetchesCompany;
$this->createsDocument = $createsDocument;
$this->createsFile = $createsFile;
$this->updatesBookingStatus = $updatesBookingStatus;
$this->invoiceDocumentProcessor = $invoiceDocumentProcessor;
}
/**
* @param Booking $booking
* @return void
* @throws \App\Classes\Exceptions\MalformedRequestException
*/
public function execute(Booking $booking)
public function execute(Booking $booking)
{
if ($booking->status === ApprovalStatus::COMPLETED) {
@@ -116,18 +104,18 @@ class CreateInvoiceTransactionProcessor
return;
}
// confirm that all payments has been transferred
if($this->calculatesBookingTransferredAmount->execute($booking) !== $this->calculatesBookingPaidAmount->execute($booking)){
if ($this->calculatesBookingTransferredAmount->execute($booking) !== $this->calculatesBookingPaidAmount->execute($booking)) {
return;
}
$po_order_transaction = $booking->transactions()
$purchaseOrder = $booking->transactions()
->where('type', TransactionType::PURCHASE_ORDER)
->complete()
->first();
$constants = SegmentConstant::where('reference', SegmentConstants::SERVICE_TYPE)->where('detail->id', $booking->service->id)->first();
if($constants->detail->is_billable && !$po_order_transaction) {
if ($constants->detail->is_billable && !$purchaseOrder) {
return;
}
@@ -166,46 +154,18 @@ class CreateInvoiceTransactionProcessor
null,
ApprovalStatus::APPROVED
);
$invoice_transaction = $this->createsTransaction->execute($po_order_transaction->booking, $transaction_object);
$invoice_transaction = $this->createsTransaction->execute($purchaseOrder->booking, $transaction_object);
$supplier = $this->fetchesCompany->execute(['id' => $transaction->receiver]);
$purchase_order_pdf = LaravelMpdf::loadView('pages.pdfs.purchase_order', ['invoice_transaction' => $invoice_transaction, 'po_order_transaction' => $po_order_transaction, 'supplier' => $supplier]);
$document_object = new DocumentObject(
DocumentType::PURCHASE_ORDER,
[chunk_split('data:application/pdf;base64,'.base64_encode($purchase_order_pdf->output()))],
'',
ApprovalStatus::COMPLETED,
'purchase_orders'
);
/** @var Document $document */
$document = $this->createsDocument->execute($po_order_transaction->booking, $document_object);
$this->createsFile->execute($document, $document_object);
// purchase order
$this->invoiceDocumentProcessor->execute($invoice_transaction, $purchaseOrder, $supplier, DocumentType::PURCHASE_ORDER);
$deliver_order_pdf = LaravelMpdf::loadView('pages.pdfs.deliver_order', ['invoice_transaction' => $invoice_transaction, 'po_order_transaction' => $po_order_transaction, 'supplier' => $supplier]);
$document_object = new DocumentObject(
DocumentType::DELIVER_ORDER,
[chunk_split('data:application/pdf;base64,'.base64_encode($deliver_order_pdf->output()))],
'',
ApprovalStatus::COMPLETED,
'delivery_orders'
);
// deliver order
$this->invoiceDocumentProcessor->execute($invoice_transaction, $purchaseOrder, $supplier, DocumentType::DELIVER_ORDER);
/** @var Document $document */
$document = $this->createsDocument->execute($po_order_transaction->booking, $document_object);
$this->createsFile->execute($document, $document_object);
$invoice_pdf = LaravelMpdf::loadView('pages.pdfs.invoice', ['invoice_transaction' => $invoice_transaction, 'po_order_transaction' => $po_order_transaction, 'supplier' => $supplier]);
$document_object = new DocumentObject(
DocumentType::INVOICE,
[chunk_split('data:application/pdf;base64,'.base64_encode($invoice_pdf->output()))],
'',
ApprovalStatus::COMPLETED,
'invoices'
);
$document = $this->createsDocument->execute($po_order_transaction->booking, $document_object);
$this->createsFile->execute($document, $document_object);
// invoice
$this->invoiceDocumentProcessor->execute($invoice_transaction, $purchaseOrder, $supplier, DocumentType::INVOICE);
$billNumber = $this->generatesTransactionBillNumber->execute('SPDO-');
@@ -231,18 +191,10 @@ class CreateInvoiceTransactionProcessor
null,
ApprovalStatus::APPROVED
);
$supplier_deliver_order_transaction = $this->createsTransaction->execute($po_order_transaction->booking, $transaction_object);
$supplier_deliver_order_transaction = $this->createsTransaction->execute($purchaseOrder->booking, $transaction_object);
$supplier_order_pdf = LaravelMpdf::loadView('pages.pdfs.supplier_deliver_order', ['supplier_deliver_order_transaction' => $supplier_deliver_order_transaction, 'po_order_transaction' => $po_order_transaction, 'supplier' => $supplier]);
$document_object = new DocumentObject(
DocumentType::SUPPLIER_DELIVER_ORDER,
[chunk_split('data:application/pdf;base64,'.base64_encode($supplier_order_pdf->output()))],
'',
ApprovalStatus::COMPLETED,
'supplier_delivery_orders'
);
$document = $this->createsDocument->execute($po_order_transaction->booking, $document_object);
$this->createsFile->execute($document, $document_object);
// supply deliver order
$this->invoiceDocumentProcessor->execute($supplier_deliver_order_transaction, $purchaseOrder, $supplier, DocumentType::SUPPLIER_DELIVER_ORDER);
$this->updatesBookingStatus->execute($booking, ApprovalStatus::COMPLETED);
}
@@ -0,0 +1,31 @@
<?php
namespace App\Classes\Modules\Transactions\Services;
use App\Models\Group;
use Illuminate\Database\Eloquent\Builder;
use App\Classes\General\Eloquent\AbstractFetchRecord;
class FetchesGroup extends AbstractFetchRecord
{
/** @var Group */
private $repository;
/**
* ListsBookings constructor.
* @param Group $repository
*/
public function __construct(Group $repository)
{
$this->repository = $repository;
}
/**
* @return Builder
*/
public function getRepository(): Builder
{
return $this->repository->newQuery();
}
}
@@ -0,0 +1,31 @@
<?php
namespace App\Classes\Modules\Transactions\Services;
use App\Models\Group;
use Illuminate\Database\Eloquent\Builder;
use App\Classes\General\Eloquent\AbstractListRecord;
class ListsGroups extends AbstractListRecord
{
/** @var Group */
private $repository;
/**
* ListsBookings constructor.
* @param Group $repository
*/
public function __construct(Group $repository)
{
$this->repository = $repository;
}
/**
* @return Builder
*/
public function getRepository(): Builder
{
return $this->repository->newQuery();
}
}
@@ -15,7 +15,7 @@ class DownloadBookingDocumentController
* @throws \App\Classes\Exceptions\MalformedRequestException
*/
public function download(Request $request, DownloadBookingDocumentLogic $logic) {
$logic->execute($request);
return $logic->execute($request);
}
}
@@ -0,0 +1,20 @@
<?php
namespace App\Http\Controllers\Companies;
use App\Classes\Modules\Companies\ControllersLogic\UpdateCompanyStatusLogic;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class UpdateCompanyStatusController
{
/**
* @param Request $request
* @param UpdateCompanyStatusLogic $logic
* @return JsonResponse
*/
public function update(Request $request, UpdateCompanyStatusLogic $logic): JsonResponse {
return $logic->execute($request);
}
}
@@ -5,6 +5,7 @@ namespace App\Http\Controllers\Exports;
use App\Classes\Modules\Exports\Services\ExportsCustomers;
use App\Classes\Modules\Exports\Services\ExportsTransactions;
use App\Classes\Modules\Exports\Services\ExportsBookingTransactions;
use App\Classes\Modules\Exports\Services\ExportsNullDebtors;
use App\Classes\Modules\Exports\Services\ExportsPaymentTransactions;
@@ -54,4 +55,10 @@ class ExportCustomersToExcelController
ob_end_clean();
return $response;
}
public function bookingTransactions(ExportsBookingTransactions $exportsBookingTransactions, Request $request){
$response = $exportsBookingTransactions->download('bookingTransactions.xls', Excel::XLS, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']);
ob_end_clean();
return $response;
}
}
@@ -0,0 +1,19 @@
<?php
namespace App\Http\Controllers\Notifications;
use App\Classes\Modules\Notifications\ControllersLogic\ListNotificationsLogic;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class ListNotificationsController
{
/**
* @param Request $request
* @param ListNotificationsLogic $logic
* @return JsonResponse
*/
public function list(Request $request, ListNotificationsLogic $logic): JsonResponse {
return $logic->execute($request);
}
}
@@ -0,0 +1,20 @@
<?php
namespace App\Http\Controllers\Transactions;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use App\Classes\Modules\Transactions\ControllersLogic\DeleteGroupLogic;
class DeleteGroupController
{
/**
* @param Request $request
* @param DeleteGroupTransactionLogic $logic
* @return JsonResponse
*/
public function delete(Request $request, DeleteGroupLogic $logic) : JsonResponse {
return $logic->execute($request);
}
}
@@ -0,0 +1,21 @@
<?php
namespace App\Http\Controllers\Transactions;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use App\Classes\Modules\Transactions\ControllersLogic\ListGroupsLogic;
class ListGroupsController
{
/**
* @param Request $request
* @param ListGroupsLogic $logic
* @return JsonResponse
*/
public function list(Request $request, ListGroupsLogic $logic) : JsonResponse {
return $logic->execute($request);
}
}
@@ -0,0 +1,20 @@
<?php
namespace App\Http\Controllers\Transactions;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use App\Classes\Modules\Transactions\ControllersLogic\UpdateGroupLogic;
class UpdateGroupController
{
/**
* @param Request $request
* @param DeleteGroupTransactionLogic $logic
* @return JsonResponse
*/
public function update(Request $request, UpdateGroupLogic $logic) : JsonResponse {
return $logic->execute($request);
}
}
+1
View File
@@ -31,6 +31,7 @@ class BookingResource extends JsonResource
'service' => new ServiceTypeResource($this->service),
'marking' => $this->marking,
'amount' => $this->fix_amount,
'amount' => $this->fix_amount,
'floating_amount' => floatval((App()->make(CalculatesBookingFloatingAmount::class))->execute($this->resource, $this->fix_currency_id)),
'paid_amount' => floatval((App()->make(CalculatesBookingPayableAmount::class))->execute($this->resource, $this->fix_currency_id)) - floatval((App()->make(CalculatesBookingRefundAmount::class))->execute($this->resource, $this->fix_currency_id)),
'outstanding_amount' => floatval((App()->make(CalculatesBookingOutstanding::class))->execute($this->resource)) - floatval((App()->make(CalculatesBookingRefundAmount::class))->execute($this->resource, $this->fix_currency_id)),
+29
View File
@@ -0,0 +1,29 @@
<?php
namespace App\Http\Resources;
use Carbon\Carbon;
use Illuminate\Http\Resources\Json\JsonResource;
class GroupResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function toArray($request)
{
return [
'id' => $this->id,
'original_amount' => (double) $this->original_amount,
'original_currency' => new CurrencyResource($this->original_currency),
'amount' => (double) $this->amount,
'currency' => new CurrencyResource($this->currency),
'created_at' => Carbon::parse($this->created_at)->format('d-m-Y h:i:s A'),
'currency_rate' => (float) $this->currency_rate,
'transactions' => TransactionResource::collection($this->transactions()->get()),
];
}
}
@@ -0,0 +1,30 @@
<?php
namespace App\Http\Resources;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\BusinessType;
use App\Classes\ValueObjects\Constants\DocumentType;
use Illuminate\Http\Resources\Json\JsonResource;
use Illuminate\Support\Facades\Crypt;
class NotificationResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function toArray($request)
{
return [
'id' => $this->id,
'title' => $this->title,
'description' => $this->description,
'long_ago' => $this->created_at->diffForHumans(),
'created_at' => $this->created_at->format('d-m-Y')
];
}
}
@@ -30,6 +30,7 @@ class TransactionResource extends JsonResource
'payment_method' => (float) $this->payment_method,
'recipient_bank_account' => new BankResource($booking->bank),
'issuer_name' => $this->issuerCompany->name,
'issuer_id' => $this->issuerCompany->id,
'amount' => (double) $this->amount,
'original_amount' => (double) $this->original_amount,
'currency' => new CurrencyResource($this->currency),
+27 -1
View File
@@ -3,11 +3,37 @@
namespace App\Models;
use App\Classes\General\Interfaces\Notifiable;
use Illuminate\Database\Eloquent\Model;
use Spatie\Activitylog\Traits\LogsActivity;
use Illuminate\Database\Eloquent\Relations\MorphTo;
class AbstractModel extends Model
class AbstractModel extends Model implements Notifiable
{
use LogsActivity;
protected static $logFillable = true;
/**
* @return MorphTo
*/
public function subject(): MorphTo
{
return $this->MorphTo('subject');
}
/**
* @return MorphTo
*/
public function target(): MorphTo
{
return $this->MorphTo('target');
}
/**
* @return MorphTo
*/
public function causer(): MorphTo
{
return $this->MorphTo('causer');
}
}
+19 -2
View File
@@ -3,11 +3,28 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Group extends Model
{
public function transaction()
public function transactions()
{
return $this->belongsToMany('App\Models\Transaction', 'group_transaction');
return $this->belongsToMany(Transaction::class, GroupTransaction::class);
}
/**
* @return BelongsTo
*/
public function currency(): BelongsTo
{
return $this->BelongsTo(Currency::class, 'currency_id', 'id');
}
/**
* @return BelongsTo
*/
public function original_currency(): BelongsTo
{
return $this->BelongsTo(Currency::class, 'original_currency_id', 'id');
}
}
+18 -1
View File
@@ -3,8 +3,25 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class GroupTransaction extends Model
{
//
protected $table = 'group_transactions';
/**
* @return BelongsTo
*/
public function group(): BelongsTo
{
return $this->BelongsTo(Group::class, 'group_id', 'id');
}
/**
* @return BelongsTo
*/
public function transaction(): BelongsTo
{
return $this->BelongsTo(Transaction::class, 'transaction_id', 'id');
}
}
+18
View File
@@ -0,0 +1,18 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;
class Notification extends AbstractModel
{
use SoftDeletes;
protected $table = 'notifications';
public function package(): BelongsTo
{
return $this->BelongsTo(Package::class, 'package_id', 'id');
}
}
@@ -13,7 +13,8 @@ class CreateGroupTransactionsTable extends Migration
*/
public function up()
{
Schema::create('group_transaction', function (Blueprint $table) {
Schema::create('group_transactions', function (Blueprint $table) {
$table->id();
$table->foreignId('group_id')->unsigned();
$table->foreignId('transaction_id')->unsigned();
});
@@ -26,6 +27,6 @@ class CreateGroupTransactionsTable extends Migration
*/
public function down()
{
Schema::dropIfExists('group_transaction');
Schema::dropIfExists('group_transactions');
}
}
@@ -0,0 +1,40 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
class CreateNotificationsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('notifications', function (Blueprint $table) {
$table->id();
$table->string('title');
$table->text('description');
$table->morphs('subject');
$table->morphs('target');
$table->morphs('causer');
$table->integer('status')->default(ApprovalStatus::APPROVED);
$table->softDeletes();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('notifications');
}
}
+6
View File
@@ -316,6 +316,12 @@ hr{
background-color: $color-primary-lighter !important;
}
.bg-primary-lighter-hover {
&:hover {
background-color: $color-primary-lighter !important;
}
}
/* Complete
------------------------------------
*/
@@ -84,7 +84,14 @@ export default {
type: 'INVOICE',
supplier: null
},
documents: ['INVOICE', 'PURCHASE_ORDER', 'DELIVER_ORDER', 'SUPPLIER_DELIVER_ORDER'],
documents: [
'INVOICE',
'PURCHASE_ORDER',
'DELIVER_ORDER',
'SUPPLIER_DELIVER_ORDER',
'INVOICE + PO + DO',
'INVOICE + PO + DO + SDO'
],
selectedDocumentStatus: false
}
},
@@ -148,7 +148,6 @@
</div>
<div class="row" v-show="createBank">
<div class="col">
{{ data.company.id }}
<bank-account-form-component v-if="data.serviceType.id !== 4" section="customerProfileSection" :disabled="formDisabled" :data="Object.keys(parameters.bankAccount).length ? parameters.bankAccount : {account_no: account_no, company_id: data.company.id, country_id: 2, account_type: 2}" :company_id="data.company.id" :country_id="2" :type="2" v-on:createdBank="updateBank($event)" :serviceType="data.serviceType" :closable=false v-on:close="clearAccount()"></bank-account-form-component>
<phone-account-form-component v-if="data.serviceType.id === 4" section="customerProfileSection" :disabled="formDisabled" :data="Object.keys(parameters.bankAccount).length ? parameters.bankAccount : {account_no: account_no, company_id: data.company.id, country_id: 2, account_type: 2}" :company_id="data.company.id" :country_id="2" :type="2" v-on:createdBank="updateBank($event)" :serviceType="data.serviceType" :closable=false v-on:close="clearAccount()"></phone-account-form-component>
</div>
@@ -40,7 +40,7 @@
<div class="row m-b-20">
<div class="col">
<h5 class="all-caps">Currency Order Placed</h5>
<div class="fs-11">Are you sure you that the currency order has been placed with the supplier?</div>
<div class="fs-11">Are you sure that the currency order has been placed with the supplier?</div>
</div>
</div>
<div class="row">
@@ -123,7 +123,7 @@
<div class="font-heading all-caps fs-10">Requested Refund Amount</div>
</div>
<div class="col-auto text-right">
<div class="font-heading fs-10">{{item.original_currency.short_code}} {{(Math.round((totalRequestedRefund + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}</div>
<div class="font-heading fs-10">{{item.currency.short_code}} {{(Math.round((totalRequestedRefund + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}</div>
</div>
</div>
<div class="row align-items-end m-b-10 bold text-danger" v-if="totalRefunds != 0">
@@ -219,7 +219,7 @@
</div>
</div>
</div>
<div class="row m-t-10" v-show="[2, 3].includes(item.status) && totalRequestedRefund < data.booking.amount">
<div class="row m-t-10" v-show="[2, 3].includes(item.status) && totalRequestedConvertRefund < data.booking.amount">
<div class="col hide">
<button class="btn btn-xs all-caps b-rad-none bg-master-lighter btn-block no-border requestModal" data-type="transferSummary">Request Refund</button>
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="transferSummary" size="large">
@@ -249,12 +249,25 @@
},
computed: {
totalRequestedRefund() {
let vm = this;
var TotalRequestedRefund = 0;
this.data.transaction_refunds.forEach(function(refunds) {
TotalRequestedRefund += refunds.status === 1 ? refunds.original_amount : 0;
});
return TotalRequestedRefund;
},
totalRequestedConvertRefund() {
let vm = this;
var TotalRequestedRefund = 0;
this.data.transaction_refunds.forEach(function(refunds) {
TotalRequestedRefund += refunds.status === 1 ? refunds.original_amount : 0;
});
if (vm.data.booking.fixed_currency.id != 1 && this.data.transaction_refunds[0]) {
TotalRequestedRefund = (TotalRequestedRefund * this.data.transaction_refunds[0].currency_rate);
}
return ((Math.round((TotalRequestedRefund + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","));
},
totalRefunds() {
var TotalRequestedRefund = 0;
this.data.transaction_refunds.forEach(function(refunds) {
@@ -28,7 +28,7 @@
<div class="col text-right">
<div class="font-heading fs-10 muted all-caps">Amount</div>
<div class="font-heading fs-14 text-success bold">
{{(Math.round((data.amount + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}
{{(Math.round((data.original_amount + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}
</div>
</div>
</div>
@@ -0,0 +1,98 @@
<template>
<div class="row m-b-10 parentContainer">
<div class="col">
<loading-component style="height: 200px; top: 0;" key="1" color="success" v-show="isLoading"></loading-component>
<div class="row p-b-5 b-b b-grey" v-show="!isLoading">
<div class="col">
<div class="row m-b-10">
<div class="col-auto">
<div class="font-heading fs-10 muted all-caps">Date</div>
<div class="font-heading fs-10">
{{item.created_at}}
</div>
</div>
<div class="col-auto">
<div class="font-heading fs-10 muted all-caps">Currency Rate</div>
<div class="font-heading fs-10">
{{item.currency_rate}}
</div>
</div>
<div class="col text-right">
<div class="font-heading fs-10 muted all-caps">Amount</div>
<div class="font-heading fs-14 text-success bold">
{{item.original_currency.short_code}} {{(Math.round((item.original_amount + Number.EPSILON) * 100) / 100).toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")}}
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="font-heading fs-10 muted all-caps">reference</div>
<span class="font-heading fs-10" v-for="transaction in item.transactions">
<a :href="route('booking.details', transaction.booking.marking)">{{transaction.booking.marking}}&nbsp;</a>
</span>
</div>
<div class="col-auto">
<div class="row parentContainer">
<div class="col p-l-0">
<button class="btn btn-xs btn-default bg-warning b-rad-none no-border requestModal" data-type="editTransactionGroup">
<i class="fa fa-pencil text-white"></i>
</button>
<modal-component small type="editTransactionGroup">
<edit-transaction-group-form-component :section="section" :currency_rate="item.currency_rate" :supplier_id ="data.transactions[0].issuer_id" :id="item.id"></edit-transaction-group-form-component>
</modal-component>
<button class="btn btn-xs btn-default bg-danger b-rad-none no-border requestModal" data-type="deleteTransactionGroup">
<i class="fa fa-times text-white"></i>
</button>
<modal-component small type="deleteTransactionGroup">
<div class="row">
<div class="col text-center">
<div class="row">
<div class="col text-center">
<div class="row m-b-20">
<div class="col">
<h5 class="all-caps">Delete Transaction Group</h5>
<div class="fs-11">Are you sure that you want to delete this transaction group?</div>
</div>
</div>
<div class="row">
<div class="col p-r-5">
<div data-dismiss="modal" class="btn btn-sm btn-default bg-master-lighter btn-block b-rad-none">Cancel</div>
</div>
<div class="col p-l-5">
<div data-dismiss="modal" class="btn btn-sm btn-danger btn-block b-rad-none" @click="deleteGroupTransaction()">Confirm</div>
</div>
</div>
</div>
</div>
</div>
</div>
</modal-component>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import componentHandler from '../../../general/mixins/componentHandler';
import staticFormHandler from '../../../general/mixins/staticFormHandler'
export default {
props: {
section:{
type: String,
required: true
}
},
methods: {
deleteGroupTransaction() {
this.isLoading = true;
this.submit(this.route('api.transaction.group.delete', this.item.id), 'delete', this.section, true, true);
}
},
mixins: [componentHandler, staticFormHandler]
}
</script>
@@ -0,0 +1,92 @@
<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">Edit Transaction Group</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 selectable :validator="$v.parameters.supplier_id">
<label>Supplier</label>
<selectable-component :endpoint="route('api.company.list') + '?filters=' + JSON.stringify({'business_type': 3, 'status_in': [2, 0]})" section="supplierListSection" valueColumn="id" :labelColumn="['name']" v-model="parameters.supplier_id"></selectable-component>
</validation-wrapper-component>
</div>
</div>
<div class="row m-b-10">
<div class="col">
<validation-wrapper-component :validator="$v.parameters.rate">
<label class="all-caps">Purchase Rate</label>
<input type="text" class="form-control" v-model.lazy="parameters.rate" v-money="exchangeRate">
</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="submitForm()">Update</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import { required } from "vuelidate/lib/validators";
import ModalFormHandler from '../../../general/mixins/modalFormHandler';
export default {
props: {
currency_rate:{
type: Number,
required: true
},
supplier_id: {
type: Number,
required: true
},
id: {
type: Number,
required: true
}
},
data(){
return {
error: '',
suppliers: [],
selectedSupplier: {
id: '',
name: '',
status: false
},
parameters: {
supplier_id: this.supplier_id,
rate: (Math.round((this.currency_rate + Number.EPSILON) * 10000) / 10000).toFixed(5)
},
}
},
validations: {
parameters: {
supplier_id: { },
rate: { },
},
},
methods: {
submitForm() {
this.submit(route('api.transaction.group.update', this.id), 'put', this.section, true, true);
}
},
mixins: [ModalFormHandler]
}
</script>
@@ -0,0 +1,96 @@
<template>
<div class="row m-b-20">
<div class="col">
<div class="row">
<div class="col">
<div class="row m-l-0 m-r-0 bg-master-light padding-10 parentContainer">
<div class="col">
<div class="row requestModal pointer" data-type="deleteBank">
<div class="col">
<validation-wrapper-component :validator="$v.parameters.supplierNames">
<label>Supplier</label>
<input type="text" class="form-control fs-12 pointer" v-model="parameters.supplierNames" disabled>
</validation-wrapper-component>
</div>
</div>
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="deleteBank">
<select-supplier-form-component section="supplierListSection" v-on:input="updateList($event)"></select-supplier-form-component>
</modal-component>
</div>
<div class="col-12 col-md mb-2 mb-md-0">
<validation-wrapper-component :validator="$v.parameters.startDate">
<label class="all-caps">Start Date</label>
<date-picker-component :parameters="parameters" v-model.lazy="parameters.startDate"></date-picker-component>
</validation-wrapper-component>
</div>
<div class="col-12 col-md mb-2 mb-md-0">
<validation-wrapper-component :validator="$v.parameters.endDate">
<label class="all-caps">End Date</label>
<date-picker-component :parameters="parameters" v-model.lazy="parameters.endDate"></date-picker-component>
</validation-wrapper-component>
</div>
<div class="col-12 col-md-auto d-flex justify-content-center align-items-center">
<button type="button" class="btn btn-lg btn-primary fs-11 w-100" @click="submitSearch()">Download</button>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import componentHandler from "../../../general/mixins/componentHandler";
import { required, minValue} from "vuelidate/lib/validators";
import {VMoney} from 'v-money'
export default {
data(){
return {
parameters: {
startDate: '',
endDate: '',
supplier: null,
supplierIds: [],
supplierNames: []
},
}
},
validations: {
parameters: {
startDate: {
required
},
endDate: {
required
},
supplierIds: {
required
},
supplierNames: {
required
},
}
},
methods: {
submitSearch(){
if(!this.validate()){ return; }
var supplierIds = JSON.stringify(this.parameters.supplierIds);
window.open(route('export.transactions.booking')+'?startDate='+this.parameters.startDate+'&endDate='+this.parameters.endDate+'&supplierIds='+supplierIds, '_blank');
},
updateList(supplierList){
let supplierIds = [];
let supplierNames = [];
supplierList.forEach(function(supplier) {
supplierIds.push(supplier.id);
supplierNames.push(supplier.name);
});
this.parameters.supplierIds = supplierIds;
this.parameters.supplierNames = supplierNames;
},
},
mixins: [componentHandler]
};
</script>
@@ -0,0 +1,43 @@
<template>
<div class="row">
<div class="col b-a b-grey" :class="{'b-gray': !selected, 'b-primary': selected, 'bg-primary-lighter': selected}">
<div class="row">
<div class="col padding-20">
<div class="row align-items-center">
<div class="col-auto pointer align-items-center" @click="selectSupplier()">
<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.name }}</h5>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import componentHandler from "../../../general/mixins/componentHandler";
export default {
props: {
selectedSupplier: {
type: Array,
required: false,
}
},
data(){
return {
selected: false
}
},
methods: {
selectSupplier(){
this.selected = !this.selected;
this.$emit('input', this.item);
}
},
mixins: [componentHandler]
};
</script>
@@ -0,0 +1,59 @@
<template>
<div class="row bg-white padding-40">
<div class="col">
<loading-component style="height: 300px; top: 0;" key="1" color="success" v-show="isLoading" ></loading-component>
<div class="row justify-content-center" v-show="!isLoading">
<div class="col">
<div class="row m-b-20">
<div class="col">
<h3 class="all-caps text-center">Please select the supplier.</h3>
</div>
</div>
<div class="row m-b-20">
<div class="col">
<list-component section="supplierListSection" :endpoint="route('api.company.list')" :options="{business_type: 3}">
<template slot="list" slot-scope="{data}">
<div class="row">
<div class="col">
<select-individual-supplier-form-component :data="data" :selectedSupplier="selectedSupplier" v-on:input="updateList($event)"></select-individual-supplier-form-component>
</div>
</div>
</template>
</list-component>
</div>
</div>
<div class="row">
<div class="col">
<div class="btn btn-sm btn-success btn-block b-rad-none" @click="submitForm()">Confirm</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import componentHandler from "../../../general/mixins/componentHandler";
import ModalFormHandler from '../../../general/mixins/modalFormHandler';
import { required, minValue} from "vuelidate/lib/validators";
import {VMoney} from 'v-money'
export default {
data(){
return {
selectedSupplier: [],
}
},
methods: {
submitForm() {
this.$emit('input', this.selectedSupplier);
this.closeModal();
},
updateList(supplier){
this.selectedSupplier.includes(supplier) ? this.selectedSupplier.splice(this.selectedSupplier.indexOf(supplier), 1) : this.selectedSupplier.push(supplier);
},
},
mixins: [componentHandler, ModalFormHandler]
};
</script>
@@ -12,7 +12,7 @@
<div class="btn btn-xs btn-outline-primary btn-block text-left b-rad-none p-t-0 p-b-0 p-l-15 p-r-15" @click="selectedSupplier.status = !selectedSupplier.status">
<div class="row">
<div class="col p-t-5 p-b-5 fs-9">
{{selectedSupplier.name}}
{{selectedSupplier.name}} - {{selectedSupplier.reference}}
</div>
<div class="col-auto b-l b-success">
<div class="row h-100 align-items-center">
@@ -31,7 +31,7 @@
<div class="col b-b b-grey p-t-10 p-b-10 pointer hover-t-10 p-b-10" :class="[{'bg-primary-light': selectedSupplier.id === supplier.id}, {'text-white': selectedSupplier.id === supplier.id}, {'hover-primary': selectedSupplier.id !== supplier.id}, {'pointer': selectedSupplier.id !== supplier.id}]" @click="updateSupplier(supplier)">
<div class="row align-items-center justify-content-center">
<div class="col">
<div class="font-heading fs-10">{{supplier.name}}</div>
<div class="font-heading fs-10">{{supplier.name}} - {{supplier.reference}}</div>
</div>
</div>
</div>
@@ -123,28 +123,7 @@
</button>
</div>
<modal-component small type="rejectDocument">
<div class="row">
<div class="col text-center">
<div class="row">
<div class="col text-center">
<div class="row m-b-20">
<div class="col">
<h5 class="all-caps">Reject Document</h5>
<div class="fs-11">Are you sure you want to reject this customer's identification?</div>
</div>
</div>
<div class="row">
<div class="col p-r-5">
<div data-dismiss="modal" class="btn btn-sm btn-default bg-master-lighter btn-block b-rad-none">Cancel</div>
</div>
<div class="col p-l-5">
<div data-dismiss="modal" class="btn btn-sm btn-danger btn-block b-rad-none" @click="approveDocument('reject')">Reject</div>
</div>
</div>
</div>
</div>
</div>
</div>
<reject-identification-verification-form-component :section="section" :data="item"></reject-identification-verification-form-component>
</modal-component>
<div class="col no-padding ml-auto">
<button class="btn btn-md btn-block btn-success b-rad-none p-t-10 p-b-10 requestModal" data-type="approveDocument">
@@ -0,0 +1,78 @@
<template>
<div class="row">
<div class="col">
<div class="row justify-content-center">
<div class="col-auto text-center">
<div class="row">
<div class="col text-center">
<div class="row">
<div class="col">
<h5 class="all-caps">Reject Document</h5>
<div class="fs-11">Are you sure you want to reject this customer's identification?</div>
</div>
</div>
<div class="row text-left margin-auto m-t-10 m-b-10">
<div class="col">
<span class="text-danger fs-9">{{ error }}</span>
<div class="fs-11">Reason: </div>
<div class="row">
<div class="col fs-11">
<div class="b-a padding-5 w-100 m-b-5 pointer b-grey muted" :class="{'b-primary': rejectRemark === rejectRemarkItem, 'text-primary': rejectRemark === rejectRemarkItem}" v-for="rejectRemarkItem in rejectRemarkArray" @click="chooseRejectRemark(rejectRemarkItem)">{{ rejectRemarkItem }}</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col p-r-5">
<div data-dismiss="modal" class="btn btn-sm btn-default bg-master-lighter btn-block b-rad-none">Cancel</div>
</div>
<div class="col p-l-5">
<div class="btn btn-sm btn-danger btn-block b-rad-none" @click="approveDocument('reject')">Reject</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import componentHandler from '../../../general/mixins/componentHandler';
import modalFormHandler from '../../../general/mixins/modalFormHandler';
import { required } from "vuelidate/lib/validators";
export default {
data(){
return {
rejectRemark: null,
rejectRemarkArray: null,
documentType: this.data.document_type === 'IDENTITY_CARD' ? 'IC' : 'SSM',
error: null,
}
},
validations: {
rejectRemark: { required },
},
created(){
this.rejectRemarkArray = [
this.documentType + ' not clear',
this.documentType + ' name different with registration name',
'Wrong Document uploaded',
'Non-Malaysian ' + this.documentType + ' Uploaded',
this.documentType + ' not Genuine'
];
},
methods: {
approveDocument(status){
this.rejectRemark === null ? this.error = 'Please choose a remark.' : null;
this.isLoading = true;
this.submit(this.route('api.company.identification.approval', this.item.owner.id, this.item.id, status), 'put', 'identificationVerificationSection', true, true);
},
chooseRejectRemark(remark) {
this.rejectRemark = remark;
}
},
mixins: [componentHandler, modalFormHandler]
}
</script>
@@ -18,7 +18,7 @@
</div>
<div class="row">
<div class="col">
<div class="font-heading all-caps fs-10">{{item.name}}</div>
<div class="font-heading all-caps fs-10">{{item.name}} - {{item.reference}}</div>
</div>
</div>
</div>
@@ -61,6 +61,18 @@
<div class="col-auto">
<div class="row">
<div class="col">
<button class="btn btn-xs btn-outline-primary b-rad-none m-r-5 requestModal" data-type="activateSupplierModal" v-if="item.status === 5">
Activate
</button>
<modal-component type="activateSupplierModal">
<activate-supplier-form-component :data="item" section="suppliersSection"></activate-supplier-form-component>
</modal-component>
<button class="btn btn-xs btn-outline-danger b-rad-none m-r-5 requestModal" data-type="suspendSupplierModal" v-if="item.status !== 5">
Suspend
</button>
<modal-component type="suspendSupplierModal">
<suspend-supplier-form-component :data="item" section="suppliersSection"></suspend-supplier-form-component>
</modal-component>
<button class="btn btn-xs btn-outline-warning b-rad-none m-r-5 requestModal" data-type="editServiceCharge">
<i class="fa fa-pencil"></i>
</button>
@@ -0,0 +1,45 @@
<template>
<div class="row text-center">
<div class="col">
<loading-component style="height: 300px; top: 0;" key="1" color="success" v-show="isLoading" ></loading-component>
<div class="row justify-content-center" v-show="!isLoading">
<div class="col">
<div class="row m-b-20">
<div class="col">
<h3 class="all-caps">Are you Sure?</h3>
<div class="fs-11">Are you sure you want to activate this Supplier?</div>
</div>
</div>
<div class="row">
<div class="col p-r-5">
<div class="btn btn-sm btn-success btn-block b-rad-none" data-dismiss="modal">Cancel</div>
</div>
<div class="col p-l-5">
<div class="btn btn-sm btn-danger btn-block b-rad-none" @click="submitForm()">Confirm</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import componentHandler from '../../../general/mixins/componentHandler';
import ModalFormHandler from '../../../general/mixins/modalFormHandler';
export default {
props: {
section: {
default: 'suppliersSection'
}
},
methods: {
submitForm() {
this.parameters.status = 1;
this.submit(this.route('api.company.status.update', this.data.id), 'put', this.section, true, false);
}
},
mixins: [componentHandler, ModalFormHandler]
}
</script>
@@ -22,6 +22,14 @@
</validation-wrapper-component>
</div>
</div>
<div class="row m-b-10">
<div class="col">
<validation-wrapper-component :validator="$v.parameters.company_reference">
<label>Reference</label>
<input type="text" class="form-control" v-model="parameters.company_reference">
</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>
@@ -43,6 +51,7 @@
return {
parameters: {
company_name: '',
company_reference: '',
}
}
},
@@ -50,7 +59,10 @@
parameters: {
company_name: {
required: true
}
},
company_reference: {
required: true
},
}
},
mixins: [ModalFormHandler]
@@ -0,0 +1,45 @@
<template>
<div class="row text-center">
<div class="col">
<loading-component style="height: 300px; top: 0;" key="1" color="success" v-show="isLoading" ></loading-component>
<div class="row justify-content-center" v-show="!isLoading">
<div class="col">
<div class="row m-b-20">
<div class="col">
<h3 class="all-caps">Are you Sure?</h3>
<div class="fs-11">Are you sure you want to suspend this Supplier?</div>
</div>
</div>
<div class="row">
<div class="col p-r-5">
<div class="btn btn-sm btn-success btn-block b-rad-none" data-dismiss="modal">Cancel</div>
</div>
<div class="col p-l-5">
<div class="btn btn-sm btn-danger btn-block b-rad-none" @click="submitForm()">Confirm</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import componentHandler from '../../../general/mixins/componentHandler';
import ModalFormHandler from '../../../general/mixins/modalFormHandler';
export default {
props: {
section: {
default: 'suppliersSection'
}
},
methods: {
submitForm() {
this.parameters.status = 5;
this.submit(this.route('api.company.status.update', this.data.id), 'put', this.section, true, false);
}
},
mixins: [componentHandler, ModalFormHandler]
}
</script>
@@ -0,0 +1,105 @@
<template>
<div class="row h-100">
<div class="col">
<div class="btn-group h-100">
<div class="d-none d-md-flex row align-items-center justify-content-center b-a b-thick h-100 pointer" :class="{'b-info' : isClicked}" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" @click="openNotification()" style="border-color: #ffffff3d">
<div class="col p-r-10 p-l-10">
<i class="fa fa-bell fs-12" :class="{'text-info' : isClicked, 'text-primary-lighter' : !isClicked}"></i>
</div>
</div>
<i class="fa fa-bell fs-18 d-md-none" :class="{'text-info' : isClicked, 'text-white' : !isClicked}" style="margin-right: -10px;" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" @click="openNotification()"></i>
<div class="b-rad-md dropdown-menu dropdown-menu-right p-l-15 p-b-15 p-r-15 p-t-0" style="height: 100vh; width:100vw; background: transparent !important; box-shadow: none!important;" @click="openNotification()">
<div class="container-fluid container-fixed-lg" style="position: relative; background: transparent; height: 100vh; left: 0;">
<div class="row shadow" style="width: 320px; position: absolute; top: 50px; right: 30px; background: white!important;">
<div class="col">
<div class="row">
<div class="bg-master-lighter col p-l-10 p-l-10 p-t-10 bg-white text-center">
<p>Notification Center</p>
</div>
</div>
<loading-component style="height: 200px; top: 0;" key="1" color="primary" v-show="isLoading"></loading-component>
<div class="row" :class="{'h-100' : notificationsLength >= 5}" v-show="!isLoading" style="max-height: 400px; ">
<div class="col page-container overflow-hidden">
<div class="row b-b b-grey bg-primary-lighter-hover pointer w-100 m-l-0 m-r-0" v-for="(notification, index) in notifications">
<div class="col-auto justify-content-center align-items-center d-flex hide">
<div>
<i class="fa fa-check-circle fs-20 p-l-5 text-success"></i>
</div>
</div>
<div class="col padding-10 p-l-15 p-r-15">
<p class="bold m-b-5 lh-16">{{ notification.title }}</p>
<p class="fs-9 m-b-0 lh-10">{{ notification.description }}</p>
<p class="fs-9 m-b-0 m-t-10 lh-10">{{ notification.long_ago }}</p>
</div>
<div class="col-auto justify-content-center align-items-center d-none" :class="{'d-flex' : index === 0}">
<div>
<i class="fa fa-circle fs-10 text-primary"></i>
</div>
</div>
</div>
</div>
</div>
<div class="row text-center m-t-50 m-b-50" v-if="notificationsLength === 0" v-show="!isLoading">
<div class="col">
<div class="row align-items-center justify-content-center hint-text">
<div class="col-4 hint-text"><img src="/images/not-found-illustration.png" class="w-100 hint-text"/></div>
</div>
<div class="row text-center">
<div class="col">
<div class="row m-t-20">
<div class="col">
<p class="all-caps no-margin fs-11" style="letter-spacing: 2px;">Nothing To Show Here</p>
</div>
</div>
<div class="row m-t-5 align-items-center justify-content-center hide">
<div class="col">
<small class="fs-9 muted all-caps font-lato" style="letter-spacing: 2px">There is no results found.</small>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row b-t muted">
<div class="col p-l-10 p-l-10 p-t-10 m-b-10 bg-white text-center">
<a href="#">View All Notifications</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import ModalFormHandler from '../../../general/mixins/modalFormHandler';
export default {
data(){
return {
isLoading: true,
error: '',
notifications: null,
isClicked: false,
notificationsLength: 0,
}
},
methods: {
openNotification(){
this.isClicked === false ? this.fetchNotification() : '';
this.isClicked = !this.isClicked;
},
fetchNotification(){
this.isLoading = true;
this.submit(route('notifications.list'), 'get', this.section, false, false)
},
successHandler(response){
this.isLoading = false;
this.notifications = response.payload.data;
this.notificationsLength = response.payload.data.length;
},
},
mixins: [ModalFormHandler]
}
</script>
@@ -2,6 +2,7 @@
@section('inner_content')
<div class="row">
<div class="col p-t-15 p-b-15">
<export-booking-transaction-form-component></export-booking-transaction-form-component>
<div class="row">
<div class="col-4">
<div class="row tabsContainer">
+16
View File
@@ -40,6 +40,22 @@
</div>
</div>
</div>
<div class="col-12 col-md-4">
<div class="row m-b-15 p-b-10 b-b b-grey">
<div class="col">
<small class="all-caps muted fs-10">Transaction Groups</small>
</div>
</div>
<div class="row">
<div class="col">
<list-component key="2" section="transactionGroupsListSection" :options="{'per_page': 5}" :endpoint="route('api.transaction.group.list')">
<template slot="list" slot-scope="{data}">
<transaction-group-component section="transactionGroupsListSection" :data="data"></transaction-group-component>
</template>
</list-component>
</div>
</div>
</div>
</div>
</div>
</div>
@@ -3,7 +3,7 @@
<br>
<htmlpageheader name="page-header">
<br><br>
<div class="separator"><strong><i>{{ $invoice_transaction->bill_no }}</i></strong></div>
<div class="separator"><strong><i>{{ $transaction->bill_no }}</i></strong></div>
</htmlpageheader>
<table>
@@ -30,10 +30,10 @@
</strong>
</div>
<div class="number">EDO: {{ $invoice_transaction->bill_no }}</div>
<div class="number">EDO: {{ $transaction->bill_no }}</div>
<div class="ref">REF: {{ $invoice_transaction->booking->marking }}</div>
<div class="ref">REF: {{ $transaction->booking->marking }}</div>
<div class="date">Date: {{ $po_order_transaction->created_at }}</div>
<div>&nbsp;</div>
</div>
@@ -93,19 +93,19 @@
<td class="description">{{ $transaction_detail->product_name }}</td>
<td width="10%" class="center top">{{ $transaction_detail->quantity }}</td>
<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) }}
@if($transaction->booking()->first()->fix_currency_id !== 1)
{{ number_format( (1/$transaction->currency_rate) * $transaction_detail->price, 2) }}
@else
{{ number_format($transaction_detail->price, 2) }}
@endif
</td>
<td width="20%" class="right top">
@if($invoice_transaction->booking()->first()->fix_currency_id !== 1)
@if($transaction->booking()->first()->fix_currency_id !== 1)
{{ number_format((float)number_format( (1/$invoice_transaction->currency_rate) * $transaction_detail->price, 2,'.','')*$transaction_detail->quantity,2) }}
{{ number_format((float)number_format( (1/$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,'.','');
$subtotal += number_format((float)number_format( (1/$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) }}
@@ -130,35 +130,35 @@
<td colspan="4"></td>
<td class="right">Service Charges</td>
<td class="right">
{{ number_format($invoice_transaction->service_charge, 2) }}
{{ number_format($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) }}
@if($transaction->booking()->first()->fix_currency_id !== 1)
{{ number_format((float)number_format( (1/$transaction->currency_rate) * $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) }}
{{ number_format((float)number_format($transaction->amount, 2,'.','') - (float)number_format($subtotal, 2,'.',''),2) }}
@endif
</td>
</tr>
@if($invoice_transaction->tax > 0)
@if($transaction->tax > 0)
<tr class="billingcharges">
<td colspan="4"></td>
<td class="right">Tax</td>
<td class="right">{{ number_format($invoice_transaction->tax, 2) }}</td>
<td class="right">{{ number_format($transaction->tax, 2) }}</td>
</tr>
@endif
<tr>
<td colspan="4"></td>
<td class="right middle">Total</td>
<td class="total right middle">
@if($invoice_transaction->booking()->first()->fix_currency_id !== 1)
{{ number_format( ((1/$invoice_transaction->currency_rate) * $invoice_transaction->amount) + $invoice_transaction->service_charge + $invoice_transaction->tax, 2) }}
@if($transaction->booking()->first()->fix_currency_id !== 1)
{{ number_format( ((1/$transaction->currency_rate) * $transaction->amount) + $transaction->service_charge + $transaction->tax, 2) }}
@else
{{ number_format($invoice_transaction->amount + $invoice_transaction->service_charge + $invoice_transaction->tax, 2) }}
{{ number_format($transaction->amount + $transaction->service_charge + $transaction->tax, 2) }}
@endif
</td>
</tr>
+16 -16
View File
@@ -3,7 +3,7 @@
<br>
<htmlpageheader name="page-header">
<br><br>
<div class="separator"><strong><i>{{ $invoice_transaction->bill_no }}</i></strong></div>
<div class="separator"><strong><i>{{ $transaction->bill_no }}</i></strong></div>
</htmlpageheader>
<table>
<tr>
@@ -29,7 +29,7 @@
</strong>
</div>
<div class="number">EI#: {{ $invoice_transaction->bill_no }}</div>
<div class="number">EI#: {{ $transaction->bill_no }}</div>
<div class="ref">Ref# {{ $po_order_transaction->booking->marking }}</div>
@@ -92,19 +92,19 @@
<td class="description">{{ $transaction_detail->product_name }}</td>
<td width="10%" class="center top">{{ $transaction_detail->quantity }}</td>
<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) }}
@if($transaction->booking()->first()->fix_currency_id !== 1)
{{ number_format( (1/$transaction->currency_rate) * $transaction_detail->price, 2) }}
@else
{{ number_format($transaction_detail->price, 2) }}
@endif
</td>
<td width="20%" class="right top">
@if($invoice_transaction->booking()->first()->fix_currency_id !== 1)
@if($transaction->booking()->first()->fix_currency_id !== 1)
{{ number_format((float)number_format( (1/$invoice_transaction->currency_rate) * $transaction_detail->price, 2,'.','')*$transaction_detail->quantity,2) }}
{{ number_format((float)number_format( (1/$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,'.','');
$subtotal += number_format((float)number_format( (1/$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) }}
@@ -129,35 +129,35 @@
<td colspan="4"></td>
<td class="right">Service Charges</td>
<td class="right">
{{ number_format($invoice_transaction->service_charge, 2) }}
{{ number_format($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) }}
@if($transaction->booking()->first()->fix_currency_id !== 1)
{{ number_format((float)number_format( (1/$transaction->currency_rate) * $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) }}
{{ number_format((float)number_format($transaction->amount, 2,'.','') - (float)number_format($subtotal, 2,'.',''),2) }}
@endif
</td>
</tr>
@if($invoice_transaction->tax > 0)
@if($transaction->tax > 0)
<tr class="billingcharges">
<td colspan="4"></td>
<td class="right">Tax</td>
<td class="right">{{ number_format($invoice_transaction->tax, 2) }}</td>
<td class="right">{{ number_format($transaction->tax, 2) }}</td>
</tr>
@endif
<tr>
<td colspan="4"></td>
<td class="right middle">Total</td>
<td class="total right middle">
@if($invoice_transaction->booking()->first()->fix_currency_id !== 1)
{{ number_format( ((1/$invoice_transaction->currency_rate) * $invoice_transaction->amount) + $invoice_transaction->service_charge + $invoice_transaction->tax, 2) }}
@if($transaction->booking()->first()->fix_currency_id !== 1)
{{ number_format( ((1/$transaction->currency_rate) * $transaction->amount) + $transaction->service_charge + $transaction->tax, 2) }}
@else
{{ number_format($invoice_transaction->amount + $invoice_transaction->service_charge + $invoice_transaction->tax, 2) }}
{{ number_format($transaction->amount + $transaction->service_charge + $transaction->tax, 2) }}
@endif
</td>
</tr>
@@ -97,19 +97,19 @@
<td class="description">{{ $transaction_detail->product_name }}</td>
<td width="10%" class="center top">{{ $transaction_detail->quantity }}</td>
<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) }}
@if($transaction->booking()->first()->fix_currency_id !== 1)
{{ number_format( (1/$transaction->currency_rate) * $transaction_detail->price, 2) }}
@else
{{ number_format($transaction_detail->price, 2) }}
@endif
</td>
<td width="20%" class="right top">
@if($invoice_transaction->booking()->first()->fix_currency_id !== 1)
@if($transaction->booking()->first()->fix_currency_id !== 1)
{{ number_format((float)number_format( (1/$invoice_transaction->currency_rate) * $transaction_detail->price, 2,'.','')*$transaction_detail->quantity,2) }}
{{ number_format((float)number_format( (1/$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,'.','');
$subtotal += number_format((float)number_format( (1/$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) }}
@@ -134,35 +134,35 @@
<td colspan="4"></td>
<td class="right">Service Charges</td>
<td class="right">
{{ number_format($invoice_transaction->service_charge, 2) }}
{{ number_format($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) }}
@if($transaction->booking()->first()->fix_currency_id !== 1)
{{ number_format((float)number_format( (1/$transaction->currency_rate) * $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) }}
{{ number_format((float)number_format($transaction->amount, 2,'.','') - (float)number_format($subtotal, 2,'.',''),2) }}
@endif
</td>
</tr>
@if($invoice_transaction->tax > 0)
@if($transaction->tax > 0)
<tr class="billingcharges">
<td colspan="4"></td>
<td class="right">Tax</td>
<td class="right">{{ number_format($invoice_transaction->tax, 2) }}</td>
<td class="right">{{ number_format($transaction->tax, 2) }}</td>
</tr>
@endif
<tr>
<td colspan="4"></td>
<td class="right middle">Total</td>
<td class="total right middle">
@if($invoice_transaction->booking()->first()->fix_currency_id !== 1)
{{ number_format( ((1/$invoice_transaction->currency_rate) * $invoice_transaction->amount) + $invoice_transaction->service_charge + $invoice_transaction->tax, 2) }}
@if($transaction->booking()->first()->fix_currency_id !== 1)
{{ number_format( ((1/$transaction->currency_rate) * $transaction->amount) + $transaction->service_charge + $transaction->tax, 2) }}
@else
{{ number_format($invoice_transaction->amount + $invoice_transaction->service_charge + $invoice_transaction->tax, 2) }}
{{ number_format($transaction->amount + $transaction->service_charge + $transaction->tax, 2) }}
@endif
</td>
</tr>
@@ -6,16 +6,16 @@
<table width="100%" style="border-bottom: 1px solid black;">
<tr>
<td style="text-align: center; color: red; text-transform: uppercase; font-weight: bold; font-size: 18px; padding-bottom: 5px;">
@if(in_array($supplier_deliver_order_transaction->issuer, [2, 1921]))
@if(in_array($transactions->issuer, [2, 1921]))
Atvantic Import & Export Snd. Bhd (1309816-P)
@endif
@if(in_array($supplier_deliver_order_transaction->issuer, [1937, 1970]))
@if(in_array($transactions->issuer, [1937, 1970]))
BK Gemilang Sdn Bhd (1403513-U)
@endif
@if(in_array($supplier_deliver_order_transaction->issuer, [2165, 2185]))
@if(in_array($transactions->issuer, [2165, 2185]))
YSN SOLUTION TRADING SDN BHD (1393892-D)
@endif
@if(in_array($supplier_deliver_order_transaction->issuer, [2210]))
@if(in_array($transactions->issuer, [2210]))
RACK SOLUTION INDUSTRIES SDN BHD (954723-W)
@endif
</td>
@@ -29,8 +29,8 @@
<strong>Delivery Order</strong>
</td>
<td class="document-detail">
PO#: {{ $supplier_deliver_order_transaction->bill_no }} <br>
Ref#: {{ $supplier_deliver_order_transaction->booking->marking }} <br>
PO#: {{ $transactions->bill_no }} <br>
Ref#: {{ $transactions->booking->marking }} <br>
Date: {{ $po_order_transaction->created_at }}
</td>
</tr>
@@ -93,19 +93,19 @@
<td class="description">{{ $transaction_detail->product_name }}</td>
<td width="10%" class="center top">{{ $transaction_detail->quantity }}</td>
<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) }}
@if($transactions->booking()->first()->fix_currency_id !== 1)
{{ number_format( (1/$transactions->currency_rate) * $transaction_detail->price, 2) }}
@else
{{ number_format($transaction_detail->price, 2) }}
@endif
</td>
<td width="20%" class="right top">
@if($supplier_deliver_order_transaction->booking()->first()->fix_currency_id !== 1)
@if($transactions->booking()->first()->fix_currency_id !== 1)
{{ number_format((float)number_format( (1/$supplier_deliver_order_transaction->currency_rate) * $transaction_detail->price, 2,'.','')*$transaction_detail->quantity,2) }}
{{ number_format((float)number_format( (1/$transactions->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,'.','');
$subtotal += number_format((float)number_format( (1/$transactions->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) }}
@@ -130,10 +130,10 @@
<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) }}
@if($transactions->booking()->first()->fix_currency_id !== 1)
{{ number_format((float)number_format( (1/$transactions->currency_rate) * $transactions->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) }}
{{ number_format((float)number_format($transactions->amount, 2,'.','') - (float)number_format($subtotal, 2,'.',''),2) }}
@endif
</td>
</tr>
@@ -141,10 +141,10 @@
<td colspan="4"></td>
<td class="right middle">Total</td>
<td class="total 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) }}
@if($transactions->booking()->first()->fix_currency_id !== 1)
{{ number_format( ((1/$transactions->currency_rate) * $transactions->amount), 2) }}
@else
{{ number_format($supplier_deliver_order_transaction->amount, 2) }}
{{ number_format($transactions->amount, 2) }}
@endif
</td>
</tr>
+8 -11
View File
@@ -65,15 +65,8 @@
</div>
</div>
</div>
<div class="col-auto p-r-30">
<div class="col-auto pr-1 pr-md-4">
<div class="row no-margin">
<div class="col-auto m-r-5 hide">
<div class="row align-items-center justify-content-center b-a b-thick h-100" style="border-color: #ffffff3d">
<div class="col p-r-10 p-l-10">
<i class="fa fa-bell fs-12 text-primary-lighter"></i>
</div>
</div>
</div>
<div class="col-auto m-r-20 d-none d-md-inline">
<div class="row align-items-center p-t-5 p-b-5 b-a b-thick d-inline-flex h-100" style="border-color: #ffffff3d">
<div class="col-auto">
@@ -86,6 +79,9 @@
</div>
</div>
</div>
<div class="col-auto m-r-5">
<notification-section-component section="section"></notification-section-component>
</div>
<div class="col-auto m-r-5 d-none d-md-inline">
<a href="{{route('settings')}}">
<div class="row align-items-center justify-content-center b-a b-thick h-100" style="border-color: #ffffff3d">
@@ -98,11 +94,12 @@
<div class="col-12 col-md-auto text-right d-none d-md-inline">
<log-out-form-component></log-out-form-component>
</div>
<div class="col-auto d-md-none pointer" @click="$store.dispatch('toggleSection', {name: 'sideMenu', status: true})">
<i class="fa fa-bars fs-18 text-white"></i>
</div>
</div>
</div>
<div class="col-auto d-md-none pointer" @click="$store.dispatch('toggleSection', {name: 'sideMenu', status: true})">
<i class="fa fa-bars fs-18 text-white"></i>
</div>
</div>
</div>
</div>
+1
View File
@@ -7,6 +7,7 @@ Route::group(['prefix' => 'company', 'as' => 'company.', 'namespace' => 'Compani
Route::get('/list', 'ListCompaniesController@list')->name('list');
Route::post('/create', 'CreateCompanyController@create')->name('create');
Route::put('/update/{id}', 'UpdateCompanyController@update')->name('update');
Route::put('update/{id}/status', 'UpdateCompanyStatusController@update')->name('status.update');
Route::delete('/delete/{id}', 'DeleteCompanyController@destroy')->name('delete');
Route::put('/update/debtor/{id}', 'UpdateCompanyDebtorController@update')->name('delete');
+6
View File
@@ -22,4 +22,10 @@ Route::group(['prefix' => 'transactions', 'namespace' => 'Transactions', 'as' =>
Route::get('/company/{id}/account/balance', 'FetchCompanyAccountBalanceController@fetch')->name('company.account.balance');
Route::get('/bank/{id}/account/balance', 'FetchBankAccountBalanceController@fetch')->name('bank.account.balance');
Route::group(['prefix' => 'groups', 'as' => 'group.'], function () {
Route::get('/list', 'ListGroupsController@list')->name('list');
Route::delete('/{id}/delete', 'DeleteGroupController@delete')->name('delete');
Route::put('/{id}/update', 'UpdateGroupController@update')->name('update');
});
});
+4 -1
View File
@@ -156,6 +156,7 @@ Route::get('/export/transactions/f614e339d7058904a831aad742e24d55', 'Exports\Exp
Route::get('/export/null-debtor/f614e339d7058904a831aad742e24d55', 'Exports\ExportCustomersToExcelController@nullDebtor')->name('newDebtor.export');
Route::get('/export/payment-transactions/f614e339d7058904a831aad742e24d55', 'Exports\ExportCustomersToExcelController@paymentTransactions')->name('paymentTransactions.export');
Route::get('/export/wallet-transactions/f614e339d7058904a831aad742e24d55', 'Exports\ExportCustomersToExcelController@walletTransactions')->name('walletTransactions.export');
Route::get('/export/booking-transactions', 'Exports\ExportCustomersToExcelController@bookingTransactions')->name('export.transactions.booking');
Route::get('/products', function (\App\Classes\Modules\Exports\Services\ExportsProducts $exportsProducts) {
$bookings = Booking::where(function($query){
@@ -189,4 +190,6 @@ Route::get('purchase/sensitive/', function(Request $request){
}
});
Route::get('/transactions/supplier/{id}/mock_up', 'Transactions\DownloadMockUpWhiteFormPdfController@download')->name('whiteForm.mockUp');
Route::get('/transactions/supplier/{id}/mock_up', 'Transactions\DownloadMockUpWhiteFormPdfController@download')->name('whiteForm.mockUp');
Route::get('/notifications/list', 'Notifications\ListNotificationsController@list')->name('notifications.list');