Initial commit

This commit is contained in:
Fritz Ramirez
2024-02-12 22:54:20 -05:00
commit 10d0c477c8
19640 changed files with 4931275 additions and 0 deletions

21
.gitignore vendored Normal file
View File

@@ -0,0 +1,21 @@
/node_modules
/public/hot
/public/storage
/public/uploads
/storage/*.key
/vendor
.env
.env.backup
.phpunit.result.cache
docker-compose.override.yml
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
/.idea
/.vscode
/storage/app/CreatorStudio
/storage/debugbar
/public/CreatorStudio
/Modules/*.zip
*.zip

115
.htaccess Normal file
View File

@@ -0,0 +1,115 @@
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Send Requests To Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE font/opentype
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE icon/svg
</IfModule>
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType icon/svg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresDefault "access plus 2 days"
</IfModule>
## EXPIRES CACHING ##
<Files .env>
Order allow,deny
Deny from all
</Files>
<Files .zip>
Order allow,deny
Deny from all
</Files>
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
# BEGIN cPanel-generated php ini directives, do not edit
# Manual editing of this file may result in unexpected behavior.
# To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
# For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)
<IfModule php8_module>
php_flag display_errors On
php_value max_execution_time 1600
php_value max_input_time 1600
php_value max_input_vars 1000
php_value memory_limit 2048M
php_value post_max_size 6001M
php_value session.gc_maxlifetime 1440
php_value session.save_path "/home/studioppls/public_html/studio_temp"
php_value upload_max_filesize 6000M
php_flag zlib.output_compression On
</IfModule>
<IfModule lsapi_module>
php_flag display_errors On
php_value max_execution_time 1600
php_value max_input_time 1600
php_value max_input_vars 1000
php_value memory_limit 2048M
php_value post_max_size 6001M
php_value session.gc_maxlifetime 1440
php_value session.save_path "/home/studioppls/public_html/studio_temp"
php_value upload_max_filesize 6000M
php_flag zlib.output_compression On
</IfModule>
# END cPanel-generated php ini directives, do not edit
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “alt-php81” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-alt-php81___lsphp .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit

16
.user.ini Normal file
View File

@@ -0,0 +1,16 @@
; cPanel-generated php ini directives, do not edit
; Manual editing of this file may result in unexpected behavior.
; To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
; For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)
[PHP]
display_errors = On
max_execution_time = 1600
max_input_time = 1600
max_input_vars = 1000
memory_limit = 2048M
post_max_size = 6001M
session.gc_maxlifetime = 1440
session.save_path = "/home/studioppls/public_html/studio_temp"
upload_max_filesize = 6000M
zlib.output_compression = On

View File

View File

@@ -0,0 +1,5 @@
<?php
return [
'name' => 'Account',
];

View File

View File

@@ -0,0 +1,138 @@
<?php
namespace Modules\Account\DataTable;
use Modules\Account\Entities\BankAccount;
use Yajra\DataTables\Html\Button;
use Yajra\DataTables\Html\Column;
use Yajra\DataTables\Services\DataTable;
class BankAccountDataTable extends DataTable
{
/**
* Build DataTable class.
*
* @param mixed $query Results from query() method.
* @return \Yajra\DataTables\DataTableAbstract
*/
public function dataTable($query)
{
return datatables()
->eloquent($query)
->addIndexColumn()
->addColumn('balance', function ($bankAccount){
return amountFormat($bankAccount->balance);
})
->addColumn('action', function($model){
return view('account::bank_account.action', compact('model'));
})
->editColumn('status', function($model){
return populate_status($model->status);
})
->rawColumns(['status', 'action']);
}
/**
* Get query source of dataTable.
*
* @param \App\Models\Product $model
* @return \Illuminate\Database\Eloquent\Builder
*/
public function query(BankAccount $model)
{
return $model->newQuery();
}
/**
* Optional method if you want to use html builder.
*
* @return \Yajra\DataTables\Html\Builder
*/
public function html()
{
return $this->builder()
->setTableId('bank-account-table')
->columns($this->getColumns())
->minifiedAjax()
->dom("Blfrtip")
->orderBy(1)
->responsive(1)
->footerCallback('function ( row, data, start, end, display ) {
var api = this.api(), data;
// converting to interger to find total
var parseFloat = function ( i ) {
return typeof i === "string" ?
i.replace(/[^\d.-]/g, "")*1 :
typeof i === "number" ?
i : 0;
};
// computing column Total of the complete result
var total = api
.column( 5 , { page: "current"})
.data()
.reduce( function (a, b) {
return parseFloat(a) + parseFloat(b);
}, 0 );
var currency_sym = $("#currency_sym").val();
// Update footer by showing the total with the reference of the column index
$(api.column(0).footer() ).html("'.trans('common.total').'");
$(api.column( 5 ).footer() ).html(currency_format(total));
}')
->language([
'search' => "<i class='ti-search'></i>",
'searchPlaceholder' => __('common.quick_search'),
'paginate' => [
'next' => "<i class='ti-arrow-right'></i>",
'previous' => "<i class='ti-arrow-left'></i>"
]
])
->tabIndex(1)
->buttons(
Button::make('copyHtml5'),
Button::make('excel'),
Button::make('csv'),
Button::make('pdf'),
Button::make('print'),
Button::make('reload')
);
}
/**
* Get columns.
*
* @return array
*/
protected function getColumns()
{
return [
Column::computed('id')->data('DT_RowIndex')->title(__('common.sl'))->width(10),
Column::make('bank_name')->title(__('bank_account.Bank Name')),
Column::make('branch_name')->title(__('bank_account.Branch Name')),
Column::make('account_name')->title(__('bank_account.Account Name')),
Column::make('account_number')->title(__('bank_account.Account Number')),
Column::make('balance')->title(__('account.Balance'))->orderable(false),
Column::make('status')->title(__('common.status')),
Column::computed('action')->title(__('common.action'))
->exportable(false)
->printable(false)
->width(150),
];
}
/**
* Get filename for export.
*
* @return string
*/
protected function filename()
{
return 'Bank_Accounts_' . date('YmdHis');
}
}

View File

@@ -0,0 +1,167 @@
<?php
namespace Modules\Account\DataTable;
use Modules\Account\Entities\ChartOfAccount;
use Yajra\DataTables\Html\Button;
use Yajra\DataTables\Html\Column;
use Yajra\DataTables\Services\DataTable;
class ChartOfAccountDataTable extends DataTable
{
/**
* Build DataTable class.
*
* @param mixed $query Results from query() method.
* @return \Yajra\DataTables\DataTableAbstract
*/
public function dataTable($query)
{
return datatables()
->eloquent($query)
->addIndexColumn()
->editColumn('name', function ($chartOfAccount){
$default_for = '';
if ($chartOfAccount->default_for){
$default_for = '<span class="badge_1 ml-1">'.__('list.'.$chartOfAccount->default_for).'</span>';
}
return $chartOfAccount->name . $default_for;
})
->editColumn('parent_id', function ($chartOfAccount){
return $this->parentTree('', $chartOfAccount);
})
->editColumn('type', function ($chartOfAccount){
return __('list.'.$chartOfAccount->type);
})
->addColumn('balance', function ($chartOfAccount){
return amountFormat($chartOfAccount->balance);
})
->addColumn('action', function($model){
return view('account::chart_of_account.action', compact('model'));
})
->editColumn('status', function($model){
return populate_status($model->status);
})
->rawColumns(['status', 'action', 'name']);
}
protected function parentTree($parent, $model){
if ($model) {
if ($model->parent){
$parent .= $model->parent->name;
if ($model->parent->parent) {
$parent .= '->';
}
return $this->parentTree($parent, $model->parent);
}
}
return $parent;
}
/**
* Get query source of dataTable.
*
* @param \App\Models\Product $model
* @return \Illuminate\Database\Eloquent\Builder
*/
public function query(ChartOfAccount $model)
{
return $model->newQuery();
}
/**
* Optional method if you want to use html builder.
*
* @return \Yajra\DataTables\Html\Builder
*/
public function html()
{
return $this->builder()
->setTableId('chart-of-account-table')
->columns($this->getColumns())
->minifiedAjax()
->dom("Blfrtip")
->orderBy(1)
->responsive(1)
->language([
'search' => "<i class='ti-search'></i>",
'searchPlaceholder' => __('common.quick_search'),
'paginate' => [
'next' => "<i class='ti-arrow-right'></i>",
'previous' => "<i class='ti-arrow-left'></i>"
]
])
->tabIndex(1)
->footerCallback('function ( row, data, start, end, display ) {
var api = this.api(), data;
// converting to interger to find total
var parseFloat = function ( i ) {
return typeof i === "string" ?
i.replace(/[^\d.-]/g, "")*1 :
typeof i === "number" ?
i : 0;
};
// computing column Total of the complete result
var total = api
.column( 5 , { page: "current"})
.data()
.reduce( function (a, b) {
return parseFloat(a) + parseFloat(b);
}, 0 );
// Update footer by showing the total with the reference of the column index
$(api.column(0).footer() ).html("'.trans('common.total').'");
$(api.column( 5 ).footer() ).html(currency_format(total));
}')
->buttons(
Button::make('copyHtml5'),
Button::make('excel'),
Button::make('csv'),
Button::make('pdf'),
Button::make('print'),
Button::make('reload')
);
}
/**
* Get columns.
*
* @return array
*/
protected function getColumns()
{
return [
Column::computed('id')->data('DT_RowIndex')->title(__('common.sl'))->width(10),
Column::make('type')->title(__('account.Type')),
Column::make('name')->title(__('account.Name')),
Column::make('code')->title(__('account.Code')),
Column::make('parent_id')->title(__('account.Parent Account')),
Column::make('balance')->title(__('account.Balance'))->orderable(false)->addClass('text-center'),
Column::make('status')->title(__('common.status')),
Column::computed('action')
->title(__('common.action'))
->exportable(false)
->printable(false)
->width(150),
];
}
/**
* Get filename for export.
*
* @return string
*/
protected function filename()
{
return 'Chart_Of_Accounts_' . date('YmdHis');
}
}

View File

@@ -0,0 +1,143 @@
<?php
namespace Modules\Account\DataTable;
use Modules\Account\Entities\Transaction;
use Yajra\DataTables\Html\Button;
use Yajra\DataTables\Html\Column;
use Yajra\DataTables\Services\DataTable;
class ExpenseDataTable extends DataTable
{
/**
* Build DataTable class.
*
* @param mixed $query Results from query() method.
* @return \Yajra\DataTables\DataTableAbstract
*/
public function dataTable($query)
{
return datatables()
->eloquent($query)
->addIndexColumn()
->editColumn('chart_of_account_id', function ($transaction){
return "{$transaction->account->name}" ;
})
->editColumn('payment_method', function ($transaction){
if ($transaction->payment_method == 'bank'){
return __('list.'.$transaction->payment_method) . " ({$transaction->bank->bank_name})" ;
}
return __('list.'.$transaction->payment_method) ;
})
->editColumn('amount', function ($transaction){
return amountFormat($transaction->amount);
})
->editColumn('transaction_date', function ($transaction){
return dateFormat($transaction->transaction_date);
})
->addColumn('action', function($model){
return view('account::expense.action', compact('model'));
})
->rawColumns(['action']);
}
/**
* Get query source of dataTable.
*
* @param \App\Models\Product $model
* @return \Illuminate\Database\Eloquent\Builder
*/
public function query(Transaction $model)
{
return $model->whereIn('come_from', ['expense','gst_tsx','product_tax'])->where('type', 'out')->newQuery();
}
/**
* Optional method if you want to use html builder.
*
* @return \Yajra\DataTables\Html\Builder
*/
public function html()
{
return $this->builder()
->setTableId('expense-table')
->columns($this->getColumns())
->minifiedAjax()
->dom("Blfrtip")
->orderBy(1)
->responsive(1)
->footerCallback('function ( row, data, start, end, display ) {
var api = this.api(), data;
// converting to interger to find total
var parseFloat = function ( i ) {
return typeof i === "string" ?
i.replace(/[^\d.-]/g, "")*1 :
typeof i === "number" ?
i : 0;
};
// computing column Total of the complete result
var total = api
.column( 4 , { page: "current"})
.data()
.reduce( function (a, b) {
return parseFloat(a) + parseFloat(b);
}, 0 );
$(api.column(0).footer() ).html("'.trans('common.total').'");
$(api.column( 4 ).footer() ).html(currency_format(total));
}')
->language([
'search' => "<i class='ti-search'></i>",
'searchPlaceholder' => __('common.quick_search'),
'paginate' => [
'next' => "<i class='ti-arrow-right'></i>",
'previous' => "<i class='ti-arrow-left'></i>"
]
])
->tabIndex(1)
->buttons(
Button::make('copyHtml5'),
Button::make('excel'),
Button::make('csv'),
Button::make('pdf'),
Button::make('print'),
Button::make('reload')
);
}
/**
* Get columns.
*
* @return array
*/
protected function getColumns()
{
return [
Column::computed('id')->data('DT_RowIndex')->title(__('common.sl'))->width(10),
Column::make('title')->title(__('common.title')),
Column::make('chart_of_account_id')->title(__('chart_of_account.Expense Account')),
Column::make('payment_method')->title(__('chart_of_account.Payment Method')),
Column::make('amount')->title(__('account.Amount')),
Column::make('transaction_date')->title(__('common.date')),
Column::computed('action')->title(__('common.action'))
->exportable(false)
->printable(false)
->width(150),
];
}
/**
* Get filename for export.
*
* @return string
*/
protected function filename()
{
return 'Expenses_' . date('YmdHis');
}
}

View File

