Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
a684c2f
Update README.md
cewlio1 Jan 11, 2025
0fa4f27
Update IvplPanelProvider.php
cewlio1 Jan 11, 2025
cdce412
#19: I want to add the Inventory Module
Jan 12, 2025
5aa4341
#19: I had to remove some obsolete files
Jan 12, 2025
3e6f2b5
Delete Modules/Inventory/Database/Migrations/2009_01_01_132442_create…
nielsdrost7 Jan 12, 2025
c0867cf
#19 Change some resources
Jan 12, 2025
446149d
Merge branch 'cewlio' of github.com:InvoicePlane/InvoicePlane-v2 into…
Jan 12, 2025
4b5b2a7
Update 2025_01_11_222604_add_inventory.php
nielsdrost7 Jan 12, 2025
f01e15d
Update ProductInventoryResource.php
nielsdrost7 Jan 12, 2025
fcd2a37
Update ProductInventoryResource.php
nielsdrost7 Jan 12, 2025
49b7575
Update ProductInventoryResource.php
nielsdrost7 Jan 12, 2025
192b72b
Update ProductInventoryResource.php
nielsdrost7 Jan 12, 2025
0e4dc94
Update IvplPanelProvider.php
nielsdrost7 Jan 12, 2025
c2fbc9a
Update ManageProductInventories.php
nielsdrost7 Jan 12, 2025
b4be7af
Update ManageProductInventories.php
nielsdrost7 Jan 12, 2025
4c1a51f
user_password is now `password` until we figure out how to log in wit…
nielsdrost7 Jan 12, 2025
0d1e585
tiny composer update
nielsdrost7 Jan 12, 2025
af9fbf6
user_password is `password`
nielsdrost7 Jan 12, 2025
8d4b196
We don't need the 'filament' block in the translations
nielsdrost7 Jan 12, 2025
06800a1
Inventory Module
nielsdrost7 Jan 12, 2025
1ac62d2
19: I want to add the Inventory Module
Jan 12, 2025
00afb72
fix conflicts
nielsdrost7 Jan 12, 2025
c3d565c
pint
nielsdrost7 Jan 12, 2025
ad34738
Fix Products Module
nielsdrost7 Jan 12, 2025
153b217
Update ProductUnitResource.php
cewlio1 Jan 12, 2025
0966fdd
Update ProductResource.php
cewlio1 Jan 12, 2025
aac5390
Update ProductFamilyResource.php
cewlio1 Jan 12, 2025
a92e59a
Update README.md
cewlio1 Jan 11, 2025
568cbb6
Update IvplPanelProvider.php
cewlio1 Jan 11, 2025
b96306a
#19: I want to add the Inventory Module
Jan 12, 2025
69878b6
#19: I had to remove some obsolete files
Jan 12, 2025
ce41ade
#19 Change some resources
Jan 12, 2025
ea3a0a8
Delete Modules/Inventory/Database/Migrations/2009_01_01_132442_create…
nielsdrost7 Jan 12, 2025
8fef78c
Update 2025_01_11_222604_add_inventory.php
nielsdrost7 Jan 12, 2025
967439a
Update ProductInventoryResource.php
nielsdrost7 Jan 12, 2025
8dc6868
Update ProductInventoryResource.php
nielsdrost7 Jan 12, 2025
89db9f9
Update ProductInventoryResource.php
nielsdrost7 Jan 12, 2025
bb90fcb
Update ProductInventoryResource.php
nielsdrost7 Jan 12, 2025
0b4f4cd
Update IvplPanelProvider.php
nielsdrost7 Jan 12, 2025
e243b94
Update ManageProductInventories.php
nielsdrost7 Jan 12, 2025
0c54068
Update ManageProductInventories.php
nielsdrost7 Jan 12, 2025
c753665
description updates
cewlio1 Jan 12, 2025
a2a4d85
test 2 for commit
cewlio1 Jan 12, 2025
481d5c1
test 2 for commit
cewlio1 Jan 13, 2025
dc8d18d
readme commit
cewlio1 Jan 13, 2025
e7ec2ad
Revert "readme commit"
cewlio1 Jan 13, 2025
8ed4dfc
Revert "test 2 for commit"
cewlio1 Jan 13, 2025
796c5bb
Revert "test 2 for commit"
cewlio1 Jan 13, 2025
2fc779e
Revert "test 2 for commit"
cewlio1 Jan 13, 2025
8b372c6
Update
cewlio1 Jan 13, 2025
50bc769
Update
cewlio1 Jan 13, 2025
d8a0420
Merge branch 'cewlio' of github.com:InvoicePlane/InvoicePlane-v2 into…
cewlio1 Jan 14, 2025
07f66a6
documents plugin install
cewlio1 Jan 14, 2025
bbe76b8
Create 2025_01_12_123456_add_team_id_to_documents_and_templates.php
cewlio1 Jan 14, 2025
2261c7b
documents migrations
cewlio1 Jan 14, 2025
b27b58c
label change
cewlio1 Jan 14, 2025
e5724be
panelprovider update
cewlio1 Jan 16, 2025
477c6a8
welcome blade
cewlio1 Jan 16, 2025
ac9fb9d
update
cewlio1 Jan 19, 2025
373ef8d
label changes
cewlio1 Jan 20, 2025
e0a39cf
make payment note nullable
cewlio1 Jan 20, 2025
cbfcdfb
update
cewlio1 Jan 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Modules/Clients/Filament/Resources/ClientResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public static function form(Form $form): Form
->schema([
TextInput::make('client_name')
->nullable()
->required()
->label(trans('ip.client_name'))
->string(),
TextInput::make('client_surname')
Expand Down Expand Up @@ -155,11 +156,13 @@ public static function form(Form $form): Form
DateTimePicker::make('client_date_created')
->disabled()
->rules(['date'])
->default(now()->toDateTimeString())
->required()
->native(false),
DateTimePicker::make('client_date_modified')
->disabled()
->rules(['date'])
->default(now()->toDateTimeString())
->required()
->native(false),
]),
Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/Database/Factories/UserFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ public function definition(): array
'user_phone' => $this->faker->phoneNumber,
'user_fax' => $this->faker->phoneNumber,
'user_mobile' => $this->faker->phoneNumber,
'email' => $this->faker->unique()->safeEmail,
'user_password' => Hash::make(Str::random(16)),
'user_email' => $this->faker->unique()->safeEmail,
'user_password' => Hash::make('password'),
'user_web' => $this->faker->url,
'user_vat_id' => $this->faker->numerify('##########'),
'user_tax_code' => $this->faker->numerify('###-###-####'),
Expand Down
4 changes: 3 additions & 1 deletion Modules/Core/Events/UserWasUpdated.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@ class UserWasUpdated
use InteractsWithSockets;
use SerializesModels;

