From 7fbee29700599113e737a0b04f2709075e753af4 Mon Sep 17 00:00:00 2001 From: Dedan Irungu Date: Thu, 3 Aug 2023 18:04:30 +0300 Subject: [PATCH] Changes to files: Entities/AccountDetail.php Entities/Detail.php Entities/DetailTax.php Entities/IReturn.php Entities/ReturnDetail.php Entities/Sale.php Entities/SaleReturn.php Entities/TransferVoucher.php Entities/VoucherNo.php --- Entities/AccountDetail.php | 20 ++++++++++++++++++- Entities/Detail.php | 22 +++++++++++++++++++-- Entities/DetailTax.php | 26 +++++++++++++++++++++---- Entities/IReturn.php | 20 ++++++++++++++++++- Entities/ReturnDetail.php | 35 ++++++++++++++++++++++++---------- Entities/Sale.php | 37 ++++++++++++++++++++++++------------ Entities/SaleReturn.php | 36 ++++++++++++++++++++++++----------- Entities/TransferVoucher.php | 20 ++++++++++++++++++- Entities/VoucherNo.php | 22 +++++++++++++++++++-- 9 files changed, 194 insertions(+), 44 deletions(-) diff --git a/Entities/AccountDetail.php b/Entities/AccountDetail.php index 3b55be7..ed44528 100755 --- a/Entities/AccountDetail.php +++ b/Entities/AccountDetail.php @@ -11,6 +11,7 @@ class AccountDetail extends BaseModel { /** * The fields that can be filled + * * @var array */ protected $fillable = [ @@ -19,16 +20,23 @@ class AccountDetail extends BaseModel /** * List of tables names that are need in this model during migration. + * * @var array */ public array $migrationDependancy = []; /** * The table associated with the model. + * * @var string */ protected $table = "sale_account_detail"; + /** + * Function for defining list of fields in table view. + * + * @return ListTable + */ public function listTable(): ListTable { // listing view fields @@ -44,6 +52,11 @@ public function listTable(): ListTable } + /** + * Function for defining list of fields in form view. + * + * @return FormBuilder + */ public function formBuilder(): FormBuilder { // listing view fields @@ -60,6 +73,11 @@ public function formBuilder(): FormBuilder } + /** + * Function for defining list of fields in filter view. + * + * @return FormBuilder + */ public function filter(): FormBuilder { // listing view fields @@ -80,7 +98,7 @@ public function filter(): FormBuilder * @param Blueprint $table * @return void */ - public function migration(Blueprint $table) + public function migration(Blueprint $table): void { $table->increments('id'); $table->integer('sale_no')->nullable(); diff --git a/Entities/Detail.php b/Entities/Detail.php index 3205ee6..432edce 100755 --- a/Entities/Detail.php +++ b/Entities/Detail.php @@ -11,6 +11,7 @@ class Detail extends BaseModel { /** * The fields that can be filled + * * @var array */ protected $fillable = [ @@ -19,16 +20,23 @@ class Detail extends BaseModel /** * List of tables names that are need in this model during migration. + * * @var array */ public array $migrationDependancy = []; /** * The table associated with the model. + * * @var string */ protected $table = "sale_detail"; + /** + * Function for defining list of fields in table view. + * + * @return ListTable + */ public function listTable(): ListTable { // listing view fields @@ -46,7 +54,12 @@ public function listTable(): ListTable } - public function formBuilder() + /** + * Function for defining list of fields in form view. + * + * @return FormBuilder + */ + public function formBuilder(): FormBuilder { // listing view fields $fields = new FormBuilder(); @@ -63,6 +76,11 @@ public function formBuilder() } + /** + * Function for defining list of fields in filter view. + * + * @return FormBuilder + */ public function filter(): FormBuilder { // listing view fields @@ -83,7 +101,7 @@ public function filter(): FormBuilder * @param Blueprint $table * @return void */ - public function migration(Blueprint $table) + public function migration(Blueprint $table): void { $table->increments('id'); $table->integer('trn_no')->nullable(); diff --git a/Entities/DetailTax.php b/Entities/DetailTax.php index 9ab67f8..da539fb 100755 --- a/Entities/DetailTax.php +++ b/Entities/DetailTax.php @@ -3,31 +3,39 @@ namespace Modules\Sale\Entities; use Illuminate\Database\Schema\Blueprint; -use Modules\Base\Entities\BaseModel; use Modules\Base\Classes\Views\FormBuilder; use Modules\Base\Classes\Views\ListTable; +use Modules\Base\Entities\BaseModel; class DetailTax extends BaseModel { /** * The fields that can be filled + * * @var array */ protected $fillable = ['invoice_details_id', 'agency_id', 'tax_rate']; /** * List of tables names that are need in this model during migration. + * * @var array */ public array $migrationDependancy = []; /** * The table associated with the model. + * * @var string */ protected $table = "sale_detail_tax"; - public function listTable(): ListTable + /** + * Function for defining list of fields in table view. + * + * @return ListTable + */ + public function listTable(): ListTable { // listing view fields $fields = new ListTable(); @@ -40,7 +48,12 @@ public function listTable(): ListTable } - public function formBuilder() + /** + * Function for defining list of fields in form view. + * + * @return FormBuilder + */ + public function formBuilder(): FormBuilder { // listing view fields $fields = new FormBuilder(); @@ -53,6 +66,11 @@ public function formBuilder() } + /** + * Function for defining list of fields in filter view. + * + * @return FormBuilder + */ public function filter(): FormBuilder { // listing view fields @@ -71,7 +89,7 @@ public function filter(): FormBuilder * @param Blueprint $table * @return void */ - public function migration(Blueprint $table) + public function migration(Blueprint $table): void { $table->increments('id'); $table->integer('invoice_details_id'); diff --git a/Entities/IReturn.php b/Entities/IReturn.php index b1d18ec..ce1f262 100755 --- a/Entities/IReturn.php +++ b/Entities/IReturn.php @@ -11,6 +11,7 @@ class IReturn extends BaseModel { /** * The fields that can be filled + * * @var array */ protected $fillable = [ @@ -20,16 +21,23 @@ class IReturn extends BaseModel /** * List of tables names that are need in this model during migration. + * * @var array */ public array $migrationDependancy = []; /** * The table associated with the model. + * * @var string */ protected $table = "sale_return"; + /** + * Function for defining list of fields in table view. + * + * @return ListTable + */ public function listTable(): ListTable { // listing view fields @@ -47,6 +55,11 @@ public function listTable(): ListTable } + /** + * Function for defining list of fields in form view. + * + * @return FormBuilder + */ public function formBuilder(): FormBuilder { // listing view fields @@ -69,6 +82,11 @@ public function formBuilder(): FormBuilder } + /** + * Function for defining list of fields in filter view. + * + * @return FormBuilder + */ public function filter(): FormBuilder { // listing view fields @@ -88,7 +106,7 @@ public function filter(): FormBuilder * @param Blueprint $table * @return void */ - public function migration(Blueprint $table) + public function migration(Blueprint $table): void { $table->increments('id'); diff --git a/Entities/ReturnDetail.php b/Entities/ReturnDetail.php index 9233c2f..65154a2 100755 --- a/Entities/ReturnDetail.php +++ b/Entities/ReturnDetail.php @@ -2,37 +2,43 @@ namespace Modules\Sale\Entities; -use Modules\Base\Entities\BaseModel; use Illuminate\Database\Schema\Blueprint; - -use Modules\Base\Classes\Views\ListTable; use Modules\Base\Classes\Views\FormBuilder; +use Modules\Base\Classes\Views\ListTable; +use Modules\Base\Entities\BaseModel; class ReturnDetail extends BaseModel { /** * The fields that can be filled + * * @var array */ protected $fillable = [ 'invoice_details_id', 'trn_no', 'product_id', 'qty', 'unit_price', 'discount', - 'tax', 'item_total', 'ecommerce_type' + 'tax', 'item_total', 'ecommerce_type', ]; /** * List of tables names that are need in this model during migration. + * * @var array */ public array $migrationDependancy = []; /** * The table associated with the model. + * * @var string */ protected $table = "sale_return_detail"; - - public function listTable(): ListTable + /** + * Function for defining list of fields in table view. + * + * @return ListTable + */ + public function listTable(): ListTable { // listing view fields $fields = new ListTable(); @@ -50,9 +56,14 @@ public function listTable(): ListTable return $fields; } - + + /** + * Function for defining list of fields in form view. + * + * @return FormBuilder + */ public function formBuilder(): FormBuilder -{ + { // listing view fields $fields = new FormBuilder(); @@ -66,11 +77,15 @@ public function formBuilder(): FormBuilder $fields->name('item_total')->type('text')->group('w-1/2'); $fields->name('ecommerce_type')->type('text')->group('w-1/2'); - return $fields; } + /** + * Function for defining list of fields in filter view. + * + * @return FormBuilder + */ public function filter(): FormBuilder { // listing view fields @@ -90,7 +105,7 @@ public function filter(): FormBuilder * @param Blueprint $table * @return void */ - public function migration(Blueprint $table) + public function migration(Blueprint $table): void { $table->increments('id'); $table->integer('invoice_details_id'); diff --git a/Entities/Sale.php b/Entities/Sale.php index e41b645..9a4294e 100755 --- a/Entities/Sale.php +++ b/Entities/Sale.php @@ -2,38 +2,44 @@ namespace Modules\Sale\Entities; -use Modules\Base\Entities\BaseModel; use Illuminate\Database\Schema\Blueprint; - -use Modules\Base\Classes\Views\ListTable; use Modules\Base\Classes\Views\FormBuilder; +use Modules\Base\Classes\Views\ListTable; +use Modules\Base\Entities\BaseModel; class Sale extends BaseModel { /** * The fields that can be filled + * * @var array */ protected $fillable = [ 'voucher_no', 'vendor_id', 'vendor_name', 'billing_address', 'trn_date', 'due_date', 'amount', 'tax', 'tax_zone_id', 'ref', 'status', 'purchase_order', - 'attachments', 'particulars' + 'attachments', 'particulars', ]; /** * List of tables names that are need in this model during migration. + * * @var array */ public array $migrationDependancy = []; /** * The table associated with the model. + * * @var string */ protected $table = "sale"; - - public function listTable(): ListTable + /** + * Function for defining list of fields in table view. + * + * @return ListTable + */ + public function listTable(): ListTable { // listing view fields $fields = new ListTable(); @@ -47,14 +53,17 @@ public function listTable(): ListTable $fields->name('amount')->type('text')->ordering(true); $fields->name('tax')->type('text')->ordering(true); - - return $fields; } - + + /** + * Function for defining list of fields in form view. + * + * @return FormBuilder + */ public function formBuilder(): FormBuilder -{ + { // listing view fields $fields = new FormBuilder(); @@ -73,11 +82,15 @@ public function formBuilder(): FormBuilder $fields->name('attachments')->type('text')->group('w-1/2'); $fields->name('particulars')->type('text')->group('w-1/2'); - return $fields; } + /** + * Function for defining list of fields in filter view. + * + * @return FormBuilder + */ public function filter(): FormBuilder { // listing view fields @@ -98,7 +111,7 @@ public function filter(): FormBuilder * @param Blueprint $table * @return void */ - public function migration(Blueprint $table) + public function migration(Blueprint $table): void { $table->increments('id'); diff --git a/Entities/SaleReturn.php b/Entities/SaleReturn.php index bda69a7..4890391 100755 --- a/Entities/SaleReturn.php +++ b/Entities/SaleReturn.php @@ -2,37 +2,43 @@ namespace Modules\Sale\Entities; -use Modules\Base\Entities\BaseModel; use Illuminate\Database\Schema\Blueprint; - -use Modules\Base\Classes\Views\ListTable; use Modules\Base\Classes\Views\FormBuilder; +use Modules\Base\Classes\Views\ListTable; +use Modules\Base\Entities\BaseModel; class SaleReturn extends BaseModel { /** * The fields that can be filled + * * @var array */ protected $fillable = [ 'invoice_id', 'voucher_no', 'customer_id', 'customer_name', 'trn_date', 'amount', - 'discount', 'discount_type', 'tax', 'reason', 'comments', 'status' + 'discount', 'discount_type', 'tax', 'reason', 'comments', 'status', ]; /** * List of tables names that are need in this model during migration. + * * @var array */ public array $migrationDependancy = []; /** * The table associated with the model. + * * @var string */ protected $table = "sale_return"; - - public function listTable(): ListTable + /** + * Function for defining list of fields in table view. + * + * @return ListTable + */ + public function listTable(): ListTable { // listing view fields $fields = new ListTable(); @@ -49,9 +55,14 @@ public function listTable(): ListTable return $fields; } - + + /** + * Function for defining list of fields in form view. + * + * @return FormBuilder + */ public function formBuilder(): FormBuilder -{ + { // listing view fields $fields = new FormBuilder(); @@ -68,12 +79,15 @@ public function formBuilder(): FormBuilder $fields->name('comments')->type('text')->group('w-1/2'); $fields->name('status')->type('text')->group('w-1/2'); - - return $fields; } + /** + * Function for defining list of fields in filter view. + * + * @return FormBuilder + */ public function filter(): FormBuilder { // listing view fields @@ -97,7 +111,7 @@ public function filter(): FormBuilder * @param Blueprint $table * @return void */ - public function migration(Blueprint $table) + public function migration(Blueprint $table): void { $table->increments('id'); diff --git a/Entities/TransferVoucher.php b/Entities/TransferVoucher.php index 21cf8da..1749148 100755 --- a/Entities/TransferVoucher.php +++ b/Entities/TransferVoucher.php @@ -11,22 +11,30 @@ class TransferVoucher extends BaseModel { /** * The fields that can be filled + * * @var array */ protected $fillable = ['voucher_no', 'trn_date', 'amount', 'ac_from', 'ac_to', 'particulars']; /** * List of tables names that are need in this model during migration. + * * @var array */ public array $migrationDependancy = []; /** * The table associated with the model. + * * @var string */ protected $table = "sale_transfer_voucher"; + /** + * Function for defining list of fields in table view. + * + * @return ListTable + */ public function listTable(): ListTable { // listing view fields @@ -43,6 +51,11 @@ public function listTable(): ListTable } + /** + * Function for defining list of fields in form view. + * + * @return FormBuilder + */ public function formBuilder(): FormBuilder { // listing view fields @@ -59,6 +72,11 @@ public function formBuilder(): FormBuilder } + /** + * Function for defining list of fields in filter view. + * + * @return FormBuilder + */ public function filter(): FormBuilder { // listing view fields @@ -78,7 +96,7 @@ public function filter(): FormBuilder * @param Blueprint $table * @return void */ - public function migration(Blueprint $table) + public function migration(Blueprint $table): void { $table->increments('id'); $table->integer('voucher_no')->nullable(); diff --git a/Entities/VoucherNo.php b/Entities/VoucherNo.php index 2889eec..673185a 100755 --- a/Entities/VoucherNo.php +++ b/Entities/VoucherNo.php @@ -11,22 +11,30 @@ class VoucherNo extends BaseModel { /** * The fields that can be filled + * * @var array */ protected $fillable = ['type', 'currency', 'editable']; /** * List of tables names that are need in this model during migration. + * * @var array */ public array $migrationDependancy = []; /** * The table associated with the model. + * * @var string */ protected $table = "sale_voucher_no"; + /** + * Function for defining list of fields in table view. + * + * @return ListTable + */ public function listTable(): ListTable { // listing view fields @@ -40,7 +48,12 @@ public function listTable(): ListTable } - public function formBuilder() + /** + * Function for defining list of fields in form view. + * + * @return FormBuilder + */ + public function formBuilder(): FormBuilder { // listing view fields $fields = new FormBuilder(); @@ -53,6 +66,11 @@ public function formBuilder() } + /** + * Function for defining list of fields in filter view. + * + * @return FormBuilder + */ public function filter(): FormBuilder { // listing view fields @@ -71,7 +89,7 @@ public function filter(): FormBuilder * @param Blueprint $table * @return void */ - public function migration(Blueprint $table) + public function migration(Blueprint $table): void { $table->increments('id'); $table->string('type')->nullable();