Skip to content

Commit

Permalink
Changes to files: Classes/ChartOfAccount.php
Browse files Browse the repository at this point in the history
Classes/Gateway.php
Classes/Invoice.php
Classes/Journal.php
Classes/Ledger.php
Classes/Payment.php
Entities/.gitkeep
Entities/ChartOfAccount.php
Entities/Coupon.php
Entities/Data/ChartOfAccount.php
Entities/Data/FinancialYear.php
Entities/Data/Gateway.php
Entities/Data/Invoice.php
Entities/Data/InvoiceStatus.php
Entities/Data/Ledger.php
Entities/Data/LedgerCategory.php
Entities/Data/Payment.php
Entities/Data/Rate.php
Entities/FinancialYear.php
Entities/Gateway.php
Entities/GatewayAllowedin.php
Entities/GatewayDisallowedin.php
Entities/GatewayRate.php
Entities/Invoice.php
Entities/InvoiceCoupon.php
Entities/InvoiceItem.php
Entities/InvoiceItemRate.php
Entities/InvoiceStatus.php
Entities/Journal.php
Entities/Ledger.php
Entities/LedgerCategory.php
Entities/OpeningBalance.php
Entities/Payment.php
Entities/PaymentRate.php
Entities/Rate.php
Entities/RateAllowedin.php
Entities/RateDisallowedin.php
Entities/RateFile.php
Entities/Transaction.php
Tests/Feature/AccountTest.php
  • Loading branch information
dedanirungu committed Aug 10, 2024
1 parent 3ebbf1f commit b4316ba
Show file tree
Hide file tree
Showing 40 changed files with 102 additions and 132 deletions.
4 changes: 2 additions & 2 deletions Classes/ChartOfAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
namespace Modules\Account\Classes;

use Illuminate\Support\Facades\Cache;
use Modules\Account\Entities\ChartOfAccount as DBChartOfAccount;
use Modules\Account\Entities\Journal as DBJournal;
use Modules\Account\Models\ChartOfAccount as DBChartOfAccount;
use Modules\Account\Models\Journal as DBJournal;