@@ -0,0 +1,146 @@
<?php
namespace Modules\Account\DataTable;
use Modules\Account\Entities\Transaction;
use Yajra\DataTables\Html\Button;
use Yajra\DataTables\Html\Column;
use Yajra\DataTables\Services\DataTable;
class IncomeDataTable extends DataTable
{
/**
* Build DataTable class.
*
* @param mixed $query Results from query() method.
* @return \Yajra\DataTables\DataTableAbstract
*/
public function dataTable($query)
{
return datatables()
->eloquent($query)
->addIndexColumn()
->editColumn('chart_of_account_id', function ($transaction){
return "{$transaction->account->name}" ;
})
->editColumn('payment_method', function ($transaction){
if ($transaction->payment_method == 'bank'){
return __('list.'.$transaction->payment_method) . " ({$transaction->bank->bank_name})" ;
}
return __('list.'.$transaction->payment_method) ;
})
->editColumn('amount', function ($transaction){
return amountFormat($transaction->amount);
})
->editColumn('transaction_date', function ($transaction){
return dateFormat($transaction->transaction_date);
})
->addColumn('action', function($model){
return view('account::income.action', compact('model'));
})
->rawColumns(['action']);
}
/**
* Get query source of dataTable.
*
* @param \App\Models\Product $model
* @return \Illuminate\Database\Eloquent\Builder
*/
public function query(Transaction $model)
{
return $model->where('come_from', 'income')->newQuery();
}
/**
* Optional method if you want to use html builder.
*
* @return \Yajra\DataTables\Html\Builder
*/
public function html()
{
return $this->builder()
->setTableId('income-table')
->columns($this->getColumns())
->minifiedAjax()
->dom("Blfrtip")
->orderBy(1)
->responsive(1)
->footerCallback('function ( row, data, start, end, display ) {
var api = this.api(), data;
// converting to interger to find total
var parseFloat = function ( i ) {
return typeof i === "string" ?
i.replace(/[^\d.-]/g, "")*1 :
typeof i === "number" ?
i : 0;
};
// computing column Total of the complete result
var total = api
.column( 4 , { page: "current"})
.data()
.reduce( function (a, b) {
return parseFloat(a) + parseFloat(b);
}, 0 );
var currency_sym = $("#currency_sym").val();
// Update footer by showing the total with the reference of the column index
$(api.column(0).footer() ).html("'.trans('common.total').'");
$(api.column( 4 ).footer() ).html(currency_format(total));
}')
->language([
'search' => "<i class='ti-search'></i>",
'searchPlaceholder' => __('common.quick_search'),
'paginate' => [
'next' => "<i class='ti-arrow-right'></i>",
'previous' => "<i class='ti-arrow-left'></i>"
]
])
->tabIndex(1)
->buttons(
Button::make('copyHtml5'),
Button::make('excel'),
Button::make('csv'),
Button::make('pdf'),
Button::make('print'),
Button::make('reload')
);
}
/**
* Get columns.
*
* @return array
*/
protected function getColumns()
{
return [
Column::computed('id')->data('DT_RowIndex')->title(__('common.sl'))->width(10),
Column::make('title')->title(__('common.title')),
Column::make('chart_of_account_id')->title(__('chart_of_account.Income Account')),
Column::make('payment_method')->title(__('chart_of_account.Payment Method')),
Column::make('amount')->title(__('account.Amount')),
Column::make('transaction_date')->title(__('common.date')),
Column::computed('action')->title(__('common.action'))
->exportable(false)
->printable(false)
->width(150),
];
}
/**
* Get filename for export.
*
* @return string
*/
protected function filename()
{
return 'Incomes_' . date('YmdHis');
}
}

View File

@@ -0,0 +1,69 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
class CreateChartOfAccountsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('chart_of_accounts', function (Blueprint $table) {
$table->id();
$table->string('code')->nullable();
$table->string('type')->nullable();
$table->string('default_for')->nullable();
$table->string('name')->nullable();
$table->bigInteger('opening_balance')->default(0);
$table->text("description")->nullable();
$table->tinyInteger("level")->default(0);
$table->string("morphable_type", 255)->nullable();
$table->unsignedBigInteger("morphable_id")->nullable();
$table->boolean("status")->default(true);
$table->foreignId('parent_id')->nullable();
$table->foreignId('created_by')->nullable();
$table->foreignId('updated_by')->nullable();
$table->timestamps();
});
$sql = [
['id' => 1, 'code' => 'income-1','type' => 'Income','default_for' => 'Income', 'name' => 'Main Income', 'opening_balance' => 0, 'description' => 'this is for main income from system', 'created_by' => 1, 'created_at' => now(), 'updated_at' => now()],
['id' => 2, 'code' => 'income-2','type' => 'Income','default_for' => 'Seller Account', 'name' => 'Main Seller Account', 'opening_balance' => 0, 'description' => 'This is for seller account', 'created_by' => 1, 'created_at' => now(), 'updated_at' => now()],
['id' => 3, 'code' => 'Income-3','type' => 'Income','default_for' => 'Product Wise Tax Account', 'name' => 'Product TAX', 'opening_balance' => 0, 'description' => 'This is for product tax', 'created_by' => 1, 'created_at' => now(), 'updated_at' => now()],
['id' => 4, 'code' => 'liability-1','type' => 'Liability','default_for' => 'GST Tax Account', 'name' => 'GST TAX', 'opening_balance' => 0, 'description' => 'This is for GST', 'created_by' => 1, 'created_at' => now(), 'updated_at' => now()],
];
DB::table('chart_of_accounts')->insert($sql);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('chart_of_accounts', function (Blueprint $table) {
$table->dropForeign('chart_of_accounts_parent_id_foreign');
$table->dropForeign('chart_of_accounts_created_by_foreign');
$table->dropForeign('chart_of_accounts_updated_by_foreign');
});
Schema::dropIfExists('chart_of_accounts');
}
}

View File

@@ -0,0 +1,51 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateBankAccountsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('bank_accounts', function (Blueprint $table) {
$table->id();
$table->string('bank_name')->nullable();
$table->string('branch_name')->nullable();
$table->string('account_name')->nullable();
$table->string('account_number')->nullable();
$table->double('opening_balance')->default(0);
$table->text("description")->nullable();
$table->boolean("status")->default(true);
$table->foreignId('created_by')->nullable();
$table->foreignId('updated_by')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('bank_accounts', function (Blueprint $table) {
$table->dropForeign('bank_accounts_created_by_foreign');
$table->dropForeign('bank_accounts_updated_by_foreign');
});
Schema::dropIfExists('bank_accounts');
}
}

View File

@@ -0,0 +1,62 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTransactionsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('transactions', function (Blueprint $table) {
$table->id();
$table->text('title')->nullable();
$table->foreignId('chart_of_account_id')->nullable();
$table->foreignId('bank_account_id')->nullable();
$table->string('type', 30)->default('in');
$table->string('payment_method', 30)->default('cash');
$table->string('come_from', 20)->nullable();
$table->text('description')->nullable();
$table->text('file')->nullable();
$table->unsignedBigInteger('morphable_id')->nullable();
$table->string('morphable_type')->nullable();
$table->double('amount')->default(0);
$table->date('transaction_date')->nullable();
$table->foreignId('created_by')->nullable();
$table->foreignId('updated_by')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('transactions', function (Blueprint $table) {
$table->dropForeign('transactions_chart_of_account_id_foreign');
$table->dropForeign('transactions_bank_account_id_foreign');
$table->dropForeign('transactions_created_by_foreign');
$table->dropForeign('transactions_updated_by_foreign');
});
Schema::dropIfExists('transactions');
}
}

View File

@@ -0,0 +1,22 @@
<?php
namespace Modules\Account\Database\Seeders;
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
class AccountDatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard();
$this->call(ChartAccountTableSeeder::class);
$this->call(BankAccountTableSeeder::class);
}
}

View File

@@ -0,0 +1,29 @@
<?php
namespace Modules\Account\Database\Seeders;
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
use Modules\Account\Entities\BankAccount;
class BankAccountTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard();
BankAccount::truncate();
BankAccount::create([
'bank_name' => 'DBBL',
'branch_name' => 'Mirpur',
'account_name' => 'John Smith',
'account_number' => '1325464652',
]);
}
}

View File

@@ -0,0 +1,49 @@
<?php
namespace Modules\Account\Database\Seeders;
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
use Modules\Account\Entities\ChartOfAccount;
class ChartAccountTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
ChartOfAccount::truncate();
ChartOfAccount::create([
'code' => 89635,
'type' => 'Income',
'default_for' => 'Income',
'name' => 'Income Account',
]);
ChartOfAccount::create([
'code' => 69636,
'type' => 'Expense',
'default_for' => 'Expense',
'name' => 'Expense Account',
]);
ChartOfAccount::create([
'code' => 59656,
'type' => 'Asset',
'default_for' => 'Asset',
'name' => 'Asset Account',
]);
ChartOfAccount::create([
'code' => 59856,
'type' => 'Loan',
'default_for' => 'Loan',
'name' => 'Loan Account',
]);
}
}

View File

View File

@@ -0,0 +1,24 @@
<?php
namespace Modules\Account\Entities;
use Illuminate\Database\Eloquent\Model;
class BankAccount extends Model
{
protected $guarded = ['id'];
protected $fillable = ['bank_name','branch_name','account_name','account_number'];
public function transactions()
{
return $this->hasMany(Transaction::class, 'bank_account_id', 'id');
}
public function getBalanceAttribute()
{
$in = $this->transactions()->where('type', 'in')->sum('amount');
$out = $this->transactions()->where('type', 'out')->sum('amount');
return $in - $out;
}
}

View File

@@ -0,0 +1,45 @@
<?php
namespace Modules\Account\Entities;
use Illuminate\Database\Eloquent\Model;
class ChartOfAccount extends Model
{
protected $fillable = [
'name',
'code',
'opening_balance',
'description',
'default_for',
'status',
'type',
];
public function parent()
{
return $this->belongsTo(ChartOfAccount::class, 'parent_id', 'id')->with('parent');
}
public function childs()
{
return $this->hasMany(ChartOfAccount::class, 'parent_id', 'id');
}
public function transactions()
{
return $this->hasMany(Transaction::class, 'chart_of_account_id', 'id');
}
public function getBalanceAttribute()
{
$in = $this->transactions()->where('type', 'in')->sum('amount');
$out = $this->transactions()->where('type', 'out')->sum('amount');
return $in - $out;
}
}

View File

@@ -0,0 +1,95 @@
<?php
namespace Modules\Account\Entities;
use App\Models\User;
use Illuminate\Database\Eloquent\Model;
use Modules\FrontendCMS\Entities\SubsciptionPaymentInfo;
use Carbon\Carbon;
class Transaction extends Model
{
protected $fillable = [
'title',
'type',
'payment_method',
'come_from',
'morphable_id',
'morphable_type',
'chart_of_account_id',
'amount',
'transaction_date',
'description',
'bank_account_id',
'created_by'
];
public function account()
{
return $this->belongsTo(ChartOfAccount::class, 'chart_of_account_id', 'id');
}
public function bank()
{
return $this->belongsTo(BankAccount::class, 'bank_account_id', 'id');
}
public function subscription_payment()
{
return $this->hasOne(SubsciptionPaymentInfo::class, 'transaction_id', 'id')->withDefault();
}
public function morphable()
{
return $this->morphTo();
}
public function scopeGetIncome($query, $type)
{
$year = Carbon::now()->year;
$query->where('type', 'in')->whereIn('come_from', ['sales_income','income','wallet_recharge','payroll_expense','installment_income','loan_expense','seller_commision']);
if ($type == "today") {
return $query->whereBetween('created_at', [Carbon::now()->format('y-m-d')." 00:00:00", Carbon::now()->format('y-m-d')." 23:59:59"])->sum('amount');
}
if ($type == "week") {
return $query->whereBetween('created_at', [Carbon::now()->subDays(7)->format('y-m-d')." 00:00:00", Carbon::now()->format('y-m-d')." 23:59:59"])->sum('amount');
}
if ($type == "month") {
$month = Carbon::now()->month;
$date_1 = Carbon::create($year, $month)->startOfMonth()->format('Y-m-d')." 00:00:00";
return $query->whereBetween('created_at', [$date_1, Carbon::now()->format('y-m-d')." 23:59:59"])->sum('amount');
}
if ($type == "year") {
$date_1 = Carbon::create($year, 1)->startOfMonth()->format('Y-m-d')." 00:00:00";
return $query->whereBetween('created_at', [$date_1, Carbon::now()->format('y-m-d')." 23:59:59"])->sum('amount');
}
}
public function scopeGetExpense($query, $type)
{
$year = Carbon::now()->year;
$query->where('type', 'out')->whereIn('come_from', ['sales_income','income','expense','wallet_recharge','payroll_expense','installment_income','loan_expense','seller_commision']);
if ($type == "today") {
return $query->whereBetween('created_at', [Carbon::now()->format('y-m-d')." 00:00:00", Carbon::now()->format('y-m-d')." 23:59:59"])->sum('amount');
}
if ($type == "week") {
return $query->whereBetween('created_at', [Carbon::now()->subDays(7)->format('y-m-d')." 00:00:00", Carbon::now()->format('y-m-d')." 23:59:59"])->sum('amount');
}
if ($type == "month") {
$month = Carbon::now()->month;
$date_1 = Carbon::create($year, $month)->startOfMonth()->format('Y-m-d')." 00:00:00";
return $query->whereBetween('created_at', [$date_1, Carbon::now()->format('y-m-d')." 23:59:59"])->sum('amount');
}
if ($type == "year") {
$date_1 = Carbon::create($year, 1)->startOfMonth()->format('Y-m-d')." 00:00:00";
return $query->whereBetween('created_at', [$date_1, Carbon::now()->format('y-m-d')." 23:59:59"])->sum('amount');
}
}
public function user(){
return $this->belongsTo(User::class,'created_by', 'id');
}
}

View File