public function __construct(public User $user) {}
public function __construct(public User $user)
{
}
}
42 changes: 42 additions & 0 deletions Modules/Core/Filament/Pages/Auth/Login.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

namespace Modules\Core\Filament\Pages\Auth;

use Filament\Http\Responses\Auth\Contracts\LoginResponse;
use Filament\Http\Responses\Auth\LoginResponse as FilamentLoginResponse;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;
use Modules\Core\Filament\Resources\UserResource;
use Filament\Pages\Auth\Login as BaseLogin;
use Modules\Core\Models\User;

class Login extends BaseLogin
{
public string $user_email = '';

public string $user_password;

protected static string $resource = UserResource::class;

protected static string $view = 'core::auth.login';

public function authenticate(): ?\Filament\Http\Responses\Auth\Contracts\LoginResponse
{
$this->validate([
'user_email' => 'required|email',
'user_password' => 'required',
]);

$user = User::where('user_email', $this->user_email)->first();

if ( ! $user || ! Hash::check($this->user_password, $user->user_password)) {
dd('Password verification failed');
}

$user = User::where('user_email', $this->user_email)->first();

Auth::login($user);

return app(LoginResponse::class);
}
}
17 changes: 16 additions & 1 deletion Modules/Core/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class User extends Authenticatable implements FilamentUser, HasAvatar, HasName

protected $casts = [
'email_verified_at' => 'datetime',
'password' => 'hashed',
'user_password' => 'hashed',
];

private ?string $user_email = null;
Expand All @@ -110,6 +110,21 @@ public function getFilamentName(): string
return $this->getAttributeValue('user_name');
}

public function getAuthIdentifierName(): string
{
return 'user_email';
}

public function getAuthPassword(): ?string
{
return $this->user_password;
}

public function username(): string
{
return 'user_email';
}

public function invoices(): HasMany
{
return $this->hasMany(Invoice::class, 'user_id');
Expand Down
7 changes: 2 additions & 5 deletions Modules/Core/Providers/CoreServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function boot(): void
//$this->registerCommandSchedules();
//$this->registerTranslations();
//$this->registerConfig();
//$this->registerViews();
$this->registerViews();
$this->loadMigrationsFrom(module_path($this->moduleName, 'Database/Migrations'));
}

Expand Down Expand Up @@ -49,12 +49,9 @@ public function registerTranslations(): void
}
}

/**
* Register views.
*/
public function registerViews(): void
{
$viewPath = resource_path('views/modules/' . $this->moduleNameLower);
$viewPath = resource_path('views/' . $this->moduleNameLower);
$sourcePath = module_path($this->moduleName, 'resources/views');

$this->publishes([$sourcePath => $viewPath], ['views', $this->moduleNameLower . '-module-views']);
Expand Down
43 changes: 43 additions & 0 deletions Modules/Core/resources/views/auth/login.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<x-filament-panels::page.simple>
@if (filament()->hasRegistration())
<x-slot name="subheading">
{{ __('filament-panels::pages/auth/login.actions.register.before') }}

{{ $this->registerAction }}
</x-slot>
@endif

{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::AUTH_LOGIN_FORM_BEFORE, scopes: $this->getRenderHookScopes()) }}