class ChartOfAccount
{
Expand Down
8 changes: 4 additions & 4 deletions Classes/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
namespace Modules\Account\Classes;

use Illuminate\Support\Facades\Cache;
use Modules\Account\Entities\Gateway as DBGateway;
use Modules\Account\Models\Gateway as DBGateway;

class Gateway
{
Expand Down Expand Up @@ -50,7 +50,7 @@ public function getGateways($show_hidden = false, $invoice = false)
*
* @return object|bool
*/
public function getGateway($gateway_id)
public function getGateway($gateway_id)
{
if (Cache::has("account_gateway_" . $gateway_id)) {
$gateway = Cache::get("account_gateway_" . $gateway_id);
Expand Down Expand Up @@ -89,7 +89,7 @@ public function getGatewayById($gateway_id)
*
* @return array|bool
*/
public function getGatewayBySlug($gateway_slug)
public function getGatewayBySlug($gateway_slug)
{
$gateway = DBGateway::where('slug', $gateway_slug)->first();

Expand Down Expand Up @@ -137,7 +137,7 @@ public function getGatewayId($gateway_slug)
}
return false;
}

/**
* Get Class Name
*
Expand Down
17 changes: 7 additions & 10 deletions Classes/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
use Modules\Account\Classes\Journal;
use Modules\Account\Classes\Ledger;
use Modules\Account\Classes\Payment;
use Modules\Account\Entities\Invoice as DBInvoice;
use Modules\Account\Entities\InvoiceItem as DBInvoiceItem;
use Modules\Account\Entities\InvoiceItemRate as DBInvoiceItemRate;
use Modules\Account\Entities\Journal as DBJournal;
use Modules\Account\Entities\Payment as DBPayment;
use Modules\Account\Events\InvoiceItemPaid;
use Modules\Account\Events\InvoicePaid;
use Modules\Account\Models\Invoice as DBInvoice;
use Modules\Account\Models\InvoiceItem as DBInvoiceItem;
use Modules\Account\Models\InvoiceItemRate as DBInvoiceItemRate;
use Modules\Account\Models\Journal as DBJournal;
use Modules\Account\Models\Payment as DBPayment;
use Modules\Core\Classes\Notification;
use Modules\Partner\Classes\Partner;

Expand Down Expand Up @@ -335,8 +335,6 @@ public function reconcileInvoices($partner_id, $invoice_id = false)

}



/**
* Get amount used from payment
*
Expand Down Expand Up @@ -442,7 +440,7 @@ public function getInvoices()
*
* @param int $partner_id
* @param boolean $invoice_id
*
*
* @return array
*/
public function getPartnerInvoices(int $partner_id, $invoice_id = false)
Expand Down Expand Up @@ -517,12 +515,11 @@ public function processInvoices()
}
}


/**
* Function for deleting Invoice
*
* @param int $invoice_id
*
*
* @return void
*/
public function deleteInvoice($invoice_id)
Expand Down
8 changes: 4 additions & 4 deletions Classes/Journal.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
use Modules\Account\Classes\Ledger;
use Modules\Account\Entities\Journal as DBJournal;
use Modules\Core\Entities\Currency;
use Modules\Account\Models\Journal as DBJournal;
use Modules\Core\Models\Currency;

class Journal
{
Expand Down Expand Up @@ -102,8 +102,8 @@ public function changeCurrency($old, $new)
$rate = $newcurrency->rate;
} else if ($usdcurrency->id != $oldcurrency->id) {
if ($newcurrency->id != $usdcurrency->id) {
$rate = $usdcurrency->rate/$oldcurrency->rate * $newcurrency->rate;
}else{
$rate = $usdcurrency->rate / $oldcurrency->rate * $newcurrency->rate;
} else {
$rate = $usdcurrency->rate / $oldcurrency->rate;
}
}
Expand Down
4 changes: 2 additions & 2 deletions Classes/Ledger.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace Modules\Account\Classes;

use Illuminate\Support\Facades\Cache;
use Modules\Account\Entities\Journal as DBJournal;
use Modules\Account\Entities\Ledger as DBLedger;
use Modules\Account\Models\Journal as DBJournal;
use Modules\Account\Models\Ledger as DBLedger;

class Ledger
{
Expand Down
5 changes: 2 additions & 3 deletions Classes/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
use Illuminate\Support\Facades\Cache;
use Modules\Account\Classes\Gateway;
use Modules\Account\Classes\Invoice;
use Modules\Account\Entities\Payment as DBPayment;
use Modules\Account\Models\Payment as DBPayment;
use Modules\Core\Classes\Notification;
use Modules\Core\Entities\Currency;
use Modules\Core\Models\Currency;
use Modules\Partner\Classes\Partner;

class Payment
Expand Down Expand Up @@ -160,7 +160,6 @@ public function getCurrencyRate($currency_id = null)
$defcurrency = Currency::where('id', $default_currency_id)->first();
$curcurrency = Currency::where('id', $currency_id)->first();


if ($curcurrency->id == $defcurrency->id) {
return 1;
}
Expand Down
File renamed without changes.
7 changes: 2 additions & 5 deletions Entities/ChartOfAccount.php → Models/ChartOfAccount.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<?php

namespace Modules\Account\Entities;
namespace Modules\Account\Models;

use Illuminate\Database\Schema\Blueprint;
use Modules\Base\Entities\BaseModel;
use Modules\Base\Models\BaseModel;

class ChartOfAccount extends BaseModel
{
Expand All @@ -21,6 +20,4 @@ class ChartOfAccount extends BaseModel
*/
protected $table = "account_chart_of_account";



}
9 changes: 2 additions & 7 deletions Entities/Coupon.php → Models/Coupon.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<?php

namespace Modules\Account\Entities;
namespace Modules\Account\Models;

use Illuminate\Database\Schema\Blueprint;
use Modules\Base\Entities\BaseModel;
use Modules\Base\Models\BaseModel;

class Coupon extends BaseModel
{
Expand Down Expand Up @@ -31,8 +30,4 @@ class Coupon extends BaseModel
*/
protected bool $can_delete = false;





}
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<?php

namespace Modules\Account\Entities\Data;
namespace Modules\Account\Models\Data;

use Modules\Base\Classes\Datasetter;

class ChartOfAccount
{
/**
* Set ordering of the Class to be migrated.
*
*
* @var int
*/
public $ordering = 1;

/**
/**
* Run the database seeds with system default records.
*
*
* @param Datasetter $datasetter
*
*
* @return void
*/
public function data(Datasetter $datasetter): void
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Modules\Account\Entities\Data;
namespace Modules\Account\Models\Data;

use Illuminate\Support\Facades\DB;
use Modules\Base\Classes\Datasetter;
Expand All @@ -9,16 +9,16 @@ class FinancialYear
{
/**
* Set ordering of the Class to be migrated.
*
*
* @var int
*/
public $ordering = 1;

/**
/**
* Run the database seeds with system default records.
*
*
* @param Datasetter $datasetter
*
*
* @return void
*/
public function data(Datasetter $datasetter): void
Expand Down
8 changes: 4 additions & 4 deletions Entities/Data/Gateway.php → Models/Data/Gateway.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Modules\Account\Entities\Data;
namespace Modules\Account\Models\Data;

use Illuminate\Support\Facades\DB;
use Modules\Base\Classes\Datasetter;
Expand All @@ -9,16 +9,16 @@ class Gateway
{
/**
* Set ordering of the Class to be migrated.
*
*
* @var int
*/
public $ordering = 3;

/**
* Run the database seeds with system default records.
*
*
* @param Datasetter $datasetter
*
*
* @return void
*/
public function data(Datasetter $datasetter): void
Expand Down
10 changes: 5 additions & 5 deletions Entities/Data/Invoice.php → Models/Data/Invoice.php
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<?php

namespace Modules\Account\Entities\Data;
namespace Modules\Account\Models\Data;

use Modules\Base\Classes\Datasetter;

class Invoice
{
/**
* Set ordering of the Class to be migrated.
*
*
* @var int
*/
public $ordering = 3;

/**
/**
* Run the database seeds with system default records.
*
*
* @param Datasetter $datasetter
*
*
* @return void
*/
public function data(Datasetter $datasetter): void
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

namespace Modules\Account\Entities\Data;
namespace Modules\Account\Models\Data;

use Modules\Base\Classes\Datasetter;

class InvoiceStatus
{
/**
* Set ordering of the Class to be migrated.
*
*
* @var int
*/
public $ordering = 1;
Expand Down
4 changes: 2 additions & 2 deletions Entities/Data/Ledger.php → Models/Data/Ledger.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Modules\Account\Entities\Data;
namespace Modules\Account\Models\Data;

use Illuminate\Support\Facades\DB;
use Modules\Base\Classes\Datasetter;
Expand All @@ -9,7 +9,7 @@ class Ledger
{
/**
* Set ordering of the Class to be migrated.
*
*
* @var int
*/
public $ordering = 2;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Modules\Account\Entities\Data;
namespace Modules\Account\Models\Data;

use Illuminate\Support\Facades\DB;
use Modules\Base\Classes\Datasetter;
Expand All @@ -9,16 +9,16 @@ class LedgerCategory
{
/**
* Set ordering of the Class to be migrated.
*
*
* @var int
*/
public $ordering = 2;

/**
* Run the database seeds with system default records.
*
*
* @param Datasetter $datasetter
*
*
* @return void
*/
public function data(Datasetter $datasetter): void
Expand Down
4 changes: 2 additions & 2 deletions Entities/Data/Payment.php → Models/Data/Payment.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

namespace Modules\Account\Entities\Data;
namespace Modules\Account\Models\Data;

use Modules\Base\Classes\Datasetter;

class Payment
{
/**
* Set ordering of the Class to be migrated.
*
*
* @var int
*/
public $ordering = 3;
Expand Down
Loading

0 comments on commit b4316ba

Please sign in to comment.