Skip to content

Commit

Permalink
Changes to files: Entities/AccountDetail.php
Browse files Browse the repository at this point in the history
Entities/Detail.php
Entities/DetailTax.php
Entities/IReturn.php
Entities/ReturnDetail.php
Entities/Sale.php
Entities/SaleReturn.php
Entities/TransferVoucher.php
Entities/VoucherNo.php
  • Loading branch information
dedanirungu committed Aug 3, 2023
1 parent ae130dd commit 7fbee29
Show file tree
Hide file tree
Showing 9 changed files with 194 additions and 44 deletions.
20 changes: 19 additions & 1 deletion Entities/AccountDetail.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class AccountDetail extends BaseModel
{
/**
* The fields that can be filled
*
* @var array<string>
*/
protected $fillable = [
Expand All @@ -19,16 +20,23 @@ class AccountDetail extends BaseModel

/**
* List of tables names that are need in this model during migration.
*
* @var array<string>
*/
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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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();
Expand Down
22 changes: 20 additions & 2 deletions Entities/Detail.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class Detail extends BaseModel
{
/**
* The fields that can be filled
*
* @var array<string>
*/
protected $fillable = [
Expand All @@ -19,16 +20,23 @@ class Detail extends BaseModel

/**
* List of tables names that are need in this model during migration.
*
* @var array<string>
*/
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
Expand All @@ -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();
Expand All @@ -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
Expand All @@ -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();
Expand Down
26 changes: 22 additions & 4 deletions Entities/DetailTax.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>
*/
protected $fillable = ['invoice_details_id', 'agency_id', 'tax_rate'];

/**
* List of tables names that are need in this model during migration.
*
* @var array<string>
*/
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();
Expand All @@ -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();
Expand All @@ -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
Expand All @@ -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');
Expand Down
20 changes: 19 additions & 1 deletion Entities/IReturn.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class IReturn extends BaseModel
{
/**
* The fields that can be filled
*
* @var array<string>
*/
protected $fillable = [
Expand All @@ -20,16 +21,23 @@ class IReturn extends BaseModel

/**
* List of tables names that are need in this model during migration.
*
* @var array<string>
*/
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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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');
Expand Down
35 changes: 25 additions & 10 deletions Entities/ReturnDetail.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>
*/
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<string>
*/
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();
Expand All @@ -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();

Expand All @@ -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
Expand All @@ -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');
Expand Down
Loading

0 comments on commit 7fbee29

Please sign in to comment.