Skip to content

Commit

Permalink
Changes to files: app/Filament/AccountPlugin.php
Browse files Browse the repository at this point in the history
app/Filament/Resources/GatewayAllowedinResource.php
app/Filament/Resources/GatewayDisallowedinResource.php
app/Filament/Resources/GatewayRateResource.php
app/Filament/Resources/GatewayResource.php
app/Filament/Resources/InvoiceCouponResource.php
app/Filament/Resources/InvoiceItemRateResource.php
app/Filament/Resources/InvoiceItemResource.php
app/Filament/Resources/InvoiceStatusResource.php
app/Filament/Resources/LedgerCategoryResource.php
app/Filament/Resources/PaymentRateResource.php
app/Filament/Resources/RateAllowedinResource.php
app/Filament/Resources/RateDisallowedinResource.php
app/Filament/Resources/RateFileResource.php
app/Models/Gateway.php
app/Models/GatewayAllowedin.php
app/Models/GatewayDisallowedin.php
app/Models/GatewayRate.php
app/Models/Invoice.php
app/Models/InvoiceCoupon.php
app/Models/InvoiceItem.php
app/Models/InvoiceItemRate.php
app/Models/Journal.php
app/Models/Ledger.php
app/Models/LedgerCategory.php
app/Models/OpeningBalance.php
app/Models/Payment.php
app/Models/PaymentRate.php
app/Models/Rate.php
app/Models/RateAllowedin.php
app/Models/RateDisallowedin.php
app/Models/RateFile.php
app/Models/Transaction.php
  • Loading branch information
dedanirungu committed Sep 5, 2024
1 parent bb0dc91 commit 757f322
Show file tree
Hide file tree
Showing 33 changed files with 479 additions and 10 deletions.
10 changes: 0 additions & 10 deletions app/Filament/AccountPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Coolsam\Modules\Concerns\ModuleFilamentPlugin;
use Filament\Contracts\Plugin;
use Filament\Facades\Filament;
use Filament\Navigation\NavigationItem;
use Filament\Panel;
use Modules\Account\Filament\Pages\AccountDashboard;

Expand All @@ -30,14 +29,5 @@ public function boot(Panel $panel): void
AccountDashboard::class,
]);

// Add "Account" to the top navigation
$panel->navigationItems([
NavigationItem::make()
->label('Account')
->url(AccountDashboard::getUrl())
->icon('heroicon-o-squares-2x2')
->sort(-1), // Adjust the order as needed
]);

}
}
2 changes: 2 additions & 0 deletions app/Filament/Resources/GatewayAllowedinResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class GatewayAllowedinResource extends Resource

protected static ?string $slug = 'account/gateway/allowedin';

protected static ?string $navigationGroup = 'Account';

protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';

protected static ?string $navigationParentItem = 'Gateway';
Expand Down
2 changes: 2 additions & 0 deletions app/Filament/Resources/GatewayDisallowedinResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class GatewayDisallowedinResource extends Resource

protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';

protected static ?string $navigationGroup = 'Account';

protected static ?string $navigationParentItem = 'Gateway';

public static function form(Form $form): Form
Expand Down
2 changes: 2 additions & 0 deletions app/Filament/Resources/GatewayRateResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class GatewayRateResource extends Resource

protected static ?string $slug = 'account/gateway/rate';

protected static ?string $navigationGroup = 'Account';

protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';

protected static ?string $navigationParentItem = 'Gateway';
Expand Down
1 change: 1 addition & 0 deletions app/Filament/Resources/GatewayResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class GatewayResource extends Resource
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';

protected static ?string $navigationGroup = 'Account';

protected static ?string $navigationLabel = 'Gateway';

protected static ?int $navigationSort = 1;
Expand Down
2 changes: 2 additions & 0 deletions app/Filament/Resources/InvoiceCouponResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class InvoiceCouponResource extends Resource

protected static ?string $slug = 'account/invoice/coupon';

protected static ?string $navigationGroup = 'Account';

protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';

public static function form(Form $form): Form
Expand Down
2 changes: 2 additions & 0 deletions app/Filament/Resources/InvoiceItemRateResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class InvoiceItemRateResource extends Resource

protected static ?string $slug = 'account/invoice/item/rate';

protected static ?string $navigationGroup = 'Account';

protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';

public static function form(Form $form): Form
Expand Down
5 changes: 5 additions & 0 deletions app/Filament/Resources/InvoiceItemResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class InvoiceItemResource extends Resource

protected static ?string $slug = 'account/invoice/item';

protected static ?string $navigationGroup = 'Account';

protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';

public static function form(Form $form): Form
Expand All @@ -30,6 +32,9 @@ public static function form(Form $form): Form
Forms\Components\TextInput::make('invoice_id')
->required()
->numeric(),
\Codedor\FilamentResourcePicker\Filament\Forms\Components\ResourcePickerInput::make('invoice_id')
->resource(InvoiceResource::class)
->required(),
Forms\Components\TextInput::make('ledger_id')
->required()
->numeric(),
Expand Down
2 changes: 2 additions & 0 deletions app/Filament/Resources/InvoiceStatusResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class InvoiceStatusResource extends Resource

protected static ?string $slug = 'account/invoice/status';

protected static ?string $navigationGroup = 'Account';

protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';

public static function form(Form $form): Form
Expand Down
2 changes: 2 additions & 0 deletions app/Filament/Resources/LedgerCategoryResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class LedgerCategoryResource extends Resource

protected static ?string $slug = 'account/ledger/category';

protected static ?string $navigationGroup = 'Account';

protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';

