diff --git a/app/Classes/General/Eloquent/Filters/DoesNotHaveTransactionType.php b/app/Classes/General/Eloquent/Filters/DoesNotHaveTransactionType.php index 3568ac3b..486819bf 100644 --- a/app/Classes/General/Eloquent/Filters/DoesNotHaveTransactionType.php +++ b/app/Classes/General/Eloquent/Filters/DoesNotHaveTransactionType.php @@ -2,6 +2,7 @@ namespace App\Classes\General\Eloquent\Filters; +use Carbon\Carbon; use Illuminate\Database\Eloquent\Builder; class DoesNotHaveTransactionType implements Filter @@ -15,6 +16,8 @@ class DoesNotHaveTransactionType implements Filter { return $builder->whereDoesntHave('transactions', function (Builder $query) use($value) { $query->where('type', $value); + })->whereHas('containers', function ($query){ + return $query->whereDate('loading_date', '>=', Carbon::parse('08-08-2022')); }); } } \ No newline at end of file diff --git a/app/Classes/General/Eloquent/Filters/SegmentIdIn.php b/app/Classes/General/Eloquent/Filters/SegmentIdIn.php new file mode 100644 index 00000000..de66a61f --- /dev/null +++ b/app/Classes/General/Eloquent/Filters/SegmentIdIn.php @@ -0,0 +1,20 @@ +whereIn('segment_id', $value); + } + +} \ No newline at end of file diff --git a/app/Classes/Modules/Companies/Services/AssignsCompanyToSegment.php b/app/Classes/Modules/Companies/Services/AssignsCompanyToSegment.php index 81b6e964..9c54d401 100644 --- a/app/Classes/Modules/Companies/Services/AssignsCompanyToSegment.php +++ b/app/Classes/Modules/Companies/Services/AssignsCompanyToSegment.php @@ -4,6 +4,7 @@ namespace App\Classes\Modules\Companies\Services; use App\Classes\Exceptions\MalformedRequestException; use App\Classes\General\Eloquent\AbstractUpdateRecord; +use App\Classes\ValueObjects\Constants\BusinessType; use App\Models\Company; use App\Models\Segment; use Illuminate\Database\QueryException; @@ -19,8 +20,9 @@ class AssignsCompanyToSegment extends AbstractUpdateRecord public function execute(Company $company, Segment $segment) { try { - - $company->segments()->attach($segment); + $companyModule = $company->companyModules()->where('type', BusinessType::IMPORTER)->first(); + $connection = $companyModule->connections()->where('inviter_reference', 'CIEF'); + $connection->segments()->attach($segment); return $company; diff --git a/app/Classes/ValueObjects/Constants/TransactionDetailType.php b/app/Classes/ValueObjects/Constants/TransactionDetailType.php index b3e1541c..aa9e835c 100644 --- a/app/Classes/ValueObjects/Constants/TransactionDetailType.php +++ b/app/Classes/ValueObjects/Constants/TransactionDetailType.php @@ -4,9 +4,9 @@ namespace App\Classes\ValueObjects\Constants; final class TransactionDetailType { - public const SHIPPING_FEE = 'Shipping Fee'; + public const SHIPPING_FEE = 'X1 Freight Service Charge'; - public const OVER_WEIGHT_CHARGES = 'Over weight charges'; + public const OVER_WEIGHT_CHARGES = 'Overweight Charges'; public const CUSTOM_CHARGES = 'Custom charges'; } diff --git a/app/Http/Controllers/Companies/AssignCompanyConnectionToConnectionSegmentController.php b/app/Http/Controllers/Companies/AssignCompanyConnectionToConnectionSegmentController.php index fab9e692..e22c554f 100644 --- a/app/Http/Controllers/Companies/AssignCompanyConnectionToConnectionSegmentController.php +++ b/app/Http/Controllers/Companies/AssignCompanyConnectionToConnectionSegmentController.php @@ -10,7 +10,7 @@ class AssignCompanyConnectionToConnectionSegmentController { /** * @param Request $request - * @param AssignCompanyToSegmentLogic $logic + * @param AssignCompanyConnectionToConnectionSegmentLogic $logic * @return JsonResponse */ public function assign(Request $request, AssignCompanyConnectionToConnectionSegmentLogic $logic): JsonResponse { diff --git a/app/Http/Resources/CompanyModuleResource.php b/app/Http/Resources/CompanyModuleResource.php index 13f4eb6a..22a0557d 100644 --- a/app/Http/Resources/CompanyModuleResource.php +++ b/app/Http/Resources/CompanyModuleResource.php @@ -47,6 +47,7 @@ class CompanyModuleResource extends JsonResource 'remarks' => RemarkResource::collection($this->remarks), 'marking' => $marking, 'warehouseCharges' => array_key_exists($this->id, $segmentConstant) ? $segmentConstant[$this->id] : null, + 'connections' => $this->connections, ]; } diff --git a/app/Http/Resources/CompanyResource.php b/app/Http/Resources/CompanyResource.php index 8e27ab73..899a9405 100644 --- a/app/Http/Resources/CompanyResource.php +++ b/app/Http/Resources/CompanyResource.php @@ -27,6 +27,7 @@ class CompanyResource extends JsonResource 'type' => (int) $this->type, 'business_type' => (int) $this->business_type, 'status' => (int) $this->status, + 'segments' => SegmentResource::collection($companyModule->connections()->first()->segments), 'contact' => new ContactResource ($this->when($this->has('contacts'), $this->contacts->first())), 'employee' => new UserResource($companyModule->employees()->first()), 'company_module' => new CompanyModuleResource($companyModule), diff --git a/database/seeders/SegmentsTableSeeder.php b/database/seeders/SegmentsTableSeeder.php index 72545884..807441c7 100644 --- a/database/seeders/SegmentsTableSeeder.php +++ b/database/seeders/SegmentsTableSeeder.php @@ -15,12 +15,7 @@ class SegmentsTableSeeder extends Seeder 'id' => 1, 'company_module_id' => 1, 'name' => 'Default Segment', - ], - [ - 'id' => 2, - 'company_module_id' => 2, - 'name' => 'Normal Member', - ], + ] ] ); } diff --git a/resources/assets/vue/components/companies/elements/CustomerProfileComponent.vue b/resources/assets/vue/components/companies/elements/CustomerProfileComponent.vue index 512fa04d..8b0b6625 100644 --- a/resources/assets/vue/components/companies/elements/CustomerProfileComponent.vue +++ b/resources/assets/vue/components/companies/elements/CustomerProfileComponent.vue @@ -30,6 +30,32 @@ +
+
+
+ +
+
+
+
+
+ {{segment.name}} + +
+ + + +
+
+
+ + + +
+
diff --git a/resources/assets/vue/components/companies/forms/AssignSegmentFormComponent.vue b/resources/assets/vue/components/companies/forms/AssignSegmentFormComponent.vue new file mode 100644 index 00000000..ba9d7a22 --- /dev/null +++ b/resources/assets/vue/components/companies/forms/AssignSegmentFormComponent.vue @@ -0,0 +1,73 @@ + + \ No newline at end of file diff --git a/resources/assets/vue/components/companies/forms/DetachSegmentFormComponent.vue b/resources/assets/vue/components/companies/forms/DetachSegmentFormComponent.vue new file mode 100644 index 00000000..7e87816d --- /dev/null +++ b/resources/assets/vue/components/companies/forms/DetachSegmentFormComponent.vue @@ -0,0 +1,44 @@ + + \ No newline at end of file diff --git a/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue b/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue index f67da627..4c2c0ab8 100644 --- a/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue @@ -9,6 +9,7 @@
{{item.order.company_module.marking}}/{{item.order.reference}} +

