Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

akaunting/akaunting

9348 stars
2 code files
View akaunting/akaunting on GitHub

app/Models/Banking/Account.php

Open in GitHub
use App\Abstracts\Model;
 
class Account extends Model
{
//
protected $casts = [
'opening_balance' => 'double',
'enabled' => 'boolean',
];
//
}

app/Traits/Import.php

Open in GitHub
use App\Models\Banking\Account;
 
trait Import
{
//
public function getAccountIdFromCurrency($row)
{
return Account::firstOrCreate([
'company_id' => company_id(),
'currency_code' => $row['currency_code'],
], [
'name' => !empty($row['account_name']) ? $row['account_name'] : $row['currency_code'],
'number' => !empty($row['account_number']) ? $row['account_number'] : rand(1, 10000),
'opening_balance' => !empty($row['opening_balance']) ? $row['opening_balance'] : 0,
'enabled' => 1,
])->id;
}
//
}

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.