Skip to content
Code-Schnipsel Gruppen Projekte

Revisionen vergleichen

Änderungen werden so angezeigt, als ob die Quellrevision mit der Zielrevision zusammengeführt würde. Erfahre mehr über den Vergleich von Revisionen.

Quelle

Zielprojekt auswählen
No results found

Ziel

Zielprojekt auswählen
  • quiqqer/erp
1 Ergebnis
Änderungen anzeigen
Commits auf Quelle (64)
werden angezeigt mit 821 Ergänzungen und 277 Löschungen
<?php
/**
* This file contains package_quiqqer_erp_ajax_copyEntity
*/
QUI::$Ajax->registerFunction(
'package_quiqqer_erp_ajax_copyEntity',
function ($uuid, $processKeepStatus, $entityPlugin) {
$Instance = (new QUI\ERP\Processes())->getEntity($uuid, $entityPlugin);
if (!($Instance instanceof QUI\ERP\ErpCopyInterface)) {
throw new QUI\Exception('This entity can not be copied!');
}
if ($processKeepStatus === 'existing') {
$Copy = $Instance->copy(
null,
$Instance->getGlobalProcessId()
);
} else {
$Copy = $Instance->copy();
}
return $Copy->toArray();
},
['uuid', 'processKeepStatus', 'entityPlugin'],
'Permission::checkAdminUser'
);
<?php
/**
* This file contains package_quiqqer_erp_ajax_getEntity
*/
QUI::$Ajax->registerFunction(
'package_quiqqer_erp_ajax_getEntity',
function ($uuid, $entityPlugin) {
$Instance = (new QUI\ERP\Processes())->getEntity($uuid, $entityPlugin);
return $Instance->toArray();
},
['uuid', 'entityPlugin'],
'Permission::checkAdminUser'
);
......@@ -37,9 +37,14 @@ function ($entityId, $entityType) {
QUI\System\Log::writeException($Exception);
}
$Processes = new QUI\ERP\Processes();
$Entity = $Processes->getEntity($entityId);
return [
'email' => $OutputProvider::getEmailAddress(Orthos::clear($entityId)),
'hideSystemDefaultTemplate' => $hideSystemDefaultTemplate
'hideSystemDefaultTemplate' => $hideSystemDefaultTemplate,
'uuid' => $Entity->getUUID(),
'prefixedNumber' => $Entity->getPrefixedNumber()
];
},
['entityId', 'entityType'],
......
......@@ -34,7 +34,8 @@ function (
try {
$entityType = Orthos::clear($entityType);
$OutputProvider = ERPOutput::getOutputProviderByEntityType($entityType);
$outputProvider = ERPOutput::getOutputProviderByEntityType($entityType);
$OutputProvider = new $outputProvider();
$TemplateProvider = ERPOutput::getOutputTemplateProviderByPackage(Orthos::clear($templateProvider));
if (empty($TemplateProvider)) {
......
......@@ -19,7 +19,27 @@ function ($globalProcessId, $entityHash) {
}
return array_map(function ($Entity) {
return $Entity->toArray();
$entityData = $Entity->toArray();
$entityData['processing_status'] = [
'id' => 0,
'title' => '---',
'color' => '#999999',
];
if (method_exists($Entity, 'getProcessingStatus')) {
/* @var $ProcessingStatus QUI\ERP\Accounting\Invoice\ProcessingStatus\Status */
$ProcessingStatus = $Entity->getProcessingStatus();
if ($ProcessingStatus) {
$entityData['processing_status'] = [
'id' => $ProcessingStatus->getId(),
'title' => $ProcessingStatus->getTitle(),
'color' => $ProcessingStatus->getColor()
];
}
}
return $entityData;
}, $Process->getEntities());
},
['globalProcessId', 'entityHash'],
......
<?php
/**
* This file contains package_quiqqer_erp_ajax_process_getProcess
*/
use QUI\ERP\Process;
use QUI\ERP\Processes;
QUI::$Ajax->registerFunction(
'package_quiqqer_erp_ajax_process_getProcess',
function ($globalProcessId, $hash) {
if (!empty($hash) && empty($globalProcessId)) {
$Entity = (new Processes())->getEntity($hash);
$globalProcessId = $Entity->getGlobalProcessId();
}
$Process = new Process($globalProcessId);
return [
'globalProcessId' => $Process->getUUID(),
'history' => $Process->getCompleteHistory()->toArray()
];
},
['globalProcessId', 'hash'],
['Permission::checkAdminUser']
);
......@@ -77,6 +77,12 @@ define('package/quiqqer/erp/bin/backend/controls/DeliveryAddress', [
const self = this,
Elm = this.getElm();
function ignoreAutoFill(node)
{
node.role = 'presentation';
node.autocomplete = 'off';
}
Elm.set('html', Mustache.render(template, {
labelDifferentDeliveryAddress: QUILocale.get(
lg,
......@@ -131,6 +137,14 @@ define('package/quiqqer/erp/bin/backend/controls/DeliveryAddress', [
this.$Firstname.disabled = false;
this.$Lastname.disabled = false;
ignoreAutoFill(this.$Salutation);
ignoreAutoFill(this.$Firstname);
ignoreAutoFill(this.$Lastname);
ignoreAutoFill(this.$Company);
ignoreAutoFill(this.$Street);
ignoreAutoFill(this.$ZIP);
ignoreAutoFill(this.$City);
const Panel = QUI.Controls.getById(
this.getElm().getParent('.qui-panel').get('data-quiid')
);
......@@ -159,10 +173,15 @@ define('package/quiqqer/erp/bin/backend/controls/DeliveryAddress', [
this.$userId = this.$Customer.getValue();
this.$Customer.addEvent('onChange', () => {
// same user needs no change
if (this.$Customer.getValue() === this.$userId) {
return;
}
this.$userId = this.$Customer.getValue();
this.$getDeliveryAddressFromUser().then((result) => {
if (!result) {
if (!result) {
this.$Checked.checked = false;
this.$checkBoxChange();
return;
......@@ -300,8 +319,8 @@ define('package/quiqqer/erp/bin/backend/controls/DeliveryAddress', [
firstname: '',
lastname: ''
};
Object.merge(Address, value);
this.$displayAddressData(Address);
this.$Checked.checked = true;
......@@ -370,15 +389,13 @@ define('package/quiqqer/erp/bin/backend/controls/DeliveryAddress', [
* @param {DocumentEvent} [event]
*/
$checkBoxChange: function(event) {
const self = this,
Checkbox = this.getElm().getElement('[name="differentDeliveryAddress"]'),
closables = this.getElm().getElements('.closable');
const closables = this.getElm().getElements('.closable');
if (event) {
event.stop();
}
if (!Checkbox) {
if (!this.$Checked) {
return;
}
......@@ -397,16 +414,7 @@ define('package/quiqqer/erp/bin/backend/controls/DeliveryAddress', [
}
if (!this.$userId) {
Checkbox.checked = false;
/*
QUI.getMessageHandler().then(function(MH) {
MH.addInformation(
QUILocale.get('quiqqer/erp', 'controls.DeliveryAddress.msg.select_customer'),
self.$Customer.getElm()
);
});
*/
this.$Checked.checked = false;
this.$AddressSelectBtn.disable();
return;
......@@ -414,7 +422,7 @@ define('package/quiqqer/erp/bin/backend/controls/DeliveryAddress', [
this.$AddressSelectBtn.enable();
if (Checkbox.checked) {
if (this.$Checked.checked) {
closables.setStyle('display', null);
return;
}
......
......@@ -5,21 +5,21 @@
<tr>
<td>
<label class="field-container">
<span class="field-container-item" title="{{labelEntityId}}">
{{labelEntityId}}
</span>
<span class="field-container-field">
{{entityId}}
</span>
<span class="field-container-item" title="{{labelEntityId}}">
{{labelEntityId}}
</span>
<span class="field-container-field quiqqer-erp-outputDialog-options-entityId">
{{entityId}}
</span>
</label>
</td>
</tr>
<tr>
<td>
<label class="field-container">
<span class="field-container-item" title="{{labelTemplate}}">
{{labelTemplate}}
</span>
<span class="field-container-item" title="{{labelTemplate}}">
{{labelTemplate}}
</span>
<select name="template" class="field-container-field"></select>
</label>
</td>
......@@ -27,9 +27,9 @@
<tr>
<td>
<label class="field-container">
<span class="field-container-item" title="{{labelOutputType}}">
{{labelOutputType}}
</span>
<span class="field-container-item" title="{{labelOutputType}}">
{{labelOutputType}}
</span>
<span class="field-container-field field-container-field-no-padding field-output"></span>
</label>
</td>
......@@ -37,9 +37,9 @@
<tr style="display: none">
<td>
<label class="field-container">
<span class="field-container-item" title="{{labelEmail}}">
{{labelEmail}}
</span>
<span class="field-container-item" title="{{labelEmail}}">
{{labelEmail}}
</span>
<input type="text"
name="recipient"
placeholder="email@domain.com"
......@@ -57,9 +57,9 @@
<tr>
<td>
<label class="field-container">
<span class="field-container-item" title="{{labelMarkAsSent}}">
{{labelMarkAsSent}}
</span>
<span class="field-container-item" title="{{labelMarkAsSent}}">
{{labelMarkAsSent}}
</span>
<div class="field-container-field">
<input type="checkbox" name="mark_as_sent" checked/>
</div>
......
Dieser Diff ist reduziert.
......@@ -1352,6 +1352,10 @@ define('package/quiqqer/erp/bin/backend/controls/articles/Article', [
}
}).inject(Container);
if (typeOf(self) === 'package/quiqqer/erp/bin/backend/controls/articles/Text') {
Edit.setStyle('textAlign', 'left');
}
if (Container === self.$Title) {
Edit.setStyle('top', -10);
}
......
......@@ -242,7 +242,7 @@ define('package/quiqqer/erp/bin/backend/controls/articles/ArticleList', [
this.$articles = [];
let selectedPosition = null;
console.log(data.articles);
if (this.$Container) {
if (this.$selectedArticle) {
selectedPosition = this.$selectedArticle.getAttribute('position');
......
......@@ -5,6 +5,7 @@
clear: both;
display: flex;
flex-direction: row;
flex-wrap: wrap;
float: left;
min-height: 50px;
position: relative;
......@@ -63,26 +64,26 @@
text-align: center;
}
.quiqqer-erp-backend-erpArticleText-buttons {
background: #fff;
bottom: 0;
opacity: 0;
padding: 10px;
position: absolute;
right: 0;
text-align: right;
transition: opacity 0.2s;
width: 75px;
z-index: 10;
background: #DEDEDE;
display: none;
width: 100%;
}
.quiqqer-erp-backend-erpArticleText-buttons button {
padding: 0 5px;
background: transparent;
border: none;
cursor: pointer;
line-height: 20px;
margin-left: 5px;
}
.quiqqer-erp-backend-erpArticleText:hover .quiqqer-erp-backend-erpArticleText-buttons {
opacity: 1;
transition: opacity 0.2s;
.quiqqer-erp-backend-erpArticle-select .quiqqer-erp-backend-erpArticleText-buttons {
display: inline-block;
}
.quiqqer-erp-backend-erpArticleText-buttons button:hover {
background: #eaeaea;
}
<div class="quiqqer-erp-backend-erpArticleText-pos cell"></div>
<div class="quiqqer-erp-backend-erpArticleText-text cell"></div>
<div class="quiqqer-erp-backend-erpArticleText-buttons"></div>
<div class="quiqqer-erp-backend-erpArticleText-buttons">
<button name="replace">
<span class="fa fa-retweet"></span>
<span>{{buttonReplace}}</span>
</button>
<button name="delete">
<span class="fa fa-trash"></span>
<span>{{buttonDelete}}</span>
</button>
</div>
\ No newline at end of file
......@@ -16,22 +16,22 @@ define('package/quiqqer/erp/bin/backend/controls/articles/Text', [
'text!package/quiqqer/erp/bin/backend/controls/articles/Text.html',
'css!package/quiqqer/erp/bin/backend/controls/articles/Text.css'
], function (Article, QUIButton, QUILocale, Mustache, template) {
"use strict";
], function(Article, QUIButton, QUILocale, Mustache, template) {
'use strict';
const lg = 'quiqqer/erp';
return new Class({
Extends: Article,
Type : 'package/quiqqer/erp/bin/backend/controls/articles/Text',
Type: 'package/quiqqer/erp/bin/backend/controls/articles/Text',
Binds: [
'$onEditTitle',
'$onEditDescription'
],
initialize: function (options) {
initialize: function(options) {
this.parent(options);
this.setAttributes({
......@@ -44,13 +44,16 @@ define('package/quiqqer/erp/bin/backend/controls/articles/Text', [
*
* @returns {HTMLDivElement}
*/
create: function () {
create: function() {
this.$Elm = new Element('div');
this.$Elm.addClass('quiqqer-erp-backend-erpArticleText');
this.$Elm.set({
html : Mustache.render(template),
html: Mustache.render(template, {
buttonReplace: QUILocale.get(lg, 'articleList.article.button.replace'),
buttonDelete: QUILocale.get(lg, 'articleList.article.button.delete')
}),
events: {
click: this.select
}
......@@ -61,15 +64,15 @@ define('package/quiqqer/erp/bin/backend/controls/articles/Text', [
this.$Buttons = this.$Elm.getElement('.quiqqer-erp-backend-erpArticleText-buttons');
this.$Loader = new Element('div', {
html : '<span class="fa fa-spinner fa-spin"></span>',
html: '<span class="fa fa-spinner fa-spin"></span>',
styles: {
background: '#fff',
display : 'none',
left : 0,
padding : 10,
position : 'absolute',
top : 0,
width : '100%'
display: 'none',
left: 0,
padding: 10,
position: 'absolute',
top: 0,
width: '100%'
}
}).inject(this.$Position);
......@@ -94,28 +97,8 @@ define('package/quiqqer/erp/bin/backend/controls/articles/Text', [
this.setTitle(this.getAttribute('title'));
this.setDescription(this.getAttribute('description'));
// edit buttons
new QUIButton({
title : QUILocale.get(lg, 'erp.articleList.article.button.replace'),
icon : 'fa fa-retweet',
styles: {
'float': 'none'
},
events: {
onClick: this.$onReplaceClick
}
}).inject(this.$Buttons);
new QUIButton({
title : QUILocale.get(lg, 'erp.articleList.article.button.delete'),
icon : 'fa fa-trash',
styles: {
'float': 'none'
},
events: {
onClick: this.openDeleteDialog
}
}).inject(this.$Buttons);
this.$Buttons.getElement('[name="replace"]').addEvent('click', this.$onReplaceClick);
this.$Buttons.getElement('[name="delete"]').addEvent('click', this.openDeleteDialog);
this.$created = true;
......@@ -128,7 +111,7 @@ define('package/quiqqer/erp/bin/backend/controls/articles/Text', [
*
* @return {Promise}
*/
calc: function () {
calc: function() {
return Promise.resolve();
},
......@@ -137,7 +120,7 @@ define('package/quiqqer/erp/bin/backend/controls/articles/Text', [
*
* @param {String} title
*/
setTitle: function (title) {
setTitle: function(title) {
this.setAttribute('title', title);
this.$Title.set('html', title);
......@@ -151,7 +134,7 @@ define('package/quiqqer/erp/bin/backend/controls/articles/Text', [
*
* @param {String} description
*/
setDescription: function (description) {
setDescription: function(description) {
this.setAttribute('description', description);
this.$Description.set('html', description);
......@@ -165,7 +148,7 @@ define('package/quiqqer/erp/bin/backend/controls/articles/Text', [
*
* @return {Promise}
*/
setQuantity: function () {
setQuantity: function() {
return Promise.resolve();
},
......@@ -173,28 +156,28 @@ define('package/quiqqer/erp/bin/backend/controls/articles/Text', [
* Set the product unit price
*
*/
setUnitPrice: function () {
setUnitPrice: function() {
return Promise.resolve();
},
/**
* Set the product unit price
**/
setVat: function () {
setVat: function() {
return Promise.resolve();
},
/**
* Show the loader
*/
showLoader: function () {
showLoader: function() {
this.$Loader.setStyle('display', null);
},
/**
* Hide the loader
*/
hideLoader: function () {
hideLoader: function() {
this.$Loader.setStyle('display', 'none');
}
});
......
......@@ -25,6 +25,8 @@ define('package/quiqqer/erp/bin/backend/controls/customerFiles/Grid', [
'openCustomerFiles',
'uploadCustomFile',
'removeSelectedFiles',
'download',
'$onDblClick',
'$onInject'
],
......@@ -169,6 +171,11 @@ define('package/quiqqer/erp/bin/backend/controls/customerFiles/Grid', [
dataIndex: 'uploadTime',
dataType: 'string',
width: 100
}, {
header: '',
dataIndex: 'download',
dataType: 'node',
width: 100
}, {
dataIndex: 'hash',
dataType: 'string',
......@@ -188,7 +195,8 @@ define('package/quiqqer/erp/bin/backend/controls/customerFiles/Grid', [
if (selected.length) {
Remove.enable();
}
}
},
dblClick: this.$onDblClick
});
this.$Grid.showLoader();
......@@ -227,7 +235,24 @@ define('package/quiqqer/erp/bin/backend/controls/customerFiles/Grid', [
}),
mail: new Element('input', {
type: 'checkbox',
checked: entry.options.attachToEmail
checked: entry.options.attachToEmail,
title: QUILocale.get(lg, 'customer.grid.mail.checkbox.title')
}),
download: new Element('button', {
type: 'button',
'class': 'qui-button qui-utils-noselect',
html: '<span class="fa fa-download"></span>',
title: QUILocale.get(lg, 'customer.grid.download.title'),
events: {
click: (e) => {
e.stop();
const Row = e.target.getParent('li.tr');
const data = this.$Grid.getDataByRow(Row.get('data-row'));
this.download(data.hash);
}
}
})
});
});
......@@ -343,7 +368,7 @@ define('package/quiqqer/erp/bin/backend/controls/customerFiles/Grid', [
if (files instanceof FileList) {
files = Array.from(files);
}
Instance.upload(files);
});
});
......@@ -453,6 +478,40 @@ define('package/quiqqer/erp/bin/backend/controls/customerFiles/Grid', [
onError: reject
});
});
},
$onDblClick: function() {
const selected = this.$Grid.getSelectedData();
if (!selected.length) {
return;
}
this.download(selected[0].hash);
},
download: function(hash) {
const uid = String.uniqueID();
const id = 'download-customer-file-' + uid;
new Element('iframe', {
src: URL_OPT_DIR + 'quiqqer/customer/bin/backend/download.php?' + Object.toQueryString({
hash: hash,
customerId: this.getAttribute('customerId')
}),
id: id,
styles: {
position: 'absolute',
top: -200,
left: -200,
width: 50,
height: 50
}
}).inject(document.body);
(function() {
document.getElements('#' + id).destroy();
}).delay(20000, this);
}
});
});
/**
* Create a copy of an erp entity
*
* @module package/quiqqer/erp/bin/backend/controls/dialogs/CopyErpEntityDialog
* @author www.pcsg.de (Henning)
*
* @event onSuccess [self, newCopy] - Fires if a copy has been successfully created
* @event onError [self] - Fires if an error occurs during copy creation
*/
define('package/quiqqer/erp/bin/backend/controls/dialogs/CopyErpEntityDialog', [
'qui/controls/windows/Confirm',
'Ajax',
'Locale'
], function(QUIConfirm, QUIAjax, QUILocale) {
'use strict';
const lg = 'quiqqer/erp';
return new Class({
Extends: QUIConfirm,
type: 'package/quiqqer/erp/bin/backend/controls/dialogs/CopyErpEntityDialog',
Binds: [
'$onOpen',
'$onSubmit'
],
options: {
hash: false,
entityPlugin: false, // kann übergeben werden um sicherzustellen das die entität auch wirklich aus diesem plugin kommt
maxHeight: 400,
maxWidth: 700,
icon: 'fa fa-copy',
texticon: 'fa fa-copy',
text: QUILocale.get(lg, 'controls.elements.copyDialog.text'),
autoclose: false,
ok_button: {
text: QUILocale.get(lg, 'controls.elements.copyDialog.ok_btn'),
textimage: 'fa fa-copy'
}
},
initialize: function(options) {
this.parent(options);
this.$CopyHistoryCheckbox = null;
this.addEvents({
onOpen: this.$onOpen,
onSubmit: this.$onSubmit
});
},
getData: function() {
return new Promise((resolve, reject) => {
QUIAjax.get('package_quiqqer_erp_ajax_getEntity', resolve, {
'package': 'quiqqer/erp',
uuid: this.getAttribute('hash'),
entityPlugin: this.getAttribute('entityPlugin'),
onError: reject
});
});
},
/**
* event: on open
*/
$onOpen: function() {
this.Loader.show();
this.getData().then((erpEntity) => {
this.setAttributes({
title: QUILocale.get(lg, 'controls.elements.copyDialog.title', {
prefixedNumber: erpEntity.prefixedNumber
})
});
this.getContent().getElement('.text').innerHTML = QUILocale.get(
lg,
'controls.elements.copyDialog.text',
{prefixedNumber: erpEntity.prefixedNumber}
);
this.getContent().getElement('.information').innerHTML = QUILocale.get(
lg,
'controls.elements.copyDialog.information',
{prefixedNumber: erpEntity.prefixedNumber}
);
this.refresh();
new Element('label', {
styles: {
display: 'block',
minWidth: 500,
width: '80%'
},
html: '' +
'<span class="quiqqer-contracts-dialog-copy-option-title">' +
QUILocale.get(lg, 'controls.elements.copyDialog.option.title') +
'</span>' +
'<span class="quiqqer-contracts-dialog-copy-option-info" style="display: none">' +
QUILocale.get(lg, 'controls.elements.copyDialog.option.info') +
'</span>' +
'<select name="copy-option" required style="width: 100%; margin-top: 10px">' +
' <option value=""></option>' +
' <option value="new">' +
'' + QUILocale.get(lg, 'controls.elements.copyDialog.option.new') +
' </option>' +
' <option value="existing">' +
'' + QUILocale.get(lg, 'controls.elements.copyDialog.option.existing') +
' </option>' +
'</select>'
}).inject(this.getContent().getElement('.information'));
this.Loader.hide();
this.getContent().getElement('[name="copy-option"]').focus();
});
},
/**
* event: on submit
*/
$onSubmit: function() {
const Copy = this.getContent().getElement('[name="copy-option"]');
if ('reportValidity' in Copy) {
Copy.reportValidity();
if ('checkValidity' in Copy) {
if (Copy.checkValidity() === false) {
return;
}
}
}
// no html5 support
if (Copy.value === '') {
return;
}
this.Loader.show();
QUIAjax.post('package_quiqqer_erp_ajax_copyEntity', (newCopy) => {
this.close();
this.fireEvent('success', [this, newCopy]);
require([
'package/quiqqer/erp/bin/backend/utils/ERPEntities'
], function(ErpUtils) {
ErpUtils.openPanelByUUID(newCopy.hash);
});
}, {
'package': 'quiqqer/erp',
uuid: this.getAttribute('hash'),
entityPlugin: this.getAttribute('entityPlugin'),
processKeepStatus: Copy.value,
onError: () => {
this.fireEvent('error', [self]);
this.Loader.hide();
}
});
}
});
});
\ No newline at end of file
......@@ -7,11 +7,12 @@ define('package/quiqqer/erp/bin/backend/controls/process/ProcessGrid', [
'qui/controls/Control',
'qui/controls/buttons/Button',
'qui/controls/loader/Loader',
'package/quiqqer/erp/bin/backend/utils/ERPEntities',
'controls/grid/Grid',
'Locale',
'Ajax'
], function(QUI, QUIControl, QUIButton, QUILoader, Grid, QUILocale, QUIAjax) {
], function(QUI, QUIControl, QUIButton, QUILoader, ERPEntityUtils, Grid, QUILocale, QUIAjax) {
'use strict';
const lg = 'quiqqer/erp';
......@@ -28,7 +29,8 @@ define('package/quiqqer/erp/bin/backend/controls/process/ProcessGrid', [
options: {
globalProcessId: false,
entityHash: false
entityHash: false,
hideUuids: []
},
initialize: function(options) {
......@@ -57,10 +59,11 @@ define('package/quiqqer/erp/bin/backend/controls/process/ProcessGrid', [
dataType: 'QUI',
width: 60
}, {
header: QUILocale.get(lg, 'erp.process.state'),
dataIndex: 'paid_status',
header: QUILocale.get(lg, 'erp.process.status'),
dataIndex: 'status',
dataType: 'node',
width: 100
width: 150,
className: 'grid-align-center'
}, {
header: QUILocale.get(lg, 'erp.process.prefixedNumber'),
dataIndex: 'prefixedNumber',
......@@ -71,6 +74,12 @@ define('package/quiqqer/erp/bin/backend/controls/process/ProcessGrid', [
dataIndex: 'uuid',
dataType: 'string',
width: 240
}, {
header: QUILocale.get(lg, 'erp.process.paid_status'),
dataIndex: 'paid_status',
dataType: 'node',
width: 100,
className: 'grid-align-center'
}
],
pagination: false
......@@ -88,9 +97,13 @@ define('package/quiqqer/erp/bin/backend/controls/process/ProcessGrid', [
QUIAjax.get('package_quiqqer_erp_ajax_process_getEntities', (result) => {
const data = [];
console.log(result);
const hideUuids = this.getAttribute('hideUuids') || [];
result.forEach((entry) => {
if (hideUuids.indexOf(entry.uuid) !== -1) {
return;
}
const Type = new QUIButton({
events: {
click: this.$click
......@@ -103,6 +116,24 @@ define('package/quiqqer/erp/bin/backend/controls/process/ProcessGrid', [
}
});
const Status = new Element('span', {
'class': 'processing-status',
text: entry.processing_status.title,
styles: {
color: entry.processing_status.color !== '---' ? entry.processing_status.color : '',
borderColor: entry.processing_status.color !== '---' ? entry.processing_status.color : ''
}
});
if (typeof entry.paid_status === 'undefined') {
entry.paid_status = 0;
}
const PaymentStatus = new Element('span', {
'class': 'payment-status payment-status-' + entry.paid_status,
html: QUILocale.get('quiqqer/erp', 'payment.status.' + entry.paid_status)
});
switch (entry.entityType) {
case 'QUI\\ERP\\Order\\Order':
Type.setAttribute('title', QUILocale.get(lg, 'processGrid.order.open'));
......@@ -119,19 +150,24 @@ define('package/quiqqer/erp/bin/backend/controls/process/ProcessGrid', [
case 'QUI\\ERP\\SalesOrders\\SalesOrder':
Type.setAttribute('title', QUILocale.get(lg, 'processGrid.salesOrder.open'));
break;
}
if (typeof entry.paid_status === 'undefined') {
entry.paid_status = 0;
case 'QUI\\ERP\\Accounting\\Offers\\Offer':
Type.setAttribute('title', QUILocale.get(lg, 'processGrid.offer.open'));
PaymentStatus.set('class', 'processing-status');
PaymentStatus.set('html', '---');
break;
case 'QUI\\ERP\\Accounting\\Offers\\OfferTemporary':
Type.setAttribute('title', QUILocale.get(lg, 'processGrid.temporaryOffer.open'));
PaymentStatus.set('class', 'processing-status');
PaymentStatus.set('html', '---');
break;
}
const PaymentStatus = new Element('span', {
'class': 'payment-status payment-status-' + entry.paid_status,
html: QUILocale.get('quiqqer/erp', 'payment.status.' + entry.paid_status)
});
data.push({
type: Type,
status: Status,
paid_status: PaymentStatus,
prefixedNumber: entry.prefixedNumber,
uuid: entry.uuid
......@@ -151,30 +187,8 @@ define('package/quiqqer/erp/bin/backend/controls/process/ProcessGrid', [
},
$click: function(Btn) {
let panel;
const uuid = Btn.getAttribute('uuid');
switch (Btn.getAttribute('entityType')) {
case 'QUI\\ERP\\Order\\Order':
panel = 'package/quiqqer/order/bin/backend/controls/panels/Order';
break;
case 'QUI\\ERP\\Accounting\\Invoice\\Invoice':
panel = 'package/quiqqer/invoice/bin/backend/controls/panels/Invoice';
break;
case 'QUI\\ERP\\Accounting\\Invoice\\InvoiceTemporary':
panel = 'package/quiqqer/invoice/bin/backend/controls/panels/TemporaryInvoice';
break;
case 'QUI\\ERP\\SalesOrders\\SalesOrder':
panel = 'package/quiqqer/salesorders/bin/js/backend/controls/panels/SalesOrder';
break;
default:
console.error('missing', uuid, Btn.getAttribute('entityType'));
return;
}
const panel = ERPEntityUtils.getPanelByEntity(Btn.getAttribute('entityType'));
require(['utils/Panels', panel], (PanelUtils, Panel) => {
PanelUtils.openPanelInTasks(
......
.quiqqer-erp-process-window-header {
background: #f7f7f7;
display: inline-block;
padding: 20px;
width: 100%;
}
.quiqqer-erp-process-window {
display: flex;
flex-direction: column;
}
.quiqqer-erp-process-window-comments {
overflow: auto;
flex-shrink: 0;
flex-grow: 1;
height: 200px;
}
\ No newline at end of file
/**
* @module package/quiqqer/erp/bin/backend/controls/process/ProcessWindow
* @author www.pcsg.de (Henning Leutz)
*/
define('package/quiqqer/erp/bin/backend/controls/process/ProcessWindow', [
'qui/QUI',
'qui/controls/windows/Popup',
'Locale',
'Ajax',
'css!package/quiqqer/erp/bin/backend/controls/process/ProcessWindow.css'
], function(QUI, QUIPopup, QUILocale, QUIAjax) {
'use strict';
const lg = 'quiqqer/erp';
return new Class({
Extends: QUIPopup,
Type: 'package/quiqqer/erp/bin/backend/controls/process/ProcessWindow',
Binds: [
'$onCreate',
'$onOpen'
],
options: {
globalProcessId: false,
hash: false,
buttons: false
},
initialize: function(options) {
this.setAttributes({
icon: 'fa fa-timeline',
title: '',
maxHeight: 900,
maxWidth: 750,
});
this.parent(options);
this.$Comments = null;
this.addEvents({
onCreate: this.$onCreate,
onOpen: this.$onOpen
});
},
$onCreate: function() {
if (!this.getAttribute('globalProcessId') && !this.getAttribute('hash')) {
this.close();
return;
}
this.Loader.show();
this.refresh();
this.getContent().setStyle('padding', 0);
this.getContent().addClass('quiqqer-erp-process-window');
new Element('div', {
'class': 'quiqqer-erp-process-window-header',
html: '<div class="quiqqer-erp-process-window-header-filter">' +
' <input type="text" name="filter" placeholder="Filter (Nachricht, Type, ID) ...">' +
' </div>'
}).inject(this.getContent());
require(['package/quiqqer/erp/bin/backend/controls/Comments'], (Comments) => {
const CommentContainer = new Element('div', {
'class': 'quiqqer-erp-process-window-comments',
styles: {
padding: 20
}
}).inject(this.getContent());
const Filter = this.getContent().getElement('[name="filter"]');
this.$Comments = new Comments().inject(CommentContainer);
Filter.addEvent('keyup', () => {
this.$Comments.filter(Filter.value);
});
this.$onOpen();
});
},
$onOpen: function() {
if (!this.getAttribute('globalProcessId') && !this.getAttribute('hash')) {
this.close();
return;
}
if (!this.$Comments) {
return;
}
this.Loader.show();
QUIAjax.get('package_quiqqer_erp_ajax_process_getProcess', (result) => {
this.setAttributes({
icon: 'fa fa-timeline',
title: QUILocale.get(lg, 'panel.globalProcess.title', {
globalProcessId: result.globalProcessId
})
});
this.refresh();
this.$Comments.clear();
this.$Comments.unserialize(result.history);
this.Loader.hide();
}, {
'package': 'quiqqer/erp',
globalProcessId: this.getAttribute('globalProcessId'),
hash: this.getAttribute('hash'),
});
}
});
});
/**
* Button which opens the window for the process
*/
define('package/quiqqer/erp/bin/backend/controls/process/ProcessWindowButton', [
'qui/QUI',
'qui/controls/buttons/Button',
'package/quiqqer/erp/bin/backend/controls/process/ProcessWindow',
'Locale'
], function(QUI, QUIButton, ProcessWindow, QUILocale) {
'use strict';
const lg = 'quiqqer/erp';
return new Class({
Extends: QUIButton,
Type: 'package/quiqqer/erp/bin/backend/controls/process/ProcessWindowButton',
options: {
globalProcessId: false,
hash: false
},
initialize: function(options) {
this.setAttributes({
styles: {
'border-left-width': 1,
'border-right-width': 1,
'float': 'right',
width: 40
}
});
this.parent(options);
this.setAttributes({
icon: 'fa fa-timeline',
title: QUILocale.get(lg, 'process.button.title')
});
this.addEvents({
click: () => {
new ProcessWindow({
globalProcessId: this.getAttribute('globalProcessId'),
hash: this.getAttribute('hash')
}).open();
}
});
}
});
});