{{item.loading_days_ago}}

Unclaimed Packing List
diff --git a/resources/views/layouts/base_pdf.blade.php b/resources/views/layouts/base_pdf.blade.php index ce46ac4f..8659c709 100644 --- a/resources/views/layouts/base_pdf.blade.php +++ b/resources/views/layouts/base_pdf.blade.php @@ -11,9 +11,135 @@ body { font-family: sun-extA; - padding: 0; } + .header { + margin-top: 5em; + } + + .separator { + text-align: right; + border-bottom: 0.5px solid black; + font-size: 0.7em; + } + + img.logo { + top: 10px; + } + + img { + height: 6em; + width: 9em; + } + + .title { + font-size: 2em; + font-weight: 1200; + } + + .details { + display: inline-block; + position: relative; + + } + + .sub-title { + font-size: 1.3em; + font-weight: bold; + } + + .label { + font-size: 1.1em; + font-weight: bold; + } + + .bill-to { + margin-top: 30px; + } + + table { + width: 100%; + vertical-align: top; + } + + th { + border-bottom: 1px solid black; + } + + td { + padding: 0.4em; + /* text-align: center; */ + } + + td.title { + text-align: left; + } + td.description, + th.description { + text-align: justify; + max-width: 40em; + } + + td.stock-code, + th.stock-code { + text-align: center; + } + + th { + vertical-align: middle; + } + + td, + th { + /* margin-top: 0.6em; + margin-right: 0.6em; */ + } + + .subtotal td { + border-top: 1px solid black; + } + + .total { + border-top: 1px solid black; + border-bottom: 3px double black; + font-weight: bolder; + } + + .address {} + + */ td.header-logo { + /* text-align: left; */ + width: fit-content; + } + + td.header-cief-address { + text-align: left; + margin-left: -30px; + } + + td.header-details { + text-align: left; + vertical-align: top; + } + + td.bill-to { + text-align: left; + } + + td.document-detail { + text-align: left; + border: 1px solid black; + padding: 1em 1em 1em 1em; + width: 16em; + } + + td.address { + text-align: left; + } + + .right { + text-align: right; + } diff --git a/resources/views/pages/pdfs/shipping_invoice.blade.php b/resources/views/pages/pdfs/shipping_invoice.blade.php index df4f2298..31e4c46e 100644 --- a/resources/views/pages/pdfs/shipping_invoice.blade.php +++ b/resources/views/pages/pdfs/shipping_invoice.blade.php @@ -17,27 +17,28 @@ (1134596-M)
- Malaysian Global Innovation & Creativity Center
- Level 1 CWS, Block 3730, Persiaran APEC,
- 63000 Cyberjaya, Malaysian.
- Tel: 018-2909252 + No. 72-3, Jalan Jalil 1,
+ The Earth Bukit Jalil,
+ 57000 Kuala Lumpur
+ Tel: 03-8082 1252 -
+
Invoice
-
EI#: {{ $invoice_transaction->bill_no }}
+
Invoice No: {{ $invoice_transaction->bill_no }}
@php $companyModule = $invoice_transaction->owner->owner->companyModule; @endphp -
Ref# {{ $invoice_transaction->owner->owner->reference }}
-
Date: {{ $invoice_transaction->created_at }}
+
Order No: {{ $invoice_transaction->owner->owner->reference }}
+
Container Ref: {{ $invoice_transaction->owner->containers()->first()->reference }}
+ {{--
{{ $companyModule->inviters()->withPivot('invitee_reference')->first()->pivot->invitee_reference }}
--}}
 
