mirror of
https://github.com/Karaka-Management/oms-StockTaking.git
synced 2026-01-28 09:28:40 +00:00
bug fixes
This commit is contained in:
parent
56777bda04
commit
fa658db1a5
2
.github/workflows/greetings.yml
vendored
2
.github/workflows/greetings.yml
vendored
|
|
@ -9,5 +9,5 @@ jobs:
|
|||
- uses: actions/first-interaction@v1
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
issue-message: 'Thank you for createing this issue. We will check it as soon as possible.'
|
||||
issue-message: 'Thank you for creating this issue. We will check it as soon as possible.'
|
||||
pr-message: 'Thank you for your pull request. We will check it as soon as possible.'
|
||||
|
|
|
|||
|
|
@ -19,9 +19,9 @@ return [
|
|||
],
|
||||
],
|
||||
],
|
||||
'^/warehouse/stocktaking/overview(\?.*$|$)' => [
|
||||
'^/warehouse/stocktaking/view(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\StockTaking\Controller\BackendController:viewStockTakingOverview',
|
||||
'dest' => '\Modules\StockTaking\Controller\BackendController:viewStockTakingView',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace Modules\StockTaking\Controller;
|
||||
|
||||
use Modules\ItemManagement\Models\NullItem;
|
||||
use Modules\StockTaking\Models\StockTaking;
|
||||
use Modules\StockTaking\Models\StockTakingMapper;
|
||||
use Modules\WarehouseManagement\Models\NullStock;
|
||||
|
|
@ -58,9 +59,9 @@ final class ApiController extends Controller
|
|||
return;
|
||||
}
|
||||
|
||||
$paymentTerm = $this->createStockTakingFromRequest($request);
|
||||
$this->createModel($request->header->account, $paymentTerm, StockTakingMapper::class, 'stocktaking', $request->getOrigin());
|
||||
$this->createStandardCreateResponse($request, $response, $paymentTerm);
|
||||
$stockTaking = $this->createStockTakingFromRequest($request);
|
||||
$this->createModel($request->header->account, $stockTaking, StockTakingMapper::class, 'stocktaking', $request->getOrigin());
|
||||
$this->createStandardCreateResponse($request, $response, $stockTaking);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -127,7 +128,9 @@ final class ApiController extends Controller
|
|||
|
||||
if (empty($stockTypeList)) {
|
||||
foreach ($stock->locations as $location) {
|
||||
$stockTypeList[] = $location->type->id;
|
||||
if ($location->type->id !== 0) {
|
||||
$stockTypeList[$location->type->id] = $location->type->id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -149,11 +152,18 @@ final class ApiController extends Controller
|
|||
|
||||
// @todo In the future create create a snapshot of distributions and reference those
|
||||
// This would also allow us to continue creating bills while doing the stocktaking?
|
||||
|
||||
// @todo Limit items if items are defined
|
||||
$stocktaking->distributions = StockDistributionMapper::getAll()
|
||||
->where('stock', $stockList)
|
||||
->where('stockType', $stockTypeList)
|
||||
->executeGetArray();
|
||||
|
||||
// @bug This doesn't include items that never had a distribution created
|
||||
foreach ($stocktaking->distributions as $distribution) {
|
||||
$stocktaking->items[$distribution->item] = new NullItem($distribution->item);
|
||||
}
|
||||
|
||||
return $stocktaking;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ declare(strict_types=1);
|
|||
|
||||
namespace Modules\StockTaking\Controller;
|
||||
|
||||
use Modules\StockTaking\Models\StockTakingMapper;
|
||||
use phpOMS\Asset\AssetType;
|
||||
use phpOMS\Contract\RenderableInterface;
|
||||
use phpOMS\Message\RequestAbstract;
|
||||
use phpOMS\Message\ResponseAbstract;
|
||||
|
|
@ -47,6 +49,53 @@ final class BackendController extends Controller
|
|||
$view->setTemplate('/Modules/StockTaking/Theme/Backend/stocktaking-list');
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1006701001, $request, $response);
|
||||
|
||||
$view->data['list'] = StockTakingMapper::getAll()
|
||||
->where('unit', $this->app->unitId)
|
||||
->execute();
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
/**
|
||||
* Routing end-point for application behavior.
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
* @param array $data Generic data
|
||||
*
|
||||
* @return RenderableInterface Returns a renderable object
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function viewStockTakingView(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
|
||||
{
|
||||
$head = $response->data['Content']->head;
|
||||
$nonce = $this->app->appSettings->getOption('script-nonce');
|
||||
|
||||
$head->addAsset(AssetType::JSLATE, 'Resources/zxing/zxing.min.js?v=' . $this->app->version, ['nonce' => $nonce, 'type' => 'module']);
|
||||
$head->addAsset(AssetType::JSLATE, 'Modules/StockTaking/Controller/Controller.js?v=' . self::VERSION, ['nonce' => $nonce, 'type' => 'module']);
|
||||
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$view->setTemplate('/Modules/StockTaking/Theme/Backend/stocktaking-view');
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1006701001, $request, $response);
|
||||
|
||||
$view->data['inventory'] = StockTakingMapper::get()
|
||||
->with('stocks')
|
||||
->with('stocks/locations')
|
||||
->with('types')
|
||||
->with('items')
|
||||
->with('items/l11n')
|
||||
->with('items/l11n/type')
|
||||
->with('items/files')
|
||||
->with('items/files/tags')
|
||||
->with('distributions')
|
||||
->where('id', (int) $request->getData('id'))
|
||||
->where('items/l11n/language', $response->header->l11n->language)
|
||||
->where('item/sl11n/type/title', ['name1', 'name2'], 'IN')
|
||||
->where('items/files/tags/name', 'profile_image')
|
||||
->execute();
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
|
|
|
|||
114
Controller/Controller.js
Normal file
114
Controller/Controller.js
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
import { Autoloader } from '../../../jsOMS/Autoloader.js';
|
||||
import { BrowserMultiFormatReader } from '../../../Resources/zxing/zxing.min.js';
|
||||
|
||||
Autoloader.defineNamespace('omsApp.Modules');
|
||||
|
||||
/* global omsApp */
|
||||
omsApp.Modules.StockTaking = class {
|
||||
/**
|
||||
* @constructor
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
constructor (app)
|
||||
{
|
||||
this.scan = null;
|
||||
this.canvas = null;
|
||||
this.ctx = null;
|
||||
this.video = null;
|
||||
this.videoBtn = null;
|
||||
this.input = null;
|
||||
this.deviceId = null;
|
||||
this.data = '';
|
||||
this.codeReader = null;
|
||||
this.capabilities = null;
|
||||
this.settings = null;
|
||||
this.zoom = null;
|
||||
this.track = null;
|
||||
};
|
||||
|
||||
bind (id)
|
||||
{
|
||||
const e = typeof id === 'undefined'
|
||||
? [document.getElementById('iScanner')]
|
||||
: [document.getElementById(id)];
|
||||
|
||||
const length = e.length;
|
||||
|
||||
for (let i = 0; i < length; ++i) {
|
||||
this.bindElement(e[i]);
|
||||
}
|
||||
};
|
||||
|
||||
bindElement (scan)
|
||||
{
|
||||
this.scan = scan;
|
||||
this.video = scan.getElementsByTagName('video')[0];
|
||||
this.input = document.getElementById('iScanData');
|
||||
this.canvas = scan.getElementsByTagName('canvas')[0];
|
||||
this.canvas.style.background = 'transparent';
|
||||
this.videoBtn = scan.getElementsByTagName('button')[0];
|
||||
this.ctx = this.canvas.getContext('2d', { willReadFrequently: true });
|
||||
this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
|
||||
this.zoom = scan.querySelector('input[type=range]');
|
||||
this.data = '';
|
||||
|
||||
const self = this;
|
||||
|
||||
this.videoBtn.addEventListener('click', () => {
|
||||
if (!self.deviceId && 'mediaDevices' in navigator) {
|
||||
navigator.mediaDevices.getUserMedia({audio: false, video: {facingMode: 'environment'}})
|
||||
.then(stream => {
|
||||
self.codeReader = new BrowserMultiFormatReader();
|
||||
|
||||
self.detectVideo(true);
|
||||
|
||||
stream.getTracks().forEach(t => {
|
||||
if (t.enabled && (t.kind === 'video' || t.kind === 'videoinput')) {
|
||||
self.deviceId = t.id;
|
||||
self.track = t;
|
||||
|
||||
self.capabilities = t.getCapabilities();
|
||||
self.settings = t.getSettings();
|
||||
}
|
||||
});
|
||||
|
||||
if ("zoom" in self.settings) {
|
||||
self.zoom.min = self.capabilities.zoom.min;
|
||||
self.zoom.max = self.capabilities.zoom.max;
|
||||
self.zoom.step = self.capabilities.zoom.step;
|
||||
self.zoom.value = self.settings.zoom;
|
||||
|
||||
self.zoom.addEventListener("input", async () => {
|
||||
await self.track.applyConstraints({ advanced: [{ zoom: self.input.value }] });
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
self.detectVideo(false);
|
||||
}
|
||||
});
|
||||
|
||||
this.video.addEventListener('click', () => {
|
||||
self.input.value = self.data;
|
||||
});
|
||||
};
|
||||
|
||||
detectVideo (repeat) {
|
||||
if (!repeat) {
|
||||
this.codeReader.reset();
|
||||
this.deviceId = null;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const self = this;
|
||||
this.codeReader.decodeFromVideoDevice(this.deviceId, this.video.id, (result, err) => {
|
||||
if (result) {
|
||||
self.data = result.text;
|
||||
}
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
window.omsApp.moduleManager.get('StockTaking').bind();
|
||||
|
|
@ -38,6 +38,8 @@ class StockTaking
|
|||
|
||||
public int $unit = 0;
|
||||
|
||||
public int $status = StockTakingStatus::ACTIVE;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -14,7 +14,10 @@ declare(strict_types=1);
|
|||
|
||||
namespace Modules\StockTaking\Models;
|
||||
|
||||
use Modules\ItemManagement\Models\ItemMapper;
|
||||
use Modules\WarehouseManagement\Models\StockDistributionMapper;
|
||||
use Modules\WarehouseManagement\Models\StockMapper;
|
||||
use Modules\WarehouseManagement\Models\StockTypeMapper;
|
||||
use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
||||
|
||||
/**
|
||||
|
|
@ -53,7 +56,25 @@ final class StockTakingMapper extends DataMapperFactory
|
|||
'mapper' => StockDistributionMapper::class,
|
||||
'table' => 'stocktaking_distribution',
|
||||
'self' => 'stocktaking_distribution_stocktaking',
|
||||
'external' => null,
|
||||
'external' => 'stocktaking_distribution_distribution',
|
||||
],
|
||||
'stocks' => [
|
||||
'mapper' => StockMapper::class,
|
||||
'table' => 'stocktaking_stock',
|
||||
'self' => 'stocktaking_stock_stocktaking',
|
||||
'external' => 'stocktaking_stock_stock',
|
||||
],
|
||||
'types' => [
|
||||
'mapper' => StockTypeMapper::class,
|
||||
'table' => 'stocktaking_type',
|
||||
'self' => 'stocktaking_type_stocktaking',
|
||||
'external' => 'stocktaking_type_type',
|
||||
],
|
||||
'items' => [
|
||||
'mapper' => ItemMapper::class,
|
||||
'table' => 'stocktaking_item',
|
||||
'self' => 'stocktaking_item_stocktaking',
|
||||
'external' => 'stocktaking_item_item',
|
||||
],
|
||||
];
|
||||
|
||||
|
|
|
|||
32
Models/StockTakingStatus.php
Normal file
32
Models/StockTakingStatus.php
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\StockTaking\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\StockTaking\Models;
|
||||
|
||||
use phpOMS\Stdlib\Base\Enum;
|
||||
|
||||
/**
|
||||
* Accept status enum.
|
||||
*
|
||||
* @package Modules\StockTaking\Models
|
||||
* @license OMS License 2.0
|
||||
* @link https://jingga.app
|
||||
* @since 1.0.0
|
||||
*/
|
||||
abstract class StockTakingStatus extends Enum
|
||||
{
|
||||
public const ACTIVE = 1;
|
||||
|
||||
public const CLOSED = 2;
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Budgeting' => '',
|
||||
'Dashboard' => '',
|
||||
]];
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Budgeting' => '',
|
||||
'Dashboard' => '',
|
||||
]];
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Budgeting' => '',
|
||||
'Dashboard' => '',
|
||||
]];
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Budgeting' => '',
|
||||
'Dashboard' => '',
|
||||
]];
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Budgeting' => '',
|
||||
'Dashboard' => '',
|
||||
]];
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Budgeting' => '',
|
||||
'Dashboard' => '',
|
||||
]];
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Budgeting' => '',
|
||||
'Dashboard' => '',
|
||||
]];
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Budgeting' => '',
|
||||
'Dashboard' => '',
|
||||
]];
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Budgeting' => '',
|
||||
'Dashboard' => '',
|
||||
]];
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Budgeting' => '',
|
||||
'Dashboard' => '',
|
||||
]];
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Budgeting' => '',
|
||||
'Dashboard' => '',
|
||||
]];
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Budgeting' => '',
|
||||
'Dashboard' => '',
|
||||
]];
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Budgeting' => '',
|
||||
'Dashboard' => '',
|
||||
]];
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Budgeting' => '',
|
||||
'Dashboard' => '',
|
||||
]];
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Budgeting' => '',
|
||||
'Dashboard' => '',
|
||||
]];
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Budgeting' => '',
|
||||
'Dashboard' => '',
|
||||
]];
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Budgeting' => '',
|
||||
'Dashboard' => '',
|
||||
]];
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Budgeting' => '',
|
||||
'Dashboard' => '',
|
||||
]];
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Budgeting' => '',
|
||||
'Dashboard' => '',
|
||||
]];
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Budgeting' => '',
|
||||
'Dashboard' => '',
|
||||
]];
|
||||
|
|
@ -16,4 +16,14 @@ return ['StockTaking' => [
|
|||
'Stocktaking' => 'Inventur',
|
||||
'Date' => 'Datum',
|
||||
'Status' => 'Status',
|
||||
'Entry' => 'Eingabe',
|
||||
'Scan' => 'Scanning',
|
||||
'Data' => 'Daten',
|
||||
'Counted' => 'Gezählt',
|
||||
'Target' => 'Soll',
|
||||
'Camera' => 'Kamera',
|
||||
'Settings' => 'Settings',
|
||||
'Analysis' => 'Auswertung',
|
||||
':status-1' => 'Aktiv',
|
||||
':status-2' => 'Geschlossen',
|
||||
]];
|
||||
|
|
|
|||
|
|
@ -16,4 +16,14 @@ return ['StockTaking' => [
|
|||
'Stocktaking' => 'Stock Taking',
|
||||
'Date' => 'Date',
|
||||
'Status' => 'Status',
|
||||
'Entry' => 'Entry',
|
||||
'Scan' => 'Scan',
|
||||
'Data' => 'Data',
|
||||
'Counted' => 'Counted',
|
||||
'Target' => 'Target',
|
||||
'Camera' => 'Camera',
|
||||
'Settings' => 'Settings',
|
||||
'Analysis' => 'Analysis',
|
||||
':status-1' => 'Active',
|
||||
':status-2' => 'Closed',
|
||||
]];
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ declare(strict_types=1);
|
|||
use phpOMS\Uri\UriFactory;
|
||||
|
||||
/** @var \phpOMS\Views\View $this */
|
||||
$assets = $this->data['assets'] ?? [];
|
||||
$list = $this->data['list'] ?? [];
|
||||
|
||||
echo $this->data['nav']->render(); ?>
|
||||
<div class="row">
|
||||
|
|
@ -27,20 +27,20 @@ echo $this->data['nav']->render(); ?>
|
|||
<table id="iSalesClientList" class="default sticky">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>
|
||||
<td class="wf-100"><?= $this->getHtml('Date'); ?>
|
||||
<td><?= $this->getHtml('ID', '0', '0'); ?>
|
||||
<td><?= $this->getHtml('Status'); ?>
|
||||
<td class="wf-100"><?= $this->getHtml('Date'); ?>
|
||||
<tbody>
|
||||
<?php
|
||||
$count = 0;
|
||||
foreach ($assets as $key => $value) :
|
||||
foreach ($list as $key => $value) :
|
||||
++$count;
|
||||
$url = UriFactory::build('{/base}/accounting/asset/view?{?}&id=' . $value->id);
|
||||
$url = UriFactory::build('{/base}/warehouse/stocktaking/view?{?}&id=' . $value->id);
|
||||
?>
|
||||
<tr data-href="<?= $url; ?>">
|
||||
<td>
|
||||
<td data-label="<?= $this->getHtml('Date', '0', '0'); ?>"><a href="<?= $url; ?>"><?= $value->id; ?></a>
|
||||
<td>
|
||||
<td data-label="<?= $this->getHtml('ID', '0', '0'); ?>"><a href="<?= $url; ?>"><?= $value->id; ?></a>
|
||||
<td data-label="<?= $this->getHtml('Status'); ?>"><a href="<?= $url; ?>"><?= $this->getHtml(':status-' . $value->status); ?></a>
|
||||
<td data-label="<?= $this->getHtml('Date', '0', '0'); ?>"><a href="<?= $url; ?>"><?= $value->createdAt->format('Y-m-d'); ?></a>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($count === 0) : ?>
|
||||
<tr><td colspan="3" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||
|
|
|
|||
283
Theme/Backend/stocktaking-view.tpl.php
Normal file
283
Theme/Backend/stocktaking-view.tpl.php
Normal file
|
|
@ -0,0 +1,283 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\AssetManagement
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
use phpOMS\Uri\UriFactory;
|
||||
|
||||
/** @var \phpOMS\Views\View $this */
|
||||
$inventory = $this->data['inventory'] ?? [];
|
||||
|
||||
echo $this->data['nav']->render(); ?>
|
||||
<div class="row">
|
||||
<div class="box more-container">
|
||||
<label class="more" for="more-settings">
|
||||
<span><?= $this->getHtml('Settings'); ?></span>
|
||||
<i class="g-icon expand">chevron_right</i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wf-100 more-container flex">
|
||||
<input class="more" id="more-settings" type="checkbox" name="more-container">
|
||||
<div class="row more">
|
||||
<div class="col-xs-12">
|
||||
<div class="box">
|
||||
<div class="form-group">
|
||||
<div class="input-control">
|
||||
<div class="form-group input-control">
|
||||
<label for="iStock"><?= $this->getHtml('Stock', 'WarehouseManagement', 'Backend'); ?></label>
|
||||
<select id="iStock" name="stock" data-action='[{"listener": "change", "action": [{"key": 1, "type": "redirect", "uri": "{%}&stock={#iStock}&type={#iStockType}&location={#iLocation}", "target": "self"}]}]'>
|
||||
<option value="0"><?= $this->getHtml('All', 'WarehouseManagement', 'Backend'); ?>
|
||||
<?php foreach ($inventory->stocks as $stock) : ?>
|
||||
<option value="<?= $stock->id; ?>"<?= $this->request->getDataInt('stock') === $stock->id ? ' selected' : ''; ?>><?= $this->printHtml($stock->name); ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="input-control">
|
||||
<div class="form-group input-control">
|
||||
<label for="iType"><?= $this->getHtml('Type', 'WarehouseManagement', 'Backend'); ?></label>
|
||||
<select id="iType" name="type" data-action='[{"listener": "change", "action": [{"key": 1, "type": "redirect", "uri": "{%}&stock={#iStock}&type={#iType}&location={#iLocation}", "target": "self"}]}]'>
|
||||
<option value="0"><?= $this->getHtml('All', 'WarehouseManagement', 'Backend'); ?>
|
||||
<?php foreach ($inventory->types as $type) : ?>
|
||||
<option value="<?= $type->id; ?>"<?= $this->request->getDataInt('type') === $type->id ? ' selected' : ''; ?>><?= $this->printHtml($type->name); ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="input-control">
|
||||
<div class="form-group input-control">
|
||||
<label for="iLocation"><?= $this->getHtml('Location', 'WarehouseManagement', 'Backend'); ?></label>
|
||||
<select id="iLocation" name="location" data-action='[{"listener": "change", "action": [{"key": 1, "type": "redirect", "uri": "{%}&stock={#iStock}&type={#iStockType}&location={#iLocation}", "target": "self"}]}]'>
|
||||
<option value="0"><?= $this->getHtml('All', 'WarehouseManagement', 'Backend'); ?>
|
||||
<?php foreach ($inventory->stocks[0]->locations as $location) : ?>
|
||||
<option value="<?= $location->id; ?>"<?= $this->request->getDataInt('location') === $location->id ? ' selected' : ''; ?>><?= $this->printHtml($location->name); ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tabview tab-2">
|
||||
<div class="box">
|
||||
<ul class="tab-links">
|
||||
<li><label for="c-tab-1"><?= $this->getHtml('Entry'); ?></label>
|
||||
<li><label for="c-tab-2"><?= $this->getHtml('Scan'); ?></label>
|
||||
<li><label for="c-tab-3"><?= $this->getHtml('Analysis'); ?></label>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tab-content">
|
||||
<input type="radio" id="c-tab-1" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-1' ? ' checked' : ''; ?>>
|
||||
<div class="tab">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<section class="portlet">
|
||||
<div class="portlet-head"><?= $this->getHtml('Items', 'ItemManagement', 'Backend'); ?><i class="g-icon download btn end-xs">download</i></div>
|
||||
<div class="slider">
|
||||
<table id="iItemList" class="default sticky">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?= $this->getHtml('Stock', 'WarehouseManagement', 'Backend'); ?>
|
||||
<td><?= $this->getHtml('Type', 'WarehouseManagement', 'Backend'); ?>
|
||||
<td><?= $this->getHtml('Location', 'WarehouseManagement', 'Backend'); ?>
|
||||
<td>
|
||||
<td><?= $this->getHtml('Number', 'ItemManagement', 'Backend'); ?>
|
||||
<label for="iItemList-sort-1">
|
||||
<input type="radio" name="iItemList-sort" id="iItemList-sort-1">
|
||||
<i class="sort-asc g-icon">expand_less</i>
|
||||
</label>
|
||||
<label for="iItemList-sort-2">
|
||||
<input type="radio" name="iItemList-sort" id="iItemList-sort-2">
|
||||
<i class="sort-desc g-icon">expand_more</i>
|
||||
</label>
|
||||
<label>
|
||||
<i class="filter g-icon">filter_alt</i>
|
||||
</label>
|
||||
<td><?= $this->getHtml('Name', 'ItemManagement', 'Backend'); ?>
|
||||
<label for="iItemList-sort-3">
|
||||
<input type="radio" name="iItemList-sort" id="iItemList-sort-3">
|
||||
<i class="sort-asc g-icon">expand_less</i>
|
||||
</label>
|
||||
<label for="iItemList-sort-4">
|
||||
<input type="radio" name="iItemList-sort" id="iItemList-sort-4">
|
||||
<i class="sort-desc g-icon">expand_more</i>
|
||||
</label>
|
||||
<label>
|
||||
<i class="filter g-icon">filter_alt</i>
|
||||
</label>
|
||||
<td class="wf-100"><?= $this->getHtml('Name', 'ItemManagement', 'Backend'); ?>
|
||||
<label for="iItemList-sort-5">
|
||||
<input type="radio" name="iItemList-sort" id="iItemList-sort-5">
|
||||
<i class="sort-asc g-icon">expand_less</i>
|
||||
</label>
|
||||
<label for="iItemList-sort-6">
|
||||
<input type="radio" name="iItemList-sort" id="iItemList-sort-6">
|
||||
<i class="sort-desc g-icon">expand_more</i>
|
||||
</label>
|
||||
<label>
|
||||
<i class="filter g-icon">filter_alt</i>
|
||||
</label>
|
||||
<td style="min-width: 100px;"><?= $this->getHtml('Quantity', 'WarehouseManagement', 'Backend'); ?>
|
||||
<tbody>
|
||||
<?php $count = 0;
|
||||
foreach ($inventory->items as $key => $value) : ++$count;
|
||||
$url = UriFactory::build('{/base}/warehouse/stocktaking/item?id=' . $value->id);
|
||||
$image = $value->getFileByTagName('profile_image');
|
||||
?>
|
||||
<tr>
|
||||
<td>0
|
||||
<td>0
|
||||
<td>0
|
||||
<td><img<?= $image->id === 0 ? '' : ' id="item' . $value->id . '" tabindex="0" data-preview="' . UriFactory::build('{/api}media/export?id=' . $image->id . '&type=html&csrf={$CSRF}') . '"'; ?> alt="<?= $this->getHtml('IMG_alt_item'); ?>" width="30" loading="lazy" class="item-image"
|
||||
src="<?= $image->id === 0
|
||||
? 'Web/Backend/img/logo_grey.png'
|
||||
: UriFactory::build($image->getPath()); ?>">
|
||||
<td><?= $this->printHtml($value->number); ?>
|
||||
<td><?= $this->printHtml($value->getL11n('name1')->content); ?>
|
||||
<td><?= $this->printHtml($value->getL11n('name2')->content); ?>
|
||||
<td><input name="count" type="number" steps="any">
|
||||
<?php endforeach; ?>
|
||||
<?php if ($count === 0) : ?>
|
||||
<tr><td colspan="9" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="radio" id="c-tab-2" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-2' ? ' checked' : ''; ?>>
|
||||
<div class="tab">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<section class="portlet">
|
||||
<div class="portlet-body">
|
||||
<div id="iScanner" style="text-align: center;" data-encoding="utf-8">
|
||||
<div class="form-group cT">
|
||||
<button><?= $this->getHtml('Camera'); ?></button>
|
||||
</div>
|
||||
<div class="form-group viewport" style="display: inline-block;position:relative;">
|
||||
<canvas style="position:absolute; left:0; right:0; width:100%; height:100%;"></canvas>
|
||||
<video id="iItemScan" style="display: block;max-width:100%;max-height:100%;" muted autoplay playsinline></video>
|
||||
</div>
|
||||
<input type="range">
|
||||
|
||||
<div class="form-group">
|
||||
<label><?= $this->getHtml('Data'); ?></label>
|
||||
<input id="iScanData" name="scan" type="text">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label><?= $this->getHtml('Quantity', 'WarehouseManagement', 'Backend'); ?></label>
|
||||
<input name="quantity" type="number" step="any">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-foot">
|
||||
<input type="submit" value="<?= $this->getHtml('Submit', '0', '0'); ?>">
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="radio" id="c-tab-3" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-3' ? ' checked' : ''; ?>>
|
||||
<div class="tab">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<section class="portlet">
|
||||
<div class="portlet-head"><?= $this->getHtml('Items', 'ItemManagement', 'Backend'); ?><i class="g-icon download btn end-xs">download</i></div>
|
||||
<div class="slider">
|
||||
<table id="iAnalysisList" class="default sticky">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?= $this->getHtml('Stock', 'WarehouseManagement', 'Backend'); ?>
|
||||
<td><?= $this->getHtml('Type', 'WarehouseManagement', 'Backend'); ?>
|
||||
<td>
|
||||
<td><?= $this->getHtml('Number', 'ItemManagement', 'Backend'); ?>
|
||||
<label for="iAnalysisList-sort-1">
|
||||
<input type="radio" name="iAnalysisList-sort" id="iAnalysisList-sort-1">
|
||||
<i class="sort-asc g-icon">expand_less</i>
|
||||
</label>
|
||||
<label for="iAnalysisList-sort-2">
|
||||
<input type="radio" name="iAnalysisList-sort" id="iAnalysisList-sort-2">
|
||||
<i class="sort-desc g-icon">expand_more</i>
|
||||
</label>
|
||||
<label>
|
||||
<i class="filter g-icon">filter_alt</i>
|
||||
</label>
|
||||
<td><?= $this->getHtml('Name', 'ItemManagement', 'Backend'); ?>
|
||||
<label for="iAnalysisList-sort-3">
|
||||
<input type="radio" name="iAnalysisList-sort" id="iAnalysisList-sort-3">
|
||||
<i class="sort-asc g-icon">expand_less</i>
|
||||
</label>
|
||||
<label for="iAnalysisList-sort-4">
|
||||
<input type="radio" name="iAnalysisList-sort" id="iAnalysisList-sort-4">
|
||||
<i class="sort-desc g-icon">expand_more</i>
|
||||
</label>
|
||||
<label>
|
||||
<i class="filter g-icon">filter_alt</i>
|
||||
</label>
|
||||
<td class="wf-100"><?= $this->getHtml('Name', 'ItemManagement', 'Backend'); ?>
|
||||
<label for="iAnalysisList-sort-5">
|
||||
<input type="radio" name="iAnalysisList-sort" id="iAnalysisList-sort-5">
|
||||
<i class="sort-asc g-icon">expand_less</i>
|
||||
</label>
|
||||
<label for="iAnalysisList-sort-6">
|
||||
<input type="radio" name="iAnalysisList-sort" id="iAnalysisList-sort-6">
|
||||
<i class="sort-desc g-icon">expand_more</i>
|
||||
</label>
|
||||
<label>
|
||||
<i class="filter g-icon">filter_alt</i>
|
||||
</label>
|
||||
<td><?= $this->getHtml('Counted'); ?>
|
||||
<td><?= $this->getHtml('Target'); ?>
|
||||
<tbody>
|
||||
<?php $count = 0;
|
||||
foreach ($inventory->items as $key => $value) : ++$count;
|
||||
$url = UriFactory::build('{/base}/warehouse/stocktaking/item?id=' . $value->id);
|
||||
$image = $value->getFileByTagName('profile_image');
|
||||
?>
|
||||
<tr>
|
||||
<td>0
|
||||
<td>0
|
||||
<td><img<?= $image->id === 0 ? '' : ' id="itemAnalysis' . $value->id . '" tabindex="0" data-preview="' . UriFactory::build('{/api}media/export?id=' . $image->id . '&type=html&csrf={$CSRF}') . '"'; ?> alt="<?= $this->getHtml('IMG_alt_item'); ?>" width="30" loading="lazy" class="item-image"
|
||||
src="<?= $image->id === 0
|
||||
? 'Web/Backend/img/logo_grey.png'
|
||||
: UriFactory::build($image->getPath()); ?>">
|
||||
<td><?= $this->printHtml($value->number); ?>
|
||||
<td><?= $this->printHtml($value->getL11n('name1')->content); ?>
|
||||
<td><?= $this->printHtml($value->getL11n('name2')->content); ?>
|
||||
<td>0
|
||||
<td>0
|
||||
<?php endforeach; ?>
|
||||
<?php if ($count === 0) : ?>
|
||||
<tr><td colspan="9" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Loading…
Reference in New Issue
Block a user