@@ -0,0 +1,101 @@
<?php
use Illuminate\Support\Facades\File;
if (!function_exists('generate_normal_translated_select_option')) {
function generate_normal_translated_select_option($data): array
{
$options = array();
foreach ($data as $key => $value) {
$options[$value] = trans('list.' . $value);
}
return $options;
}
}
if (!function_exists('get_account_var')) {
function get_account_var($list): array
{
$file = module_path('Account', 'Resources/var/' . $list . '.json');
return File::exists($file) ? json_decode(file_get_contents($file), true) : [];
}
}
if (!function_exists('spn_active_link')) {
function spn_active_link($route_or_path, $class = 'active')
{
if (is_array($route_or_path)) {
foreach ($route_or_path as $route) {
if (request()->is($route)) {
return $class;
}
}
return in_array(request()->route()->getName(), $route_or_path) ? $class : false;
} else {
if (request()->route()->getName() == $route_or_path) {
return $class;
}
if (request()->is($route_or_path)) {
return $class;
}
}
return false;
}
}
if (!function_exists('spn_nav_item_open')) {
function spn_nav_item_open($data, $default_class = 'active')
{
foreach ($data as $d) {
if (spn_active_link($d, true)) {
return $default_class;
}
}
return false;
}
}
if (!function_exists('populate_status')) {
function populate_status($status)
{
if ($status) {
return '<span class="badge_1">' . __('common.active') . '</span>';
} else {
return '<span class="badge_2">' . __('common.in-active') . '</span>';
}
}
}
if (!function_exists('amountFormat')) {
function amountFormat($amount)
{
return single_price($amount);
}
}
if (!function_exists('dateFormat')) {
function dateFormat($date)
{
return dateConvert($date);
}
}
if (!function_exists('gv')) {
function gv($params, $key, $default = null)
{
return (isset($params[$key]) && $params[$key]) ? $params[$key] : $default;
}
}
if (!function_exists('gbv')) {
function gbv($params, $key)
{
return (isset($params[$key]) && $params[$key]) ? 1 : 0;
}
}

View File

@@ -0,0 +1,99 @@
<?php
namespace Modules\Account\Http\Controllers;
use Illuminate\Contracts\Support\Renderable;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Modules\Account\DataTable\BankAccountDataTable;
use Modules\Account\Http\Requests\BankAccountRequest;
use Modules\Account\Services\BankAccountService;
use Modules\UserActivityLog\Traits\LogActivity;
class BankAccountController extends Controller
{
/**
* @var BankAccountService
*/
private $bankAccountService;
/**
* @var Request
*/
private $request;
/**
* BankAccountController constructor.
* @param BankAccountService $bankAccountService
*/
public function __construct(
BankAccountService $bankAccountService,
Request $request
)
{
$this->bankAccountService = $bankAccountService;
$this->request = $request;
$this->middleware('maintenance_mode');
$this->middleware('prohibited_demo_mode')->only('store','update','destroy');
}
/**
* Display a listing of the resource.
* @return Renderable
*/
public function index(BankAccountDataTable $dataTable)
{
return $dataTable->render('account::bank_account.index');
}
/**
* Show the form for creating a new resource.
* @return Renderable
*/
public function create()
{
return view('account::bank_account.create');
}
public function store(BankAccountRequest $request)
{
$this->bankAccountService->store($request->validated());
LogActivity::successLog('bank created successful.');
return $this->success(['message' => trans('bank_account.The requested bank account created successful')]);
}
public function show($id)
{
if ($this->request->ajax() and $this->request->wantsJson()) {
return $this->bankAccountService->find($id);
}
}
/**
* Show the form for editing the specified resource.
* @param int $id
* @return Renderable
*/
public function edit($id)
{
$bankAccount = $this->bankAccountService->find($id);
return view('account::bank_account.edit', compact('bankAccount'));
}
public function update(BankAccountRequest $request, $id)
{
$this->bankAccountService->update($request->validated(), $id);
LogActivity::successLog('bank updated successful.');
return $this->success(['message' => trans('bank_account.The requested bank account updated successful')]);
}
public function destroy($id)
{
$this->bankAccountService->destroy($id);
LogActivity::successLog('bank deleted successful.');
return $this->success(['message' => trans('bank_account.The requested bank account deleted successful')]);
}
}

View File

@@ -0,0 +1,95 @@
<?php
namespace Modules\Account\Http\Controllers;
use Illuminate\Contracts\Support\Renderable;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Modules\Account\DataTable\ChartOfAccountDataTable;
use Modules\Account\Http\Requests\ChartOfAccountRequest;
use Modules\Account\Services\ChartOfAccountService;
use Modules\UserActivityLog\Traits\LogActivity;
class ChartOfAccountController extends Controller
{
/**
* @var ChartOfAccountService
*/
private $chartOfAccountService;
/**
* @var Request
*/
private $request;
/**
* ChartOfAccountController constructor.
* @param ChartOfAccountService $chartOfAccountService
*/
public function __construct(
ChartOfAccountService $chartOfAccountService,
Request $request
)
{
$this->chartOfAccountService = $chartOfAccountService;
$this->request = $request;
$this->middleware('maintenance_mode');
$this->middleware('prohibited_demo_mode')->only('store', 'update', 'destroy');
}
public function index(ChartOfAccountDataTable $dataTable)
{
return $dataTable->render('account::chart_of_account.index');
}
/**
* Show the form for creating a new resource.
* @return Renderable
*/
public function create()
{
$preRequisite = $this->chartOfAccountService->preRequisite();
return view('account::chart_of_account.create', $preRequisite);
}
public function store(ChartOfAccountRequest $request)
{
$this->chartOfAccountService->store($request->validated());
LogActivity::successLog('chart of account created successful.');
return $this->success(['message' => trans('chart_of_account.The requested chart of account created successful')]);
}
public function show($id)
{
if ($this->request->ajax() and $this->request->wantsJson()) {
return $this->chartOfAccountService->find($id);
}
}
/**
* Show the form for editing the specified resource.
* @param int $id
* @return Renderable
*/
public function edit($id)
{
$preRequisite = $this->chartOfAccountService->preRequisite($id);
return view('account::chart_of_account.edit', $preRequisite);
}
public function update(ChartOfAccountRequest $request, $id)
{
$this->chartOfAccountService->update($request->validated(), $id);
LogActivity::successLog('chart of account updated successful.');
return $this->success(['message' => trans('chart_of_account.The requested chart of account updated successful')]);
}
public function destroy($id)
{
$this->chartOfAccountService->destroy($id);
LogActivity::successLog('chart of account deleted successful.');
return $this->success(['message' => trans('chart_of_account.The requested chart of account deleted successful')]);
}
}

View File

@@ -0,0 +1,105 @@
<?php
namespace Modules\Account\Http\Controllers;
use Illuminate\Contracts\Support\Renderable;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Modules\Account\DataTable\ExpenseDataTable;
use Modules\Account\Http\Requests\ExpenseRequest;
use Modules\Account\Services\TransactionService;
use Modules\UserActivityLog\Traits\LogActivity;
class ExpenseController extends Controller
{
/**
* @var IncomeService
*/
private $transactionService;
/**
* @var Request
*/
private $request;
/**
* IncomeController constructor.
* @param IncomeService $transactionService
*/
public function __construct(
TransactionService $transactionService,
Request $request
) {
$this->transactionService = $transactionService;
$this->request = $request;
$this->middleware('maintenance_mode');
$this->middleware('prohibited_demo_mode')->only('store', 'update', 'destroy');
}
/**
* Display a listing of the resource.
* @return Renderable
*/
public function index(ExpenseDataTable $dataTable)
{
return $dataTable->render('account::expense.index');
}
/**
* Show the form for creating a new resource.
* @return Renderable
*/
public function create()
{
$preRequisite = $this->transactionService->preRequisite(['expense']);
return view('account::expense.create', $preRequisite);
}
public function store(ExpenseRequest $request)
{
$come_from = 'expense';
if ($request->gst_pay) {
$come_from = 'gst_tsx';
}
if ($request->product_tax_pay) {
$come_from = 'product_tax';
}
$this->transactionService->store(array_merge($request->validated(), ['come_from' => $come_from, 'type' => 'out']));
LogActivity::successLog('expenses created successful.');
return $this->success(['message' => trans('expense.The requested expense created successful')]);
}
public function show($id)
{
if ($this->request->ajax() and $this->request->wantsJson()) {
return $this->transactionService->find($id);
}
}
/**
* Show the form for editing the specified resource.
* @param int $id
* @return Renderable
*/
public function edit($id)
{
$preRequisite = $this->transactionService->preRequisite(['expense'], $id);
return view('account::expense.edit', $preRequisite);
}
public function update(ExpenseRequest $request, $id)
{
$this->transactionService->update($request->validated(), $id);
LogActivity::successLog('expenses updated successful.');
return $this->success(['message' => trans('expense.The requested expense updated successful')]);
}
public function destroy($id)
{
$this->transactionService->destroy($id);
LogActivity::successLog('expenses deleted successful.');
return $this->success(['message' => trans('expense.The requested expense deleted successful')]);
}
}

View File

@@ -0,0 +1,101 @@
<?php
namespace Modules\Account\Http\Controllers;
use Illuminate\Contracts\Support\Renderable;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Modules\Account\DataTable\IncomeDataTable;
use Modules\Account\Http\Requests\IncomeRequest;
use Modules\Account\Services\TransactionService;
use Modules\UserActivityLog\Traits\LogActivity;
class IncomeController extends Controller
{
/**
* @var IncomeService
*/
private $transactionService;
/**
* @var Request
*/
private $request;
/**
* IncomeController constructor.
* @param IncomeService $transactionService
*/
public function __construct(
TransactionService $transactionService,
Request $request
) {
$this->transactionService = $transactionService;
$this->request = $request;
$this->middleware('maintenance_mode');
$this->middleware('prohibited_demo_mode')->only('store', 'update', 'destroy');
}
/**
* Display a listing of the resource.
* @return Renderable
*/
public function index(IncomeDataTable $dataTable)
{
return $dataTable->render('account::income.index');
}
/**
* Show the form for creating a new resource.
* @return Renderable
*/
public function create()
{
try {
$preRequisite = $this->transactionService->preRequisite(['income']);
return view('account::income.create', $preRequisite);
} catch (\Exception $e) {
LogActivity::errorLog($e->getMessage());
}
}
public function store(IncomeRequest $request)
{
$this->transactionService->store(array_merge($request->validated(), ['come_from' => 'income', 'type' => 'in']));
LogActivity::successLog('income created successful.');
return $this->success(['message' => trans('income.The requested income created successful')]);
}
public function show($id)
{
if ($this->request->ajax() and $this->request->wantsJson()) {
return $this->transactionService->find($id);
}
}
/**
* Show the form for editing the specified resource.
* @param int $id
* @return Renderable
*/
public function edit($id)
{
$preRequisite = $this->transactionService->preRequisite(['income'], $id);
return view('account::income.edit', $preRequisite);
}
public function update(IncomeRequest $request, $id)
{
$this->transactionService->update($request->validated(), $id);
LogActivity::successLog('income updated successful.');
return $this->success(['message' => trans('income.The requested income updated successful')]);
}
public function destroy($id)
{
$this->transactionService->destroy($id);
LogActivity::successLog('income deleted successful.');
return $this->success(['message' => trans('income.The requested income deleted successful')]);
}
}

View File

@@ -0,0 +1,107 @@
<?php
namespace Modules\Account\Http\Controllers;
use Illuminate\Contracts\Support\Renderable;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Modules\Account\Repositories\ChartOfAccountRepository;
use Modules\Account\Services\ReportService;
use Yajra\DataTables\Facades\DataTables;
class ReportController extends Controller
{
/**
* @var ReportService
*/
private $reportService;
/**
* @var Request
*/
private $request;
public function __construct(ReportService $reportService, Request $request)
{
$this->reportService = $reportService;
$this->request = $request;
$this->middleware('maintenance_mode');
}
public function profit()
{
$data = $this->reportService->profit($this->request->all());
if ($this->request->ajax()) {
return view('account::report.profit.data', compact('data'));
}
return view('account::report.profit.index', compact('data'));
}
public function transaction()
{
$data = $this->reportService->transaction($this->request->all());
if ($this->request->ajax()) {
return view('account::report.transaction.data')->with($data);
}
return view('account::report.transaction.index');
}
public function transaction_dtbl(Request $request)
{
return DataTables::of($this->reportService->transactionQuery($request->all())['transactions'])
->addIndexColumn()
->addColumn('date',function($transactions){
return dateFormat($transactions->transaction_date);
})
->addColumn('chart_of_account',function($transactions){
return $transactions->account ? $transactions->account->name : '';
})
->addColumn('bank_account', function($transactions){
return $transactions->bank ? $transactions->bank->bank_name : '';
})
->addColumn('title', function($transactions){
return $transactions->title;
})
->addColumn('credit', function($transactions){
return ($transactions->type == 'in') ? amountFormat($transactions->amount) : '';
})
->addColumn('debit', function($transactions){
return ($transactions->type == 'out') ? amountFormat($transactions->amount) : '';
})
->make(true);
}
public function statement()
{
$data = $this->reportService->statement($this->request->all());
return view('account::report.statement.index')->with($data);
}
public function statement_dtbl(Request $request)
{
return DataTables::of($this->reportService->statementQuery($request->all())['transactions'])
->addIndexColumn()
->addColumn('date',function($transactions){
return dateFormat($transactions->transaction_date);
})
->addColumn('title', function($transactions){
return $transactions->title;
})
->addColumn('credit', function($transactions){
return ($transactions->type == 'in') ? amountFormat($transactions->amount) : '';
})
->addColumn('debit', function($transactions){
return ($transactions->type == 'out') ? amountFormat($transactions->amount) : '';
})
->make(true);
}
public function bankStatement($id)
{
$data = $this->reportService->bankReport($id);
return view('account::report.bank.index')->with($data);
}
}

View File

View File

View File

@@ -0,0 +1,56 @@
<?php
namespace Modules\Account\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class BankAccountRequest extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'bank_name' => ['required', 'string', 'max:191'],
'branch_name' => ['required', 'string', 'max:191'],
'account_name' => ['required', 'string', 'max:191'],
'account_number' => ['required', 'string', 'max:191', 'unique:bank_accounts,account_number,' . $this->bank_account],
'opening_balance' => ['sometimes', 'nullable', 'numeric'],
'description' => ['sometimes', 'nullable', 'string', 'max:500'],
'status' => ['sometimes', 'boolean'],
];
}
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function attributes()
{
return [
'bank_name' => trans('bank_account.Bank Name'),
'branch_name' => trans('bank_account.Branch Name'),
'name' => trans('bank_account.Account Name'),
'code' => trans('bank_account.Account Number'),
'opening_balance' => trans('account.Opening Balance'),
'description' => trans('common.Description'),
'status' => trans('common.status'),
];
}
}

View File