@@ -56,7 +57,7 @@
@php - $addresses = $invoice_transaction->owner->owner->addresses()->where('status', '=', 2)->first(); + $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 }} , @@ -82,53 +83,53 @@ No Description - Quantity - Unit Price (RM) - Total Amount
(RM) + Quantity + Unit Price (RM) + Total Amount
(RM) @foreach ($invoice_transaction->transactionDetails as $key => $transaction_detail) {{ $key + 1 }} - {{ $transaction_detail->name }} - {{ $transaction_detail->quantity }} - - {{ $transaction_detail->price }} + {!! $transaction_detail->name !!} + {{ round($transaction_detail->quantity, 3) }} + + {{ round($transaction_detail->price, 2) }} - {{ $transaction_detail->amount }} + {{ round($transaction_detail->amount, 2) }} @endforeach - + Subtotal - {{ number_format($invoice_transaction->amount, 2) }} + {{ round($invoice_transaction->amount, 2) }} - + Service Charges - {{ number_format($invoice_transaction->service_charge, 2) }} + {{ round($invoice_transaction->service_charge, 2) }} @if($invoice_transaction->tax > 0) - + Tax {{ number_format($invoice_transaction->tax, 2) }} @endif - + Total - {{ number_format($invoice_transaction->amount, 2) }} + {{ round($invoice_transaction->amount, 2) }} diff --git a/resources/views/pages/settings.blade.php b/resources/views/pages/settings.blade.php index 3bf26f0c..e09653b0 100644 --- a/resources/views/pages/settings.blade.php +++ b/resources/views/pages/settings.blade.php @@ -285,7 +285,7 @@
- + diff --git a/resources/views/partials/menu.blade.php b/resources/views/partials/menu.blade.php index 42dd5141..952060c7 100644 --- a/resources/views/partials/menu.blade.php +++ b/resources/views/partials/menu.blade.php @@ -147,7 +147,7 @@
Shipping Queue
-
+
'company', 'as' => 'company.', 'namespace' => 'Compani Route::post('/team/create', 'AddNewMemberController@create')->name('team.create'); - Route::group(['prefix' => '{id}/segment', 'as' => 'segment.'], function () { - Route::post('/assign', 'AssignCompanyToSegmentController@assign')->name('assign'); - Route::delete('/detach/{segment_id}', 'RemoveCompanyFromSegmentController@detach')->name('detach'); - }); +// Route::group(['prefix' => '{id}/segment', 'as' => 'segment.'], function () { +// Route::post('/assign', 'AssignCompanyToSegmentController@assign')->name('assign'); +// Route::delete('/detach/{segment_id}', 'RemoveCompanyFromSegmentController@detach')->name('detach'); +// }); Route::group(['prefix' => '{id}/connection/{company_connection_id}', 'as' => 'connection.'], function () { Route::post('/assign', 'AssignCompanyConnectionToConnectionSegmentController@assign')->name('assign');