<x-filament-panels::form id="form" wire:submit="authenticate">
<div class="mb-4">
<x-filament::input
id="user_email"
name="user_email"
type="email"
required
placeholder="{{ trans('ip.email') }}"
wire:model.defer="user_email"
autofocus
/>
</div>

<div class="mb-4">
<x-filament::input
id="user_password"
name="user_password"
type="password"
required
placeholder="{{ trans('ip.loginalert_no_password') }}"
wire:model.defer="user_password"
/>
</div>

<x-filament-panels::form.actions
:actions="$this->getCachedFormActions()"
:full-width="$this->hasFullWidthFormActions()"
/>
</x-filament-panels::form>

{{ \Filament\Support\Facades\FilamentView::renderHook(\Filament\View\PanelsRenderHook::AUTH_LOGIN_FORM_AFTER, scopes: $this->getRenderHookScopes()) }}
</x-filament-panels::page.simple>
Empty file.
17 changes: 17 additions & 0 deletions Modules/Inventory/Database/Factories/ProductInventoryFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace Modules\Inventory\Database\Factories;

use Illuminate\Database\Eloquent\Factories\Factory;
use Modules\Inventory\Models\ProductInventory;

class ProductInventoryFactory extends Factory
{
protected $model = ProductInventory::class;

public function definition(): array
{
return [
];
}
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class () extends Migration {
public function up(): void
{
Schema::create('product_inventories', function (Blueprint $table): void {
$table->increments('inventory_id');
$table->unsignedInteger('product_id');
$table->integer('quantity_on_hand')->default(0);
$table->integer('reorder_point')->nullable();

$table->foreign('product_id')->references('product_id')->on('products')->onDelete('cascade');
});
}

public function down(): void
{
Schema::dropIfExists('product_inventories');
}
};
Empty file.
14 changes: 14 additions & 0 deletions Modules/Inventory/Database/Seeders/FamiliesTableSeeder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace Modules\Products\Database\Seeders;

use Illuminate\Database\Seeder;
use Modules\Products\Models\ProductFamily;

class FamiliesTableSeeder extends Seeder
{
public function run(): void
{
ProductFamily::factory()->count(5)->create();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace Modules\Inventory\Database\Seeders;

use Illuminate\Database\Seeder;
use Modules\Inventory\Models\ProductInventory;

class ProductInventoriesTableSeeder extends Seeder
{
public function run(): void
{
ProductInventory::factory()->count(500)->create();
}
}
14 changes: 14 additions & 0 deletions Modules/Inventory/Database/Seeders/ProductUnitsTableSeeder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace Modules\Products\Database\Seeders;

use Illuminate\Database\Seeder;
use Modules\Products\Models\ProductUnit;

class ProductUnitsTableSeeder extends Seeder
{
public function run(): void
{
ProductUnit::factory()->count(5)->create();
}
}
14 changes: 14 additions & 0 deletions Modules/Inventory/Database/Seeders/ProductsTableSeeder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace Modules\Products\Database\Seeders;

use Illuminate\Database\Seeder;
use Modules\Products\Models\Product;

class ProductsTableSeeder extends Seeder
{
public function run(): void
{
Product::factory()->count(500)->create();
}
}
Empty file.
17 changes: 17 additions & 0 deletions Modules/Inventory/Events/ProductInventoryWasCreated.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace Modules\Inventory\Events;

use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
use Modules\Inventory\Models\ProductInventory;

class ProductInventoryWasCreated
{
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;

public function __construct(public ProductInventory $productInventory) {}
}
17 changes: 17 additions & 0 deletions Modules/Inventory/Events/ProductInventoryWasUpdated.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace Modules\Inventory\Events;

use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
use Modules\Inventory\Models\ProductInventory;

class ProductInventoryWasUpdated
{
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;

public function __construct(public ProductInventory $productInventory) {}
}
17 changes: 17 additions & 0 deletions Modules/Inventory/Events/ProductWasCreated.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace Modules\Inventory\Events;

use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
use Modules\Products\Models\Product;

class ProductWasCreated
{
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;

public function __construct(public Inventory $product) {}
}
17 changes: 17 additions & 0 deletions Modules/Inventory/Events/ProductWasUpdated.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace Modules\Inventory\Events;

use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
use Modules\Products\Models\Product;

class ProductWasUpdated
{
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;

public function __construct(public Inventory $product) {}
}
36 changes: 36 additions & 0 deletions Modules/Inventory/Filament/InventoryPlugin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

namespace Modules\Inventory\Filament;

use Coolsam\Modules\Concerns\ModuleFilamentPlugin;
use Filament\Contracts\Plugin;
use Filament\Panel;
use Modules\Inventory\Filament\Resources\ProductInventoryResource;

class InventoryPlugin implements Plugin
{
use ModuleFilamentPlugin;

public function getModuleName(): string
{
return 'Inventory';
}

public function getId(): string
{
return 'Inventory';
}

public function register(Panel $panel): void
{
$panel
->resources([
ProductInventoryResource::class,
]);
}

public function boot(Panel $panel): void
{
// TODO: Implement boot() method.
}
}
Loading