changes
This commit is contained in:
0
Modules/SalesEntry/app/Http/Controllers/.gitkeep
Normal file
0
Modules/SalesEntry/app/Http/Controllers/.gitkeep
Normal file
135
Modules/SalesEntry/app/Http/Controllers/SalesEntryController.php
Normal file
135
Modules/SalesEntry/app/Http/Controllers/SalesEntryController.php
Normal file
@ -0,0 +1,135 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\SalesEntry\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Modules\Admin\Repositories\FieldInterface;
|
||||
use Modules\Customer\Repositories\CustomerInterface;
|
||||
use Modules\Product\Repositories\CategoryInterface;
|
||||
use Modules\Product\Repositories\ProductInterface;
|
||||
use Modules\SalesEntry\Models\SalesEntry;
|
||||
use Modules\SalesEntry\Repositories\SalesEntryInterface;
|
||||
use Modules\Stock\Repositories\StockInterface;
|
||||
|
||||
class SalesEntryController extends Controller
|
||||
{
|
||||
|
||||
private $productRepository;
|
||||
private $customerRepository;
|
||||
private $salesEntryRepository;
|
||||
private $categoryRepository;
|
||||
private $stockRepository;
|
||||
private $fieldRepository;
|
||||
|
||||
public function __construct( ProductInterface $productRepository,
|
||||
CustomerInterface $customerRepository,
|
||||
SalesEntryInterface $salesEntryRepository,
|
||||
CategoryInterface $categoryRepository,
|
||||
StockInterface $stockRepository,
|
||||
FieldInterface $fieldRepository )
|
||||
{
|
||||
$this->productRepository = $productRepository;
|
||||
$this->customerRepository = $customerRepository;
|
||||
$this->salesEntryRepository = $salesEntryRepository;
|
||||
$this->categoryRepository = $categoryRepository;
|
||||
$this->stockRepository = $stockRepository;
|
||||
$this->fieldRepository = $fieldRepository;
|
||||
|
||||
|
||||
}
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$data['title'] = 'Sales Entries';
|
||||
$data['salesEntries'] = SalesEntry::all();
|
||||
return view('salesEntry::salesEntry.index', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$data['title'] = 'New Sales Entry';
|
||||
$data['categoryList'] = $this->categoryRepository->pluck();
|
||||
$data['stockList'] = $this->stockRepository->pluck();
|
||||
$data['productList'] = $this->productRepository->pluck();
|
||||
$data['customerList'] = $this->customerRepository->pluck();
|
||||
$data['sizes'] = $this->fieldRepository->getDropdownByAlias('size');
|
||||
$data['paymentModes'] = $this->fieldRepository->getDropdownByAlias('payment-mode');
|
||||
$data['editable'] = false;
|
||||
|
||||
return view('salesEntry::salesEntry.create', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
$this->salesEntryRepository->create($request);
|
||||
|
||||
return redirect()->route('salesEntry.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
return view('salesEntry::salesEntry.show');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$data['customerList'] = $this->customerRepository->pluck();
|
||||
$data['categoryList'] = $this->categoryRepository->pluck();
|
||||
$data['stockList'] = $this->stockRepository->pluck();
|
||||
$data['productList'] = $this->productRepository->pluck();
|
||||
$data['sizes'] = $this->fieldRepository->getDropdownByAlias('size');
|
||||
$data['paymentModes'] = $this->fieldRepository->getDropdownByAlias('payment-mode');
|
||||
$data['order'] = SalesEntry::with('orderDetails')->find($id);
|
||||
$data['id'] = $id;
|
||||
$data['editable'] = true;
|
||||
$data['title'] = "Edit Sales Entry";
|
||||
return view('salesEntry::salesEntry.edit');
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, $id): RedirectResponse
|
||||
{
|
||||
$this->salesEntryRepository->update($id,$request);
|
||||
return redirect()->route('salesEntry.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
return $this->salesEntryRepository->delete($id);
|
||||
}
|
||||
|
||||
public function cloneSalesProduct(Request $request)
|
||||
{
|
||||
$data = [];
|
||||
$numInc = $request->numberInc;
|
||||
$script = true;
|
||||
$productList= $this->productRepository->pluck('id');
|
||||
$stockList= $this->stockRepository->pluck('id');
|
||||
$categoryList= $this->categoryRepository->pluck('id');
|
||||
|
||||
return response()->json([
|
||||
'view' => view('salesEntry::salesEntry.clone-product', compact('data', 'numInc', 'script', 'productList'))->render(),
|
||||
]);
|
||||
}
|
||||
}
|
0
Modules/SalesEntry/app/Http/Requests/.gitkeep
Normal file
0
Modules/SalesEntry/app/Http/Requests/.gitkeep
Normal file
0
Modules/SalesEntry/app/Models/.gitkeep
Normal file
0
Modules/SalesEntry/app/Models/.gitkeep
Normal file
33
Modules/SalesEntry/app/Models/SalesEntry.php
Normal file
33
Modules/SalesEntry/app/Models/SalesEntry.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\SalesEntry\Models;
|
||||
|
||||
use App\Traits\StatusTrait;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Modules\Customer\Models\Customer;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Modules\SalesEntry\Models\SalesEntryDetail;
|
||||
|
||||
|
||||
class SalesEntry extends Model
|
||||
{
|
||||
USE StatusTrait;
|
||||
|
||||
protected $table = 'tbl_salesentries';
|
||||
protected $guarded = [];
|
||||
protected $appends = ['status_name'];
|
||||
|
||||
|
||||
public function salesEntryDetails():HasMany{
|
||||
return $this->hasMany(SalesEntryDetail::class,'salesentry_id');
|
||||
}
|
||||
|
||||
public function customer():BelongsTo{
|
||||
return $this->belongsTo(Customer::class);
|
||||
}
|
||||
|
||||
public static function getFillableField(){
|
||||
return (new self())->fillable;
|
||||
}
|
||||
}
|
25
Modules/SalesEntry/app/Models/SalesEntryDetail.php
Normal file
25
Modules/SalesEntry/app/Models/SalesEntryDetail.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\SalesEntry\Models;
|
||||
|
||||
use App\Traits\StatusTrait;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Modules\SalesEntry\Models\SalesEntry;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Modules\Supplier\Models\Supplier;
|
||||
|
||||
|
||||
class SalesEntryDetail extends Model
|
||||
{
|
||||
USE StatusTrait;
|
||||
|
||||
protected $table = 'tbl_salesentrydetails';
|
||||
protected $guarded = [];
|
||||
protected $appends = ['status_name'];
|
||||
|
||||
|
||||
public function order(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(SalesEntry::class);
|
||||
}
|
||||
}
|
0
Modules/SalesEntry/app/Observers/.gitkeep
Normal file
0
Modules/SalesEntry/app/Observers/.gitkeep
Normal file
0
Modules/SalesEntry/app/Providers/.gitkeep
Normal file
0
Modules/SalesEntry/app/Providers/.gitkeep
Normal file
32
Modules/SalesEntry/app/Providers/EventServiceProvider.php
Normal file
32
Modules/SalesEntry/app/Providers/EventServiceProvider.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\SalesEntry\Providers;
|
||||
|
||||
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
||||
|
||||
class EventServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The event handler mappings for the application.
|
||||
*
|
||||
* @var array<string, array<int, string>>
|
||||
*/
|
||||
protected $listen = [];
|
||||
|
||||
/**
|
||||
* Indicates if events should be discovered.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected static $shouldDiscoverEvents = true;
|
||||
|
||||
/**
|
||||
* Configure the proper event listeners for email verification.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function configureEmailVerification(): void
|
||||
{
|
||||
|
||||
}
|
||||
}
|
49
Modules/SalesEntry/app/Providers/RouteServiceProvider.php
Normal file
49
Modules/SalesEntry/app/Providers/RouteServiceProvider.php
Normal file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\SalesEntry\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
||||
|
||||
class RouteServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Called before routes are registered.
|
||||
*
|
||||
* Register any model bindings or pattern based filters.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
parent::boot();
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the routes for the application.
|
||||
*/
|
||||
public function map(): void
|
||||
{
|
||||
$this->mapApiRoutes();
|
||||
|
||||
$this->mapWebRoutes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the "web" routes for the application.
|
||||
*
|
||||
* These routes all receive session state, CSRF protection, etc.
|
||||
*/
|
||||
protected function mapWebRoutes(): void
|
||||
{
|
||||
Route::middleware('web')->group(module_path('SalesEntry', '/routes/web.php'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the "api" routes for the application.
|
||||
*
|
||||
* These routes are typically stateless.
|
||||
*/
|
||||
protected function mapApiRoutes(): void
|
||||
{
|
||||
Route::middleware('api')->prefix('api')->name('api.')->group(module_path('SalesEntry', '/routes/api.php'));
|
||||
}
|
||||
}
|
123
Modules/SalesEntry/app/Providers/SalesEntryServiceProvider.php
Normal file
123
Modules/SalesEntry/app/Providers/SalesEntryServiceProvider.php
Normal file
@ -0,0 +1,123 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\SalesEntry\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Blade;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Modules\SalesEntry\Repositories\SalesEntryInterface;
|
||||
use Modules\SalesEntry\Repositories\SalesEntryRepository;
|
||||
|
||||
class SalesEntryServiceProvider extends ServiceProvider
|
||||
{
|
||||
protected string $moduleName = 'SalesEntry';
|
||||
|
||||
protected string $moduleNameLower = 'salesEntry';
|
||||
|
||||
/**
|
||||
* Boot the application events.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
$this->registerCommands();
|
||||
$this->registerCommandSchedules();
|
||||
$this->registerTranslations();
|
||||
$this->registerConfig();
|
||||
$this->registerViews();
|
||||
$this->loadMigrationsFrom(module_path($this->moduleName, 'database/migrations'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the service provider.
|
||||
*/
|
||||
public function register(): void
|
||||
{
|
||||
$this->app->register(EventServiceProvider::class);
|
||||
$this->app->register(RouteServiceProvider::class);
|
||||
$this->app->bind(SalesEntryInterface::class, SalesEntryRepository::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register commands in the format of Command::class
|
||||
*/
|
||||
protected function registerCommands(): void
|
||||
{
|
||||
// $this->commands([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register command Schedules.
|
||||
*/
|
||||
protected function registerCommandSchedules(): void
|
||||
{
|
||||
// $this->app->booted(function () {
|
||||
// $schedule = $this->app->make(Schedule::class);
|
||||
// $schedule->command('inspire')->hourly();
|
||||
// });
|
||||
}
|
||||
|
||||
/**
|
||||
* Register translations.
|
||||
*/
|
||||
public function registerTranslations(): void
|
||||
{
|
||||
$langPath = resource_path('lang/modules/'.$this->moduleNameLower);
|
||||
|
||||
if (is_dir($langPath)) {
|
||||
$this->loadTranslationsFrom($langPath, $this->moduleNameLower);
|
||||
$this->loadJsonTranslationsFrom($langPath);
|
||||
} else {
|
||||
$this->loadTranslationsFrom(module_path($this->moduleName, 'lang'), $this->moduleNameLower);
|
||||
$this->loadJsonTranslationsFrom(module_path($this->moduleName, 'lang'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register config.
|
||||
*/
|
||||
protected function registerConfig(): void
|
||||
{
|
||||
$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.
|
||||
*/
|
||||
public function registerViews(): void
|
||||
{
|
||||
$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);
|
||||
|
||||
$componentNamespace = str_replace('/', '\\', config('modules.namespace').'\\'.$this->moduleName.'\\'.ltrim(config('modules.paths.generator.component-class.path'), config('modules.paths.app_folder', '')));
|
||||
Blade::componentNamespace($componentNamespace, $this->moduleNameLower);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the services provided by the provider.
|
||||
*
|
||||
* @return array<string>
|
||||
*/
|
||||
public function provides(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string>
|
||||
*/
|
||||
private function getPublishableViewPaths(): array
|
||||
{
|
||||
$paths = [];
|
||||
foreach (config('view.paths') as $path) {
|
||||
if (is_dir($path.'/modules/'.$this->moduleNameLower)) {
|
||||
$paths[] = $path.'/modules/'.$this->moduleNameLower;
|
||||
}
|
||||
}
|
||||
|
||||
return $paths;
|
||||
}
|
||||
}
|
0
Modules/SalesEntry/app/Repositories/.gitkeep
Normal file
0
Modules/SalesEntry/app/Repositories/.gitkeep
Normal file
17
Modules/SalesEntry/app/Repositories/SalesEntryInterface.php
Normal file
17
Modules/SalesEntry/app/Repositories/SalesEntryInterface.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\SalesEntry\Repositories;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
interface SalesEntryInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getSalesEntryById($SalesEntryId);
|
||||
public function getSalesEntryByEmail($email);
|
||||
public function delete($SalesEntryId);
|
||||
public function create(Request $request);
|
||||
public function update($SalesEntryId, Request $request);
|
||||
public function pluck();
|
||||
|
||||
}
|
119
Modules/SalesEntry/app/Repositories/SalesEntryRepository.php
Normal file
119
Modules/SalesEntry/app/Repositories/SalesEntryRepository.php
Normal file
@ -0,0 +1,119 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\SalesEntry\Repositories;
|
||||
|
||||
use Flasher\Laravel\Http\Request;
|
||||
use Modules\SalesEntry\Models\SalesEntry;
|
||||
use Modules\SalesEntry\Models\SalesEntryDetail;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class SalesEntryRepository implements SalesEntryInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return SalesEntry::when(true, function ($query) {
|
||||
})->paginate(20);
|
||||
}
|
||||
|
||||
public function getSalesEntryById($SalesEntryId)
|
||||
{
|
||||
return SalesEntry::findOrFail($SalesEntryId);
|
||||
}
|
||||
|
||||
public function getSalesEntryByEmail($email)
|
||||
{
|
||||
return SalesEntry::where('email', $email)->first();
|
||||
}
|
||||
|
||||
public function delete($SalesEntryId)
|
||||
{
|
||||
DB::transaction(function() use ($SalesEntryId) {
|
||||
SalesEntryDetail::where('salesentry_id', $SalesEntryId)->delete();
|
||||
|
||||
SalesEntry::destroy($SalesEntryId);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public function create($request)
|
||||
{
|
||||
$salesEntryDetails = $request->except(SalesEntry::getFillableField());
|
||||
|
||||
$salesEntry = $request->only(SalesEntry::getFillableField());
|
||||
$salesEntryData = SalesEntry::create($salesEntry);
|
||||
|
||||
$request->merge(['salesentry_id' => $salesEntryData->id]);
|
||||
|
||||
foreach ($salesEntryDetails['product_id'] as $key => $productId) {
|
||||
$data = [
|
||||
'salesentry_id' => $request->input('salesentry_id'),
|
||||
'product_id' => $productId,
|
||||
'unit' => $salesEntryDetails['unit'][$key],
|
||||
'rate' => $salesEntryDetails['rate'][$key],
|
||||
'quantity' => $salesEntryDetails['qty'][$key],
|
||||
'amount' => $salesEntryDetails['amt'][$key],
|
||||
'desc' => $salesEntryDetails['desc'][$key],
|
||||
];
|
||||
SalesEntryDetail::create($data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function update($SalesEntryId, $request)
|
||||
{
|
||||
$fillableFields = SalesEntry::getFillableField();
|
||||
$salesEntryData = $request->only($fillableFields);
|
||||
|
||||
$salesEntry = SalesEntry::find($SalesEntryId);
|
||||
$salesEntry->update($salesEntryData);
|
||||
|
||||
|
||||
$additionalExcludes = ['_method', '_token'];
|
||||
$excludeFields = array_merge($fillableFields, $additionalExcludes);
|
||||
|
||||
$data = $request->except($excludeFields);
|
||||
|
||||
$updatedCombinations = [];
|
||||
|
||||
if (isset($data['product_id'])) {
|
||||
foreach ($data['product_id'] as $key => $productId) {
|
||||
$obj = [
|
||||
'salesentry_id' => $SalesEntryId,
|
||||
'product_id' => $productId,
|
||||
'unit' => $data['unit'][$key],
|
||||
'rate' => $data['rate'][$key],
|
||||
'quantity' => $data['qty'][$key],
|
||||
'amount' => $data['amt'][$key],
|
||||
'desc' => $data['desc'][$key],
|
||||
];
|
||||
|
||||
$combinationKey = "{$SalesEntryId}_{$productId}_{$data['unit'][$key]}";
|
||||
|
||||
$salesEntryDetail = $salesEntry->salesEntryDetails()->where('product_id', $productId)->where('unit', $data['unit'][$key])->first();
|
||||
if ($salesEntryDetail) {
|
||||
$salesEntryDetail->update($obj);
|
||||
} else {
|
||||
SalesEntryDetail::create($obj);
|
||||
}
|
||||
|
||||
$updatedCombinations[] = $combinationKey;
|
||||
}
|
||||
}
|
||||
|
||||
$salesEntry->salesEntryDetails()->each(function ($salesEntryDetail) use ($updatedCombinations) {
|
||||
$combinationKey = "{$salesEntryDetail->salesEntry_id}_{$salesEntryDetail->product_id}_{$salesEntryDetail->unit}";
|
||||
if (!in_array($combinationKey, $updatedCombinations)) {
|
||||
$salesEntryDetail->delete();
|
||||
}
|
||||
});
|
||||
|
||||
return $salesEntry;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function pluck()
|
||||
{
|
||||
return SalesEntry::pluck('name', 'id');
|
||||
}
|
||||
}
|
30
Modules/SalesEntry/composer.json
Normal file
30
Modules/SalesEntry/composer.json
Normal file
@ -0,0 +1,30 @@
|
||||
{
|
||||
"name": "nwidart/salesentry",
|
||||
"description": "",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nicolas Widart",
|
||||
"email": "n.widart@gmail.com"
|
||||
}
|
||||
],
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [],
|
||||
"aliases": {
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Modules\\SalesEntry\\": "app/",
|
||||
"Modules\\SalesEntry\\Database\\Factories\\": "database/factories/",
|
||||
"Modules\\SalesEntry\\Database\\Seeders\\": "database/seeders/"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Modules\\SalesEntry\\Tests\\": "tests/"
|
||||
}
|
||||
}
|
||||
}
|
0
Modules/SalesEntry/config/.gitkeep
Normal file
0
Modules/SalesEntry/config/.gitkeep
Normal file
5
Modules/SalesEntry/config/config.php
Normal file
5
Modules/SalesEntry/config/config.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'name' => 'SalesEntry',
|
||||
];
|
0
Modules/SalesEntry/database/factories/.gitkeep
Normal file
0
Modules/SalesEntry/database/factories/.gitkeep
Normal file
0
Modules/SalesEntry/database/migrations/.gitkeep
Normal file
0
Modules/SalesEntry/database/migrations/.gitkeep
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('tbl_salesentries', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('title')->nullable();
|
||||
$table->string('slug')->nullable();
|
||||
$table->date('sales_date')->nullable();
|
||||
$table->unsignedBigInteger('customer_id')->nullable();
|
||||
$table->unsignedBigInteger('product_id')->nullable();
|
||||
$table->unsignedBigInteger('category_id')->nullable();
|
||||
$table->unsignedBigInteger('stock_id')->nullable();
|
||||
$table->unsignedBigInteger('size_id')->nullable();
|
||||
$table->string('payment')->nullable();
|
||||
$table->unsignedBigInteger('paymentmode_id')->nullable();
|
||||
$table->string('paymentref')->nullable();
|
||||
$table->decimal('sub_total', 10, 2)->nullable();
|
||||
$table->decimal('tax', 10, 2)->nullable();
|
||||
$table->decimal('discount_amt', 10, 2)->nullable();
|
||||
$table->decimal('total_amt', 10, 2)->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('tbl_salesentries');
|
||||
}
|
||||
};
|
||||
|
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('tbl_salesentrydetails', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('salesentry_id')->nullable();
|
||||
$table->unsignedBigInteger('product_id')->nullable();
|
||||
$table->unsignedBigInteger('category_id')->nullable();
|
||||
$table->unsignedBigInteger('stock_id')->nullable();
|
||||
$table->unsignedBigInteger('size_id')->nullable();
|
||||
$table->string('unit')->nullable();
|
||||
$table->integer('rate')->nullable();
|
||||
$table->integer('quantity')->nullable();
|
||||
$table->decimal('amount', 6);
|
||||
$table->text('desc')->nullable();
|
||||
$table->integer('status')->nullable();
|
||||
$table->text('remarks')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('tbl_salesentrydetails');
|
||||
}
|
||||
};
|
||||
|
0
Modules/SalesEntry/database/seeders/.gitkeep
Normal file
0
Modules/SalesEntry/database/seeders/.gitkeep
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\SalesEntry\Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class SalesEntryDatabaseSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
// $this->call([]);
|
||||
}
|
||||
}
|
11
Modules/SalesEntry/module.json
Normal file
11
Modules/SalesEntry/module.json
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "SalesEntry",
|
||||
"alias": "salesentry",
|
||||
"description": "",
|
||||
"keywords": [],
|
||||
"priority": 0,
|
||||
"providers": [
|
||||
"Modules\\SalesEntry\\Providers\\SalesEntryServiceProvider"
|
||||
],
|
||||
"files": []
|
||||
}
|
15
Modules/SalesEntry/package.json
Normal file
15
Modules/SalesEntry/package.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build"
|
||||
},
|
||||
"devDependencies": {
|
||||
"axios": "^1.1.2",
|
||||
"laravel-vite-plugin": "^0.7.5",
|
||||
"sass": "^1.69.5",
|
||||
"postcss": "^8.3.7",
|
||||
"vite": "^4.0.0"
|
||||
}
|
||||
}
|
0
Modules/SalesEntry/resources/assets/.gitkeep
Normal file
0
Modules/SalesEntry/resources/assets/.gitkeep
Normal file
0
Modules/SalesEntry/resources/assets/js/app.js
Normal file
0
Modules/SalesEntry/resources/assets/js/app.js
Normal file
0
Modules/SalesEntry/resources/assets/sass/app.scss
Normal file
0
Modules/SalesEntry/resources/assets/sass/app.scss
Normal file
0
Modules/SalesEntry/resources/views/.gitkeep
Normal file
0
Modules/SalesEntry/resources/views/.gitkeep
Normal file
7
Modules/SalesEntry/resources/views/index.blade.php
Normal file
7
Modules/SalesEntry/resources/views/index.blade.php
Normal file
@ -0,0 +1,7 @@
|
||||
@extends('salesentry::layouts.master')
|
||||
|
||||
@section('content')
|
||||
<h1>Hello World</h1>
|
||||
|
||||
<p>Module: {!! config('salesentry.name') !!}</p>
|
||||
@endsection
|
29
Modules/SalesEntry/resources/views/layouts/master.blade.php
Normal file
29
Modules/SalesEntry/resources/views/layouts/master.blade.php
Normal file
@ -0,0 +1,29 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
|
||||
<title>SalesEntry Module - {{ config('app.name', 'Laravel') }}</title>
|
||||
|
||||
<meta name="description" content="{{ $description ?? '' }}">
|
||||
<meta name="keywords" content="{{ $keywords ?? '' }}">
|
||||
<meta name="author" content="{{ $author ?? '' }}">
|
||||
|
||||
<!-- Fonts -->
|
||||
<link rel="preconnect" href="https://fonts.bunny.net">
|
||||
<link href="https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel="stylesheet" />
|
||||
|
||||
{{-- Vite CSS --}}
|
||||
{{-- {{ module_vite('build-salesentry', 'resources/assets/sass/app.scss') }} --}}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@yield('content')
|
||||
|
||||
{{-- Vite JS --}}
|
||||
{{-- {{ module_vite('build-salesentry', 'resources/assets/js/app.js') }} --}}
|
||||
</body>
|
@ -0,0 +1,46 @@
|
||||
<div class="card card-body product-card card-border-secondary mb-2 border">
|
||||
<div class="row gy-2 mb-2">
|
||||
<div class="col-md-4">
|
||||
{{ html()->label('Product')->class('form-label') }}
|
||||
@if (isset($editable) && $editable)
|
||||
{{ html()->select('product_id[]', $productList, $item->product_id)->class('form-select product_id')->attributes(['id' => 'product_id'])->placeholder('Enter Product Name')->required() }}
|
||||
@else
|
||||
@endif
|
||||
{{ html()->select('product_id[]', $productList)->class('form-select product_id')->attributes(['id' => 'product_id'])->placeholder('Enter Product Name')->required() }}
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
{{ html()->label('Unit')->class('form-label') }}
|
||||
{{ html()->text('unit[]', isset($editable) && $editable ? $item->unit : null)->class('form-control unit')->placeholder('Enter Unit')->required()->attributes(['id' => 'unit']) }}
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
{{ html()->label('Rate')->class('form-label') }}
|
||||
{{ html()->text('rate[]', isset($editable) && $editable ? $item->rate : null)->class('form-control product-price cleave-numeral rate~~')->placeholder('Enter Rate')->attributes(['id' => 'rate']) }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
{{ html()->label('Quantity')->class('form-label') }}
|
||||
{{ html()->text('qty[]', isset($editable) && $editable ? $item->quantity : null)->class('form-control product-quantity cleave-numeral qty')->placeholder('Enter QTY')->attributes(['id' => 'qty']) }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
{{ html()->label('Amount')->class('form-label') }}
|
||||
{{ html()->text('amt[]', isset($editable) && $editable ? $item->amount : null)->class('form-control product-line-price bg-light')->placeholder('Enter Amount')->isReadOnly() }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{{ html()->label('Description')->class('form-label') }}
|
||||
{{ html()->text('desc[]', isset($editable) && $editable ? $item->desc : null)->class('form-control')->placeholder('Enter Description') }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 d-flex justify-content-end align-items-end">
|
||||
<button type="button" class="btn btn-danger btn-icon waves-effect btn-remove waves-light"><i
|
||||
class="ri-delete-bin-5-line"></i></button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,27 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => $title])
|
||||
<!-- end page title -->
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="{{ route('salesEntry.store') }}" class="needs-validation" novalidate method="post">
|
||||
@csrf
|
||||
@include('salesEntry::salesEntry.partials.action')
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- container-fluid -->
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
|
||||
@endpush
|
47
Modules/SalesEntry/resources/views/salesEntry/edit.blade.php
Normal file
47
Modules/SalesEntry/resources/views/salesEntry/edit.blade.php
Normal file
@ -0,0 +1,47 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box d-sm-flex align-items-center justify-content-between">
|
||||
<h4 class="mb-sm-0">{{ $title }}</h4>
|
||||
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li class="breadcrumb-item"><a href="javascript: void(0);">Dashboards</a></li>
|
||||
<li class="breadcrumb-item active">{{ $title }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
{{ html()->modelForm($order, 'PUT')->route('order.update', $id)->class(['needs-validation'])->attributes(['novalidate'])->open() }}
|
||||
|
||||
@include('order::order.partials.action')
|
||||
|
||||
{{ html()->closeModelForm() }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--end row-->
|
||||
|
||||
</div>
|
||||
<!-- container-fluid -->
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
|
||||
@endpush
|
@ -0,0 +1,68 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-header align-items-center d-flex">
|
||||
<h5 class="card-title flex-grow-1 mb-0">{{ $title }}</h5>
|
||||
<div class="flex-shrink-0">
|
||||
<a href="{{ route('salesEntry.create') }}" class="btn btn-success waves-effect waves-light"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i> Add</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table id="buttons-datatables" class="display table-sm table-bordered table"
|
||||
style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>S.N</th>
|
||||
<th>Customer</th>
|
||||
<th>Sales Date</th>
|
||||
<th>Total Amount</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse ($salesEntries as $key => $item)
|
||||
<tr>
|
||||
<td>{{ $key + 1 }}</td>
|
||||
<td>{{ $item->customer->customer_name }}</td>
|
||||
<td>{{ $item->sales_date }}</td>
|
||||
<td>{{ $item->total_amt }}</td>
|
||||
<td>
|
||||
<div class="hstack flex-wrap gap-3">
|
||||
<a href="javascript:void(0);" class="link-info fs-15 view-item-btn"
|
||||
data-bs-toggle="modal" data-bs-target="#viewModal">
|
||||
<i class="ri-eye-line"></i>
|
||||
</a>
|
||||
<a href="{{ route('salesEntry.edit', $item->id) }}"
|
||||
class="link-success fs-15 edit-item-btn"><i
|
||||
class="ri-edit-2-line"></i></a>
|
||||
|
||||
<a href="javascript:void(0);"
|
||||
data-link="{{ route('salesEntry.destroy', $item->id) }}"
|
||||
data-id="{{ $item->id }}"
|
||||
class="link-danger fs-15 remove-item-btn"><i
|
||||
class="ri-delete-bin-line"></i></a>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--end row-->
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
@ -0,0 +1,219 @@
|
||||
<div class="row gy-1">
|
||||
<h5 class="text-primary text-center">Order Details</h5>
|
||||
<div class="border border-dashed"></div>
|
||||
<div class="col-md-4">
|
||||
{{ html()->label('Sales Date')->class('form-label') }}
|
||||
{{ html()->date('sales_date')->class('form-control')->placeholder('Choose Sales Date')->required() }}
|
||||
{{ html()->div('Please choose Sales date')->class('invalid-feedback') }}
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
{{ html()->label('Customer')->class('form-label') }}
|
||||
{{ html()->select('customer_id', $customerList)->class('form-control')->placeholder('Select Customer')->required() }}
|
||||
{{ html()->div('Please select customer')->class('invalid-feedback') }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
{{-- <div class="row mt-2">
|
||||
<p class="text-primary">Shipping Details</p>
|
||||
<div class="border border-dashed"></div>
|
||||
<div class="col-md-4">
|
||||
{{ html()->label('Address')->class('form-label') }}
|
||||
{{ html()->text('address')->class('form-control')->placeholder('Enter Address') }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{{ html()->label('Shipping Date')->class('form-label') }}
|
||||
{{ html()->date('shiiping_date')->class('form-control')->placeholder('Enter Temporary Address') }}
|
||||
</div>
|
||||
</div> --}}
|
||||
|
||||
<div class="row gy-1 gx-2 mt-1">
|
||||
<div class="d-flex justify-content-end">
|
||||
<button type="button" class="btn btn-info btn-icon add-btn text-end"><i class="ri-add-line"></i></button>
|
||||
</div>
|
||||
@if ($editable && $salesEntry->salesEntryDetail->isNotEmpty())
|
||||
@foreach ($salesEntry->salesEntryDetail as $item)
|
||||
@include('salesEntry::salesEntry.clone-product')
|
||||
@endforeach
|
||||
@else
|
||||
@include('salesEntry::salesEntry.clone-product')
|
||||
@endif
|
||||
<div class="appendProductCard"></div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-end w-30 mb-2">
|
||||
<table class="table-borderless align-middle">
|
||||
<tbody>
|
||||
{{-- <tr>
|
||||
<th scope="row">Sub Total</th>
|
||||
<td style="width:150px;">
|
||||
<input type="text" name="sub_total" class="form-control bg-light border-0" id="subtotal"
|
||||
placeholder="$0.00" readonly="">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Estimated Tax (11%)</th>
|
||||
<td>
|
||||
<input type="text" name="tax" class="form-control bg-light border-0" id="tax"
|
||||
placeholder="$0.00" readonly="">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Discount</th>
|
||||
<td>
|
||||
<input type="text" name="discount_amt" class="form-control bg-light border-0" id="discount"
|
||||
placeholder="$0.00" readonly="">
|
||||
</td>
|
||||
</tr> --}}
|
||||
<tr class="border-top border-top-dashed">
|
||||
<th scope="row">Total Amount</th>
|
||||
<td>
|
||||
<input type="text" name="total_amt" class="form-control bg-light border-0" id="total"
|
||||
placeholder="$0.00" readonly="">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row gy-1 my-2">
|
||||
<h5 class="text-primary text-center">Payment Details</h5>
|
||||
<div class="border border-dashed"></div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{{ html()->label('Payment')->class('form-label') }}
|
||||
{{ html()->text('payment')->class('form-control')->placeholder('Enter Payment') }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{{ html()->label('Mode of Payment')->class('form-label') }}
|
||||
{{ html()->select('paymentmode_id', $paymentModes)->class('form-select select2')->placeholder('Select Payment Mode') }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{{ html()->label('Payment Reference')->class('form-label') }}
|
||||
{{ html()->text('paymentref')->class('form-control')->placeholder('Enter Payment Reference') }}
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="mb-4 text-end">
|
||||
<button type="submit" class="btn btn-success w-sm">Save</button>
|
||||
</div>
|
||||
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('assets/libs/cleave.js/cleave.min.js') }}"></script>
|
||||
<script src="{{ asset('assets/js/pages/form-masks.init.js') }}"></script>
|
||||
|
||||
<script>
|
||||
$("body").on('click', '.add-btn', function(e) {
|
||||
e.preventDefault();
|
||||
numberInc = $('.product-card').length
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '{{ url('clone-sales-product') }}',
|
||||
|
||||
data: {
|
||||
numberInc: numberInc
|
||||
},
|
||||
success: function(response) {
|
||||
$('.appendProductCard').append(response.view)
|
||||
// $('#salesEntry-container').html(response.view).fadeIn()
|
||||
},
|
||||
error: function(xhr) {
|
||||
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
$("body").on('click', '.btn-remove', function() {0
|
||||
if ($('.product-card').length > 1) {
|
||||
$(this).parents(".product-card").remove();
|
||||
}
|
||||
recalculate();
|
||||
});
|
||||
|
||||
$(window).on('load', function() {
|
||||
recalculate();
|
||||
})
|
||||
|
||||
|
||||
function amountKeyup() {
|
||||
$("body").on('keyup', '.product-price', function() {
|
||||
var priceInput = $(this);
|
||||
var qtyInput = priceInput.closest(".row").find(".product-quantity");
|
||||
var linePrice = priceInput.closest(".row").find(".product-line-price");
|
||||
updateQuantity(priceInput.val(), qtyInput.val(), linePrice);
|
||||
});
|
||||
|
||||
$("body").on('keyup', '.product-quantity', function() {
|
||||
var priceInput = $(this);
|
||||
var qtyInput = priceInput.closest(".row").find(".product-price");
|
||||
var linePrice = priceInput.closest(".row").find(".product-line-price");
|
||||
updateQuantity(priceInput.val(), qtyInput.val(), linePrice);
|
||||
});
|
||||
}
|
||||
|
||||
amountKeyup()
|
||||
|
||||
function updateQuantity(rate, qty, linePriceInput) {
|
||||
var amount = (rate * qty).toFixed(2);
|
||||
linePriceInput.val(amount);
|
||||
recalculate();
|
||||
}
|
||||
|
||||
function recalculate() {
|
||||
var subtotal = 0;
|
||||
$(".product-line-price").each(function() {
|
||||
if ($(this).val()) {
|
||||
subtotal += parseFloat($(this).val());
|
||||
}
|
||||
});
|
||||
|
||||
// var tax = subtotal * 0.125;
|
||||
// var discount = subtotal * 0.15;
|
||||
// var shipping = subtotal > 0 ? 65 : 0;
|
||||
// var total = subtotal + tax + shipping - discount;
|
||||
|
||||
// $("#subtotal").val(subtotal.toFixed(2));
|
||||
// $("#tax").val(tax.toFixed(2));
|
||||
// $("#discount").val(discount.toFixed(2));
|
||||
// $("#shipping").val(shipping.toFixed(2));
|
||||
$("#total").val(subtotal.toFixed(2));
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$('body').on('change', '.product_id', function() {
|
||||
var selectedId = $(this).find(':selected').val();
|
||||
var formRow = $(this).closest('.row');
|
||||
|
||||
if (selectedId) {
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '{{ route('get-product-detail') }}',
|
||||
data: {
|
||||
id: selectedId
|
||||
},
|
||||
success: function(response) {
|
||||
var qtyInput = formRow.find('#qty').val(response.data.qty);
|
||||
formRow.find('#unit').val(response.data.unit);
|
||||
var priceInput = formRow.find('#rate').val(response.data.price);
|
||||
var linePrice = priceInput.closest(".row").find(".product-line-price");
|
||||
|
||||
|
||||
updateQuantity(priceInput.val(), qtyInput.val(), linePrice);
|
||||
},
|
||||
error: function(xhr) {
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
@ -0,0 +1,16 @@
|
||||
<div class="modal fade" id="viewModal" tabindex="-1" aria-labelledby="viewModalLabel" aria-modal="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalgridLabel">View Leave</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form action="{{ route('leave.store') }}" class="needs-validation" novalidate method="post">
|
||||
@csrf
|
||||
@include('leave::leave.partials.action')
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
0
Modules/SalesEntry/routes/.gitkeep
Normal file
0
Modules/SalesEntry/routes/.gitkeep
Normal file
19
Modules/SalesEntry/routes/api.php
Normal file
19
Modules/SalesEntry/routes/api.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Modules\SalesEntry\Http\Controllers\SalesEntryController;
|
||||
|
||||
/*
|
||||
*--------------------------------------------------------------------------
|
||||
* API Routes
|
||||
*--------------------------------------------------------------------------
|
||||
*
|
||||
* Here is where you can register API routes for your application. These
|
||||
* routes are loaded by the RouteServiceProvider within a group which
|
||||
* is assigned the "api" middleware group. Enjoy building your API!
|
||||
*
|
||||
*/
|
||||
|
||||
Route::middleware(['auth:sanctum'])->prefix('v1')->group(function () {
|
||||
Route::apiResource('salesentry', SalesEntryController::class)->names('salesentry');
|
||||
});
|
20
Modules/SalesEntry/routes/web.php
Normal file
20
Modules/SalesEntry/routes/web.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Modules\SalesEntry\Http\Controllers\SalesEntryController;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Web Routes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here is where you can register web routes for your application. These
|
||||
| routes are loaded by the RouteServiceProvider within a group which
|
||||
| contains the "web" middleware group. Now create something great!
|
||||
|
|
||||
*/
|
||||
|
||||
Route::group([], function () {
|
||||
Route::resource('salesEntry', SalesEntryController::class)->names('salesEntry');
|
||||
Route::get('clone-sales-product', [SalesEntryController::class, 'cloneSalesProduct'])->name('salesEntry.cloneSalesProduct');
|
||||
});
|
26
Modules/SalesEntry/vite.config.js
Normal file
26
Modules/SalesEntry/vite.config.js
Normal file
@ -0,0 +1,26 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import laravel from 'laravel-vite-plugin';
|
||||
|
||||
export default defineConfig({
|
||||
build: {
|
||||
outDir: '../../public/build-salesentry',
|
||||
emptyOutDir: true,
|
||||
manifest: true,
|
||||
},
|
||||
plugins: [
|
||||
laravel({
|
||||
publicDirectory: '../../public',
|
||||
buildDirectory: 'build-salesentry',
|
||||
input: [
|
||||
__dirname + '/resources/assets/sass/app.scss',
|
||||
__dirname + '/resources/assets/js/app.js'
|
||||
],
|
||||
refresh: true,
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
//export const paths = [
|
||||
// 'Modules/SalesEntry/resources/assets/sass/app.scss',
|
||||
// 'Modules/SalesEntry/resources/assets/js/app.js',
|
||||
//];
|
Reference in New Issue
Block a user