@@ -0,0 +1,85 @@
<?php
namespace Modules\Account\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class ChartOfAccountRequest extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
if ($this->chart_of_account) {
return [
'name' => ['required', 'string', 'max:191', 'unique:chart_of_accounts,name,' . $this->chart_of_account],
'code' => ['sometimes', 'nullable', 'string', 'max:191', 'unique:chart_of_accounts,code,' . $this->chart_of_account],
'description' => ['sometimes', 'nullable', 'string'],
'opening_balance' => ['sometimes', 'nullable', 'numeric'],
'default_for' => [
'sometimes', 'nullable', 'string',
Rule::in(get_account_var('list')['account_default_for']),
],
'status' => ['sometimes', 'boolean'],
];
}
return [
'parent_id' => [
'sometimes', 'nullable', 'integer',
Rule::exists('chart_of_accounts', 'id')->where(function ($query) {
return $query->where('status', 1);
})
],
'name' => ['required', 'string', 'max:191', 'unique:chart_of_accounts,name,' . $this->chart_of_account],
'code' => ['sometimes', 'nullable', 'string', 'max:191', 'unique:chart_of_accounts,code,' . $this->chart_of_account],
'type' => [
Rule::requiredIf(!$this->parent_id),
Rule::in(get_account_var('list')['account_type']),
'string', 'max:191'
],
'description' => ['sometimes', 'nullable', 'string'],
'opening_balance' => ['sometimes', 'nullable', 'numeric'],
'default_for' => [
'sometimes', 'nullable', 'string',
Rule::in(get_account_var('list')['account_default_for']),
],
'status' => ['sometimes', 'boolean'],
];
}
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function attributes()
{
return [
'parent_id' => trans('account.Parent Account'),
'name' => trans('account.Name'),
'code' => trans('account.Code'),
'type' => trans('account.Type'),
'opening_balance' => trans('account.Opening Balance'),
'description' => trans('common.Description'),
'default_for' => trans('account.Default for'),
'status' => trans('common.Status'),
];
}
}

View File

@@ -0,0 +1,70 @@
<?php
namespace Modules\Account\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class ExpenseRequest extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'chart_of_account_id' => [
'required', 'integer',
Rule::exists('chart_of_accounts', 'id')->where(function ($query) {
return $query->where('status', 1);
})
],
'bank_account_id' => [
'required_if:payment_method,bank', 'nullable', 'integer',
Rule::exists('bank_accounts', 'id')->where(function ($query) {
return $query->where('status', 1);
})
],
'payment_method' => [
'required', 'string', 'max:50',
Rule::in(get_account_var('list')['payment_method'])
],
'title' => ['required', 'string', 'max:191'],
'amount' => ['required', 'numeric'],
'transaction_date' => ['required', 'date'],
'description' => ['sometimes', 'nullable', 'string', 'max:500'],
'file' => ['sometimes', 'nullable', 'file']
];
}
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function attributes()
{
return [
'title' => trans('common.Expense'),
'chart_of_account_id' => trans('chart_of_account.Expense Account'),
'bank_account_id' => trans('bank_account.Bank Accounts'),
'payment_method' => trans('chart_of_account.Payment Method'),
'amount' => trans('account.Amount'),
'transaction_date' => trans('account.Transaction date'),
'description' => trans('common.Description'),
];
}
}

View File

@@ -0,0 +1,70 @@
<?php
namespace Modules\Account\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class IncomeRequest extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'chart_of_account_id' => [
'required', 'integer',
Rule::exists('chart_of_accounts', 'id')->where(function ($query) {
return $query->where('status', 1)->where('type', 'income');
})
],
'bank_account_id' => [
'required_if:payment_method,bank', 'nullable', 'integer',
Rule::exists('bank_accounts', 'id')->where(function ($query) {
return $query->where('status', 1);
})
],
'payment_method' => [
'required', 'string', 'max:50',
Rule::in(get_account_var('list')['payment_method'])
],
'title' => ['required', 'string', 'max:191'],
'amount' => ['required', 'numeric'],
'transaction_date' => ['required', 'date'],
'description' => ['sometimes', 'nullable', 'string', 'max:500'],
'file' => ['sometimes', 'nullable', 'file']
];
}
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function attributes()
{
return [
'title' => trans('common.Incomes'),
'chart_of_account_id' => trans('chart_of_account.Income Account'),
'bank_account_id' => trans('bank_account.Bank Accounts'),
'payment_method' => trans('chart_of_account.Payment Method'),
'amount' => trans('account.Amount'),
'transaction_date' => trans('account.Transaction date'),
'description' => trans('common.Description'),
];
}
}

View File

@@ -0,0 +1,71 @@
<?php
namespace Modules\Account\Observers;
use Illuminate\Support\Facades\Auth;
use Modules\Account\Entities\BankAccount;
use Modules\Account\Repositories\TransactionRepository;
class BankAccountsObserver
{
/**
* @var TransactionRepository
*/
private $transactionRepository;
/**
* BankAccountsObserver constructor.
* @param TransactionRepository $transactionRepository
*/
public function __construct(TransactionRepository $transactionRepository)
{
$this->transactionRepository = $transactionRepository;
}
public function creating(BankAccount $bankAccount){
$bankAccount->created_by = Auth::id();
}
public function created(BankAccount $bankAccount){
if ($bankAccount->opening_balance){
$this->transactionRepository->create($this->transactionFormate($bankAccount));
}
}
public function updating(BankAccount $bankAccount){
$bankAccount->updated_by = Auth::id();
}
public function updated(BankAccount $bankAccount){
$transaction = $this->transactionRepository->findByParam(['bank_account_id' => $bankAccount->id,'come_from' => 'opening_balance']);
if ($transaction){
if ($bankAccount->opening_balance){
$this->transactionRepository->update($this->transactionFormate($bankAccount), $transaction->id);
} else{
$transaction->delete();
}
} else {
if ($bankAccount->opening_balance){
$this->transactionRepository->create($this->transactionFormate($bankAccount));
}
}
}
private function transactionFormate(BankAccount $bankAccount)
{
return [
'title' => "Opening balance",
'description' => "{$bankAccount->bank_name} ({$bankAccount->account_number})",
'payment_method' => 'Bank',
'amount' => $bankAccount->opening_balance,
'transaction_date' => date('Y-m-d'),
'bank_account_id' => $bankAccount->id,
'come_from' => 'opening_balance',
'type' => 'in',
];
}
}

View File

@@ -0,0 +1,122 @@
<?php
namespace Modules\Account\Observers;
use Illuminate\Support\Facades\Auth;
use Modules\Account\Entities\ChartOfAccount;
use Modules\Account\Repositories\TransactionRepository;
class ChartOfAccountsObserver
{
/**
* @var TransactionRepository
*/
private $transactionRepository;
/**
* BankAccountsObserver constructor.
* @param TransactionRepository $transactionRepository
*/
public function __construct(TransactionRepository $transactionRepository)
{
$this->transactionRepository = $transactionRepository;
}
public function creating(ChartOfAccount $chartOfAccount)
{
$level = 0;
$parent = ChartOfAccount::find($chartOfAccount->parent_id);
if ($parent) {
$chartOfAccount->type = $parent->type;
$level = $parent->level + 1;
}
if (!$chartOfAccount->code) {
$id = ChartOfAccount::max('id') + 1;
$chartOfAccount->code = $chartOfAccount->type . '-' . $this->generate_code($id, $parent);
}
if ($chartOfAccount->default_for) {
ChartOfAccount::where('default_for', $chartOfAccount->default_for)->update(['default_for' => null]);
}
$chartOfAccount->created_by = Auth::id();
$chartOfAccount->level = $level;
}
protected function generate_code($id, $parent)
{
if ($parent) {
$id = $parent->id . '-' . $id;
if ($parent->parent) {
return $this->generate_code($id, $parent->parent);
}
}
return $id;
}
public function created(ChartOfAccount $chartOfAccount)
{
if ($chartOfAccount->opening_balance) {
$this->transactionRepository->create($this->transactionFormate($chartOfAccount));
}
}
public function updating(ChartOfAccount $chartOfAccount)
{
$parent = ChartOfAccount::find($chartOfAccount->parent_id);
if (!$chartOfAccount->code) {
$id = ChartOfAccount::max('id') + 1;
$chartOfAccount->code = $chartOfAccount->type . '-' . $this->generate_code($id, $parent);
}
if ($chartOfAccount->default_for) {
ChartOfAccount::where('default_for', $chartOfAccount->default_for)->update(['default_for' => null]);
}
$chartOfAccount->updated_by = Auth::id();
}
public function updated(ChartOfAccount $chartOfAccount)
{
$transaction = $this->transactionRepository->findByParam(['chart_of_account_id' => $chartOfAccount->id]);
if ($transaction) {
if ($chartOfAccount->opening_balance) {
$this->transactionRepository->update($this->transactionFormate($chartOfAccount), $transaction->id);
} else {
$transaction->delete();
}
} else {
if ($chartOfAccount->opening_balance) {
$this->transactionRepository->create($this->transactionFormate($chartOfAccount));
}
}
}
private function transactionFormate(ChartOfAccount $chartOfAccount)
{
$type = 'in';
if ($chartOfAccount->type == 'expense') {
$type = 'out';
}
return [
'title' => "Opening balance",
'description' => "{$chartOfAccount->name} ({$chartOfAccount->code})",
'payment_method' => 'cash',
'amount' => $chartOfAccount->opening_balance,
'transaction_date' => date('Y-m-d'),
'chart_of_account_id' => $chartOfAccount->id,
'come_from' => 'opening_balance',
'type' => $type,
];
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace Modules\Account\Observers;
use Illuminate\Support\Facades\Auth;
use Modules\Account\Entities\Transaction;
class TransactionsObserver
{
public function creating(Transaction $transaction)
{
$transaction->created_by = getParentSellerId();
}
public function updating(Transaction $transaction)
{
$transaction->updated_by = Auth::id();
}
}

View File

View File

@@ -0,0 +1,113 @@
<?php
namespace Modules\Account\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Database\Eloquent\Factory;
class AccountServiceProvider extends ServiceProvider
{
/**
* @var string $moduleName
*/
protected $moduleName = 'Account';
/**
* @var string $moduleNameLower
*/
protected $moduleNameLower = 'account';
/**
* Boot the application events.
*
* @return void
*/
public function boot()
{
$this->registerTranslations();
$this->registerConfig();
$this->registerViews();
$this->loadMigrationsFrom(module_path($this->moduleName, 'Database/Migrations'));
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->app->register(RouteServiceProvider::class);
}
/**
* Register config.
*
* @return void
*/
protected function registerConfig()
{
$this->publishes([
module_path($this->moduleName, 'Config/config.php') => config_path($this->moduleNameLower . '.php'),
], 'config');
$this->mergeConfigFrom(
module_path($this->moduleName, 'Config/config.php'), $this->moduleNameLower
);
}
/**
* Register views.
*
* @return void
*/
public function registerViews()
{
$viewPath = resource_path('views/modules/' . $this->moduleNameLower);
$sourcePath = module_path($this->moduleName, 'Resources/views');
$this->publishes([
$sourcePath => $viewPath
], ['views', $this->moduleNameLower . '-module-views']);
$this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->moduleNameLower);
}
/**
* Register translations.
*
* @return void
*/
public function registerTranslations()
{
$langPath = resource_path('lang/modules/' . $this->moduleNameLower);
if (is_dir($langPath)) {
$this->loadTranslationsFrom($langPath, $this->moduleNameLower);
} else {
$this->loadTranslationsFrom(module_path($this->moduleName, 'Resources/lang'), $this->moduleNameLower);
}
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return [];
}
private function getPublishableViewPaths(): array
{
$paths = [];
foreach (\Config::get('view.paths') as $path) {
if (is_dir($path . '/modules/' . $this->moduleNameLower)) {
$paths[] = $path . '/modules/' . $this->moduleNameLower;
}
}
return $paths;
}
}

View File

@@ -0,0 +1,40 @@
<?php
namespace Modules\Account\Providers;
use Illuminate\Support\ServiceProvider;
use Modules\Account\Entities\BankAccount;
use Modules\Account\Entities\ChartOfAccount;
use Modules\Account\Entities\Transaction;
use Modules\Account\Observers\BankAccountsObserver;
use Modules\Account\Observers\ChartOfAccountsObserver;
use Modules\Account\Observers\TransactionsObserver;
class ModelObserverProvider extends ServiceProvider
{
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
//
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return [];
}
public function boot(){
ChartOfAccount::observe(ChartOfAccountsObserver::class);
Transaction::observe(TransactionsObserver::class);
BankAccount::observe(BankAccountsObserver::class);
}
}

View File

@@ -0,0 +1,69 @@
<?php
namespace Modules\Account\Providers;
use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
/**
* The module namespace to assume when generating URLs to actions.
*
* @var string
*/
protected $moduleNamespace = 'Modules\Account\Http\Controllers';
/**
* Called before routes are registered.
*
* Register any model bindings or pattern based filters.
*
* @return void
*/
public function boot()
{
parent::boot();
}
/**
* Define the routes for the application.
*
* @return void
*/
public function map()
{
$this->mapApiRoutes();
$this->mapWebRoutes();
}
/**
* Define the "web" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapWebRoutes()
{
Route::middleware('web')
->namespace($this->moduleNamespace)
->group(module_path('Account', '/Routes/web.php'));
}
/**
* Define the "api" routes for the application.
*
* These routes are typically stateless.
*
* @return void
*/
protected function mapApiRoutes()
{
Route::prefix('api')
->middleware('api')
->namespace($this->moduleNamespace)
->group(module_path('Account', '/Routes/api.php'));
}
}

View File

