mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 12:34:18 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0298eb946f | |||
| 70fb35e37c | |||
| 1a30877ca9 | |||
| 569a22c0db |
@@ -1,20 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class Receiver implements Filter
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Builder $builder
|
||||
* @param $value
|
||||
* @return Builder|mixed
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->where('receiver', '=', $value);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Accounts\ControllersLogic;
|
||||
|
||||
use App\Classes\Modules\Accounts\Services\FetchesUser;
|
||||
use App\Classes\Modules\Accounts\Standards\Rules\CanFetchUser;
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Http\Resources\UserCompanyResource;
|
||||
use ErrorException;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class FetchUserByEmailLogic extends AbstractControllerLogic
|
||||
{
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function notification():array {
|
||||
return [
|
||||
'title' => 'Fetch Users',
|
||||
'message' => 'You have successfully retrieved the user by email'
|
||||
];
|
||||
}
|
||||
|
||||
/** @var CanFetchUser */
|
||||
private $canFetchUser;
|
||||
|
||||
/** @var FetchesUser */
|
||||
private $fetchesUser;
|
||||
|
||||
/**
|
||||
* FetchUserByEmailLogic constructor.
|
||||
* @param CanFetchUser $canFetchUser
|
||||
* @param FetchesUser $fetchessUser
|
||||
*/
|
||||
public function __construct(CanFetchUser $canFetchUser, FetchesUser $fetchesUser)
|
||||
{
|
||||
$this->canFetchUser = $canFetchUser;
|
||||
$this->fetchesUser = $fetchesUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return JsonResponse
|
||||
* @throws ErrorException
|
||||
*/
|
||||
public function logic(Request $request) : JsonResponse
|
||||
{
|
||||
try {
|
||||
|
||||
$this->canFetchUser->passes();
|
||||
|
||||
$query = $this->fetchesUser->execute(['email' => $request->route('email')]);
|
||||
|
||||
return $this->resourceResponse(new UserCompanyResource($query));
|
||||
|
||||
} catch (\Exception $exception){
|
||||
throw new ErrorException($exception->getMessage(), $exception->getCode());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Companies\ControllersLogic;
|
||||
|
||||
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\Transactions\Services\ListsTransactions;
|
||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use App\Http\Resources\TransactionResource;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ListCompanyModuleInvoicesLogic extends AbstractControllerLogic
|
||||
{
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function notification(): array
|
||||
{
|
||||
return [
|
||||
'title' => 'Retrieved Company Module Invoices',
|
||||
'message' => 'You have successfully retrieved a list of Invoices'
|
||||
];
|
||||
}
|
||||
|
||||
/** @var ListsTransactions */
|
||||
private $listsTransactions;
|
||||
|
||||
/**
|
||||
* ListCompanyModuleInvoicesLogic constructor.
|
||||
* @param ListsTransactions $listsTransactions
|
||||
*/
|
||||
public function __construct(ListsTransactions $listsTransactions)
|
||||
{
|
||||
$this->listsTransactions = $listsTransactions;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return JsonResponse
|
||||
* @throws \App\Classes\Exceptions\AccessForbiddenException
|
||||
* @throws \App\Classes\Exceptions\MalformedRequestException
|
||||
* @throws \App\Classes\Exceptions\RequestValidationException
|
||||
*/
|
||||
public function logic(Request $request): JsonResponse
|
||||
{
|
||||
$filterArray = [
|
||||
"per_page" => 10,
|
||||
"order_by" => (object)[
|
||||
"column" => 'id',
|
||||
"DESC" => true,
|
||||
],
|
||||
"status_in" => [2],
|
||||
"receiver" => intval($request->route('company_module_id')),
|
||||
"type" => TransactionType::SHIPPING_INVOICE
|
||||
];
|
||||
|
||||
// $this->canListTransactions->passes();
|
||||
|
||||
$query = $this->listsTransactions->execute($filterArray);
|
||||
|
||||
return $this->collectionResponse(TransactionResource::collection($query));
|
||||
}
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Exports\Services;
|
||||
|
||||
use App\Classes\ValueObjects\Constants\PackingListType;
|
||||
use App\Models\CompanyModule;
|
||||
use App\Models\Company;
|
||||
use App\Models\PackingList;
|
||||
use Carbon\Carbon;
|
||||
use Maatwebsite\Excel\Concerns\Exportable;
|
||||
use Maatwebsite\Excel\Concerns\FromCollection;
|
||||
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadingRow;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
use Maatwebsite\Excel\Concerns\WithMapping;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ExportsCustomerTotalOrderByYear implements FromCollection, WithHeadings, WithHeadingRow, WithMapping, ShouldAutoSize
|
||||
{
|
||||
use Exportable;
|
||||
|
||||
private $request;
|
||||
|
||||
public function __construct(Request $request)
|
||||
{
|
||||
$this->request = $request;
|
||||
}
|
||||
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
'CompanyId',
|
||||
'CompanyName',
|
||||
'CompanyReference',
|
||||
'TotalCbm'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Support\Collection|mixed
|
||||
*/
|
||||
public function collection()
|
||||
{
|
||||
$packingLists = PackingList::where('type', PackingListType::SHIPPING_PACKING_LIST)->whereHas('containers', function($container){
|
||||
return $container->where('loading_date', '>=', Carbon::parse('01-01-' . $this->request->route('year')))
|
||||
->where('loading_date', '<=', Carbon::parse('31-12-' . $this->request->route('year')));
|
||||
})->get();
|
||||
|
||||
$packingLists = $packingLists->groupBy(function ($packingList){
|
||||
return $packingList->owner->company_module_id;
|
||||
})->sortByDesc(function($companyModule){
|
||||
return $companyModule->sum(function($packingList){
|
||||
return $packingList->packages->sum(function ($package){
|
||||
return (($package->width / 100) * ($package->height / 100) * ($package->length / 100)) * $package->quantity;
|
||||
});
|
||||
});
|
||||
})->take(10);
|
||||
return $packingLists;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $row
|
||||
* @return array
|
||||
*/
|
||||
public function map($row): array
|
||||
{
|
||||
|
||||
$companyModule = $row[0]->owner->companyModule;
|
||||
$marking = $companyModule->inviters()->withPivot('invitee_reference')->first()->pivot->invitee_reference;
|
||||
|
||||
$cbm = $row->sum(function($packingList){
|
||||
return $packingList->packages->sum(function ($package){
|
||||
return (($package->width / 100) * ($package->height / 100) * ($package->length / 100)) * $package->quantity;
|
||||
});
|
||||
});
|
||||
|
||||
return [
|
||||
$companyModule->company_id,
|
||||
$companyModule->name,
|
||||
$marking,
|
||||
$cbm
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\ValueObjects\Constants;
|
||||
|
||||
final class RouteType {
|
||||
|
||||
public const WEB = 1;
|
||||
|
||||
public const API = 2;
|
||||
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Accounts;
|
||||
|
||||
|
||||
use App\Classes\Modules\Accounts\ControllersLogic\FetchUserByEmailLogic;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class FetchUserByEmailController
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param FetchUserByEmailLogic $logic
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function fetch(Request $request, FetchUserByEmailLogic $logic): JsonResponse {
|
||||
return $logic->execute($request);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Companies;
|
||||
|
||||
use App\Classes\Modules\Companies\ControllersLogic\ListCompanyModuleInvoicesLogic;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ListCompanyModuleInvoicesController
|
||||
{
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param ListCompanyModulesLogic $logic
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function list(Request $request, ListCompanyModuleInvoicesLogic $logic): JsonResponse {
|
||||
return $logic->execute($request);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,7 +4,6 @@ namespace App\Http\Controllers\Exports;
|
||||
|
||||
|
||||
use App\Classes\Modules\Exports\Services\ExportsCustomersOrderLatestDate;
|
||||
use App\Classes\Modules\Exports\Services\ExportsCustomerTotalOrderByYear;
|
||||
use App\Classes\Modules\Exports\Services\ExportsPaymentTransactions;
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -32,11 +31,4 @@ class ExportCustomersToExcelController
|
||||
ob_end_clean();
|
||||
return $response;
|
||||
}
|
||||
|
||||
public function totalOrders(Request $request){
|
||||
$exportsTotalOrders = new ExportsCustomerTotalOrderByYear($request);
|
||||
$response = $exportsTotalOrders->download('total-orders-' . $request->route('year') . '.xls', Excel::XLS, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']);
|
||||
ob_end_clean();
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,11 +38,13 @@ class Kernel extends HttpKernel
|
||||
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
|
||||
\App\Http\Middleware\VerifyCsrfToken::class,
|
||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
\App\Http\Middleware\WebRouteLogs::class,
|
||||
],
|
||||
|
||||
'api' => [
|
||||
'throttle:300,1',
|
||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
\App\Http\Middleware\ApiRouteLogs::class,
|
||||
],
|
||||
];
|
||||
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\RouteLog;
|
||||
use App\Classes\ValueObjects\Constants\RouteType;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class ApiRouteLogs
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
|
||||
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function handle(Request $request, Closure $next)
|
||||
{
|
||||
$ip_address = getenv('REMOTE_ADDR') == '::1' ? '127.0.0.1' : getenv('REMOTE_ADDR');
|
||||
$url = urldecode($request->fullUrl());
|
||||
$request_method = $request->method();
|
||||
$platform = $request->header('sec-ch-ua-platform');
|
||||
$browser = Str::after($request->header('sec-ch-ua'), 'Not?A_Brand";v="8", "Chromium";v="108", "');
|
||||
$geo = unserialize(file_get_contents("http://www.geoplugin.net/php.gp?ip=$ip_address"));
|
||||
$longitude = $geo["geoplugin_longitude"];
|
||||
$latitude = $geo["geoplugin_latitude"];
|
||||
$last_page = url()->previous();
|
||||
$countryName = $geo["geoplugin_countryName"];
|
||||
|
||||
$user_id = Auth::user() ? Auth::user()->id : 0;
|
||||
|
||||
// if ($user_id != 0) {
|
||||
// // $ip_address
|
||||
// $webRouteLogWithSameIp = RouteLog::where('ip_address', $ip_address)->where('user_id', 0)->get();
|
||||
// dd($webRouteLogWithSameIp);
|
||||
// foreach($webRouteLogWithSameIp as $result){
|
||||
// $result
|
||||
// }
|
||||
// }
|
||||
|
||||
$route_log = [
|
||||
'user_id' => $user_id,
|
||||
// 'ip_address' => $request->ip(),
|
||||
'ip_address' => $ip_address,
|
||||
'url' => $url,
|
||||
'request_method' => $request_method,
|
||||
'browser' => $browser,
|
||||
'platform' => $platform,
|
||||
'longitude' => $longitude,
|
||||
'latitude' => $latitude,
|
||||
'last_page' => $last_page,
|
||||
'countryname' => $countryName,
|
||||
'route_type' => RouteType::API,
|
||||
];
|
||||
|
||||
RouteLog::create($route_log);
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\RouteLog;
|
||||
use App\Classes\ValueObjects\Constants\RouteType;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class WebRouteLogs
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
|
||||
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function handle(Request $request, Closure $next)
|
||||
{
|
||||
$ip_address = getenv('REMOTE_ADDR') == '::1' ? '127.0.0.1' : getenv('REMOTE_ADDR');
|
||||
$url = $request->fullUrl();
|
||||
$request_method = $request->method();
|
||||
$platform = $request->header('sec-ch-ua-platform');
|
||||
$browser = Str::after($request->header('sec-ch-ua'), 'Not?A_Brand";v="8", "Chromium";v="108", "');
|
||||
$geo = unserialize(file_get_contents("http://www.geoplugin.net/php.gp?ip=$ip_address"));
|
||||
$longitude = $geo["geoplugin_longitude"];
|
||||
$latitude = $geo["geoplugin_latitude"];
|
||||
$last_page = url()->previous();
|
||||
$countryName = $geo["geoplugin_countryName"];
|
||||
|
||||
$route_log = [
|
||||
'user_id' => Auth::user() ? Auth::user()->id : 0,
|
||||
// 'ip_address' => $request->ip(),
|
||||
'ip_address' => $ip_address,
|
||||
'url' => $url,
|
||||
'request_method' => $request_method,
|
||||
'browser' => $browser,
|
||||
'platform' => $platform,
|
||||
'longitude' => $longitude,
|
||||
'latitude' => $latitude,
|
||||
'last_page' => $last_page,
|
||||
'countryname' => $countryName,
|
||||
'route_type' => RouteType::WEB,
|
||||
];
|
||||
|
||||
// dd($route_log);
|
||||
|
||||
RouteLog::create($route_log);
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,6 @@ class PackageResource extends JsonResource
|
||||
'weight' => $this->weight,
|
||||
'quantity' => $this->quantity,
|
||||
'cbm' => (($this->width / 100) * ($this->height / 100) * ($this->length / 100)) * $this->quantity,
|
||||
'reference' => $this->packingList->reference,
|
||||
'status' => $this->status,
|
||||
$this->mergeWhen($originalPackingList->owner instanceof Order, [
|
||||
'order' => New OrderResource($originalPackingList->owner)
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class UserCompanyResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'name' => $this->name,
|
||||
'reference' => $this->companyModule()->first()->inviters()->withPivot('invitee_reference')->first()->pivot->invitee_reference,
|
||||
'type' => (int) $this->type,
|
||||
'status' => (int) $this->status,
|
||||
'email' => $this->email
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class RouteLog extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'ip_address',
|
||||
'url',
|
||||
'request_method',
|
||||
'browser',
|
||||
'platform',
|
||||
'longitude',
|
||||
'latitude',
|
||||
'last_page',
|
||||
'countryname',
|
||||
'route_type'
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateRouteLogsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('route_logs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('user_id')->unsigned();
|
||||
$table->string('ip_address');
|
||||
$table->string('url', 255);
|
||||
$table->string('request_method');
|
||||
$table->string('browser')->nullable();
|
||||
$table->string('platform')->nullable();
|
||||
$table->string('longitude')->nullable();
|
||||
$table->string('latitude')->nullable();
|
||||
$table->string('last_page')->nullable();
|
||||
$table->string('countryname')->nullable();
|
||||
$table->integer('route_type');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('route_logs');
|
||||
}
|
||||
}
|
||||
@@ -32,12 +32,6 @@
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<div class="row align-items-center parentContainer">
|
||||
<div class="col-auto padding-5 b-a b-grey b-rad-lg pointer m-r-15" @click="hrefPaymenBillingPage">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px"
|
||||
width="35" height="35"
|
||||
viewBox="0 0 172 172"
|
||||
style=" fill:#000000;"><defs><linearGradient x1="69.875" y1="96.52694" x2="69.875" y2="108.37075" gradientUnits="userSpaceOnUse" id="color-1_44039_gr1"><stop offset="0" stop-color="#4ec9ff"></stop><stop offset="1" stop-color="#2bffe6"></stop></linearGradient><linearGradient x1="86" y1="21.05119" x2="86" y2="153.19019" gradientUnits="userSpaceOnUse" id="color-2_44039_gr2"><stop offset="0" stop-color="#009add"></stop><stop offset="1" stop-color="#00baa4"></stop></linearGradient><linearGradient x1="80.625" y1="21.05119" x2="80.625" y2="153.19019" gradientUnits="userSpaceOnUse" id="color-3_44039_gr3"><stop offset="0" stop-color="#009add"></stop><stop offset="1" stop-color="#00baa4"></stop></linearGradient><linearGradient x1="75.25" y1="21.05119" x2="75.25" y2="153.19019" gradientUnits="userSpaceOnUse" id="color-4_44039_gr4"><stop offset="0" stop-color="#009add"></stop><stop offset="1" stop-color="#00baa4"></stop></linearGradient><linearGradient x1="69.875" y1="21.05119" x2="69.875" y2="153.19019" gradientUnits="userSpaceOnUse" id="color-5_44039_gr5"><stop offset="0" stop-color="#009add"></stop><stop offset="1" stop-color="#00baa4"></stop></linearGradient><linearGradient x1="129" y1="21.05119" x2="129" y2="153.19019" gradientUnits="userSpaceOnUse" id="color-6_44039_gr6"><stop offset="0" stop-color="#009add"></stop><stop offset="1" stop-color="#00baa4"></stop></linearGradient><linearGradient x1="139.75" y1="21.05119" x2="139.75" y2="153.19019" gradientUnits="userSpaceOnUse" id="color-7_44039_gr7"><stop offset="0" stop-color="#009add"></stop><stop offset="1" stop-color="#00baa4"></stop></linearGradient><linearGradient x1="118.25" y1="21.05119" x2="118.25" y2="153.19019" gradientUnits="userSpaceOnUse" id="color-8_44039_gr8"><stop offset="0" stop-color="#009add"></stop><stop offset="1" stop-color="#00baa4"></stop></linearGradient></defs><g fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><path d="M0,172v-172h172v172z" fill="none"></path><g><path d="M86,104.8125c0,1.4835 -1.204,2.6875 -2.6875,2.6875h-26.875c-1.4835,0 -2.6875,-1.204 -2.6875,-2.6875v-5.375c0,-1.4835 1.204,-2.6875 2.6875,-2.6875h26.875c1.4835,0 2.6875,1.204 2.6875,2.6875z" fill="url(#color-1_44039_gr1)"></path><path d="M154.0045,83.57856c-1.58025,-1.87856 -3.913,-2.95356 -6.407,-2.95356h-5.16v-8.0625c0,-4.44513 -4.03125,-8.0625 -8.0625,-8.0625v-26.875c0,-2.96431 -2.41069,-5.375 -5.375,-5.375h-38.65162l-3.88881,-7.77762c-0.91375,-1.83288 -2.75469,-2.97237 -4.80794,-2.97237h-18.17825h-1.66088h-18.8125c-2.96431,0 -5.375,2.41069 -5.375,5.375v96.75h-21.5v13.4375c0,7.40944 6.02806,13.4375 13.4375,13.4375h91.375c7.40944,0 13.4375,-6.02806 13.4375,-13.4375v-18.8125h4.74344c6.80475,0 12.55869,-4.71119 13.68475,-11.20419l2.95625,-17.02263c0.39775,-2.29512 -0.23919,-4.644 -1.75494,-6.44463zM137.0625,72.5625v8.0625h-16.125v-8.0625c0,-1.4835 1.20669,-2.6875 2.6875,-2.6875h10.75c1.4835,0 2.6875,1.204 2.6875,2.6875zM129,43h-5.375v-5.375h5.375zM81.65163,26.875l2.6875,5.375h-15.49344l-2.6875,-5.375zM60.15163,26.875l3.88881,7.78031c0.91913,1.83019 2.76275,2.96969 4.81063,2.96969h49.39894v5.375h-75.25v-16.125zM29.5625,145.125c-4.44513,0 -8.0625,-3.61469 -8.0625,-8.0625v-8.0625h86v8.0625c0,3.02344 1.00244,5.375 2.69288,8.0625zM129,137.0625c0,4.44512 -3.61738,8.0625 -8.0625,8.0625c-4.44512,0 -8.0625,-3.61738 -8.0625,-8.0625v-13.4375h-69.875v-75.25h86v16.125h-5.375c-4.44512,0 -8.0625,3.61737 -8.0625,8.0625v8.0625h-5.16c-2.494,0 -4.82675,1.075 -6.407,2.95356c-1.51306,1.80062 -2.15269,4.1495 -1.75225,6.44194l2.95625,17.02531c1.12606,6.493 6.87731,11.20419 13.68475,11.20419h10.11575zM150.46237,89.10138l-2.95625,17.02531c-0.67725,3.91031 -4.20325,6.74831 -8.38769,6.74831h-20.23419c-4.18444,0 -7.71044,-2.838 -8.38769,-6.74831l-2.95625,-17.028c-0.172,-0.99706 0.28219,-1.72 0.57244,-2.064c0.55362,-0.65575 1.38675,-1.03469 2.28975,-1.03469h37.195c0.903,0 1.73613,0.37894 2.29244,1.03738c0.28756,0.344 0.74444,1.06425 0.57244,2.064z" fill="url(#color-2_44039_gr2)"></path><path d="M53.75,59.125h53.75v5.375h-53.75z" fill="url(#color-3_44039_gr3)"></path><path d="M53.75,69.875h43v5.375h-43z" fill="url(#color-4_44039_gr4)"></path><path d="M53.75,80.625h32.25v5.375h-32.25z" fill="url(#color-5_44039_gr5)"></path><path d="M126.3125,91.375h5.375v16.125h-5.375z" fill="url(#color-6_44039_gr6)"></path><path d="M137.0625,91.375h5.375v10.75h-5.375z" fill="url(#color-7_44039_gr7)"></path><path d="M115.5625,91.375h5.375v10.75h-5.375z" fill="url(#color-8_44039_gr8)"></path></g></g></svg>
|
||||
</div>
|
||||
<div class="col-auto padding-5 b-a b-grey b-rad-lg pointer requestModal" data-type="assignSegment">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px"
|
||||
width="30" height="30"
|
||||
@@ -187,10 +181,7 @@
|
||||
delay: 1000
|
||||
});
|
||||
$(this.$refs.copyButton).tooltip('show');
|
||||
},
|
||||
hrefPaymenBillingPage(){
|
||||
window.location.href = route('customer.payment-and-billing', this.item.company_module.marking);
|
||||
},
|
||||
}
|
||||
},
|
||||
mixins: [componentHandler]
|
||||
}
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
<template>
|
||||
<div class="row m-b-15 align-items-end">
|
||||
<div class="col-auto">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="font-heading fs-10 muted all-caps">Name</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="font-heading all-caps fs-11">{{this.item.name}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2 text-right">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="font-heading fs-10 muted all-caps">Reference</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="font-heading all-caps fs-11">{{this.item.reference}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<a :href="route('customer.profile', this.item.reference)" target="_blank">
|
||||
<button type="button" class="btn btn-xs btn-primary fs-11">Open in new tab</button>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import componentHandler from '../../../general/mixins/componentHandler';
|
||||
export default {
|
||||
mixins: [componentHandler]
|
||||
}
|
||||
</script>
|
||||
-158
@@ -1,158 +0,0 @@
|
||||
<template>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col-12 col-sm-12 col-md-9">
|
||||
<div class="row m-b-15 m-l-5 m-r-10">
|
||||
<div class="col b-a b-grey rounded bg-master-light">
|
||||
<div class="row">
|
||||
<div class="col padding-20">
|
||||
<div class="row align-items-center justify-conten-center" @click="chooseAllInvoice()">
|
||||
<div class="col-auto pointer">
|
||||
<i class="fa fs-30 fa-fw" :class="{'fa-square-o': !selectAllInvoice, 'fa-check-square': selectAllInvoice, 'text-primary':selectAllInvoice}" ></i>
|
||||
</div>
|
||||
<div class="col">
|
||||
<h5 class="no-margin font-heading">Invoice No</h5>
|
||||
</div>
|
||||
<div class="col">
|
||||
<h5 class="no-margin">Invoice Date</h5>
|
||||
</div>
|
||||
<!-- <div class="col">
|
||||
<h5 class="no-margin">Status</h5>
|
||||
</div> -->
|
||||
<div class="col">
|
||||
<h5 class="no-margin">Amount</h5>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<div class="btn bg-grey no-border muted invisible">
|
||||
<i class="fa fa-file-pdf-o"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" v-for="invoice in invoices">
|
||||
<div class="col">
|
||||
<payments-billing-components :data="invoice" :selectedInvoice="selectedInvoice" v-on:input="updateList($event)"></payments-billing-components>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-sm-12 col-md-3">
|
||||
<div class="row align-items-center">
|
||||
<div class="col b-a b-grey rounded padding-25">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h6 class="semi-bold muted">Payment Summary</h6>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row align-items-center justify-content-center">
|
||||
<div class="col-auto">
|
||||
<div class="padding-5">
|
||||
<i class="fa fa-angle-up"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col p-l-0">
|
||||
<h6 class="semi-bold text-primary">{{selectedInvoice.length}} Invoice Selected</h6>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row" v-for="invoice in selectedInvoice">
|
||||
<div class="col">
|
||||
<h6 class="no-margin">{{ invoice.bill_no }}</h6>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<h6 class="no-margin">MYR {{ invoice.amount.toFixed(2) }}</h6>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h6 class="normal m-t-0 m-b-0">Total Amount</h6>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<h6 class="text-primary bold m-t-0 m-b-0">MYR {{ sumAmount }}</h6>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="btn btn-xl btn-success pointer m-t-10 w-100" @click='generateSummaryInvoice'>Generate Summary Invoice</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
company_module_id: {
|
||||
type: Number,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
section: 'customerPaymentBillingSectionComponent',
|
||||
isLoading: true,
|
||||
invoices: null,
|
||||
selectedInvoice: [],
|
||||
selectAllInvoice: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
pendingQueue () {
|
||||
return this.$store.getters.isInCompleteQueue(this.section);
|
||||
},
|
||||
sumAmount () {
|
||||
var new_object = this.selectedInvoice;
|
||||
return Object.keys(new_object).reduce(function(total, key) {
|
||||
return total + Math.round(new_object[key].amount * 100) / 100;
|
||||
}, 0).toFixed(2);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
pendingQueue(inComplete){
|
||||
if(inComplete){
|
||||
this.fetchInvoice();
|
||||
}
|
||||
}
|
||||
},
|
||||
created(){
|
||||
this.$store.dispatch('updateListQueue', {'name': this.section});
|
||||
},
|
||||
methods: {
|
||||
fetchInvoice(){
|
||||
this.isLoading = true;
|
||||
this.submit(route('api.company.invoice.list', this.company_module_id), 'get', this.section, false, false)
|
||||
},
|
||||
successHandler(response){
|
||||
this.$store.dispatch('completeList', {'name': this.section, 'data': []});
|
||||
this.isLoading = false;
|
||||
this.invoices = response.payload.data;
|
||||
},
|
||||
generateSummaryInvoice(){
|
||||
var selectedId = this.selectedInvoice.map(s=>s.id);
|
||||
window.open(route('invoice.combined_summary', JSON.stringify(selectedId)), '_blank');
|
||||
},
|
||||
updateList(packageList){
|
||||
this.selectedInvoice.includes(packageList) ? this.selectedInvoice.splice(this.selectedInvoice.indexOf(packageList), 1) : this.selectedInvoice.push(packageList);
|
||||
this.selectedInvoice.length === this.invoices.length ? this.selectAllInvoice = true : this.selectAllInvoice = false;
|
||||
},
|
||||
chooseAllInvoice(){
|
||||
this.selectAllInvoice = !this.selectAllInvoice;
|
||||
this.selectedInvoice = [];
|
||||
if (this.selectAllInvoice) {
|
||||
this.selectedInvoice = this.invoices;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -19,12 +19,6 @@
|
||||
<p class="bold m-b-5 fs-12">{{item.description}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-b-10 align-items-center" v-if="$store.getters.isAdmin">
|
||||
<div class="col-auto">
|
||||
<p class="no-margin all-caps fs-10 lh-10 light">Reference</p>
|
||||
<p class="no-margin fs-12">{{item.reference}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row b-t b-b b-grey m-b-15">
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
@@ -180,4 +174,4 @@
|
||||
},
|
||||
mixins: [componentHandler]
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
@@ -67,14 +67,6 @@
|
||||
<p class="no-margin bold text-info fs-12"><a :href="route('customer.profile', item.order.company_module.marking)">{{item.order.company_module.marking}}</a></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-b-5" v-if="$store.getters.isAdmin">
|
||||
<div class="col-auto p-r-5">
|
||||
<p class="no-margin all-caps fs-10 light">Reference</p>
|
||||
</div>
|
||||
<div class="col p-l-5">
|
||||
<p class="no-margin bold text-info fs-12">{{item.reference}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-b-5">
|
||||
<div class="col-auto p-r-5">
|
||||
<p class="no-margin all-caps fs-10 light">Order Number</p>
|
||||
|
||||
+93
-42
@@ -4,36 +4,110 @@
|
||||
<div class="row">
|
||||
<div class="col padding-20">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-auto pointer align-items-center" @click="activate()">
|
||||
<div class="col-auto pointer align-items-center" @click="selected = !selected">
|
||||
<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.bill_no }}</h5>
|
||||
<h5 class="no-margin">{{item.country.id}}05052021</h5>
|
||||
</div>
|
||||
<div class="col">
|
||||
<h5 class="no-margin">{{ item.created_at }}</h5>
|
||||
<h5 class="no-margin">Invoice Date Invoice Date</h5>
|
||||
</div>
|
||||
<!-- <div class="col">
|
||||
<div class="col">
|
||||
<h5 class="no-margin">Status</h5>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="col">
|
||||
<h5 class="no-margin">MYR {{ item.amount.toFixed(2) }}</h5>
|
||||
<h5 class="no-margin">Amount</h5>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<div v-if="item.documents.length">
|
||||
<div v-for="file in item.documents[0].files" v-bind:key="file.id" class="col-auto no-padding">
|
||||
<document-file-viewer-component :file="file">
|
||||
<template slot="button">
|
||||
<div class="btn bg-grey no-border muted">
|
||||
<i class="fa fa-file-pdf-o"></i>
|
||||
</div>
|
||||
</template>
|
||||
</document-file-viewer-component>
|
||||
<div class="btn bg-grey no-border" @click="expanded = !expanded">
|
||||
<i class="fa" :class="{'fa-angle-down': !expanded, 'fa-angle-up': expanded}" ></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row b-t b-grey p-t-10" v-show="expanded">
|
||||
<div class="col p-b-10">
|
||||
<div class="row">
|
||||
<div class="col p-l-20 p-r-20 p-t-10 p-b-10">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-auto invisible">
|
||||
<i class="fa fs-30 fa-fw" :class="{'fa-square-o': !selected, 'fa-check-square': selected, 'text-primary':selected}" ></i>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h5 class="m-b-0">Carrier Tracking Number</h5>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h5 class="semi-bold m-t-0 m-b-0 large-text">#1zbr06tw403742920</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h5 class="m-b-0">Due Date</h5>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h5 class="semi-bold m-t-0 m-b-0 large-text">11.04.2021</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h5 class="semi-bold m-t-0 m-b-0 large-text">Outstanding</h5>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h5 class="semi-bold m-t-0 m-b-0 large-text">RM0.00</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div class="btn bg-grey no-border muted invisible">
|
||||
<i class="fa fa-file-pdf-o"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col p-l-20 p-r-20 p-t-10 p-b-10">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-auto invisible">
|
||||
<i class="fa fs-30 fa-fw" :class="{'fa-square-o': !selected, 'fa-check-square': selected, 'text-primary':selected}" ></i>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h5 class="m-b-0 normal-text">This package was delivered by</h5>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h5 class="semi-bold m-t-0 m-b-0 large-text">#1zbr06tw403742920</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h5 class="m-b-0">Date Paid</h5>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h5 class="semi-bold m-t-0 m-b-0 large-text">21.01.2021</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="btn btn-outline-complete btn-lg">
|
||||
Invoice Detail
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -46,33 +120,10 @@
|
||||
<script>
|
||||
import componentHandler from '../../../general/mixins/componentHandler';
|
||||
export default {
|
||||
props: {
|
||||
selectedInvoice: {
|
||||
type: Array,
|
||||
required: false,
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
expanded: false,
|
||||
selectedValue: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
activate(){
|
||||
this.select = !this.select;
|
||||
this.$emit('input', this.data);
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
selected() {
|
||||
var response = false;
|
||||
this.selectedInvoice.forEach((value, index) => {
|
||||
if (value.id == this.item.id) {
|
||||
response = true;
|
||||
}
|
||||
});
|
||||
return response;
|
||||
selected: false,
|
||||
}
|
||||
},
|
||||
mixins: [componentHandler]
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
<template>
|
||||
<div class="row" @keyup.enter="fetchReport">
|
||||
<div class="col">
|
||||
<div class="row m-b-15">
|
||||
<div class="col-8 p-r-0">
|
||||
<div class="row">
|
||||
<div class="col p-r-0">
|
||||
<div class="form-group no-margin form-group-default b-rad-none">
|
||||
<label class="text-primary">Email</label>
|
||||
<input type="text" class="form-control" v-model="email" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col p-l-0">
|
||||
<div class="btn btn-primary b-rad-none" @click="fetchReport()">
|
||||
<i class="fa fa-search lh-40"></i>
|
||||
</div>
|
||||
<div class="btn btn-secondary b-rad-none" @click="resetSearch()">
|
||||
<i class="fa fa-remove lh-40"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" v-if="search">
|
||||
<div class="col bg-white padding-25">
|
||||
<p v-if="!userCompany">{{ message }}</p>
|
||||
<loading-component v-if="isLoading"></loading-component>
|
||||
<user-company-component v-if="userCompany" :data="userCompany"></user-company-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
import LoadingComponent from "../../general/elements/LoadingComponent";
|
||||
export default {
|
||||
components: {LoadingComponent},
|
||||
data(){
|
||||
return {
|
||||
section: 'searchUserCompanyByEmailSection',
|
||||
isLoading: false,
|
||||
search: false,
|
||||
email: '',
|
||||
userCompany: null,
|
||||
message: 'Searching...'
|
||||
}
|
||||
},
|
||||
validations: {
|
||||
marking: {},
|
||||
},
|
||||
methods: {
|
||||
fetchReport(){
|
||||
this.isLoading = true;
|
||||
this.search = true;
|
||||
this.userCompany = null;
|
||||
this.message = 'Searching...';
|
||||
this.submit(route('api.account.user.company', this.email), 'get', this.section, false, false);
|
||||
},
|
||||
successHandler(response){
|
||||
this.isLoading = false;
|
||||
this.report = response.payload.data;
|
||||
if(response.payload.data != undefined)
|
||||
this.userCompany = response.payload.data;
|
||||
else
|
||||
this.message = 'Customer not found';
|
||||
},
|
||||
errorHandler(response){
|
||||
this.isLoading = false;
|
||||
this.userCompany = null;
|
||||
this.message = 'Customer not found';
|
||||
},
|
||||
resetSearch() {
|
||||
this.userCompany = null;
|
||||
this.search = false;
|
||||
this.email = '';
|
||||
message: 'Searching...';
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -3,7 +3,6 @@
|
||||
<div class="row" :class="[{'d-flex': $store.getters.isAdmin}]" v-if="$store.getters.isAdmin">
|
||||
<div class="col">
|
||||
<customer-activity-report-section-component></customer-activity-report-section-component>
|
||||
<search-customer-by-email-component></search-customer-by-email-component>
|
||||
<div class="row" v-show="!$store.getters.isShowing('customerActivityReportSection')">
|
||||
<div class="col">
|
||||
<customer-report-section-component></customer-report-section-component>
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
@extends('layouts.base_portal')
|
||||
@section('inner_content')
|
||||
<customer-payment-billing-section-component :company_module_id={{$company_module_id}}></customer-payment-billing-section-component>
|
||||
@endsection
|
||||
@@ -5,9 +5,135 @@
|
||||
<br><br>
|
||||
<div class="separator"><strong><i>{{ $invoice_transaction->bill_no }}</i></strong></div>
|
||||
</htmlpageheader>
|
||||
<table>
|
||||
<tr>
|
||||
<td class="header-logo">
|
||||
<img src="{{ asset('images/ri_1.png') }}" alt="logo" id="logo" class="logo">
|
||||
</td>
|
||||
<td class="header-cief-address">
|
||||
<span class="company-name">
|
||||
<strong>
|
||||
CIEF WORLDWIDE SDN BHD
|
||||
</strong>
|
||||
</span>
|
||||
<span class="company-reg">(1134596-M)</span><br>
|
||||
No. 72-3, Jalan Jalil 1,<br>
|
||||
The Earth Bukit Jalil,<br>
|
||||
57000 Kuala Lumpur<br>
|
||||
Tel: 03-8082 1252
|
||||
</td>
|
||||
<td class="header-details">
|
||||
<div class="title" style="font-size: 20px; text-transform: uppercase;">
|
||||
<strong>
|
||||
Invoice
|
||||
</strong>
|
||||
</div>
|
||||
|
||||
@include('pages.pdfs.shipping_invoice_inner', ['invoice_transaction' => $invoice_transaction])
|
||||
<div class="number">Invoice No: {{ $invoice_transaction->bill_no }}</div>
|
||||
|
||||
@php
|
||||
$companyModule = $invoice_transaction->owner->owner->companyModule;
|
||||
@endphp
|
||||
|
||||
<div class="date">Date: {{ $invoice_transaction->created_at }}</div>
|
||||
<div class="ref">Order No: {{ $invoice_transaction->owner->owner->reference }}</div>
|
||||
<div class="ref">Container Ref: {{ $invoice_transaction->owner->containers()->first()->reference }}</div>
|
||||
{{--<div class="d-none">{{ $companyModule->inviters()->withPivot('invitee_reference')->first()->pivot->invitee_reference }}</div>--}}
|
||||
<div> </div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" class="bill-to">
|
||||
<span class="sub-title">
|
||||
Bill To
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" class="address">
|
||||
<div class="label">
|
||||
{{ $companyModule->name }}
|
||||
</div>
|
||||
<div class="address">
|
||||
@php
|
||||
$addresses = $companyModule->addresses()->where('status', '=', \App\Classes\ValueObjects\Constants\ApprovalStatus::APPROVED)->where('type', '=', \App\Classes\ValueObjects\Constants\AddressType::BILLING)->first();
|
||||
@endphp
|
||||
{{ $addresses->street_one }}
|
||||
{{ $addresses->street_two }} ,
|
||||
{{ $addresses->district()->first()->name }},
|
||||
{{ $addresses->postcode }}
|
||||
{{ $addresses->state()->first()->name }},
|
||||
{{ $addresses->country()->first()->name }}
|
||||
</div>
|
||||
<div>
|
||||
@php
|
||||
$contact = $companyModule->contacts()->first();
|
||||
@endphp
|
||||
Phone: {{ $contact ? $contact->phone : '' }}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
<br>
|
||||
<table class="line-table" style="overflow: wrap" autosize="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="5%">No</th>
|
||||
<th class="description">Description</th>
|
||||
<th width="15%">Quantity</th>
|
||||
<th width="20%">Unit Price (RM)</th>
|
||||
<th width="20%">Total Amount<br>(RM)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($invoice_transaction->transactionDetails as $key => $transaction_detail)
|
||||
<tr>
|
||||
<td width="5%" class="center top">{{ $key + 1 }}</td>
|
||||
<td class="description">{!! $transaction_detail->name !!}</td>
|
||||
<td width="15%" class="center top" style="text-align: center">{{ round($transaction_detail->quantity, 3) }}</td>
|
||||
<td width="20%" class="center top" style="text-align: center">
|
||||
{{ round($transaction_detail->price, 2) }}
|
||||
</td>
|
||||
<td width="20%" class="right top">
|
||||
{{ round($transaction_detail->amount, 2) }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr class="subtotal">
|
||||
<td colspan="3"></td>
|
||||
<td class="right middle">Subtotal</td>
|
||||
<td class="right middle">
|
||||
{{ round($invoice_transaction->amount, 2) }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="billingcharges">
|
||||
<td colspan="3"></td>
|
||||
<td class="right">Service Charges</td>
|
||||
<td class="right">
|
||||
{{ round($invoice_transaction->service_charge, 2) }}
|
||||
</td>
|
||||
</tr>
|
||||
@if($invoice_transaction->tax > 0)
|
||||
<tr class="billingcharges">
|
||||
<td colspan="3"></td>
|
||||
<td class="right">Tax</td>
|
||||
<td class="right">{{ number_format($invoice_transaction->tax, 2) }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
<tr>
|
||||
<td colspan="3"></td>
|
||||
<td class="right middle">Total</td>
|
||||
<td class="total right middle">
|
||||
{{ round($invoice_transaction->amount, 2) }}
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<htmlpagefooter name="page-footer">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
|
||||
@@ -1,129 +0,0 @@
|
||||
<table>
|
||||
<tr>
|
||||
<td class="header-logo">
|
||||
<img src="{{ asset('images/ri_1.png') }}" alt="logo" id="logo" class="logo">
|
||||
</td>
|
||||
<td class="header-cief-address">
|
||||
<span class="company-name">
|
||||
<strong>
|
||||
CIEF WORLDWIDE SDN BHD
|
||||
</strong>
|
||||
</span>
|
||||
<span class="company-reg">(1134596-M)</span><br>
|
||||
No. 72-3, Jalan Jalil 1,<br>
|
||||
The Earth Bukit Jalil,<br>
|
||||
57000 Kuala Lumpur<br>
|
||||
Tel: 03-8082 1252
|
||||
</td>
|
||||
<td class="header-details">
|
||||
<div class="title" style="font-size: 20px; text-transform: uppercase;">
|
||||
<strong>
|
||||
Invoice
|
||||
</strong>
|
||||
</div>
|
||||
|
||||
<div class="number">Invoice No: {{ $invoice_transaction->bill_no }}</div>
|
||||
|
||||
@php
|
||||
$companyModule = $invoice_transaction->owner->owner->companyModule;
|
||||
@endphp
|
||||
|
||||
<div class="date">Date: {{ $invoice_transaction->created_at }}</div>
|
||||
<div class="ref">Order No: {{ $invoice_transaction->owner->owner->reference }}</div>
|
||||
<div class="ref">Container Ref: {{ $invoice_transaction->owner->containers()->first()->reference }}</div>
|
||||
{{--<div class="d-none">{{ $companyModule->inviters()->withPivot('invitee_reference')->first()->pivot->invitee_reference }}</div>--}}
|
||||
<div> </div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" class="bill-to">
|
||||
<span class="sub-title">
|
||||
Bill To
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" class="address">
|
||||
<div class="label">
|
||||
{{ $companyModule->name }}
|
||||
</div>
|
||||
<div class="address">
|
||||
@php
|
||||
$addresses = $companyModule->addresses()->where('status', '=', \App\Classes\ValueObjects\Constants\ApprovalStatus::APPROVED)->where('type', '=', \App\Classes\ValueObjects\Constants\AddressType::BILLING)->first();
|
||||
@endphp
|
||||
{{ $addresses->street_one }}
|
||||
{{ $addresses->street_two }} ,
|
||||
{{ $addresses->district()->first()->name }},
|
||||
{{ $addresses->postcode }}
|
||||
{{ $addresses->state()->first()->name }},
|
||||
{{ $addresses->country()->first()->name }}
|
||||
</div>
|
||||
<div>
|
||||
@php
|
||||
$contact = $companyModule->contacts()->first();
|
||||
@endphp
|
||||
Phone: {{ $contact ? $contact->phone : '' }}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
<br>
|
||||
<table class="line-table" style="overflow: wrap" autosize="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="5%">No</th>
|
||||
<th class="description">Description</th>
|
||||
<th width="15%">Quantity</th>
|
||||
<th width="20%">Unit Price (RM)</th>
|
||||
<th width="20%">Total Amount<br>(RM)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($invoice_transaction->transactionDetails as $key => $transaction_detail)
|
||||
<tr>
|
||||
<td width="5%" class="center top">{{ $key + 1 }}</td>
|
||||
<td class="description">{!! $transaction_detail->name !!}</td>
|
||||
<td width="15%" class="center top" style="text-align: center">{{ round($transaction_detail->quantity, 3) }}</td>
|
||||
<td width="20%" class="center top" style="text-align: center">
|
||||
{{ round($transaction_detail->price, 2) }}
|
||||
</td>
|
||||
<td width="20%" class="right top">
|
||||
{{ round($transaction_detail->amount, 2) }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr class="subtotal">
|
||||
<td colspan="3"></td>
|
||||
<td class="right middle">Subtotal</td>
|
||||
<td class="right middle">
|
||||
{{ round($invoice_transaction->amount, 2) }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="billingcharges">
|
||||
<td colspan="3"></td>
|
||||
<td class="right">Service Charges</td>
|
||||
<td class="right">
|
||||
{{ round($invoice_transaction->service_charge, 2) }}
|
||||
</td>
|
||||
</tr>
|
||||
@if($invoice_transaction->tax > 0)
|
||||
<tr class="billingcharges">
|
||||
<td colspan="3"></td>
|
||||
<td class="right">Tax</td>
|
||||
<td class="right">{{ number_format($invoice_transaction->tax, 2) }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
<tr>
|
||||
<td colspan="3"></td>
|
||||
<td class="right middle">Total</td>
|
||||
<td class="total right middle">
|
||||
{{ round($invoice_transaction->amount, 2) }}
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
@@ -1,143 +0,0 @@
|
||||
@extends('layouts.base_pdf')
|
||||
@section('inner_content')
|
||||
@php
|
||||
$grandTotal = 0;
|
||||
$grandSubTotal = 0;
|
||||
@endphp
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td class="header-logo">
|
||||
<img src="{{ asset('images/ri_1.png') }}" alt="logo" id="logo" class="logo">
|
||||
</td>
|
||||
<td class="header-cief-address">
|
||||
<span class="company-name">
|
||||
<strong>
|
||||
CIEF WORLDWIDE SDN BHD
|
||||
</strong>
|
||||
</span>
|
||||
<span class="company-reg">(1134596-M)</span><br>
|
||||
No. 72-3, Jalan Jalil 1,<br>
|
||||
The Earth Bukit Jalil,<br>
|
||||
57000 Kuala Lumpur<br>
|
||||
Tel: 03-8082 1252
|
||||
</td>
|
||||
<td class="header-details">
|
||||
<div class="title" style="font-size: 20px; text-transform: uppercase;">
|
||||
<strong>
|
||||
Summary
|
||||
</strong>
|
||||
</div>
|
||||
|
||||
@php
|
||||
$companyModule = $invoice_transactions[0]->owner->owner->companyModule;
|
||||
@endphp
|
||||
|
||||
{{-- <div class="date">Date: {{ $invoice_transactions[0]->created_at }}</div> --}}
|
||||
<div class="date">Date: {{ \Carbon\Carbon::now() }}</div>
|
||||
<div> </div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" class="bill-to">
|
||||
<span class="sub-title">
|
||||
Bill To
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" class="address">
|
||||
<div class="label">
|
||||
{{ $companyModule->name }}
|
||||
</div>
|
||||
<div class="address">
|
||||
@php
|
||||
$addresses = $companyModule->addresses()->where('status', '=', \App\Classes\ValueObjects\Constants\ApprovalStatus::APPROVED)->where('type', '=', \App\Classes\ValueObjects\Constants\AddressType::BILLING)->first();
|
||||
@endphp
|
||||
{{ $addresses->street_one }}
|
||||
{{ $addresses->street_two }} ,
|
||||
{{ $addresses->district()->first()->name }},
|
||||
{{ $addresses->postcode }}
|
||||
{{ $addresses->state()->first()->name }},
|
||||
{{ $addresses->country()->first()->name }}
|
||||
</div>
|
||||
<div>
|
||||
@php
|
||||
$contact = $companyModule->contacts()->first();
|
||||
@endphp
|
||||
Phone: {{ $contact ? $contact->phone : '' }}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
<br>
|
||||
<table class="line-table" style="overflow: wrap" autosize="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="5%">No</th>
|
||||
<th class="description">Invoice No</th>
|
||||
<th class="description">Description</th>
|
||||
<th width="15%">Quantity</th>
|
||||
<th width="20%">Unit Price (RM)</th>
|
||||
<th width="20%">Total Amount<br>(RM)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($invoice_transactions as $key => $invoice_transaction)
|
||||
@foreach ($invoice_transaction->transactionDetails as $transaction_detail)
|
||||
<tr>
|
||||
<td width="5%" class="center top">{{ $key + 1 }}</td>
|
||||
<td width="15%" class="center top">{{ $invoice_transaction->bill_no }}</td>
|
||||
<td class="description">{!! $transaction_detail->name !!}</td>
|
||||
<td width="15%" class="center top" style="text-align: center">{{ round($transaction_detail->quantity, 3) }}</td>
|
||||
<td width="15%" class="center top" style="text-align: center">
|
||||
{{ round($transaction_detail->price, 2) }}
|
||||
</td>
|
||||
<td width="15%" class="right top">
|
||||
{{ round($transaction_detail->amount, 2) }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@php
|
||||
$grandSubTotal = $grandSubTotal + $invoice_transaction->amount;
|
||||
$grandTotal = $grandTotal + $invoice_transaction->amount;
|
||||
@endphp
|
||||
@endforeach
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr class="subtotal">
|
||||
<td colspan="4"></td>
|
||||
<td class="right middle">Subtotal</td>
|
||||
<td class="right middle">
|
||||
{{ round($grandSubTotal, 2) }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4"></td>
|
||||
<td class="right middle">Total</td>
|
||||
<td class="total right middle">
|
||||
{{ round($grandTotal, 2) }}
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
@foreach ($invoice_transactions as $transaction)
|
||||
<pagebreak />
|
||||
@include('pages.pdfs.shipping_invoice_inner', ['invoice_transaction' => $transaction])
|
||||
@endforeach
|
||||
|
||||
|
||||
<htmlpagefooter name="page-footer">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="text-align: right; ">This is generated by computer. No signature required.</td>
|
||||
<td style="text-align: right; ">Page {PAGENO} of {nbpg}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</htmlpagefooter>
|
||||
@endsection
|
||||
File diff suppressed because one or more lines are too long
@@ -35,7 +35,6 @@ Route::group(['prefix' => 'account', 'namespace' => 'Accounts', 'as' => 'account
|
||||
});
|
||||
|
||||
Route::group(['middleware' => 'valid.token', 'prefix' => 'user', 'as' => 'user.'], function () {
|
||||
Route::get('/{email}', 'FetchUserByEmailController@fetch')->name('company');
|
||||
Route::post('/show', 'FetchUserController@fetch')->name('show');
|
||||
Route::get('/list', 'ListUsersController@list')->name('list');
|
||||
Route::put('/update/{id}', 'UpdateUserController@update')->name('update');
|
||||
|
||||
@@ -33,6 +33,4 @@ Route::group(['prefix' => 'company', 'as' => 'company.', 'namespace' => 'Compani
|
||||
});
|
||||
|
||||
Route::get('/module/list', 'ListCompanyModulesController@list')->name('module.list');
|
||||
|
||||
Route::get('/{company_module_id}/invoice/list', 'ListCompanyModuleInvoicesController@list')->name('invoice.list');
|
||||
});
|
||||
|
||||
+2
-19
@@ -22,7 +22,6 @@ use App\Models\Document;
|
||||
use App\Models\PackingList;
|
||||
use Illuminate\Support\Facades\Crypt;
|
||||
use App\Models\Container;
|
||||
use App\Models\Transaction;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
@@ -166,12 +165,6 @@ Route::get('/customer/{marking}/details', function ($marking) {
|
||||
return view('pages.customers.profile_details', ['id' => $id]);
|
||||
})->name('customer.profile.details');
|
||||
|
||||
Route::get('/customer/{marking}/payment-and-billing', function ($marking) {
|
||||
$connection = CompanyConnection::where('invitee_reference', $marking)->first();
|
||||
$company_module_id = $connection->invitee->id;
|
||||
return view('pages.customers.paymentsBilling', ['company_module_id' => $company_module_id]);
|
||||
})->name('customer.payment-and-billing');
|
||||
|
||||
Route::get('/orders/refresh', function(\Illuminate\Http\Request $request){
|
||||
$packingLists = \App\Models\PackingList::where('type', \App\Classes\ValueObjects\Constants\PackingListType::WAREHOUSE_RECEIVE_LIST)->has('containers')->get();
|
||||
dd($packingLists);
|
||||
@@ -210,9 +203,9 @@ Route::get('/order/{id}/download', 'Orders\DownloadOrderQrPdfController@download
|
||||
Route::get('/report/customclearance/{orderid}', 'Reports\CustomcClearanceReportController@download')->name('report.customclearance');
|
||||
|
||||
Route::group(['prefix' => 'template', 'as' => 'template.'], function () {
|
||||
Route::get('/payment-and-billing', function () {
|
||||
Route::get('/payments-and-billing', function () {
|
||||
return view('pages.templates.paymentsBilling');
|
||||
})->name('payment-and-billing');
|
||||
})->name('payments-and-billing');
|
||||
|
||||
Route::get('/shipping-queue', function () {
|
||||
return view('pages.templates.shippingQueue');
|
||||
@@ -324,7 +317,6 @@ Route::get('/export/on-hold-packing-list', 'Exports\ExportPendingArrangementPack
|
||||
Route::get('/export/arrived-parcel', 'Exports\ExportArrivedParcelController@export')->name('packing_list.arrived_parcel.export');
|
||||
Route::get('/export/parcel-summary', 'Exports\ExportArrivedParcelController@summary');
|
||||
Route::get('/export/parcel-postcode', 'Exports\ExportParcelPostcodesController@export');
|
||||
Route::get('/export/{year}/customer-total-order', 'Exports\ExportCustomersToExcelController@totalOrders');
|
||||
|
||||
Route::get('/settings', function () {
|
||||
return view('pages.settings');
|
||||
@@ -688,14 +680,5 @@ Route::get('/invoices/fix', function(){
|
||||
|
||||
});
|
||||
|
||||
Route::get('/invoices/combine/{ids}', function($ids){
|
||||
|
||||
$ids = json_decode($ids);
|
||||
|
||||
$transactions = Transaction::whereIn('id', $ids)->get();
|
||||
|
||||
$pdf = LaravelMpdf::loadView('pages.pdfs.shipping_invoices_combined', ['invoice_transactions' => $transactions]);
|
||||
return $pdf->download('combined_invoice_.pdf');
|
||||
})->name('invoice.combined_summary');
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user