migrate to gtea from bistbucket
This commit is contained in:
28
public/restaurant/Modules/Accounting/app/Models/Account.php
Normal file
28
public/restaurant/Modules/Accounting/app/Models/Account.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Accounting\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class Account extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'restaurant_id',
|
||||
'name',
|
||||
'code',
|
||||
'type',
|
||||
'opening_balance',
|
||||
'current_balance',
|
||||
'status',
|
||||
];
|
||||
|
||||
public const TABLE_NAME = 'accounts';
|
||||
|
||||
protected $table = self::TABLE_NAME;
|
||||
|
||||
public function transactionDetails(): HasMany
|
||||
{
|
||||
return $this->hasMany(TransactionDetail::class);
|
||||
}
|
||||
}
|
||||
28
public/restaurant/Modules/Accounting/app/Models/Deposit.php
Normal file
28
public/restaurant/Modules/Accounting/app/Models/Deposit.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Accounting\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Deposit extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'restaurant_id',
|
||||
'fund_id',
|
||||
'account_id',
|
||||
'deposit_category_id',
|
||||
'amount',
|
||||
'transaction_date',
|
||||
'voucher_no',
|
||||
'received_from',
|
||||
'note',
|
||||
'created_by',
|
||||
'status',
|
||||
];
|
||||
|
||||
protected $dates = ['transaction_date'];
|
||||
|
||||
public const TABLE_NAME = 'deposits';
|
||||
|
||||
protected $table = self::TABLE_NAME;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Accounting\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class DepositCategory extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'restaurant_id',
|
||||
'name',
|
||||
'status',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'deleted_at',
|
||||
];
|
||||
|
||||
public const TABLE_NAME = 'deposit_categories';
|
||||
|
||||
protected $table = self::TABLE_NAME;
|
||||
}
|
||||
28
public/restaurant/Modules/Accounting/app/Models/Expense.php
Normal file
28
public/restaurant/Modules/Accounting/app/Models/Expense.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Accounting\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Expense extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'restaurant_id',
|
||||
'fund_id',
|
||||
'account_id',
|
||||
'expense_category_id',
|
||||
'amount',
|
||||
'transaction_date',
|
||||
'voucher_no',
|
||||
'received_from',
|
||||
'note',
|
||||
'created_by',
|
||||
'status',
|
||||
];
|
||||
|
||||
protected $dates = ['transaction_date'];
|
||||
|
||||
public const TABLE_NAME = 'expenses';
|
||||
|
||||
protected $table = self::TABLE_NAME;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Accounting\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ExpenseCategory extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'restaurant_id',
|
||||
'name',
|
||||
'status',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'deleted_at',
|
||||
];
|
||||
|
||||
public const TABLE_NAME = 'expense_categories';
|
||||
|
||||
protected $table = self::TABLE_NAME;
|
||||
}
|
||||
29
public/restaurant/Modules/Accounting/app/Models/Fund.php
Normal file
29
public/restaurant/Modules/Accounting/app/Models/Fund.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Accounting\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class Fund extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'restaurant_id',
|
||||
'name',
|
||||
'type',
|
||||
'code',
|
||||
'opening_balance',
|
||||
'current_balance',
|
||||
'is_default',
|
||||
'status',
|
||||
];
|
||||
|
||||
public const TABLE_NAME = 'funds';
|
||||
|
||||
protected $table = self::TABLE_NAME;
|
||||
|
||||
public function transactions(): HasMany
|
||||
{
|
||||
return $this->hasMany(Transaction::class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Accounting\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class FundTransfer extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'restaurant_id',
|
||||
'from_fund_id',
|
||||
'to_fund_id',
|
||||
'amount',
|
||||
'note',
|
||||
'created_by',
|
||||
'transfer_date',
|
||||
];
|
||||
|
||||
protected $dates = ['transfer_date'];
|
||||
|
||||
public const TABLE_NAME = 'fund_transfers';
|
||||
|
||||
protected $table = self::TABLE_NAME;
|
||||
}
|
||||
26
public/restaurant/Modules/Accounting/app/Models/Tip.php
Normal file
26
public/restaurant/Modules/Accounting/app/Models/Tip.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Accounting\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Tip extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'restaurant_id',
|
||||
'waiter_id',
|
||||
'order_id',
|
||||
'amount',
|
||||
'collected_at',
|
||||
'status',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'deleted_at',
|
||||
];
|
||||
|
||||
protected $dates = ['collected_at'];
|
||||
|
||||
public const TABLE_NAME = 'tips';
|
||||
|
||||
protected $table = self::TABLE_NAME;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Accounting\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class TipDistribution extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'restaurant_id',
|
||||
'waiter_id',
|
||||
'account_id',
|
||||
'amount',
|
||||
'created_by',
|
||||
'distributed_at',
|
||||
'status',
|
||||
'created_by',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'deleted_at',
|
||||
];
|
||||
|
||||
protected $dates = ['distributed_at'];
|
||||
|
||||
public const TABLE_NAME = 'tip_distributions';
|
||||
|
||||
protected $table = self::TABLE_NAME;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Accounting\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class Transaction extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'restaurant_id',
|
||||
'fund_id',
|
||||
'transaction_type',
|
||||
'transaction_date',
|
||||
'reference_no',
|
||||
'notes',
|
||||
'total_debit',
|
||||
'total_credit',
|
||||
'created_by',
|
||||
];
|
||||
|
||||
protected $dates = ['transaction_date'];
|
||||
|
||||
public const TABLE_NAME = 'transactions';
|
||||
|
||||
protected $table = self::TABLE_NAME;
|
||||
|
||||
public function details(): HasMany
|
||||
{
|
||||
return $this->hasMany(TransactionDetail::class);
|
||||
}
|
||||
|
||||
public function fund(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Fund::class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Accounting\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class TransactionDetail extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'restaurant_id',
|
||||
'transaction_id',
|
||||
'account_id',
|
||||
'debit',
|
||||
'credit',
|
||||
'note',
|
||||
];
|
||||
|
||||
public const TABLE_NAME = 'transaction_details';
|
||||
|
||||
protected $table = self::TABLE_NAME;
|
||||
|
||||
public function account(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Account::class);
|
||||
}
|
||||
|
||||
public function transaction(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Transaction::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user