partial update create page opnames

This commit is contained in:
2025-06-03 12:56:33 +07:00
parent a881779c4f
commit 215792ce63
24 changed files with 4407 additions and 1542 deletions

View File

@@ -82,58 +82,65 @@ class ProductsController extends Controller
*/
public function store(Request $request)
{
$request->validate([
'code' => [
'required',
'string',
Rule::unique('products')->whereNull('deleted_at'),
],
'name' => 'required|string',
'description' => 'nullable|string',
'unit' => 'nullable|string',
'active' => 'required|boolean',
'product_category_id' => 'required|exists:product_categories,id',
'dealer_stock' => 'nullable|array',
'dealer_stock.*.dealer_id' => 'required|exists:dealers,id',
'dealer_stock.*.quantity' => 'required|integer|min:0',
]);
try{
$request->validate([
'code' => [
'required',
'string',
Rule::unique('products')->whereNull('deleted_at'),
],
'name' => 'required|string',
'description' => 'nullable|string',
'unit' => 'nullable|string',
'active' => 'required|boolean',
'product_category_id' => 'required|exists:product_categories,id',
'dealer_stock' => 'nullable|array',
'dealer_stock.*.dealer_id' => 'required|exists:dealers,id',
'dealer_stock.*.quantity' => 'required|integer|min:0',
]);
// Create product
$product = Product::create([
'code' => $request->code,
'name' => $request->name,
'unit' => $request->unit,
'active' => $request->active,
'description' => $request->description,
'product_category_id' => $request->product_category_id,
]);
// Prepare dealer stock for pivot and create mutation records
$pivotData = [];
if ($request->has('dealer_stock')) {
foreach ($request->dealer_stock as $stockData) {
if (empty($stockData['dealer_id']) || !isset($stockData['quantity'])) continue;
// Create product
$product = Product::create([
'code' => $request->code,
'name' => $request->name,
'unit' => $request->unit,
'description' => $request->description,
'product_category_id' => $request->product_category_id,
]);
$dealerId = $stockData['dealer_id'];
$quantity = $stockData['quantity'];
// Prepare dealer stock for pivot and create mutation records
$pivotData = [];
if ($request->has('dealer_stock')) {
foreach ($request->dealer_stock as $stockData) {
if (empty($stockData['dealer_id']) || !isset($stockData['quantity'])) continue;
$dealerId = $stockData['dealer_id'];
$quantity = $stockData['quantity'];
$pivotData[$dealerId] = ['quantity' => $quantity];
// Create stock mutation for initial stock "in"
StockMutation::create([
'product_id' => $product->id,
'dealer_id' => $dealerId,
'mutation_type' => 'in', // karena ini penambahan stok awal
'quantity' => $quantity,
'description' => 'Initial stock added when product created',
'user_id' => Auth::id(),
]);
$pivotData[$dealerId] = ['quantity' => $quantity];
// Create stock mutation for initial stock "in"
StockMutation::create([
'product_id' => $product->id,
'dealer_id' => $dealerId,
'mutation_type' => 'in', // karena ini penambahan stok awal
'quantity' => $quantity,
'description' => 'Initial stock added when product created',
'user_id' => Auth::id(),
]);
}
// Attach dealer stock using pivot table
$product->dealers()->attach($pivotData);
}
// Attach dealer stock using pivot table
$product->dealers()->attach($pivotData);
return redirect()->route('products.index')->with('success', 'Produk berhasil ditambahkan.');
}catch(\Exception $ex){
throw $ex;
}
return redirect()->route('products.index')->with('success', 'Produk berhasil ditambahkan.');
}
/**

View File

@@ -0,0 +1,40 @@
<?php
namespace App\Http\Controllers\WarehouseManagement;
use App\Http\Controllers\Controller;
use App\Models\StockOpname;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
use Yajra\DataTables\Facades\DataTables;
class StockOpnamesController extends Controller
{
public function index(Request $request){
try{
if ($request->ajax()) {
$query = StockOpname::with(['product', 'dealer', 'user']);
return DataTables::of($query)
->addIndexColumn()
->addColumn('product_name', function ($row) {
return $row->product ? $row->product->name : '-';
})
->addColumn('dealer_name', function ($row) {
return $row->dealer ? $row->dealer->name : '-';
})
->addColumn('user_name', function ($row) {
return $row->user ? $row->user->name : '-';
})
->editColumn('opname_date', function ($row) {
return $row->opname_date->format('d M Y');
})
->make(true);
}
return view('warehouse_management.stock_opnames.index');
}catch(\Exception $ex){
Log::error($ex->getMessage());
}
}
}

View File

@@ -2,7 +2,10 @@
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.3|^8.0",
@@ -51,9 +54,10 @@
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
],
"dev": "npm run development",
"dev": "npx concurrently \"php artisan serve\" \"npm run hot\"",
"development": "npx mix",
"watch": "npx mix watch",
"hot": "npx mix watch --hot",
"production": "npx mix --production"
},
"extra": {

View File

@@ -26,6 +26,10 @@ class MenuSeeder extends Seeder
[
'name' => 'Mutasi Produk',
'link' => 'mutations.index'
],
[
'name' => 'Stock Opname',
'link' => 'opnames.index'
]
];

5150
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -13,11 +13,18 @@
"@popperjs/core": "^2.10.2",
"axios": "^0.21",
"bootstrap": "^5.1.3",
"laravel-mix": "^6.0.6",
"browser-sync": "^2.29.3",
"browser-sync-webpack-plugin": "^2.3.0",
"concurrently": "^9.1.2",
"cross-env": "^7.0.3",
"laravel-mix": "^6.0.49",
"lodash": "^4.17.19",
"postcss": "^8.1.14",
"resolve-url-loader": "^5.0.0",
"sass": "^1.32.11",
"sass-loader": "^11.0.1"
"sass-loader": "^11.0.1",
"webpack": "^5.99.9",
"webpack-cli": "^6.0.1",
"webpack-dev-server": "^4.15.2"
}
}

View File

@@ -449,10 +449,6 @@ legend + * {
padding: 0;
}
::-webkit-file-upload-button {
font: inherit;
}
::file-selector-button {
font: inherit;
}
@@ -2223,10 +2219,6 @@ progress {
color: #6c757d;
opacity: 1;
}
.form-control:-ms-input-placeholder {
color: #6c757d;
opacity: 1;
}
.form-control::placeholder {
color: #6c757d;
opacity: 1;
@@ -2235,27 +2227,10 @@ progress {
background-color: #e9ecef;
opacity: 1;
}
.form-control::-webkit-file-upload-button {
padding: 0.375rem 0.75rem;
margin: -0.375rem -0.75rem;
-webkit-margin-end: 0.75rem;
margin-inline-end: 0.75rem;
color: #212529;
background-color: #e9ecef;
pointer-events: none;
border-color: inherit;
border-style: solid;
border-width: 0;
border-inline-end-width: 1px;
border-radius: 0;
-webkit-transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.form-control::file-selector-button {
padding: 0.375rem 0.75rem;
margin: -0.375rem -0.75rem;
-webkit-margin-end: 0.75rem;
margin-inline-end: 0.75rem;
margin-inline-end: 0.75rem;
color: #212529;
background-color: #e9ecef;
pointer-events: none;
@@ -2267,25 +2242,17 @@ progress {
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
@media (prefers-reduced-motion: reduce) {
.form-control::-webkit-file-upload-button {
-webkit-transition: none;
transition: none;
}
.form-control::file-selector-button {
transition: none;
}
}
.form-control:hover:not(:disabled):not([readonly])::-webkit-file-upload-button {
background-color: #dde0e3;
}
.form-control:hover:not(:disabled):not([readonly])::file-selector-button {
background-color: #dde0e3;
}
.form-control::-webkit-file-upload-button {
padding: 0.375rem 0.75rem;
margin: -0.375rem -0.75rem;
-webkit-margin-end: 0.75rem;
margin-inline-end: 0.75rem;
margin-inline-end: 0.75rem;
color: #212529;
background-color: #e9ecef;
pointer-events: none;
@@ -2329,23 +2296,15 @@ progress {
font-size: 0.7875rem;
border-radius: 0.2rem;
}
.form-control-sm::-webkit-file-upload-button {
padding: 0.25rem 0.5rem;
margin: -0.25rem -0.5rem;
-webkit-margin-end: 0.5rem;
margin-inline-end: 0.5rem;
}
.form-control-sm::file-selector-button {
padding: 0.25rem 0.5rem;
margin: -0.25rem -0.5rem;
-webkit-margin-end: 0.5rem;
margin-inline-end: 0.5rem;
margin-inline-end: 0.5rem;
}
.form-control-sm::-webkit-file-upload-button {
padding: 0.25rem 0.5rem;
margin: -0.25rem -0.5rem;
-webkit-margin-end: 0.5rem;
margin-inline-end: 0.5rem;
margin-inline-end: 0.5rem;
}
.form-control-lg {
@@ -2354,23 +2313,15 @@ progress {
font-size: 1.125rem;
border-radius: 0.3rem;
}
.form-control-lg::-webkit-file-upload-button {
padding: 0.5rem 1rem;
margin: -0.5rem -1rem;
-webkit-margin-end: 1rem;
margin-inline-end: 1rem;
}
.form-control-lg::file-selector-button {
padding: 0.5rem 1rem;
margin: -0.5rem -1rem;
-webkit-margin-end: 1rem;
margin-inline-end: 1rem;
margin-inline-end: 1rem;
}
.form-control-lg::-webkit-file-upload-button {
padding: 0.5rem 1rem;
margin: -0.5rem -1rem;
-webkit-margin-end: 1rem;
margin-inline-end: 1rem;
margin-inline-end: 1rem;
}
textarea.form-control {
@@ -2684,9 +2635,6 @@ textarea.form-control-lg {
.form-floating > .form-control::-moz-placeholder {
color: transparent;
}
.form-floating > .form-control:-ms-input-placeholder {
color: transparent;
}
.form-floating > .form-control::placeholder {
color: transparent;
}
@@ -2694,10 +2642,6 @@ textarea.form-control-lg {
padding-top: 1.625rem;
padding-bottom: 0.625rem;
}
.form-floating > .form-control:not(:-ms-input-placeholder) {
padding-top: 1.625rem;
padding-bottom: 0.625rem;
}
.form-floating > .form-control:focus, .form-floating > .form-control:not(:placeholder-shown) {
padding-top: 1.625rem;
padding-bottom: 0.625rem;
@@ -2714,10 +2658,6 @@ textarea.form-control-lg {
opacity: 0.65;
transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
}
.form-floating > .form-control:not(:-ms-input-placeholder) ~ label {
opacity: 0.65;
transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
}
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-select ~ label {
@@ -2998,7 +2938,6 @@ textarea.form-control-lg {
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
background-color: transparent;
border: 1px solid transparent;
@@ -5003,12 +4942,6 @@ textarea.form-control-lg {
color: #101214;
}
@-webkit-keyframes progress-bar-stripes {
0% {
background-position-x: 1rem;
}
}
@keyframes progress-bar-stripes {
0% {
background-position-x: 1rem;
@@ -5046,13 +4979,11 @@ textarea.form-control-lg {
}
.progress-bar-animated {
-webkit-animation: 1s linear infinite progress-bar-stripes;
animation: 1s linear infinite progress-bar-stripes;
animation: 1s linear infinite progress-bar-stripes;
}
@media (prefers-reduced-motion: reduce) {
.progress-bar-animated {
-webkit-animation: none;
animation: none;
animation: none;
}
}
@@ -5415,7 +5346,6 @@ textarea.form-control-lg {
pointer-events: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
opacity: 0.25;
}
@@ -5443,7 +5373,6 @@ textarea.form-control-lg {
}
.toast-container {
width: -webkit-max-content;
width: -moz-max-content;
width: max-content;
max-width: 100%;
@@ -6011,8 +5940,7 @@ textarea.form-control-lg {
float: left;
width: 100%;
margin-right: -100%;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
backface-visibility: hidden;
transition: transform 0.6s ease-in-out;
}
@media (prefers-reduced-motion: reduce) {
@@ -6193,12 +6121,6 @@ textarea.form-control-lg {
color: #000;
}
@-webkit-keyframes spinner-border {
to {
transform: rotate(360deg) /* rtl:ignore */;
}
}
@keyframes spinner-border {
to {
transform: rotate(360deg) /* rtl:ignore */;
@@ -6212,8 +6134,7 @@ textarea.form-control-lg {
border: 0.25em solid currentColor;
border-right-color: transparent;
border-radius: 50%;
-webkit-animation: 0.75s linear infinite spinner-border;
animation: 0.75s linear infinite spinner-border;
animation: 0.75s linear infinite spinner-border;
}
.spinner-border-sm {
@@ -6222,16 +6143,6 @@ textarea.form-control-lg {
border-width: 0.2em;
}
@-webkit-keyframes spinner-grow {
0% {
transform: scale(0);
}
50% {
opacity: 1;
transform: none;
}
}
@keyframes spinner-grow {
0% {
transform: scale(0);
@@ -6249,8 +6160,7 @@ textarea.form-control-lg {
background-color: currentColor;
border-radius: 50%;
opacity: 0;
-webkit-animation: 0.75s linear infinite spinner-grow;
animation: 0.75s linear infinite spinner-grow;
animation: 0.75s linear infinite spinner-grow;
}
.spinner-grow-sm {
@@ -6261,8 +6171,7 @@ textarea.form-control-lg {
@media (prefers-reduced-motion: reduce) {
.spinner-border,
.spinner-grow {
-webkit-animation-duration: 1.5s;
animation-duration: 1.5s;
animation-duration: 1.5s;
}
}
.offcanvas {
@@ -6389,14 +6298,7 @@ textarea.form-control-lg {
}
.placeholder-glow .placeholder {
-webkit-animation: placeholder-glow 2s ease-in-out infinite;
animation: placeholder-glow 2s ease-in-out infinite;
}
@-webkit-keyframes placeholder-glow {
50% {
opacity: 0.2;
}
animation: placeholder-glow 2s ease-in-out infinite;
}
@keyframes placeholder-glow {
@@ -6409,15 +6311,7 @@ textarea.form-control-lg {
mask-image: linear-gradient(130deg, #000 55%, rgba(0, 0, 0, 0.8) 75%, #000 95%);
-webkit-mask-size: 200% 100%;
mask-size: 200% 100%;
-webkit-animation: placeholder-wave 2s linear infinite;
animation: placeholder-wave 2s linear infinite;
}
@-webkit-keyframes placeholder-wave {
100% {
-webkit-mask-position: -200% 0%;
mask-position: -200% 0%;
}
animation: placeholder-wave 2s linear infinite;
}
@keyframes placeholder-wave {
@@ -6538,7 +6432,6 @@ textarea.form-control-lg {
}
.sticky-top {
position: -webkit-sticky;
position: sticky;
top: 0;
z-index: 1020;
@@ -6546,7 +6439,6 @@ textarea.form-control-lg {
@media (min-width: 576px) {
.sticky-sm-top {
position: -webkit-sticky;
position: sticky;
top: 0;
z-index: 1020;
@@ -6554,7 +6446,6 @@ textarea.form-control-lg {
}
@media (min-width: 768px) {
.sticky-md-top {
position: -webkit-sticky;
position: sticky;
top: 0;
z-index: 1020;
@@ -6562,7 +6453,6 @@ textarea.form-control-lg {
}
@media (min-width: 992px) {
.sticky-lg-top {
position: -webkit-sticky;
position: sticky;
top: 0;
z-index: 1020;
@@ -6570,7 +6460,6 @@ textarea.form-control-lg {
}
@media (min-width: 1200px) {
.sticky-xl-top {
position: -webkit-sticky;
position: sticky;
top: 0;
z-index: 1020;
@@ -6578,7 +6467,6 @@ textarea.form-control-lg {
}
@media (min-width: 1400px) {
.sticky-xxl-top {
position: -webkit-sticky;
position: sticky;
top: 0;
z-index: 1020;
@@ -6781,7 +6669,6 @@ textarea.form-control-lg {
}
.position-sticky {
position: -webkit-sticky !important;
position: sticky !important;
}
@@ -7898,14 +7785,12 @@ textarea.form-control-lg {
.user-select-auto {
-webkit-user-select: auto !important;
-moz-user-select: auto !important;
-ms-user-select: auto !important;
user-select: auto !important;
}
.user-select-none {
-webkit-user-select: none !important;
-moz-user-select: none !important;
-ms-user-select: none !important;
user-select: none !important;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -15,7 +15,7 @@
\********************************************************************/
/***/ (() => {
eval("//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsid2VicGFjazovLy8uL3Jlc291cmNlcy9qcy93YXJlaG91c2VfbWFuYWdlbWVudC9zdG9ja19tdXRhdGlvbnMvaW5kZXguanM/OGNlZiJdLCJzb3VyY2VzQ29udGVudCI6WyIiXSwibWFwcGluZ3MiOiIiLCJmaWxlIjoiLi9yZXNvdXJjZXMvanMvd2FyZWhvdXNlX21hbmFnZW1lbnQvc3RvY2tfbXV0YXRpb25zL2luZGV4LmpzLmpzIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./resources/js/warehouse_management/stock_mutations/index.js\n");
eval("$.ajaxSetup({\n headers: {\n \"X-CSRF-TOKEN\": $('meta[name=\"csrf-token\"]').attr(\"content\")\n }\n});\nvar tableContainer = $(\"#stock-mutations-table\");\nvar url = tableContainer.data(\"url\");\nvar table = $(\"#stock-mutations-table\").DataTable({\n processing: true,\n serverSide: true,\n ajax: url,\n columns: [{\n data: \"product_name\",\n name: \"product_name\"\n }, {\n data: \"dealer_name\",\n name: \"dealer_name\"\n }, {\n data: \"user_name\",\n name: \"user_name\"\n }, {\n data: \"mutation_type_label\",\n name: \"mutation_type_label\"\n }, {\n data: \"quantity\",\n name: \"quantity\"\n }, {\n data: \"created_at\",\n name: \"created_at\"\n }]\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyIkIiwiYWpheFNldHVwIiwiaGVhZGVycyIsImF0dHIiLCJ0YWJsZUNvbnRhaW5lciIsInVybCIsImRhdGEiLCJ0YWJsZSIsIkRhdGFUYWJsZSIsInByb2Nlc3NpbmciLCJzZXJ2ZXJTaWRlIiwiYWpheCIsImNvbHVtbnMiLCJuYW1lIl0sInNvdXJjZXMiOlsid2VicGFjazovLy8uL3Jlc291cmNlcy9qcy93YXJlaG91c2VfbWFuYWdlbWVudC9zdG9ja19tdXRhdGlvbnMvaW5kZXguanM/OGNlZiJdLCJzb3VyY2VzQ29udGVudCI6WyIkLmFqYXhTZXR1cCh7XG4gICAgaGVhZGVyczoge1xuICAgICAgICBcIlgtQ1NSRi1UT0tFTlwiOiAkKCdtZXRhW25hbWU9XCJjc3JmLXRva2VuXCJdJykuYXR0cihcImNvbnRlbnRcIiksXG4gICAgfSxcbn0pO1xubGV0IHRhYmxlQ29udGFpbmVyID0gJChcIiNzdG9jay1tdXRhdGlvbnMtdGFibGVcIik7XG5sZXQgdXJsID0gdGFibGVDb250YWluZXIuZGF0YShcInVybFwiKTtcbmxldCB0YWJsZSA9ICQoXCIjc3RvY2stbXV0YXRpb25zLXRhYmxlXCIpLkRhdGFUYWJsZSh7XG4gICAgcHJvY2Vzc2luZzogdHJ1ZSxcbiAgICBzZXJ2ZXJTaWRlOiB0cnVlLFxuICAgIGFqYXg6IHVybCxcbiAgICBjb2x1bW5zOiBbXG4gICAgICAgIHsgZGF0YTogXCJwcm9kdWN0X25hbWVcIiwgbmFtZTogXCJwcm9kdWN0X25hbWVcIiB9LFxuICAgICAgICB7IGRhdGE6IFwiZGVhbGVyX25hbWVcIiwgbmFtZTogXCJkZWFsZXJfbmFtZVwiIH0sXG4gICAgICAgIHsgZGF0YTogXCJ1c2VyX25hbWVcIiwgbmFtZTogXCJ1c2VyX25hbWVcIiB9LFxuICAgICAgICB7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FUCxJQUFJLEVBQUUsVUFBUjtJQUFvQk8sSUFBSSxFQUFFO0VBQTFCLENBTEssRUFNTDtJQUFFUCxJQUFJLEVBQUUsWUFBUjtJQUFzQk8sSUFBSSxFQUFFO0VBQTVCLENBTks7QUFKcUMsQ0FBdEMsQ0FBWiIsImZpbGUiOiIuL3Jlc291cmNlcy9qcy93YXJlaG91c2VfbWFuYWdlbWVudC9zdG9ja19tdXRhdGlvbnMvaW5kZXguanMiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./resources/js/warehouse_management/stock_mutations/index.js\n");
/***/ })

View File

@@ -0,0 +1,32 @@
/*
* ATTENTION: An "eval-source-map" devtool has been used.
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file with attached SourceMaps in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ "./resources/js/warehouse_management/stock_opnames/index.js":
/*!******************************************************************!*\
!*** ./resources/js/warehouse_management/stock_opnames/index.js ***!
\******************************************************************/
/***/ (() => {
eval("$.ajaxSetup({\n headers: {\n \"X-CSRF-TOKEN\": $('meta[name=\"csrf-token\"]').attr(\"content\")\n }\n});\nvar tableContainer = $(\"#stock-opnames-table\");\nvar url = tableContainer.data(\"url\");\nvar table = $(\"#stock-opnames-table\").DataTable({\n processing: true,\n serverSide: true,\n ajax: url,\n columns: [{\n data: \"product_name\",\n name: \"product_name\"\n }, {\n data: \"dealer_name\",\n name: \"dealer_name\"\n }, {\n data: \"user_name\",\n name: \"user_name\"\n }, {\n data: \"system_quantity\",\n name: \"system_quantity\"\n }, {\n data: \"physical_quantity\",\n name: \"physical_quantity\"\n }, {\n data: \"difference\",\n name: \"difference\"\n }, {\n data: \"opname_date\",\n name: \"opname_date\"\n }]\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyIkIiwiYWpheFNldHVwIiwiaGVhZGVycyIsImF0dHIiLCJ0YWJsZUNvbnRhaW5lciIsInVybCIsImRhdGEiLCJ0YWJsZSIsIkRhdGFUYWJsZSIsInByb2Nlc3NpbmciLCJzZXJ2ZXJTaWRlIiwiYWpheCIsImNvbHVtbnMiLCJuYW1lIl0sInNvdXJjZXMiOlsid2VicGFjazovLy8uL3Jlc291cmNlcy9qcy93YXJlaG91c2VfbWFuYWdlbWVudC9zdG9ja19vcG5hbWVzL2luZGV4LmpzPzI3YTQiXSwic291cmNlc0NvbnRlbnQiOlsiJC5hamF4U2V0dXAoe1xuICAgIGhlYWRlcnM6IHtcbiAgICAgICAgXCJYLUNTUkYtVE9LRU5cIjogJCgnbWV0YVtuYW1lPVwiY3NyZi10b2tlblwiXScpLmF0dHIoXCJjb250ZW50XCIpLFxuICAgIH0sXG59KTtcbmxldCB0YWJsZUNvbnRhaW5lciA9ICQoXCIjc3RvY2stb3BuYW1lcy10YWJsZVwiKTtcbmxldCB1cmwgPSB0YWJsZUNvbnRhaW5lci5kYXRhKFwidXJsXCIpO1xubGV0IHRhYmxlID0gJChcIiNzdG9jay1vcG5hbWVzLXRhYmxlXCIpLkRhdGFUYWJsZSh7XG4gICAgcHJvY2Vzc2luZzogdHJ1ZSxcbiAgICBzZXJ2ZXJTaWRlOiB0cnVlLFxuICAgIGFqYXg6IHVybCxcbiAgICBjb2x1bW5zOiBbXG4gICAgICAgIHsgZGF0YTogXCJwcm9kdWN0X25hbWVcIiwgbmFtZTogXCJwcm9kdWN0X25hbWVcIiB9LFxuICAgICAgICB7IGRhdGE6IFwiZGVhbGVyX25hbWVcIiwgbmFtZTogXCJkZWFsZXJfbmFtZVwiIH0sXG4gICAgICAgIHsgZGF0YTogXCJ1c2VyX25hbWVcIiwgbmFtZTogXCJ1c2VyX25hbWVcIiB9LFxuICAgICA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FBM0IsQ0FISyxFQUlMO0lBQUVQLElBQUksRUFBRSxpQkFBUjtJQUEyQk8sSUFBSSxFQUFFO0VBQWpDLENBSkssRUFLTDtJQUFFUCxJQUFJLEVBQUUsbUJBQVI7SUFBNkJPLElBQUksRUFBRTtFQUFuQyxDQUxLLEVBTUw7SUFBRVAsSUFBSSxFQUFFLFlBQVI7SUFBc0JPLElBQUksRUFBRTtFQUE1QixDQU5LLEVBT0w7SUFBRVAsSUFBSSxFQUFFLGFBQVI7SUFBdUJPLElBQUksRUFBRTtFQUE3QixDQVBLO0FBSm1DLENBQXBDLENBQVoiLCJmaWxlIjoiLi9yZXNvdXJjZXMvanMvd2FyZWhvdXNlX21hbmFnZW1lbnQvc3RvY2tfb3BuYW1lcy9pbmRleC5qcyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./resources/js/warehouse_management/stock_opnames/index.js\n");
/***/ })
/******/ });
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module can't be inlined because the eval-source-map devtool is used.
/******/ var __webpack_exports__ = {};
/******/ __webpack_modules__["./resources/js/warehouse_management/stock_opnames/index.js"]();
/******/
/******/ })()
;

View File

@@ -5,5 +5,6 @@
"/js/warehouse_management/products/create.js": "/js/warehouse_management/products/create.js",
"/js/warehouse_management/products/edit.js": "/js/warehouse_management/products/edit.js",
"/js/warehouse_management/stock_mutations/index.js": "/js/warehouse_management/stock_mutations/index.js",
"/js/warehouse_management/stock_opnames/index.js": "/js/warehouse_management/stock_opnames/index.js",
"/css/app.css": "/css/app.css"
}

View File

@@ -0,0 +1,20 @@
$.ajaxSetup({
headers: {
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"),
},
});
let tableContainer = $("#stock-mutations-table");
let url = tableContainer.data("url");
let table = $("#stock-mutations-table").DataTable({
processing: true,
serverSide: true,
ajax: url,
columns: [
{ data: "product_name", name: "product_name" },
{ data: "dealer_name", name: "dealer_name" },
{ data: "user_name", name: "user_name" },
{ data: "mutation_type_label", name: "mutation_type_label" },
{ data: "quantity", name: "quantity" },
{ data: "created_at", name: "created_at" },
],
});

View File

@@ -0,0 +1,21 @@
$.ajaxSetup({
headers: {
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"),
},
});
let tableContainer = $("#stock-opnames-table");
let url = tableContainer.data("url");
let table = $("#stock-opnames-table").DataTable({
processing: true,
serverSide: true,
ajax: url,
columns: [
{ data: "product_name", name: "product_name" },
{ data: "dealer_name", name: "dealer_name" },
{ data: "user_name", name: "user_name" },
{ data: "system_quantity", name: "system_quantity" },
{ data: "physical_quantity", name: "physical_quantity" },
{ data: "difference", name: "difference" },
{ data: "opname_date", name: "opname_date" },
],
});

View File

@@ -215,9 +215,9 @@
</li>
@endcan
@can('view', $menus['work.index'])
@can('view', $menus['mutations.index'])
<li class="kt-menu__item" aria-haspopup="true">
<a href="{{ route('work.index') }}" class="kt-menu__link">
<a href="{{ route('mutations.index') }}" class="kt-menu__link">
<i class="fa fa-list" style="display: flex; align-items: center; margin-right: 10px;"></i>
<span class="kt-menu__link-text">Mutasi Produk</span>
</a>

View File

@@ -31,6 +31,14 @@
<input type="text" name="unit" id="unit" class="form-control" required>
</div>
<div class="form-group">
<label for="active"><strong>Status Produk</strong></label>
<select name="active" class="form-control" required>
<option value="1">Aktif</option>
<option value="0">Tidak Aktif</option>
</select>
</div>
<div class="form-group">
<label for="description"><strong>Deskripsi</strong></label>
<textarea name="description" id="description" class="form-control" rows="3"></textarea>

View File

@@ -44,5 +44,5 @@
@endsection
@section('javascripts')
<script src="{{mix('js/warehouse_management/products/index.js')}}"></script>
<script src="{{ mix('js/warehouse_management/products/index.js') }}"></script>
@endsection

View File

@@ -25,13 +25,14 @@
<div class="kt-portlet__body">
<div class="table-responsive">
<!--begin: Datatable -->
<table class="table table-striped table-bordered table-hover" id="mutations-table" data-url="{{ route("mutations.index") }}">
<table class="table table-striped table-bordered table-hover" id="stock-mutations-table" data-url="{{ route("mutations.index") }}">
<thead>
<tr>
<th>Produk</th>
<th>Dealer</th>
<th>User</th>
<th>Pengguna</th>
<th>Tipe Mutasi</th>
<th>Jumlah</th>
<th>Dibuat</th>
</tr>
</thead>

View File

@@ -0,0 +1,49 @@
@extends('layouts.backapp')
@section('content')
<div class="kt-portlet kt-portlet--mobile" id="kt_blockui_datatable">
<div class="kt-portlet__head kt-portlet__head--lg">
<div class="kt-portlet__head-label">
<span class="kt-portlet__head-icon">
<i class="kt-font-brand flaticon2-line-chart"></i>
</span>
<h3 class="kt-portlet__head-title">
Tabel Mutasi Stock Produk
</h3>
</div>
@can('create', $menus['mutations.index'])
<div class="kt-portlet__head-toolbar">
<div class="kt-portlet__head-wrapper">
<div class="kt-portlet__head-actions">
<a href="{{ route('opnames.create') }}" class="btn btn-bold btn-label-brand btn--sm">Tambah</a>
</div>
</div>
</div>
@endcan
</div>
<div class="kt-portlet__body">
<div class="table-responsive">
<!--begin: Datatable -->
<table class="table table-striped table-bordered table-hover" id="stock-opnames-table" data-url="{{ route("opnames.index") }}">
<thead>
<tr>
<th>Produk</th>
<th>Dealer</th>
<th>Pengguna</th>
<th>Total Sistem</th>
<th>Total Fisik</th>
<th>Perbedaan</th>
<th>Tanggal Opname</th>
</tr>
</thead>
</table>
<!--end: Datatable -->
</div>
</div>
</div>
@endsection
@section('javascripts')
<script src="{{mix('js/warehouse_management/stock_opnames/index.js')}}"></script>
@endsection

View File

@@ -10,6 +10,7 @@ use App\Http\Controllers\UserController;
use App\Http\Controllers\WarehouseManagement\ProductCategoriesController;
use App\Http\Controllers\WarehouseManagement\ProductsController;
use App\Http\Controllers\WarehouseManagement\StockMutationsController;
use App\Http\Controllers\WarehouseManagement\StockOpnamesController;
use App\Http\Controllers\WorkController;
use App\Models\Menu;
use App\Models\Privilege;
@@ -210,6 +211,7 @@ Route::group(['middleware' => 'auth'], function() {
Route::get('categories/parents', [ProductCategoriesController::class, 'getParents'])->name('products.parents');
Route::post('products/{product}/toggle-active', [ProductsController::class, 'toggleActive'])->name('products.toggleActive');
Route::get('mutations/index',[StockMutationsController::class, 'index'])->name('mutations.index');
Route::get('opnames/index',[StockOpnamesController::class, 'index'])->name('opnames.index');
});
});

View File

@@ -33,4 +33,42 @@ mix.js("resources/js/app.js", "public/js")
"resources/js/warehouse_management/stock_mutations/index.js",
"public/js/warehouse_management/stock_mutations"
)
.js(
"resources/js/warehouse_management/stock_opnames/index.js",
"public/js/warehouse_management/stock_opnames"
)
.sourceMaps();
mix.browserSync({
proxy: "127.0.0.1:8000",
open: false,
files: [
"app/**/*.php",
"resources/views/**/*.php",
"resources/js/**/*.js",
"resources/sass/**/*.scss",
"public/js/**/*.js",
"public/css/**/*.css",
],
});
mix.setPublicPath("public");
mix.setResourceRoot("/");
const devServerPort = process.env.MIX_DEV_SERVER_PORT || 8080;
mix.webpackConfig({
devServer: {
host: process.env.MIX_DEV_SERVER_HOST || "localhost",
port: devServerPort,
hot: true,
headers: {
"Access-Control-Allow-Origin": "*",
},
},
});
mix.options({
hmrOptions: {
host: process.env.MIX_DEV_SERVER_HOST || "localhost",
port: devServerPort,
},
});