From 790ece14d1804005a3c7fbc4e35f8e1b6b14ab08 Mon Sep 17 00:00:00 2001 From: Deon George Date: Tue, 9 May 2023 17:08:31 +0900 Subject: [PATCH] Change product name_detail, name to name, pid --- app/Models/Product.php | 29 ++++++------------- .../backend/adminlte/product/report.blade.php | 4 ++- .../adminlte/product/widget/detail.blade.php | 8 ++--- .../backend/adminlte/service/home.blade.php | 2 +- .../adminlte/service/widget/active.blade.php | 14 ++++++--- .../supplier/widget/products.blade.php | 2 +- .../metronic/order/widget/info/base.blade.php | 2 +- 7 files changed, 29 insertions(+), 32 deletions(-) diff --git a/app/Models/Product.php b/app/Models/Product.php index 5e6475b..3959f94 100644 --- a/app/Models/Product.php +++ b/app/Models/Product.php @@ -31,18 +31,17 @@ use App\Traits\{ProductDetails,SiteID}; * Attributes for products: * + lid : Local ID for product (part number) * + sid : System ID for product (part number) - * + category : Type of product supplied - * + category_name : Type of product supplied (Friendly Name for display, not for internal logic) - * + supplier : Supplier for this offering - * + name : Brief Name for our product with name_detail - * + name_short : Product ID for our Product (description.name => name_short) - * + name_detail : Details of our product (description.description_short => name_detail) - * + description : Product description (description.description_full => description_full) + * + base_charge : Default billing amount * + billing_interval : Default Billing Interval * + billing_interval_string: Default Billing Interval in human-readable form - * + setup_charge : Charge to setup this product - * + base_charge : Default billing amount + * + category : Type of product supplied + * + category_name : Type of product supplied (Friendly Name for display, not for internal logic) + * + description : Product description (description.description_full => description_full) * + min_charge : Minimum charge taking into account billing interval and setup charges + * + name : Details of our product (description.description_short => name_detail) + * + pid : Product ID for our Product (description.name => name_short) + * + setup_charge : Charge to setup this product + * + supplier : Supplier for this offering * * Attributes for product types (type - Product/*) * + name : Short Name for our Product @@ -259,16 +258,6 @@ class Product extends Model implements IDs * @return string */ public function getNameAttribute(): string - { - return $this->getNameShortAttribute().(($x=$this->getNameDetailAttribute()) ? ': '.$x : ''); - } - - /** - * Our products Long Name - * - * @return string - */ - public function getNameDetailAttribute(): string { return $this->translate->name_detail; } @@ -278,7 +267,7 @@ class Product extends Model implements IDs * * @return string */ - public function getNameShortAttribute(): string + public function getPIDAttribute(): string { return $this->translate->name_short; } diff --git a/resources/views/theme/backend/adminlte/product/report.blade.php b/resources/views/theme/backend/adminlte/product/report.blade.php index 96367ef..89f637a 100644 --- a/resources/views/theme/backend/adminlte/product/report.blade.php +++ b/resources/views/theme/backend/adminlte/product/report.blade.php @@ -22,6 +22,7 @@ ID Type + PID Product Services @@ -32,6 +33,7 @@ {{ $x->id }} {{ $x->category_name }} + {{ $x->product->pid }} {{ $x->product->name }} {{ $s->count() }} @@ -75,7 +77,7 @@ fixedHeader: true, order: [ [1,'asc'], - [2,'asc'], + [3,'asc'], ], rowGroup: { dataSrc: [1], diff --git a/resources/views/theme/backend/adminlte/product/widget/detail.blade.php b/resources/views/theme/backend/adminlte/product/widget/detail.blade.php index d975205..dfe9680 100644 --- a/resources/views/theme/backend/adminlte/product/widget/detail.blade.php +++ b/resources/views/theme/backend/adminlte/product/widget/detail.blade.php @@ -16,7 +16,7 @@ 'id'=>'translate.name_short', 'old'=>'translate.name_short', 'name'=>'translate[name_short]', - 'value'=>$o->name_short ?? '', + 'value'=>$o->pid, ]) @@ -28,7 +28,7 @@ 'id'=>'translate.name_detail', 'old'=>'translate.name_detail', 'name'=>'translate[name_detail]', - 'value'=>$o->name_detail ?? '', + 'value'=>$o->name, ]) @@ -53,7 +53,7 @@
-
+
@@ -117,7 +117,7 @@
-
+
Pricing Ex Taxes
diff --git a/resources/views/theme/backend/adminlte/service/home.blade.php b/resources/views/theme/backend/adminlte/service/home.blade.php index 614ea05..2a7b0a9 100644 --- a/resources/views/theme/backend/adminlte/service/home.blade.php +++ b/resources/views/theme/backend/adminlte/service/home.blade.php @@ -8,7 +8,7 @@ @endsection @section('contentheader_title') - Service: {{ $o->sid }} {{ $o->product->name_detail }} + Service: {{ $o->sid }} {{ $o->product->name }} @endsection @section('contentheader_description') {{ $o->name }} diff --git a/resources/views/theme/backend/adminlte/service/widget/active.blade.php b/resources/views/theme/backend/adminlte/service/widget/active.blade.php index 691201c..fb6b976 100644 --- a/resources/views/theme/backend/adminlte/service/widget/active.blade.php +++ b/resources/views/theme/backend/adminlte/service/widget/active.blade.php @@ -1,13 +1,13 @@ - + -
+

Active Services

@if ($o->services->count()) - +
@@ -24,7 +24,7 @@ - + @endforeach @@ -67,6 +67,12 @@ return rows.count()+' x ' + group; }, }, + columnDefs: [ + { + targets: [1], + visible: false, + }, + ], }); $('#services_active tbody').on('click','tr', function () { diff --git a/resources/views/theme/backend/adminlte/supplier/widget/products.blade.php b/resources/views/theme/backend/adminlte/supplier/widget/products.blade.php index 39c86f0..82c7a8a 100644 --- a/resources/views/theme/backend/adminlte/supplier/widget/products.blade.php +++ b/resources/views/theme/backend/adminlte/supplier/widget/products.blade.php @@ -38,7 +38,7 @@ @foreach($oo->products->pluck('products')->flatten()->filter() as $po) - + diff --git a/resources/views/theme/frontend/metronic/order/widget/info/base.blade.php b/resources/views/theme/frontend/metronic/order/widget/info/base.blade.php index e0f54d9..29a78e3 100644 --- a/resources/views/theme/frontend/metronic/order/widget/info/base.blade.php +++ b/resources/views/theme/frontend/metronic/order/widget/info/base.blade.php @@ -1,6 +1,6 @@
-

{!! $o->name_detail !!}

+

{!! $o->name !!}

ID{{ $oo->sid }} {{ $oo->product->category_name }} {{ $oo->name_short }}{{ $oo->product->name_short }}{{ $oo->product->name }} {{ $oo->external_billing ? '-' : $oo->invoice_next->format('Y-m-d') }}
{{ $po->lid }}{{ $po->name_short }}{{ $po->pid }} {{ $po->name }} {{ $po->active ? 'YES' : 'NO' }} {{ $po->billing_interval_string }}