@@ -0,0 +1,91 @@
<?php
namespace Modules\Account\Repositories;
use Illuminate\Support\Facades\DB;
use Illuminate\Validation\ValidationException;
use Modules\Account\Entities\BankAccount;
class BankAccountRepository
{
/**
* @var BankAccount
*/
protected $bankAccount;
/**
* BankAccountRepository constructor.
* @param BankAccount $bankAccount
*/
public function __construct(BankAccount $bankAccount)
{
$this->bankAccount = $bankAccount;
}
public function pluckAll()
{
return $this->bankAccount->select(DB::raw('CONCAT(bank_name, " (", account_number, ")") AS full_name'), 'id')->where('status', 1)->get()
->pluck('full_name', 'id')->prepend(__('chart_of_account.Select Account'), "");
}
public function pluckByType($type)
{
return $this->bankAccount->select(DB::raw('CONCAT(name, " (", code, ")") AS full_name'), 'id')->where(['status' => 1, 'type' => $type])->get()
->pluck('full_name', 'id')->prepend(__('chart_of_account.Select Account'), "");
}
public function create($request)
{
return $this->bankAccount->forceCreate($this->formatRequest($request));
}
public function update($request, $id)
{
$bankAccount = $this->find($id);
$bankAccount->forceFill($this->formatRequest($request))->save();
return $bankAccount->refresh();
}
/**
* @throws \Throwable
*/
public function find($id, array $with = [])
{
$bankAccount = $this->bankAccount->with($with)->find($id);
throw_if(!$bankAccount, ValidationException::withMessages(['message' => __('bank_account.The requested bank account is not found')]));
return $bankAccount;
}
private function formatRequest($request): array
{
return [
'bank_name' => gv($request, 'bank_name'),
'branch_name' => gv($request, 'branch_name'),
'account_name' => gv($request, 'account_name'),
'account_number' => gv($request, 'account_number'),
'opening_balance' => gv($request, 'opening_balance', 0),
'description' => gv($request, 'description'),
'status' => gbv($request, 'status'),
];
}
public function delete($id)
{
$bankAccount = $this->deleteAble($id);
return $bankAccount->delete();
}
private function deleteAble($id)
{
$bankAccount = $this->find($id, ['transactions' => function ($q) {
return $q->where('come_from', '!=', 'opening_balance');
}]);
throw_if($bankAccount->transactions->count(), ValidationException::withMessages(['message' => __("account::bank_account.You can\'t delete an account which has child element")]));
return $bankAccount;
}
}

View File

@@ -0,0 +1,105 @@
<?php
namespace Modules\Account\Repositories;
use Illuminate\Support\Facades\DB;
use Illuminate\Validation\ValidationException;
use Modules\Account\Entities\ChartOfAccount;
class ChartOfAccountRepository
{
/**
* @var ChartOfAccount
*/
protected $chartOfAccount;
/**
* ChartOfAccountRepository constructor.
* @param ChartOfAccount $chartOfAccount
*/
public function __construct(ChartOfAccount $chartOfAccount)
{
$this->chartOfAccount = $chartOfAccount;
}
public function pluckAll($id = null)
{
$query = $this->chartOfAccount->select(DB::raw('CONCAT(name, " (", code, ")") AS full_name'), 'id')->where('status', 1)->get();
if ($id) {
$query = $query->except($id);
}
return $query->pluck('full_name', 'id')->prepend(__('chart_of_account.Add As A Parent Account'), '');
}
public function pluckByType($type)
{
return $this->chartOfAccount->select(DB::raw('CONCAT(name, " (", code, ")") AS full_name'), 'id')->where('status', 1)->whereIn('type', $type)->get()
->pluck('full_name', 'id')->prepend(__('chart_of_account.Select Account'), '');
}
public function create($request)
{
return $this->chartOfAccount->forceCreate($this->formatRequest($request));
}
public function update($request, $id)
{
$chartOfAccount = $this->find($id);
$chartOfAccount->forceFill($this->formatRequest($request, $chartOfAccount))->save();
return $chartOfAccount->refresh();
}
/**
* @throws \Throwable
*/
public function find($id, array $with = [])
{
$chartOfAccount = $this->chartOfAccount->with($with)->find($id);
throw_if(!$chartOfAccount, ValidationException::withMessages(['message' => __('chart_of_account.The requested chart of account is not found')]));
return $chartOfAccount;
}
/**
* @throws \Throwable
*/
public function findDefaultAccount($type, array $with = [])
{
return $this->chartOfAccount->with($with)->where('default_for', $type)->first();
}
private function formatRequest($request, $chartOfAccount = null): array
{
$formatRequest = [
'name' => gv($request, 'name'),
'code' => gv($request, 'code'),
'opening_balance' => gv($request, 'opening_balance', 0),
'description' => gv($request, 'description'),
'default_for' => gv($request, 'default_for'),
'status' => gbv($request, 'status'),
];
if (!$chartOfAccount) {
$formatRequest['parent_id'] = gv($request, 'parent_id');
$formatRequest['type'] = gv($request, 'type');
}
return $formatRequest;
}
public function delete($id)
{
$chartOfAccount = $this->deleteAble($id);
return $chartOfAccount->delete();
}
private function deleteAble($id)
{
$chartOfAccount = $this->find($id, ['childs', 'transactions']);
throw_if($chartOfAccount->childs()->count(), ValidationException::withMessages(['message' => __("account::chart_of_account.You cann\'t delete an account which has child element")]));
throw_if($chartOfAccount->transactions()->count(), ValidationException::withMessages(['message' => __('chart_of_account.Account has Transaction')]));
return $chartOfAccount;
}
}

View File