public static function form(Form $form): Form
Expand Down
2 changes: 2 additions & 0 deletions app/Filament/Resources/PaymentRateResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class PaymentRateResource extends Resource

protected static ?string $slug = 'account/payment/rate';

protected static ?string $navigationGroup = 'Account';

protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';

public static function form(Form $form): Form
Expand Down
2 changes: 2 additions & 0 deletions app/Filament/Resources/RateAllowedinResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class RateAllowedinResource extends Resource

protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';

protected static ?string $navigationGroup = 'Account';

protected static ?string $navigationLabel = 'Rate Allowed In';
protected static ?string $navigationParentItem = 'Rate';

Expand Down
2 changes: 2 additions & 0 deletions app/Filament/Resources/RateDisallowedinResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class RateDisallowedinResource extends Resource

protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';

protected static ?string $navigationGroup = 'Account';

protected static ?string $navigationLabel = 'Rate Disallowed In';
protected static ?string $navigationParentItem = 'Rate';

Expand Down
1 change: 1 addition & 0 deletions app/Filament/Resources/RateFileResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class RateFileResource extends Resource

protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';

protected static ?string $navigationGroup = 'Account';
protected static ?string $navigationLabel = 'Rate File';
protected static ?string $navigationParentItem = 'Rate';

Expand Down
23 changes: 23 additions & 0 deletions app/Models/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace Modules\Account\Models;

use Modules\Account\Models\Ledger;
use Modules\Base\Models\BaseModel;
use Modules\Core\Models\Currency;

class Gateway extends BaseModel
{
Expand Down Expand Up @@ -31,4 +33,25 @@ class Gateway extends BaseModel
* @var bool
*/
protected bool $can_delete = false;

/**
* Add relationship to Ledger
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function ledger()
{
return $this->belongsTo(Ledger::class);
}

/**
* Add relationship to Currency
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function currency()
{
return $this->belongsTo(Currency::class);
}

}
21 changes: 21 additions & 0 deletions app/Models/GatewayAllowedin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace Modules\Account\Models;

use Modules\Account\Models\Gateway;
use Modules\Base\Models\BaseModel;
use Modules\Core\Models\Country;

class GatewayAllowedin extends BaseModel
{
Expand All @@ -20,4 +22,23 @@ class GatewayAllowedin extends BaseModel
* @var string
*/
protected $table = "account_gateway_allowedin";

/**
* Add relationship to Gateway
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function gateway()
{
return $this->belongsTo(Gateway::class);
}

/**
* Add relationship to Country
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/

public function country()
{
return $this->belongsTo(Country::class);
}
}
20 changes: 20 additions & 0 deletions app/Models/GatewayDisallowedin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace Modules\Account\Models;

use Modules\Account\Models\Gateway;
use Modules\Base\Models\BaseModel;
use Modules\Core\Models\Country;

class GatewayDisallowedin extends BaseModel
{
Expand All @@ -20,4 +22,22 @@ class GatewayDisallowedin extends BaseModel
* @var string
*/
protected $table = "account_gateway_disallowedin";

/**
* Add relationship to Gateway
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function gateway()
{
return $this->belongsTo(Gateway::class);
}

/**
* Add relationship to Country
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function country()
{
return $this->belongsTo(Country::class);
}
}
20 changes: 20 additions & 0 deletions app/Models/GatewayRate.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Modules\Account\Models;

use Modules\Account\Models\Gateway;
use Modules\Account\Models\Rate;
use Modules\Base\Models\BaseModel;

class GatewayRate extends BaseModel
Expand All @@ -20,4 +22,22 @@ class GatewayRate extends BaseModel
* @var string
*/
protected $table = "account_gateway_rate";

/**
* Add relationship to Gateway
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function gateway()
{
return $this->belongsTo(Gateway::class);
}

/**
* Add relationship to Rate
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function rate()
{
return $this->belongsTo(Rate::class);
}
}
10 changes: 10 additions & 0 deletions app/Models/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Modules\Account\Models;

use Modules\Base\Models\BaseModel;
use Modules\Partner\Models\Partner;

class Invoice extends BaseModel
{
Expand All @@ -23,4 +24,13 @@ class Invoice extends BaseModel
* @var string
*/
protected $table = "account_invoice";

/**
* Add relationship to Partner
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function partner()
{
return $this->belongsTo(Partner::class);
}
}
20 changes: 20 additions & 0 deletions app/Models/InvoiceCoupon.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Modules\Account\Models;

use Modules\Account\Models\Coupon;
use Modules\Account\Models\Invoice;
use Modules\Base\Models\BaseModel;

class InvoiceCoupon extends BaseModel
Expand All @@ -20,4 +22,22 @@ class InvoiceCoupon extends BaseModel
* @var string
*/
protected $table = "account_invoice_coupon";

/**
* Add relationship to Invoice
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function invoice()
{
return $this->belongsTo(Invoice::class);
}

/**
* Add relationship to Coupon
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function coupon()
{
return $this->belongsTo(Coupon::class);
}
}
21 changes: 21 additions & 0 deletions app/Models/InvoiceItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Modules\Account\Models;

use Modules\Account\Models\Invoice;
use Modules\Account\Models\Ledger;
use Modules\Base\Models\BaseModel;

class InvoiceItem extends BaseModel
Expand All @@ -23,4 +25,23 @@ class InvoiceItem extends BaseModel
* @var string
*/
protected $table = "account_invoice_item";

/**
* Add relationship to Invoice
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function invoice()
{
return $this->belongsTo(Invoice::class);
}

/**
* Add relationship to Ledger
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function ledger()
{
return $this->belongsTo(Ledger::class);
}

}
Loading

0 comments on commit 757f322

Please sign in to comment.