mirror of
https://github.com/Karaka-Management/oms-AssetManagement.git
synced 2026-01-11 14:48:40 +00:00
Test fixes
This commit is contained in:
parent
e1934a84ea
commit
293304340f
|
|
@ -77,6 +77,11 @@
|
|||
"type": "VARCHAR(255)",
|
||||
"null": false
|
||||
},
|
||||
"assetmgmt_asset_location": {
|
||||
"name": "assetmgmt_asset_location",
|
||||
"type": "VARCHAR(255)",
|
||||
"null": false
|
||||
},
|
||||
"assetmgmt_asset_status": {
|
||||
"name": "assetmgmt_asset_status",
|
||||
"type": "TINYINT",
|
||||
|
|
@ -166,13 +171,13 @@
|
|||
"null": false
|
||||
},
|
||||
"assetmgmt_attr_type_required": {
|
||||
"description": "Every asset must have this attribute type if set to true.",
|
||||
"comment": "Every asset must have this attribute type if set to true.",
|
||||
"name": "assetmgmt_attr_type_required",
|
||||
"type": "TINYINT(1)",
|
||||
"null": false
|
||||
},
|
||||
"assetmgmt_attr_type_pattern": {
|
||||
"description": "This is a regex validation pattern.",
|
||||
"comment": "This is a regex validation pattern.",
|
||||
"name": "assetmgmt_attr_type_pattern",
|
||||
"type": "VARCHAR(255)",
|
||||
"null": false
|
||||
|
|
|
|||
|
|
@ -219,6 +219,10 @@ final class Installer extends InstallerAbstract
|
|||
$module = $app->moduleManager->get('AssetManagement', 'ApiAssetAttribute');
|
||||
|
||||
foreach ($attributes as $attribute) {
|
||||
if (!isset($attribute['values'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$itemAttrValue[$attribute['name']] = [];
|
||||
|
||||
/** @var array $value */
|
||||
|
|
|
|||
|
|
@ -83,12 +83,14 @@ final class ApiController extends Controller
|
|||
*/
|
||||
public function createAssetFromRequest(RequestAbstract $request) : Asset
|
||||
{
|
||||
$asset = new Asset();
|
||||
$asset->name = $request->getDataString('name') ?? '';
|
||||
$asset->info = $request->getDataString('info') ?? '';
|
||||
$asset->type = new NullBaseStringL11nType((int) ($request->getDataInt('type') ?? 0));
|
||||
$asset->status = AssetStatus::tryFromValue($request->getDataInt('status')) ?? AssetStatus::INACTIVE;
|
||||
$asset->unit = $request->getDataInt('unit') ?? $this->app->unitId;
|
||||
$asset = new Asset();
|
||||
$asset->name = $request->getDataString('name') ?? '';
|
||||
$asset->info = $request->getDataString('info') ?? '';
|
||||
$asset->code = $request->getDataString('code') ?? '';
|
||||
$asset->location = $request->getDataString('location') ?? '';
|
||||
$asset->type = new NullBaseStringL11nType((int) ($request->getDataInt('type') ?? 0));
|
||||
$asset->status = AssetStatus::tryFromValue($request->getDataInt('status')) ?? AssetStatus::INACTIVE;
|
||||
$asset->unit = $request->getDataInt('unit') ?? $this->app->unitId;
|
||||
$asset->equipment = $request->getDataInt('equipment');
|
||||
|
||||
return $asset;
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ final class BackendController extends Controller
|
|||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
|
||||
$view->setTemplate('/Modules/AssetManagement/Theme/Backend/asset-view');
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1008402001, $request, $response);
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1006601001, $request, $response);
|
||||
|
||||
$view->data['asset'] = AssetMapper::get()
|
||||
->with('attributes')
|
||||
|
|
@ -132,6 +132,11 @@ final class BackendController extends Controller
|
|||
$view->data['units'] = UnitMapper::getAll()
|
||||
->executeGetArray();
|
||||
|
||||
$view->data['attributeTypes'] = AssetAttributeTypeMapper::getAll()
|
||||
->with('l11n')
|
||||
->where('l11n/language', $response->header->l11n->language)
|
||||
->executeGetArray();
|
||||
|
||||
$view->data['attributeView'] = new \Modules\Attribute\Theme\Backend\Components\AttributeView($this->app->l11nManager, $request, $response);
|
||||
$view->data['attributeView']->data['default_localization'] = $this->app->l11nServer;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
# Structure
|
||||
|
||||
## ER
|
||||
|
||||

|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 52 KiB |
|
|
@ -1,2 +1,17 @@
|
|||
# Asset
|
||||
|
||||
## Code
|
||||
|
||||
A custom code that can be set for an asset.
|
||||
|
||||
## Location
|
||||
|
||||
Location where the asset is located.
|
||||
|
||||

|
||||
|
||||
## Attributes
|
||||
|
||||
Attributes allow you to add additional information to assets.
|
||||
|
||||

|
||||
|
|
@ -1,14 +1,14 @@
|
|||
# Introduction
|
||||
|
||||
The **Tasks** module allows users to create to do's for themselves and for other users. Tasks can be shared and worked on with multiple users. It is also possible to attach files and tags for easier categorization and better search. Tasks can also be forwarded from one user to another.
|
||||
The **Asset Management** module allows users to create and manage assets for accounting purposes. Assets can have general information stored in the asset master file as well as different depreciation types.
|
||||
|
||||
## Garget Group
|
||||
## Target Group
|
||||
|
||||
The target group for this module is everyone who wants to manage their to do in an application either for themselves or in an organization structure.
|
||||
The target group for this module is the accounting department.
|
||||
|
||||
# Setup
|
||||
|
||||
This module doesn't have any additional setup requirements since it is installed during the application install process.
|
||||
This module doesn't have any additional setup requirements.
|
||||
|
||||
# Features
|
||||
|
||||
|
|
@ -16,17 +16,13 @@ This module doesn't have any additional setup requirements since it is installed
|
|||
|
||||
Upload or link already uploaded files.
|
||||
|
||||
## Tags
|
||||
## Attributes
|
||||
|
||||
Add tags to tasks for categorization and improved search.
|
||||
Create and add custom attributes
|
||||
|
||||
## Forwarding
|
||||
## Notes
|
||||
|
||||
Tasks can be forwarded from one user to another.
|
||||
|
||||
# Dependencies
|
||||
|
||||
* [Finance](Finance)
|
||||
Create custom notes
|
||||
|
||||
# Recommendation
|
||||
|
||||
|
|
|
|||
BIN
Docs/Help/img/asset/asset_attributes.png
Normal file
BIN
Docs/Help/img/asset/asset_attributes.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
BIN
Docs/Help/img/asset/asset_files.png
Normal file
BIN
Docs/Help/img/asset/asset_files.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 58 KiB |
BIN
Docs/Help/img/asset/asset_general.png
Normal file
BIN
Docs/Help/img/asset/asset_general.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
BIN
Docs/Help/img/asset/asset_notes.png
Normal file
BIN
Docs/Help/img/asset/asset_notes.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
22
Docs/img.json
Normal file
22
Docs/img.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
[
|
||||
[
|
||||
"/accounting/asset/view?id=1",
|
||||
"//*[@id=\"content\"]/div/div[2]/div[1]/div/div[1]/section",
|
||||
"/AssetManagement/Docs/Help/img/asset/asset_general.png"
|
||||
],
|
||||
[
|
||||
"/accounting/asset/view?id=1#c-tab-2",
|
||||
"//*[@id=\"content\"]/div/div[2]/div[2]/div",
|
||||
"/AssetManagement/Docs/Help/img/asset/asset_attributes.png"
|
||||
],
|
||||
[
|
||||
"/accounting/asset/view?id=1#c-tab-3",
|
||||
"//*[@id=\"content\"]/div/div[2]/div[3]/div",
|
||||
"/AssetManagement/Docs/Help/img/asset/asset_files.png"
|
||||
],
|
||||
[
|
||||
"/accounting/asset/view?id=1#c-tab-4",
|
||||
"//*[@id=\"content\"]/div/div[2]/div[4]/div",
|
||||
"/AssetManagement/Docs/Help/img/asset/asset_notes.png"
|
||||
]
|
||||
]
|
||||
|
|
@ -32,6 +32,10 @@ class Asset implements \JsonSerializable
|
|||
|
||||
public int $status = AssetStatus::ACTIVE;
|
||||
|
||||
public string $code = '';
|
||||
|
||||
public string $location = '';
|
||||
|
||||
public BaseStringL11nType $type;
|
||||
|
||||
public string $info = '';
|
||||
|
|
|
|||
|
|
@ -42,10 +42,11 @@ final class AssetMapper extends DataMapperFactory
|
|||
'assetmgmt_asset_id' => ['name' => 'assetmgmt_asset_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'assetmgmt_asset_name' => ['name' => 'assetmgmt_asset_name', 'type' => 'string', 'internal' => 'name'],
|
||||
'assetmgmt_asset_number' => ['name' => 'assetmgmt_asset_number', 'type' => 'string', 'internal' => 'number'],
|
||||
'assetmgmt_asset_location' => ['name' => 'assetmgmt_asset_location', 'type' => 'string', 'internal' => 'location'],
|
||||
'assetmgmt_asset_status' => ['name' => 'assetmgmt_asset_status', 'type' => 'int', 'internal' => 'status'],
|
||||
'assetmgmt_asset_info' => ['name' => 'assetmgmt_asset_info', 'type' => 'string', 'internal' => 'info'],
|
||||
'assetmgmt_asset_unit' => ['name' => 'assetmgmt_asset_unit', 'type' => 'int', 'internal' => 'unit'],
|
||||
'assetmgmt_asset_equipment' => ['name' => 'assetmgmt_asset_equipment', 'type' => 'int', 'internal' => 'equipment'],
|
||||
'assetmgmt_asset_equipment' => ['name' => 'assetmgmt_asset_equipment', 'type' => 'int', 'internal' => 'equipment'],
|
||||
'assetmgmt_asset_type' => ['name' => 'assetmgmt_asset_type', 'type' => 'int', 'internal' => 'type'],
|
||||
'assetmgmt_asset_responsible' => ['name' => 'assetmgmt_asset_responsible', 'type' => 'int', 'internal' => 'responsible'],
|
||||
'assetmgmt_asset_created_at' => ['name' => 'assetmgmt_asset_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true],
|
||||
|
|
|
|||
|
|
@ -13,16 +13,25 @@
|
|||
declare(strict_types=1);
|
||||
|
||||
return ['AssetManagement' => [
|
||||
'Assets' => 'Assets',
|
||||
'Asset' => 'Asset',
|
||||
'Equipment' => 'Equipment',
|
||||
'CreateEquipment' => 'Create Equipment',
|
||||
'Number' => 'Number',
|
||||
'Status' => 'Status',
|
||||
'Name' => 'Name',
|
||||
'Type' => 'Type',
|
||||
':status1' => 'Active',
|
||||
':status2' => 'Inactive',
|
||||
':status3' => 'Damaged',
|
||||
':status4' => 'Out of order',
|
||||
'Assets' => 'Assets',
|
||||
'Asset' => 'Asset',
|
||||
'Equipment' => 'Equipment',
|
||||
'CreateEquipment' => 'Create Equipment',
|
||||
'Number' => 'Number',
|
||||
'Start' => 'Start',
|
||||
'End' => 'End',
|
||||
'Attributes' => 'Attributes',
|
||||
'Files' => 'Files',
|
||||
'Notes' => 'Notes',
|
||||
'Status' => 'Status',
|
||||
'PurchasePrice' => 'Purchase Price',
|
||||
'LeasingFee' => 'Leasing Fee',
|
||||
'Name' => 'Name',
|
||||
'Type' => 'Type',
|
||||
'Code' => 'Code',
|
||||
'Location' => 'Location',
|
||||
':status1' => 'Active',
|
||||
':status2' => 'Inactive',
|
||||
':status3' => 'Damaged',
|
||||
':status4' => 'Out of order',
|
||||
]];
|
||||
|
|
|
|||
|
|
@ -33,14 +33,14 @@ $assetTypes = $this->data['types'] ?? [];
|
|||
*/
|
||||
echo $this->data['nav']->render();
|
||||
?>
|
||||
<div class="tabview tab-2">
|
||||
<div id="iAssetView" class="tabview tab-2 url-rewrite">
|
||||
<div class="box">
|
||||
<ul class="tab-links">
|
||||
<li><label for="c-tab-1"><?= $this->getHtml('Asset'); ?></label>
|
||||
<li><label for="c-tab-2"><?= $this->getHtml('Attributes'); ?></label>
|
||||
<li><label for="c-tab-3"><?= $this->getHtml('Files'); ?></label>
|
||||
<li><label for="c-tab-4"><?= $this->getHtml('Notes'); ?></label>
|
||||
<li><label for="c-tab-8"><?= $this->getHtml('Costs'); ?></label>
|
||||
<!--<li><label for="c-tab-5"><?= $this->getHtml('Costs'); ?></label>-->
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tab-content">
|
||||
|
|
@ -49,7 +49,7 @@ echo $this->data['nav']->render();
|
|||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<section class="portlet">
|
||||
<div class="portlet-head"><?= $this->getHtml('Profile'); ?></div>
|
||||
<div class="portlet-head"><?= $this->getHtml('Asset'); ?></div>
|
||||
<div class="portlet-body">
|
||||
<div class="form-group">
|
||||
<label for="iAssetAssetProfileName"><?= $this->getHtml('Name'); ?></label>
|
||||
|
|
@ -57,13 +57,8 @@ echo $this->data['nav']->render();
|
|||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iAssetDriver"><?= $this->getHtml('Driver'); ?></label>
|
||||
<input type="text" id="iAssetDriver" name="driver" value="" disabled>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iAssetEin"><?= $this->getHtml('EIN'); ?></label>
|
||||
<input type="text" id="iAssetEin" name="vin" value="<?= $this->printHtml($asset->getAttribute('vin')->value->getValue()); ?>">
|
||||
<label for="iAssetCode"><?= $this->getHtml('Code'); ?></label>
|
||||
<input type="text" id="iAssetCode" name="code" value="<?= $this->printHtml($asset->number); ?>">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
|
@ -76,22 +71,8 @@ echo $this->data['nav']->render();
|
|||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iAssetEnd"><?= $this->getHtml('Type'); ?></label>
|
||||
<select id="iAssetEnd" name="asset_type">
|
||||
<?php foreach ($assetTypes as $type) : ?>
|
||||
<option value="<?= $type->id; ?>"<?= $asset->type->id === $type->id ? ' selected' : ''; ?>><?= $this->printHtml($type->getL11n()); ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iAssetMake"><?= $this->getHtml('Make'); ?></label>
|
||||
<input type="text" id="iAssetMake" name="make" value="<?= $this->printHtml($asset->getAttribute('maker')->value->getValue()); ?>">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iAssetModel"><?= $this->getHtml('Model'); ?></label>
|
||||
<input type="text" id="iAssetModel" name="asset_model" value="<?= $this->printHtml($asset->getAttribute('asset_model')->value->getValue()); ?>">
|
||||
<label for="iAssetLocation"><?= $this->getHtml('Location'); ?></label>
|
||||
<input type="text" id="iAssetLocation" name="location" value="<?= $this->printHtml($asset->number); ?>">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
|
@ -160,7 +141,7 @@ echo $this->data['nav']->render();
|
|||
<?= $this->data['asset-notes']->render('asset-notes', '', $asset->notes); ?>
|
||||
</div>
|
||||
|
||||
<input type="radio" id="c-tab-8" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-8' ? ' checked' : ''; ?>>
|
||||
<input type="radio" id="c-tab-5" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-5' ? ' checked' : ''; ?>>
|
||||
<div class="tab">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user