@@ -0,0 +1,298 @@
<?php
namespace Modules\Account\Repositories;
use App\Traits\ImageStore;
use Carbon\Carbon;
use Illuminate\Support\Facades\DB;
use Illuminate\Validation\ValidationException;
use Modules\Account\Entities\BankAccount;
use Modules\Account\Entities\ChartOfAccount;
use Modules\Account\Entities\Transaction;
use Modules\Invoice\Entities\Invoice;
class TransactionRepository
{
use ImageStore;
/**
* @var Transaction
*/
protected $transaction;
/**
* TransactionRepository constructor.
* @param Transaction $transaction
*/
public function __construct(Transaction $transaction)
{
$this->transaction = $transaction;
}
public function pluckAll($id)
{
$query = $this->transaction->select(DB::raw('CONCAT(name, " (", code, ")") AS full_name'), 'id')->where('status', 1)->get();
if ($id) {
$query = $query->except($id);
}
return $query->pluck('full_name', 'id')->prepend(__('chart_of_account.Add As A Parent Account'), null);
}
public function create($request)
{
return $this->transaction->forceCreate($this->formatRequest($request));
}
public function update($request, $id)
{
$transaction = $this->find($id);
$transaction->forceFill($this->formatRequest($request, $transaction))->save();
return $transaction->refresh();
}
/**
* @throws \Throwable
*/
public function find($id, array $with = [])
{
$transaction = $this->transaction->with($with)->find($id);
throw_if(!$transaction, ValidationException::withMessages(['message' => __('chart_of_account.The requested chart of account is not found')]));
return $transaction;
}
/**
* @throws \Throwable
*/
public function findByParam($param, array $with = [])
{
$transaction = $this->transaction->with($with)->where($param)->first();
return $transaction;
}
private function formatRequest($request, $transaction = null): array
{
$formattedRequest = [
'title' => gv($request, 'title'),
'chart_of_account_id' => gv($request, 'chart_of_account_id'),
'payment_method' => gv($request, 'payment_method', 'cash'),
'amount' => gv($request, 'amount'),
'transaction_date' => gv($request, 'transaction_date'),
'description' => gv($request, 'description'),
'morphable_id' => gv($request, 'morphable_id'),
'morphable_type' => gv($request, 'morphable_type'),
];
if (gv($request, 'payment_method', 'cash') == 'Bank') {
$formattedRequest['bank_account_id'] = gv($request, 'bank_account_id');
} else {
$formattedRequest['bank_account_id'] = null;
}
if (gv($request, 'file')) {
$formattedRequest['file'] = $this->saveImage(gv($request, 'file'));
}
if (!$transaction) {
$formattedRequest['come_from'] = gv($request, 'come_from');
$formattedRequest['type'] = gv($request, 'type', 'in');
}
return $formattedRequest;
}
public function delete($id)
{
$transaction = $this->deleteAble($id);
return $transaction->delete();
}
private function deleteAble($id)
{
$transaction = $this->find($id);
return $transaction;
}
public function getTotalAmountByParamFilterByDate(array $params, $start, $end)
{
$transaction = $this->transaction->where('type', $params['type'])->whereIn('come_from', $params['come_from']);
if ($start) {
$transaction = $transaction->where('transaction_date', '>=', $start);
}
if ($end) {
$transaction = $transaction->where('transaction_date', '<=', $end);
}
return $transaction->sum('amount');
}
public function allTransactions($start, $end, $account_id = null, $bank_account_id = null)
{
$transaction = $this->transaction->with('account', 'bank');
if ($start || $end) {
$transaction = $transaction->whereBetween('transaction_date', [$start, $end]);
}
if ($account_id || $bank_account_id) {
if ($account_id && $bank_account_id) {
$transaction = $transaction->where(function ($query) use ($account_id, $bank_account_id) {
$query->orWhere('chart_of_account_id', $account_id)->orWhere('bank_account_id', $bank_account_id);
});
} else {
if ($account_id) {
$transaction = $transaction->where('chart_of_account_id', $account_id);
}
if ($bank_account_id) {
$transaction = $transaction->where('bank_account_id', $bank_account_id);
}
}
}
return $transaction->get();
}
public function allTransactionsQuery($start, $end, $account_id = null, $bank_account_id = null)
{
$transaction = $this->transaction->with('account', 'bank');
if ($start || $end) {
$transaction = $transaction->whereBetween('transaction_date', [$start, $end]);
}
if ($account_id || $bank_account_id) {
if ($account_id && $bank_account_id) {
$transaction = $transaction->where(function ($query) use ($account_id, $bank_account_id) {
$query->orWhere('chart_of_account_id', $account_id)->orWhere('bank_account_id', $bank_account_id);
});
} else {
if ($account_id) {
$transaction = $transaction->where('chart_of_account_id', $account_id);
}
if ($bank_account_id) {
$transaction = $transaction->where('bank_account_id', $bank_account_id);
}
}
}
return $transaction;
}
public function makeTransaction($title, $type, $method, $default_for, $chart_account_id, $description, $class, $amount, $date, $creator, $id = null, $bank_id = null)
{
if ($bank_id) {
return $this->transaction->create([
'bank_account_id' => $bank_id,
'title' => $title,
'type' => $type,
'payment_method' => $method,
'come_from' => $default_for,
'description' => $description,
'morphable_id' => $class->id,
'morphable_type' => $title == 'Invoice' ? Invoice::class : get_class($class),
'amount' => $amount,
'transaction_date' => $date,
'created_by' => $creator,
]);
} else {
$chart_account = ChartOfAccount::where('id', $chart_account_id)->first();
if ($chart_account) {
if ($id) {
return Transaction::whereHasMorph('morphable', get_class($class), function ($query) use ($id) {
$query->where('id', $id);
})->update([
'amount' => $amount,
]);
} else {
return $this->transaction->create([
'chart_of_account_id' => $chart_account->id,
'title' => $title,
'type' => $type,
'payment_method' => $method,
'come_from' => $default_for,
'description' => $description,
'morphable_id' => $class->id,
'morphable_type' => $title == 'Invoice' ? Invoice::class : get_class($class),
'amount' => $amount,
'transaction_date' => $date,
'created_by' => $creator,
]);
}
} else
return false;
}
}
public function totalIncome($date)
{
if (empty($date)) {
return $this->transaction::where('type', 'in')->sum('amount');
} else
return $this->transaction::where('type', 'in')->whereBetween('transaction_date', $date)->sum('amount');
}
public function totalExpense($date)
{
if (empty($date))
return $this->transaction::where('type', 'out')->sum('amount');
else
return $this->transaction::where('type', 'out')->whereBetween('transaction_date', $date)->sum('amount');
}
public function transactions($date, $type)
{
$check = 0;
if (empty($date)) {
$expenses = $this->transaction::selectRaw("sum(amount) as amount,type,transaction_date,DAYNAME(transaction_date) as day_name,DAY(transaction_date) as day,
DATE_FORMAT(transaction_date,'%b') as month_name,DATE_FORMAT(transaction_date,'%m') as month,YEAR(transaction_date) as year");
} else {
$expenses = $this->transaction::whereBetween('transaction_date', $date)->selectRaw("sum(amount) as amount,type,transaction_date,DAYNAME(transaction_date) as day_name,DAY(transaction_date) as day,
DATE_FORMAT(transaction_date,'%b') as month_name,DATE_FORMAT(transaction_date,'%m') as month,YEAR(transaction_date) as year");
}
if ($type == 'month_name') {
$expenses->groupBy('month')->orderBy('month', 'asc');
$check = 1;
}
if ($type == 'year') {
$expenses->groupBy('year')->orderBy('year', 'asc');
$check = 1;
} elseif ($check == 0) {
$expenses->groupBy('day')->orderBy('day', 'asc');
}
return $expenses->get();
}
public function incomeByDate($date, $type)
{
if ($type == 'month_name') {
return $this->transaction::where('type', 'in')->whereMonth('transaction_date', Carbon::parse($date))->whereYear('transaction_date', Carbon::parse($date))->sum('amount');
}
if ($type == 'year') {
return $this->transaction::where('type', 'in')->whereYear('transaction_date', Carbon::parse($date))->sum('amount');
}
return $this->transaction::where('type', 'in')->whereDate('transaction_date', Carbon::parse($date))->sum('amount');
}
public function expenseByDate($date, $type)
{
if ($type == 'month_name') {
return $this->transaction::where('type', 'out')->whereMonth('transaction_date', Carbon::parse($date))->whereYear('transaction_date', Carbon::parse($date))->sum('amount');
}
if ($type == 'year') {
return $this->transaction::where('type', 'out')->whereYear('transaction_date', Carbon::parse($date))->sum('amount');
}
return $this->transaction::where('type', 'out')->whereDate('transaction_date', Carbon::parse($date))->sum('amount');
}
}

View File

View File

@@ -0,0 +1,23 @@
<?php
return [
'Account' => 'Account',
'Chart Of Accounts' => 'Chart Of Accounts',
'Bank Accounts' => 'Bank Accounts',
'Incomes' => 'Incomes',
'Expenses' => 'Expenses',
'Parent Account' => 'Parent Account',
'Name' => 'Name',
'Code' => 'Code',
'Type' => 'Type',
'Description' => 'Description',
'Default for' => 'Default for',
'Amount' => 'Amount',
'Transaction date' => 'Transaction date',
'Profit' => 'Profit',
'From The Beginning' => 'From The Beginning',
'Balance' => 'Balance',
'GST/TAX/VAT' => 'GST / TAX / VAT',
'Opening Balance' => 'Opening Balance',
'Main Income Account' => 'Main Income Account',
'Total Product Wise Tax' => 'Total Product Wise Tax',
];

View File

@@ -0,0 +1,16 @@
<?php
return [
'Bank Accounts' => 'Bank Accounts',
'New Account' => 'New Account',
'Select Default Account For' => 'Select Default Account For',
'The requested bank account deleted successful' => 'The requested bank account deleted successful',
'The requested bank account created successful' => 'The requested bank account created successful',
'The requested bank account updated successful' => 'The requested bank account updated successful',
'Bank Name' => 'Bank Name',
'title' => 'Title',
'Branch Name' => 'Branch Name',
'Account Name' => 'Account Name',
'Account Number' => 'Account Number',
"You can\'t delete an account which has child element" => "You can\'t delete an account which has child element",
'The requested bank account is not found' => 'The requested bank account is not found',
];

View File

@@ -0,0 +1,23 @@
<?php
return [
'Select your Expense Account' => 'Select your Expense Account',
'Chart Of Accounts' => 'Chart Of Accounts',
'New Account' => 'New Account',
'Add As A Parent Account' => 'Add As A Parent Account',
'Parent account selection will add your account as a sub account' => 'Parent account selection will add your account as a sub account',
'Select your Income Account' => 'Select your Income Account',
'Account code need to be unique, Leave blank for auto generate an unique account code' => 'Account code need to be unique, Leave blank for auto generate an unique account code',
'Selecting a default Account, will remove previously default account for selected item' => 'Selecting a default Account, will remove previously default account for selected item',
'Select Default Account For' => 'Select Default Account For',
"You can\'t delete an account which has child element" => "You can\'t delete an account which has child element",
'The requested chart of account is not found' => 'The requested chart of account is not found',
'The requested chart of account deleted successful' => 'The requested chart of account deleted successful',
'The requested chart of account created successful' => 'The requested chart of account created successful',
'Income Account' => 'Income Account',
'Expense Account' => 'Expense Account',
'Select Account' => 'Select Account',
'Payment Method' => 'Payment Method',
'Select your Payment method' => 'Select your Payment method',
'Edit Account' => 'Edit Account',
'The requested chart of account updated successful' => 'The requested chart of account updated successful',
];

View File

@@ -0,0 +1,10 @@
<?php
return [
'Expense' => 'Expense',
'New Expense' => 'New Expense',
'Edit Expense' => 'Edit Expense',
'The requested expense is not found' => 'The requested expense is not found',
'The requested expense deleted successful' => 'The requested expense deleted successful',
'The requested expense created successful' => 'The requested expense created successful',
'The requested expense updated successful' => 'The requested expense updated successful',
];

View File

@@ -0,0 +1,11 @@
<?php
return [
"You cann\'t delete an income which has child element" => 'You cann\'t delete an income which has child element',
'Incomes' => 'Incomes',
'New Income' => 'New Income',
'The requested income is not found' => 'The requested income is not found',
'The requested income deleted successful' => 'The requested income deleted successful',
'The requested income created successful' => 'The requested income created successful',
'The requested income updated successful' => 'The requested income updated successful',
'Edit Income' => 'Edit Income'
];

View File

@@ -0,0 +1,18 @@
<?php
return [
'Cheque' => 'Cheque',
'Purchase' => 'Purchase',
'Expense' => 'Expense',
'Asset' => 'Asset',
'Income' => 'Income',
'Liabilities' => "Liabilities",
'Sale' => 'Sale',
'Cash' => 'Cash',
'Bank' => 'Bank',
'Loan' => 'Loan',
'Liability' => 'Liability',
'GST Tax Account'=>'GST Tax Account',
'Product Wise Tax Account'=>'Product Wise Tax Account',
'Seller Account'=>'Seller Account',
];

View File

@@ -0,0 +1,11 @@
<?php
return [
'Transaction' => 'Transaction',
'Transactions' => 'Transactions',
'Credit' => 'Credit',
'Debit' => 'Debit',
'Statement' => 'Statement',
'Account History' => 'Account History',
'Bank Account Details' => 'Bank Account Details',
'Current Balance' => 'Current Balance',
];

View File

@@ -0,0 +1,23 @@
<?php
return [
'Account' => 'حساب',
'Chart Of Accounts' => ' مخطط الحساب',
'Bank Accounts' => ' حساب المصرفي',
'Incomes' => ' دخل',
'Expenses' => 'نفقات',
'Parent Account' => ' والد حساب',
'Name' => ' إسم',
'Code' => ' رمز',
'Type' => ' نوع',
'Description' => ' وصف',
'Default for' => ' تقصير ل',
'Amount' => ' مبلغ',
'Transaction date' => ' صفقة تاريخ',
'Opening Balance' => ' فتحة ميزان',
'Balance' => ' ميزان',
'Profit' => ' ربح',
'From The Beginning' => ' من البداية',
'GST/TAX/VAT' => 'ضريبة السلع والخدمات / الضرائب / ضريبة القيمة المضافة',
'Main Income Account' => 'حساب الدخل الرئيسي',
'Total Product Wise Tax' => 'إجمالي ضريبة المنتج الحكيمة',
];

View File

@@ -0,0 +1,15 @@
<?php
return [
'Bank Accounts'=>'حساب المصرفي',
'New Account'=>' حساب جديد',
'Select Default Account For'=>' يعلّل تقصير مختار',
"You cann't delete an account which has child element"=>' أنت يستطيع لا يمحو حساب أيّ يتلقّى طفل عنصر',
'The requested bank account is not found'=>' لا يؤسّس ال يرجو حساب المصرفي',
'The requested bank account deleted successful'=>' ال يرجو حساب المصرفي يمحو ناجح',
'The requested bank account created successful'=>' خلق ال يرجو حساب المصرفي ناجح',
'The requested bank account updated successful'=>' ال يرجو حساب المصرفي محيّن ناجح',
'Bank Name'=>' بنك إسم',
'Branch Name'=>' فرع إسم',
'Account Name'=>' حساب إسم',
'Account Number'=>' رقم حساب',
];

View File

@@ -0,0 +1,23 @@
<?php
return [
'Chart Of Accounts' => 'مخطط الحساب',
'New Account' => ' حساب جديد',
'Add As A Parent Account' => ' أضفت كوالد حساب',
'Parent account selection will add your account as a sub account' => ' والد حساب سيضيف إنتقاء حسابك كحساب فرعيّ',
'Select your Expense Account' => ' انتقيت ك نفقة تكليف حساب',
'Select your Income Account' => ' انتقيت ك دخل حساب',
'Select your Payment method' => ' انتقيت ك دفع طريقة',
'Account code need to be unique. Leave blank for auto generate an unique account code.' => ' حساب رمز حاجة أن يكون فريد. تركت فراغ لسيارة يلد فريد حساب رمز.',
'Selecting a default Account, will remove previously default account for selected item.' => ' سيزيل ينتقي تقصير حساب، سابقا تقصير يعلّل ينتقي مادة.',
'Select Default Account For' => ' يعلّل تقصير مختار',
"You cann't delete an account which has child element" => ' أنت يستطيع لا يمحو حساب أيّ يتلقّى طفل عنصر',
'The requested chart of account is not found' => ' لا يؤسّس ال يرجو مخطط الحساب',
'The requested chart of account deleted successful' => ' ال يرجو مخطط من حساب يمحو ناجح',
'The requested chart of account created successful' => ' خلق ال يرجو مخطط الحساب ناجح',
'Income Account' => ' دخل حساب',
'Expense Account' => ' نفقة تكليف حساب',
'Select Account' => ' انتقيت حساب',
'Payment Method' => ' دفع طريقة',
'Edit Account' => 'تحرير الحساب',
'The requested chart of account updated successful' => 'تم تحديث مخطط الحساب المطلوب بنجاح',
];

View File

@@ -0,0 +1,10 @@
<?php
return [
'Expense'=>'نفقة تكليف',
'New Expense'=>' نفقة تكليف جديد',
'Edit Expense'=>' حرّرت نفقة تكليف',
'The requested expense is not found'=>' لا يؤسّس ال يرجو نفقة تكليف',
'The requested expense deleted successful'=>' ال يرجو نفقة تكليف يمحو ناجح',
'The requested expense created successful'=>' خلق ال يرجو نفقة تكليف ناجح',
'The requested expense updated successful'=>' ال يرجو نفقة تكليف محيّن ناجح',
];

View File

@@ -0,0 +1,11 @@
<?php
return [
'Incomes'=>'دخل',
'New Income'=>' دخل جديد',
'Edit Income'=>' حرّرت دخل',
"You cann't delete an income which has child element"=>' أنت يستطيع لا يمحو دخل أيّ يتلقّى طفل عنصر',
'The requested income is not found'=>' لا يؤسّس ال يرجو دخل',
'The requested income deleted successful'=>' ال يرجو دخل يمحو ناجح',
'The requested income created successful'=>' خلق ال يرجو دخل ناجح',
'The requested income updated successful'=>' ال يرجو دخل محيّن ناجح',
];

View File

@@ -0,0 +1,13 @@
<?php
return [
'Income' => 'دخل',
'Expense' => ' نفقة تكليف',
'Asset' => ' أصل',
'Liabilities' => ' مسؤولية',
'Sale' => ' عمليّة بيع',
'Purchase' => ' شراء',
'Cash' => ' نقد',
'Bank' => ' بنك',
'Cheque' => ' شيك',
'Loan' => 'يقرض',
];

View File

@@ -0,0 +1,11 @@
<?php
return [
'Transaction'=>'صفقة',
'Transactions'=>' صفقة',
'Credit'=>' اعتمادات',
'Debit'=>' دين',
'Statement'=>' بيان',
'Account History'=>' حساب تاريخ',
'Bank Account Details'=>' حساب المصرفي تفصيل',
'Current Balance'=>' رصيد الحالي',
];

View File

@@ -0,0 +1,23 @@
<?php
return [
'Account' => 'অ্যাকাউন্ট',
'Chart Of Accounts' => ' চার্ট অ্যাকাউন্ট',
'Bank Accounts' => ' ব্যাঙ্ক অ্যাকাউন্ট',
'Incomes' => ' হয়েছে',
'Expenses' => ' ব্যয়',
'Parent Account' => ' অভিভাবক অ্যাকাউন্ট',
'Name' => ' নাম',
'Code' => ' কোড',
'Type' => ' প্রকার',
'Description' => ' বর্ণনা',
'Default for' => ' ডিফল্ট জন্য',
'Amount' => ' পরিমাণ',
'Transaction date' => ' বিনিময় তারিখ',
'Opening Balance' => ' খোলা হয়েছিল',
'Balance' => ' ভারসাম্য',
'Profit' => ' লাভ হয়',
'From The Beginning' => ' শুরু থেকে',
'GST/TAX/VAT' => 'জিএসটি/ট্যাক্স/ভ্যাট',
'Main Income Account' => 'প্রধান আয়ের হিসাব',
'Total Product Wise Tax' => 'মোট পণ্য অনুসারে কর',
];

View File

@@ -0,0 +1,15 @@
<?php
return [
'Bank Accounts'=>'ব্যাঙ্ক অ্যাকাউন্ট',
'New Account'=>' নতুন অ্যাকাউন্ট',
'Select Default Account For'=>' ডিফল্ট অ্যাকাউন্টের জন্য নির্বাচন করুন',
"You cann't delete an account which has child element"=>' আপনি কোন একাউন্ট বিলোপ করতে পারেন না যা চাইল্ড এলিমেন্ট',
'The requested bank account is not found'=>' অনুরোধ করা ব্যাঙ্ক একাউন্ট খুঁজে পাওয়া গেল না',
'The requested bank account deleted successful'=>' অনুরোধ করা ব্যাঙ্ক একাউন্ট বিলোপ করা সফল',
'The requested bank account created successful'=>' অনুরোধ করা ব্যাঙ্ক অ্যাকাউন্ট তৈরি করা সফল',
'The requested bank account updated successful'=>' অনুরোধ করা ব্যাঙ্ক অ্যাকাউন্ট আপডেট করা হয়েছে সফল',
'Bank Name'=>' ব্যাংক নাম',
'Branch Name'=>' শাখা নাম',
'Account Name'=>' অ্যাকাউন্ট নাম',
'Account Number'=>' অ্যাকাউন্ট নম্বর',
];

View File

@@ -0,0 +1,23 @@
<?php
return [
'Chart Of Accounts' => 'চার্ট অ্যাকাউন্ট',
'New Account' => ' নতুন অ্যাকাউন্ট',
'Add As A Parent Account' => ' একটি অভিভাবক অ্যাকাউন্ট হিসাবে যুক্ত করুন',
'Parent account selection will add your account as a sub account' => ' অভিভাবক অ্যাকাউন্ট যোগ করুন নির্বাচন করা হবে আপনার অ্যাকাউন্ট হিসাবে উপ অ্যাকাউন্ট',
'Select your Expense Account' => ' আপনার কিছু অ্যাকাউন্ট নির্বাচন করুন',
'Select your Income Account' => ' আপনার আয় অ্যাকাউন্ট নির্বাচন করুন',
'Select your Payment method' => ' আপনার প্রদানের পদ্ধতিটি নির্বাচন করুন',
'Account code need to be unique. Leave blank for auto generate an unique account code.' => ' অ্যাকাউন্ট কোড হতে হবে অদ্বিতীয়। ফাঁকা রাখুন জন্য একটি অনন্য অ্যাকাউন্ট কোড স্বয়ংক্রিয় জেনেরেট করুন।',
'Selecting a default Account, will remove previously default account for selected item.' => ' একটি ডিফল্ট অ্যাকাউন্ট নির্বাচন করে অপসারণ করা হবে, পূর্বে নির্বাচিত আইটেমের জন্য ডিফল্ট অ্যাকাউন্ট।',
'Select Default Account For' => ' ডিফল্ট অ্যাকাউন্টের জন্য নির্বাচন করুন',
"You cann't delete an account which has child element" => ' আপনি কোন একাউন্ট বিলোপ করতে পারেন না যা চাইল্ড এলিমেন্ট',
'The requested chart of account is not found' => ' অনুরোধ করা ছক একাউন্ট খুঁজে পাওয়া গেল না',
'The requested chart of account deleted successful' => ' অনুরোধ করা চার্ট এর একাউন্ট বিলোপ করা সফল',
'The requested chart of account created successful' => ' অনুরোধ করা ছক অ্যাকাউন্ট তৈরি করা সফল',
'Income Account' => ' আয় অ্যাকাউন্ট',
'Expense Account' => ' খরচা অ্যাকাউন্ট',
'Select Account' => ' একাউন্ট নির্বাচন করুন',
'Payment Method' => ' প্রদানের পদ্ধতি',
'The requested chart of account updated successful' => 'অনুরোধ করা অ্যাকাউন্টের চার্টটি সফলভাবে আপডেট হয়েছে',
'Edit Account' => 'অ্যাকাউন্ট সম্পাদনা করুন',
];

View File

@@ -0,0 +1,10 @@
<?php
return [
'Expense'=>'খরচা',
'New Expense'=>' নতুন কার্য সমাধা করা',
'Edit Expense'=>' কিছু সম্পাদনা করুন',
'The requested expense is not found'=>' অনুরোধ করা কিছু পাওয়া যায়নি',
'The requested expense deleted successful'=>' অনুরোধ করা কিছু বিলোপ করা সফল',
'The requested expense created successful'=>' অনুরোধ করা কিছু তৈরি সফল',
'The requested expense updated successful'=>' অনুরোধ করা কিছু আপডেট সফল',
];

View File

@@ -0,0 +1,11 @@
<?php
return [
"You can't delete an income which has child element"=>'আপনি বিলোপ করতে পারেন না, যা চাইল্ড এলিমেন্ট একটি আয় করেছে',
'Incomes'=>' হয়েছে',
'New Income'=>' নতুন আয়',
'The requested income is not found'=>' অনুরোধ করা আয় খুঁজে পাওয়া গেল না',
'The requested income deleted successful'=>' অনুরোধ করা আয়ের বিলোপ করা সফল',
'The requested income created successful'=>' অনুরোধ করা আয়ের তৈরি সফল',
'The requested income updated successful'=>' অনুরোধ করা আয়ের আধুনিকীকৃত সফল',
'Edit Income'=>' আয়ের সম্পাদনা করুন',
];

View File

@@ -0,0 +1,13 @@
<?php
return [
'Income' => 'আয়',
'Expense' => ' খরচা',
'Asset' => ' সম্পত্তি',
'Liabilities' => 'দায়বদ্ধতা',
'Sale' => ' বিক্রি করা হয়',
'Purchase' => ' ক্রয় করা',
'Cash' => "নগদ",
'Bank' => ' ব্যাংক',
'Cheque' => 'চেক',
'Loan' => 'ঋণ',
];

View File

@@ -0,0 +1,11 @@
<?php
return [
'Transaction'=>'বিনিময়',
'Transactions'=>' ব্যবসা',
'Credit'=>'ক্রেডিট',
'Debit'=>' ডেবিট',
'Statement'=>' বিবৃতি',
'Account History'=>' অ্যাকাউন্ট ইতিহাস',
'Bank Account Details'=>' ব্যাংক অ্যাকাউন্টের বিবরণ',
'Current Balance'=>'বর্তমান হিসাব',
];

View File

@@ -0,0 +1,20 @@
<?php
return [
'Account'=>'Konto',
'Chart Of Accounts'=>' Diagramm Rechnungsprüfungen',
'Bank Accounts'=>' Bankkonten',
'Incomes'=>' Einkommen',
'Expenses'=>' Ausgaben',
'Parent Account'=>' Elternteil-Konto',
'Name'=>' Name',
'Code'=>' Code',
'Type'=>' Art',
'Description'=>' Beschreibung',
'Default for'=>' Fallen Sie für zurück',
'Amount'=>' Menge',
'Transaction date'=>' Geschäftsdatum',
'Opening Balance'=>' Öffnende Balance',
'Balance'=>' Balance',
'Profit'=>' Gewinn',
'From The Beginning'=>' Von Anfang an',
];

View File

@@ -0,0 +1,15 @@
<?php
return [
'Bank Accounts'=>'Bankkonten',
'New Account'=>' Neues Konto',
'Select Default Account For'=>' Ausgewählte Nichterfüllung erklären',
"You cann't delete an account which has child element"=>' Sie können ein Konto nicht löschen, das Kinderelement hat',
'The requested bank account is not found'=>' Das geforderte Bankkonto wird nicht gefunden',
'The requested bank account deleted successful'=>' Das geforderte Bankkonto löschte erfolgreiches',
'The requested bank account created successful'=>' Das geforderte Bankkonto schuf erfolgreiches',
'The requested bank account updated successful'=>' Das geforderte Bankkonto aktualisierte erfolgreiches',
'Bank Name'=>' Bankadresse',
'Branch Name'=>' Niederlassungs-Name',
'Account Name'=>' Kontenbezeichnung',
'Account Number'=>' Kontonummer',
];

View File

@@ -0,0 +1,23 @@
<?php
return [
'Chart Of Accounts' => 'Diagramm Rechnungsprüfungen',
'New Account' => ' Neues Konto',
'Add As A Parent Account' => ' Fügen Sie als Elternteil-Konto hinzu',
'Parent account selection will add your account as a sub account' => ' Elternteilkontoauswahl fügt Ihr Konto als Vorkonto hinzu',
'Select your Expense Account' => ' Wählen Sie Ihre Auslagenrechnung vor',
'Select your Income Account' => ' Wählen Sie Ihre Ertragsrechnung vor',
'Select your Payment method' => ' Wählen Sie Ihre Zahlungsmethode vor',
'Account code need to be unique. Leave blank for auto generate an unique account code.' => ' Kontoschlüsselbedarf, einzigartig zu sein. Lassen Sie freien Raum für Auto, einen einzigartigen Kontoschlüssel zu erzeugen.',
'Selecting a default Account, will remove previously default account for selected item.' => ' Das Vorwählen eines Nichterfüllung Kontos, entfernt vorher Nichterfüllung erklären vorgewähltes Einzelteil.',
'Select Default Account For' => ' Ausgewählte Nichterfüllung erklären',
"You cann't delete an account which has child element" => ' Sie können ein Konto nicht löschen, das Kinderelement hat',
'The requested chart of account is not found' => ' Das erbetene Diagramm des Kontos wird nicht gefunden',
'The requested chart of account deleted successful' => ' Das erbetene Diagramm des Kontos löschte erfolgreiches',
'The requested chart of account created successful' => ' Das erbetene Diagramm des Kontos schuf erfolgreiches',
'Income Account' => ' Ertragsrechnung',
'Expense Account' => ' Auslagenrechnung',
'Select Account' => ' Ausgewähltes Konto',
'Payment Method' => ' Zahlungs-Methode',
'Edit Account' => 'Konto bearbeiten',
'The requested chart of account updated successful' => 'Der angeforderte Kontenplan wurde erfolgreich aktualisiert',
];

View File

@@ -0,0 +1,10 @@
<?php
return [
'Expense'=>'Ausgabe',
'New Expense'=>' Neue Ausgabe',
'Edit Expense'=>' Redigieren Sie Ausgabe',
'The requested expense is not found'=>' Die geforderte Ausgabe wird nicht gefunden',
'The requested expense deleted successful'=>' Die geforderte Ausgabe löschte erfolgreiches',
'The requested expense created successful'=>' Die geforderte Ausgabe schuf erfolgreiches',
'The requested expense updated successful'=>' Die geforderte Ausgabe aktualisierte erfolgreiches',
];

View File

@@ -0,0 +1,11 @@
<?php
return [
"You cann't delete an income which has child element"=>'Sie können ein Einkommen nicht löschen, das Kinderelement hat',
'Incomes'=>' Einkommen',
'New Income'=>' Neues Einkommen',
'The requested income is not found'=>' Das geforderte Einkommen wird nicht gefunden',
'The requested income deleted successful'=>' Das geforderte Einkommen löschte erfolgreiches',
'The requested income created successful'=>' Das geforderte Einkommen schuf erfolgreiches',
'The requested income updated successful'=>' Das geforderte Einkommen aktualisierte erfolgreiches',
'Edit Income'=>' Redigieren Sie Einkommen',
];

View File

@@ -0,0 +1,14 @@
<?php
return [
'Income' => 'Einkommen',
'Expense' => ' Ausgabe',
'Asset' => ' Anlagegut',
'Liabilities' => ' Verbindlichkeiten',
'Sale' => ' Verkauf',
'Purchase' => ' Kauf',
'Cash' => ' Bargeld',
'Bank' => ' Bank',
'Cheque' => ' Scheck',
'Loan' => 'Darlehen',
'Liability' => 'Liability',
];

View File

@@ -0,0 +1,11 @@
<?php
return [
'Transaction'=>'Geschäft',
'Transactions'=>' Geschäfte',
'Credit'=>' Kredit',
'Debit'=>' Debet',
'Statement'=>' Aussage',
'Account History'=>' Konto-Geschichte',
'Bank Account Details'=>' Bankkonto-Details',
'Current Balance'=>' Aktuelles Guthaben',
];

View File

@@ -0,0 +1,20 @@
<?php
return [
'Account'=>'Cuenta',
'Chart Of Accounts'=>' Carta de cuentas',
'Bank Accounts'=>' Cuentas bancarias',
'Incomes'=>' Rentas',
'Expenses'=>' Costos',
'Parent Account'=>' Cuenta del padre',
'Name'=>' Nombre',
'Code'=>' Código',
'Type'=>' Tipo',
'Description'=>' Descripción',
'Default for'=>' Omita para',
'Amount'=>' Cantidad',
'Transaction date'=>' Fecha de la transacción',
'Opening Balance'=>' Balanza de apertura',
'Balance'=>' Balanza',
'Profit'=>' Beneficio',
'From The Beginning'=>' Desde el principio',
];

View File

@@ -0,0 +1,15 @@
<?php
return [
'Bank Accounts'=>'Cuentas bancarias',
'New Account'=>' Nueva cuenta',
'Select Default Account For'=>' El defecto selecto explica',
"You cann't delete an account which has child element"=>' Usted no puede suprimir una cuenta que tenga elemento secundario',
'The requested bank account is not found'=>' La cuenta bancaria pedida no se encuentra',
'The requested bank account deleted successful'=>' La cuenta bancaria pedida suprimió acertado',
'The requested bank account created successful'=>' La cuenta bancaria pedida creó acertado',
'The requested bank account updated successful'=>' La cuenta bancaria pedida puso al día acertado',
'Bank Name'=>' Nombre de banco',
'Branch Name'=>' Nombre de rama',
'Account Name'=>' Nombre de cuenta',
'Account Number'=>' Número de cuenta',
];

View File

@@ -0,0 +1,23 @@
<?php
return [
'Chart Of Accounts' => 'Carta de cuentas',
'New Account' => ' Nueva cuenta',
'Add As A Parent Account' => ' Añada como cuenta del padre',
'Parent account selection will add your account as a sub account' => ' La selección de la cuenta del padre añadirá su cuenta como cuenta sub',
'Select your Expense Account' => ' Seleccione su cuenta de costo',
'Select your Income Account' => ' Seleccione su cuenta de ingresos',
'Select your Payment method' => ' Seleccione su forma de pago',
'Account code need to be unique. Leave blank for auto generate an unique account code.' => ' Necesidad del código de cuenta de ser único. Deje el espacio en blanco para el auto para generar un código de cuenta único.',
'Selecting a default Account, will remove previously default account for selected item.' => ' La selección de una cuenta del defecto, quitará previamente defecto explica el elemento seleccionado.',
'Select Default Account For' => ' El defecto selecto explica',
"You cann't delete an account which has child element" => ' Usted no puede suprimir una cuenta que tenga elemento secundario',
'The requested chart of account is not found' => ' La carta de la cuenta pedida no se encuentra',
'The requested chart of account deleted successful' => ' La carta de la cuenta pedida suprimió acertado',
'The requested chart of account created successful' => ' La carta de la cuenta pedida creó acertado',
'Income Account' => ' Cuenta de ingresos',
'Expense Account' => ' Cuenta de costo',
'Select Account' => ' Cuenta selecta',
'Payment Method' => ' Forma de pago',
'Edit Account' => 'Editar cuenta',
'The requested chart of account updated successful' => 'El plan de cuenta solicitado se actualizó correctamente',
];

View File

@@ -0,0 +1,10 @@
<?php
return [
'Expense'=>'Costo',
'New Expense'=>' Nuevo costo',
'Edit Expense'=>' Corrija el costo',
'The requested expense is not found'=>' El costo pedido no se encuentra',
'The requested expense deleted successful'=>' El costo pedido suprimió acertado',
'The requested expense created successful'=>' El costo pedido creó acertado',
'The requested expense updated successful'=>' El costo pedido puso al día acertado',
];

View File

@@ -0,0 +1,11 @@
<?php
return [
"You cann't delete an income which has child element"=>'Usted no puede suprimir una renta que tenga elemento secundario',
'Incomes'=>' Rentas',
'New Income'=>' Nueva renta',
'The requested income is not found'=>' La renta pedida no se encuentra',
'The requested income deleted successful'=>' La renta pedida suprimió acertado',
'The requested income created successful'=>' La renta pedida creó acertado',
'The requested income updated successful'=>' La renta pedida puso al día acertado',
'Edit Income'=>' Corrija la renta',
];

View File

@@ -0,0 +1,14 @@
<?php
return [
'Income' => 'Renta',
'Expense' => ' Costo',
'Asset' => ' Activo',
'Liabilities' => ' Responsabilidades',
'Sale' => ' Venta',
'Purchase' => ' Compra',
'Cash' => ' Efectivo',
'Bank' => ' Banco',
'Cheque' => ' Cheque',
'Loan' => 'Prunto',
];

View File

@@ -0,0 +1,11 @@
<?php
return [
'Transaction'=>'Transacción',
'Transactions'=>' Transacciones',
'Credit'=>' Crédito',
'Debit'=>' Debe',
'Statement'=>' Declaración',
'Account History'=>' Historia de la cuenta',
'Bank Account Details'=>' Detalles de la cuenta bancaria',
'Current Balance'=>' Equilibrio actual',
];

View File

@@ -0,0 +1,20 @@
<?php
return [
'Account'=>'Compte ',
'Chart Of Accounts'=>' Diagramme des comptes ',
'Bank Accounts'=>' Comptes bancaires ',
'Incomes'=>' Revenus ',
'Expenses'=>' Dépenses ',
'Parent Account'=>' Compte de parent ',
'Name'=>' Nom ',
'Code'=>' Code ',
'Type'=>' Type ',
'Description'=>' Description ',
'Default for'=>' Transférez pour ',
'Amount'=>' Quantité ',
'Transaction date'=>' Date de transaction ',
'Opening Balance'=>"Équilibre de s'ouvrir",
'Balance'=>' Équilibre ',
'Profit'=>' Bénéfice ',
'From The Beginning'=>' Du début',
];

View File

@@ -0,0 +1,15 @@
<?php
return [
'Bank Accounts'=>'Comptes bancaires ',
'New Account'=>' Nouveau compte ',
'Select Default Account For'=>' Le défaut choisi expliquent ',
"You can't delete an account which has child element"=>"Vous ne pouvez pas supprimer un compte qui a l'élément d'enfant",
'The requested bank account is not found'=>"Le compte bancaire demandé n'est pas trouvé",
'The requested bank account deleted successful'=>' Le compte bancaire demandé a supprimé réussi ',
'The requested bank account created successful'=>' Le compte bancaire demandé a créé réussi ',
'The requested bank account updated successful'=>' Le compte bancaire demandé a mis à jour réussi ',
'Bank Name'=>' Nom de banque ',
'Branch Name'=>' Nom de branche ',
'Account Name'=>' Nom de compte ',
'Account Number'=>' Numéro de compte',
];

View File

@@ -0,0 +1,23 @@
<?php
return [
'Chart Of Accounts' => 'Diagramme des comptes ',
'New Account' => ' Nouveau compte ',
'Add As A Parent Account' => ' Ajoutez comme compte de parent ',
'Parent account selection will add your account as a sub account' => ' La sélection de compte de parent ajoutera votre compte comme sous compte ',
'Select your Expense Account' => ' Choisissez votre note de frais ',
'Select your Income Account' => ' Choisissez votre compte de produits ',
'Select your Payment method' => ' Choisissez votre méthode de paiement ',
'Account code need to be unique. Leave blank for auto generate an unique account code.' => "Le besoin de code de compte d'être unique. Laissez le blanc pour l'automobile pour produire d'un code de compte unique",
'Selecting a default Account, will remove previously default account for selected item.' => "La sélection d'un compte de défaut, enlèvera précédemment le défaut expliquent l'article choisi",
'Select Default Account For' => ' Le défaut choisi expliquent ',
"You can't delete an account which has child element" => "Vous ne pouvez pas supprimer un compte qui a l'élément d'enfant",
'The requested chart of account is not found' => "Le diagramme du compte demandé n'est pas trouvé",
'The requested chart of account deleted successful' => ' Le diagramme du compte demandé a supprimé réussi ',
'The requested chart of account created successful' => ' Le diagramme du compte demandé a créé réussi ',
'Income Account' => ' Compte de produits ',
'Expense Account' => ' Note de frais ',
'Select Account' => ' Compte choisi ',
'Payment Method' => ' Méthode de paiement',
'Edit Account' => 'Modifier le compte',
'The requested chart of account updated successful' => 'Le plan de compte demandé a bien été mis à jour',
];

View File

@@ -0,0 +1,10 @@
<?php
return [
'Expense'=>'Dépenses ',
'New Expense'=>' Nouvelles dépenses ',
'Edit Expense'=>' Éditez les dépenses ',
'The requested expense is not found'=>' Les dépenses demandées ne sont pas trouvées ',
'The requested expense deleted successful'=>' Les dépenses demandées ont supprimé réussi ',
'The requested expense created successful'=>' Les dépenses demandées ont créé réussi ',
'The requested expense updated successful'=>' Les dépenses demandées ont mis à jour réussi',
];

View File

@@ -0,0 +1,11 @@
<?php
return [
"You can't delete an income which has child element"=>"Vous ne pouvez pas supprimer un revenu qui a l'élément d'enfant",
'Incomes'=>' Revenus ',
'New Income'=>' Nouveau revenu ',
'The requested income is not found'=>"Le revenu demandé n'est pas trouvé",
'The requested income deleted successful'=>' Le revenu demandé a supprimé réussi ',
'The requested income created successful'=>' Le revenu demandé a créé réussi ',
'The requested income updated successful'=>' Le revenu demandé a mis à jour réussi ',
'Edit Income'=>' Éditez le revenu',
];

View File

@@ -0,0 +1,13 @@
<?php
return [
'Income' => 'Revenu ',
'Expense' => ' Dépenses ',
'Asset' => ' Capitaux ',
'Liabilities' => ' Responsabilités ',
'Sale' => ' Vente ',
'Purchase' => ' Achat ',
'Cash' => ' Argent liquide ',
'Bank' => ' Banque ',
'Cheque' => ' Chèque',
'Loan' => 'Prête',
];

View File

@@ -0,0 +1,11 @@
<?php
return [
'Transaction'=>'Transaction ',
'Transactions'=>' Transactions ',
'Credit'=>' Crédit ',
'Debit'=>' Débit ',
'Statement'=>' Déclaration ',
'Account History'=>' Histoire de compte ',
'Bank Account Details'=>' Détails de compte bancaire ',
'Current Balance'=>' Balance courante',
];

View File

@@ -0,0 +1,20 @@
<?php
return [
'Account'=>'खाता',
'Chart Of Accounts'=>' खातों का चार्ट',
'Bank Accounts'=>' बैंक खाते',
'Incomes'=>' आय',
'Expenses'=>' खर्च',
'Parent Account'=>' पैरेंट खाता',
'Name'=>' नाम',
'Code'=>' कोड',
'Type'=>' क़िस्म',
'Description'=>' वर्णन',
'Default for'=>' डिफ़ॉल्ट',
'Amount'=>' राशि',
'Transaction date'=>' हस्तांतरण तारीख़',
'Profit'=>' लाभ',
'From The Beginning'=>' शुरू से प्रारंभ होगा',
'Balance'=>' संतुलन',
'Opening Balance'=>' संतुलन खोला जा रहा है',
];

View File

@@ -0,0 +1,15 @@
<?php
return [
'Bank Accounts'=>'बैंक खाते',
'New Account'=>' नया खाता',
'Select Default Account For'=>' चयन के लिए डिफ़ॉल्ट खाता',
'The requested bank account deleted successful'=>' अनुरोधित बैंक खाता हटाया गया सफल',
'The requested bank account created successful'=>' अनुरोधित बैंक खाता बनाया गया सफल',
'The requested bank account updated successful'=>' अनुरोधित बैंक खाता अद्यतन सफल',
'Bank Name'=>' बैंक नाम',
'Branch Name'=>' शाखा नाम',
'Account Name'=>' खाता नाम',
'Account Number'=>' खाता नंबर',
"You can\'t delete an account which has child element"=>' आप को नहीं हटा सकते जिसमें कोई खाता चाइल्ड तत्व',
'The requested bank account is not found'=>' अनुरोधित बैंक खाता नहीं मिला',
];

View File

@@ -0,0 +1,23 @@
<?php
return [
'Chart Of Accounts'=>'खातों का संचित्र',
'New Account'=>' नया खाता',
'Add As A Parent Account'=>' एक जनक खाते के रूप में जोड़ें',
'Parent account selection will add your account as a sub account'=>'अभिभावक खाते का चयन आपके खाते को उप खाते के रूप में जोड़ देगा',
'Select your Expense Account'=>'अपना व्यय खाता चुनें',
'Select your Income Account'=>'अपना आय खाता चुनें',
'Select your Payment method'=>'अपनी भुगतान विधि चुनें',
'Account code need to be unique. Leave blank for auto generate an unique account code'=>'खाता कोड अद्वितीय होना चाहिए। ऑटो के लिए खाली छोड़ना एक अद्वितीय खाता कोड उत्पन्न करता है',
'Selecting a default Account, will remove previously default account for selected item'=>'एक डिफ़ॉल्ट खाता का चयन, चयनित आइटम के लिए पहले डिफ़ॉल्ट खाते को हटा देगा',
'Select Default Account For'=>'के लिए डिफ़ॉल्ट खाता चुनें',
"You can't delete an account which has child element"=>'आप उस खाते को नहीं हटा सकते जिसमें बाल तत्व है',
'The requested chart of account is not found'=>'खाते का अनुरोधित चार्ट नहीं मिला है',
'The requested chart of account deleted successful'=>'खाते का अनुरोधित चार्ट सफल हटा दिया गया',
'The requested chart of account created successful'=>'खाते का अनुरोधित चार्ट सफल बना',
'Income Account'=>'आय खाता',
'Expense Account'=>'खर्च का हिसाब',
'Select Account'=>'खाता चुनें',
'Payment Method'=>'भुगतान का तरीका',
'Edit Account' => 'खाता संपादित करें',
'The requested chart of account updated successful' => 'खाते का अनुरोधित चार्ट सफल हुआ',
];

View File

@@ -0,0 +1,10 @@
<?php
return [
'Expense'=>'व्यय',
'New Expense'=>' नया व्यय',
'Edit Expense'=>' व्यय संपादित करें',
'The requested expense is not found'=>' अनुरोधित व्यय नहीं मिला',
'The requested expense deleted successful'=>' अनुरोधित व्यय हटाए गए सफल',
'The requested expense created successful'=>' अनुरोधित खर्च सफल बनाया था',
'The requested expense updated successful'=>' अनुरोधित व्यय अद्यतन सफल',
];

View File

@@ -0,0 +1,11 @@
<?php
return [
"You can't delete an income which has child element"=>'आप कोई आय नहीं हटा सकते हैं जो चाइल्ड तत्व है',
'Incomes'=>' आय',
'New Income'=>' नया आय',
'The requested income is not found'=>' अनुरोध की गई आमदनी नहीं मिला है',
'The requested income deleted successful'=>' अनुरोधित आय हटाए गए सफल',
'The requested income created successful'=>' अनुरोध की गई आमदनी सफल बनाया था',
'The requested income updated successful'=>' सफल अद्यतन अनुरोध की गई आमदनी',
'Edit Income'=>' आमदनी के लिए आर्थिक संपादित करें',
];

View File

@@ -0,0 +1,13 @@
<?php
return [
'Cheque' => 'चेक',
'Purchase' => ' क्रय',
'Expense' => ' व्यय',
'Asset' => ' संपत्ति',
'Income' => ' आय',
'Liabilities' => ' देयताएं',
'Sale' => ' सेल',
'Cash' => ' नकद',
'Bank' => ' बैंक',
'Loan' => 'ऋण',
];

View File

@@ -0,0 +1,11 @@
<?php
return [
'Transaction'=>'हस्तांतरण',
'Transactions'=>' हस्तांतरण',
'Credit'=>' क्रेडिट',
'Debit'=>' डेबिट',
'Statement'=>' कथन',
'Account History'=>' खाता इतिहास',
'Bank Account Details'=>' बैंक खाता विवरण',
'Current Balance'=>' वर्तमान संतुलन',
];

View File

@@ -0,0 +1,20 @@
<?php
return [
'Account'=>'Conto',
'Chart Of Accounts'=>' Piano contabile',
'Bank Accounts'=>' Conti bancari',
'Incomes'=>' Redditi',
'Expenses'=>' Spese',
'Parent Account'=>' Conto del genitore',
'Name'=>' Nome',
'Code'=>' Codice',
'Type'=>' Tipo',
'Description'=>' Descrizione',
'Default for'=>' Stabilizzi per',
'Amount'=>' Importo',
'Transaction date'=>' Data di transazione',
'Profit'=>' Profitto',
'From The Beginning'=>"Dall'inizio",
'Balance'=>' Equilibrio',
'Opening Balance'=>' Riporto a nuovo',
];

View File

@@ -0,0 +1,15 @@
<?php
return [
'Bank Accounts'=>'Conti bancari',
'New Account'=>' Nuovo conto',
'Select Default Account For'=>' Il difetto scelto rappresenta',
'The requested bank account deleted successful'=>' Il conto bancario richiesto ha cancellato riuscito',
'The requested bank account created successful'=>' Il conto bancario richiesto ha creato riuscito',
'The requested bank account updated successful'=>' Il conto bancario richiesto ha aggiornato riuscito',
'Bank Name'=>' Nome della Banca',
'Branch Name'=>' Nome di ramo',
'Account Name'=>' Nome di conto',
'Account Number'=>' Codice fiscale',
'You can\'t delete an account which has child element'=>' Potete \ “t cancellare un conto che ha elemento del bambino',
'The requested bank account is not found'=>' Il conto bancario richiesto non è trovato',
];

View File

@@ -0,0 +1,23 @@
<?php
return [
'Select your Expense Account' => 'Selezioni il vostro conto di spesa',
'Chart Of Accounts' => ' Piano contabile',
'New Account' => ' Nuovo conto',
'Add As A Parent Account' => ' Aggiunga come conto del genitore',
'Parent account selection will add your account as a sub account' => ' La selezione di conto del genitore aggiungerà il vostro conto come sotto conto',
'Select your Income Account' => ' Selezioni il vostro conto proventi',
'Account code need to be unique, Leave blank for auto generate an unique account code' => "Necessità di codice di conto di essere unico, spazio in bianco di permesso per l'auto generare un codice di conto unico",
'Selecting a default Account, will remove previously default account for selected item' => "La selezione del conto di difetto, rimuoverà precedentemente il difetto rappresenta l'oggetto selezionato",
'Select Default Account For' => ' Il difetto scelto rappresenta',
'You can\'t delete an account which has child element' => ' Potete \ “t cancellare un conto che ha elemento del bambino',
'The requested chart of account is not found' => ' Il grafico del conto richiesto non è trovato',
'The requested chart of account deleted successful' => ' Il grafico del conto richiesto ha cancellato riuscito',
'The requested chart of account created successful' => ' Il grafico del conto richiesto ha creato riuscito',
'Income Account' => ' Conto proventi',
'Expense Account' => ' Conto di spesa',
'Select Account' => ' Conto scelto',
'Payment Method' => ' Metodo di pagamento',
'Select your Payment method' => ' Selezioni il vostro metodo di pagamento',
'Edit Account' => 'Modifica account',
'The requested chart of account updated successful' => 'Il piano dei conti richiesto è stato aggiornato correttamente',
];

Some files were not shown because too many files have changed in this diff Show More