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/invoice
1 Ergebnis
Änderungen anzeigen
Commits auf Quelle (4)
  • Henning Leutz's avatar
    fix: load user data for editing Invoice and TemporaryInvoice panels · 06a34ad6
    verfasst von Henning Leutz
    - Loaded user lock information to enhance usability in Invoice and TemporaryInvoice panels.
    - Ensured more meaningful user data for lock notification messages.
    - Renamed functions and aligned code for better readability.
    - Refined dependency loading in unlock panel function to increase stability.
    - Added 'Users' dependency for user information retrieval.
    
    Related: pcsg/buero#488
    06a34ad6
  • Henning Leutz's avatar
    refactor: improve invoice download dialog UI/UX · 582b6caa
    verfasst von Henning Leutz
    - Modified 'Dialogs.css' to replace the button-based UI with a dropdown select for invoice download
    options.
    - Refactored the relevant methods in 'Dialogs.js' accordingly, removing button event listeners and
    implementing new logic for select-based UI.
    - Replaced 'QUIPopup' with 'QUIConfirm' to incorporate an 'OK' button for confirmation.
    - Changed hardcoded button options to select options in the DOM structure.
    - Altered event listeners in 'Dialogs.js' to suit the new 'select' element and handle submission of
    invoice download requests differently.
    - Preserved the behavior of injecting an iframe for actual downloads, with necessary changes in
    parameters and references now pointing to the select value instead of button value.
    
    Related: quiqqer/invoice#157
    582b6caa
  • Henning Leutz's avatar
    fix: delay increase and element destruction in Dialogs.js · 9c93a365
    verfasst von Henning Leutz
    The commit uncomments the element destruction line and increases the delay from 1 second to 10
    seconds in the Dialogs.js file. This is expected to improve the user-interface responsiveness and
    reduce potential crashes.
    9c93a365
  • Henning Leutz's avatar
    Merge branch 'next-2.x' into 'main' · ec17bd3c
    verfasst von Henning Leutz
    fix: load user data for editing Invoice and TemporaryInvoice panels
    
    See merge request !90
    ec17bd3c
......@@ -18,11 +18,12 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
'Locale',
'Ajax',
'Mustache',
'Users',
'css!package/quiqqer/invoice/bin/backend/controls/panels/Invoice.css'
], function(QUI, QUIPanel, QUIButton, QUIConfirm, Invoices, Comments,
CustomerFileSelect, Sandbox, Locker, QUILocale, QUIAjax, Mustache
], function (QUI, QUIPanel, QUIButton, QUIConfirm, Invoices, Comments,
CustomerFileSelect, Sandbox, Locker, QUILocale, QUIAjax, Mustache, Users
) {
'use strict';
......@@ -59,7 +60,7 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
uuid: false
},
initialize: function(options) {
initialize: function (options) {
this.setAttributes({
icon: 'fa fa-file-text-o'
});
......@@ -88,7 +89,7 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
*
* @return {string}
*/
$getLockKey: function() {
$getLockKey: function () {
return 'lock-invoice-' + this.getAttribute('hash');
},
......@@ -96,20 +97,20 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
* Return the lock group
* @return {string}
*/
$getLockGroups: function() {
$getLockGroups: function () {
return 'quiqqer/invoice';
},
/**
* Refresh the invoice data
*/
doRefresh: function() {
doRefresh: function () {
const self = this;
return Promise.all([
Invoices.get(this.getAttribute('hash')),
Invoices.hasRefund(this.getAttribute('hash'))
]).then(function(response) {
]).then(function (response) {
const data = response[0],
hasRefund = response[1];
......@@ -139,7 +140,7 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
/**
* event: on create
*/
$onCreate: function() {
$onCreate: function () {
require([
'package/quiqqer/erp/bin/backend/controls/process/ProcessWindowButton'
], (ProcessWindowButton) => {
......@@ -349,7 +350,7 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
/**
* event: on inject
*/
$onInject: function() {
$onInject: function () {
const self = this;
this.Loader.show();
......@@ -357,7 +358,7 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
Locker.isLocked(
this.$getLockKey(),
this.$getLockGroups()
).then(function(isLocked) {
).then(function (isLocked) {
if (isLocked) {
self.$locked = isLocked;
self.lockPanel();
......@@ -368,14 +369,14 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
self.$getLockKey(),
self.$getLockGroups()
);
}).then(function() {
}).then(function () {
return self.doRefresh();
}).then(function() {
}).then(function () {
self.openPreview();
}).catch(function(e) {
}).catch(function (e) {
console.error(e);
QUI.getMessageHandler().then(function(MH) {
QUI.getMessageHandler().then(function (MH) {
MH.addError(e.getMessage());
});
......@@ -386,7 +387,7 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
/**
* event: on destroy
*/
$onDestroy: function() {
$onDestroy: function () {
Locker.unlock(
this.$getLockKey(),
this.$getLockGroups()
......@@ -396,7 +397,7 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
/**
* lock the complete panel
*/
lockPanel: function() {
lockPanel: function () {
this.getButtons('actions').disable();
this.getButtons('lock').show();
},
......@@ -406,7 +407,7 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
*
* @return {Promise<T>}
*/
unlockPanel: function() {
unlockPanel: function () {
const self = this;
this.Loader.show();
......@@ -414,12 +415,12 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
return Locker.unlock(
this.$getLockKey(),
this.$getLockGroups()
).then(function() {
).then(function () {
return Locker.isLocked(
self.$getLockKey(),
self.$getLockGroups()
);
}).then(function(isLocked) {
}).then(function (isLocked) {
if (isLocked) {
return;
}
......@@ -434,7 +435,7 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
);
return self.refresh();
}).then(function() {
}).then(function () {
return self.openInfo();
});
},
......@@ -442,7 +443,7 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
/**
* show the lock message window
*/
$showLockMessage: function() {
$showLockMessage: function () {
const self = this;
let btnText = QUILocale.get('quiqqer/core', 'submit');
......@@ -450,34 +451,39 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
btnText = QUILocale.get(lg, 'button.unlock.invoice.is.locked');
}
new QUIConfirm({
title: QUILocale.get(lg, 'window.unlock.invoice.title'),
icon: 'fa fa-warning',
texticon: 'fa fa-warning',
text: QUILocale.get(lg, 'window.unlock.invoice.text', this.$locked),
information: QUILocale.get(lg, 'message.invoice.is.locked', this.$locked),
autoclose: false,
maxHeight: 400,
maxWidth: 600,
ok_button: {
text: btnText
},
this.Loader.show();
events: {
onSubmit: function(Win) {
if (!window.USER.isSU) {
Win.close();
return;
}
Users.get(this.$locked).loadIfNotLoaded().then((user) => {
new QUIConfirm({
title: QUILocale.get(lg, 'window.unlock.invoice.title'),
icon: 'fa fa-warning',
texticon: 'fa fa-warning',
text: QUILocale.get(lg, 'window.unlock.invoice.text', user.getAttributes()),
information: QUILocale.get(lg, 'message.invoice.is.locked', user.getAttributes()),
autoclose: false,
maxHeight: 400,
maxWidth: 600,
ok_button: {
text: btnText
},
events: {
onSubmit: function (Win) {
if (!window.USER.isSU) {
Win.close();
return;
}
Win.Loader.show();
Win.Loader.show();
self.unlockPanel().then(function() {
Win.close();
});
self.unlockPanel().then(function () {
Win.close();
});
}
}
}
}).open();
}).open();
this.Loader.hide();
});
},
/**
......@@ -485,7 +491,7 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
*
* @return {Promise}
*/
print: function() {
print: function () {
const self = this,
Data = self.getAttribute('data');
......@@ -504,10 +510,10 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
entityType = 'Invoice';
}
return new Promise(function(resolve) {
return new Promise(function (resolve) {
require([
'package/quiqqer/invoice/bin/backend/utils/Dialogs'
], function(Dialogs) {
], function (Dialogs) {
Dialogs.openPrintDialog(Data.hash, entityType).then(resolve);
});
});
......@@ -518,7 +524,7 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
*
* @return {Promise}
*/
copy: function() {
copy: function () {
return new Promise((resolve) => {
require([
'package/quiqqer/erp/bin/backend/controls/dialogs/CopyErpEntityDialog'
......@@ -539,22 +545,22 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
*
* @return {Promise}
*/
creditNote: function() {
creditNote: function () {
const self = this;
return new Promise(function(resolve) {
return new Promise(function (resolve) {
require([
'package/quiqqer/invoice/bin/backend/utils/Dialogs'
], function(Dialogs) {
Dialogs.openCreateCreditNoteDialog(self.getAttribute('data').hash).then(function(invoiceId) {
], function (Dialogs) {
Dialogs.openCreateCreditNoteDialog(self.getAttribute('data').hash).then(function (invoiceId) {
if (!invoiceId) {
return;
}
return new Promise(function(res) {
return new Promise(function (res) {
require([
'package/quiqqer/invoice/bin/backend/utils/Panels'
], function(PanelUtils) {
], function (PanelUtils) {
PanelUtils.openTemporaryInvoice(invoiceId).then(res);
});
});
......@@ -563,9 +569,8 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
});
},
download: function()
{
require(['package/quiqqer/invoice/bin/backend/utils/Dialogs'], (Dialogs)=> {
download: function () {
require(['package/quiqqer/invoice/bin/backend/utils/Dialogs'], (Dialogs) => {
Dialogs.openDownloadDialog(this.getAttribute('data').hash);
});
},
......@@ -575,21 +580,21 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
*
* @return {Promise}
*/
storno: function() {
storno: function () {
const self = this;
return new Promise(function(resolve, reject) {
return new Promise(function (resolve, reject) {
require([
'package/quiqqer/invoice/bin/backend/utils/Dialogs'
], function(Dialogs) {
Dialogs.openStornoDialog(self.getAttribute('data').hash).then(function() {
], function (Dialogs) {
Dialogs.openStornoDialog(self.getAttribute('data').hash).then(function () {
return self.refresh();
}).then(function() {
}).then(function () {
resolve();
}).catch(function(Error) {
}).catch(function (Error) {
reject(Error);
QUI.getMessageHandler().then(function(MH) {
QUI.getMessageHandler().then(function (MH) {
MH.addError(Error.getMessage());
});
});
......@@ -602,17 +607,17 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
/**
* Open the information
*/
openInfo: function() {
openInfo: function () {
const self = this;
this.Loader.show();
this.getCategory('info').setActive();
return this.$closeCategory().then(function(Container) {
return new Promise(function(resolve) {
return this.$closeCategory().then(function (Container) {
return new Promise(function (resolve) {
require([
'text!package/quiqqer/invoice/bin/backend/controls/panels/Invoice.Data.html'
], function(template) {
], function (template) {
let data = self.getAttribute('data');
if (typeOf(data) !== 'object') {
......@@ -717,14 +722,14 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
Form.elements.processing_status.value = data.processing_status;
}
QUI.parse(Container).then(function() {
QUI.parse(Container).then(function () {
const Processing = QUI.Controls.getById(
Container.getElement('[name="processing_status"]').get('data-quiid')
);
Processing.addEvent('onChange', function() {
Processing.addEvent('onChange', function () {
self.Loader.show();
self.setProcessingStatus(Processing.getValue()).then(function() {
self.setProcessingStatus(Processing.getValue()).then(function () {
self.Loader.hide();
self.showSavedIconAnimation();
});
......@@ -734,9 +739,9 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
});
});
});
}).then(function() {
}).then(function () {
return self.$openCategory();
}).then(function() {
}).then(function () {
self.Loader.hide();
});
},
......@@ -745,7 +750,7 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
* open articles
* @deprecated
*/
openArticles: function() {
openArticles: function () {
return;
const self = this;
......@@ -756,10 +761,10 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
this.$closeCategory(),
Invoices.getInvoicePreview(self.getAttribute('data').hash, true)
//Invoices.getArticlesHtml(self.getAttribute('data').id)
]).then(function(result) {
]).then(function (result) {
const Container = result[0];
return new Promise(function(resolve) {
return new Promise(function (resolve) {
Container.set('html', '');
Container.setStyle('padding', 0);
......@@ -775,18 +780,18 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
width: '100%'
},
events: {
onLoad: function(Box) {
onLoad: function (Box) {
Box.getElm().addClass('quiqqer-invoice-backend-invoice-preview');
resolve();
}
}
}).inject(Pager);
});
}).then(function() {
}).then(function () {
return self.$openCategory();
}).then(function() {
}).then(function () {
self.Loader.hide();
}).catch(function(err) {
}).catch(function (err) {
console.error(err.getMessage());
console.error(err);
self.Loader.hide();
......@@ -796,17 +801,17 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
/**
* Open payments list
*/
openPayments: function() {
openPayments: function () {
const self = this;
this.Loader.show();
this.getCategory('payments').setActive();
return this.$closeCategory().then(function(Container) {
return new Promise(function(resolve) {
return this.$closeCategory().then(function (Container) {
return new Promise(function (resolve) {
require([
'package/quiqqer/payment-transactions/bin/backend/controls/IncomingPayments/TransactionList'
], function(TransactionList) {
], function (TransactionList) {
new TransactionList({
Panel: self,
hash: self.getAttribute('data').hash,
......@@ -818,7 +823,7 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
Invoices.linkTransaction(
self.getAttribute('data').hash,
txId
).then(function() {
).then(function () {
Control.refresh();
});
}
......@@ -826,9 +831,9 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
}).inject(Container);
});
});
}).then(function() {
}).then(function () {
return self.$openCategory();
}).then(function() {
}).then(function () {
self.Loader.hide();
});
},
......@@ -838,24 +843,24 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
*
* @return {Promise}
*/
openHistory: function() {
openHistory: function () {
const self = this;
this.Loader.show();
this.getCategory('history').setActive();
return this.$closeCategory().then(function(Container) {
return this.$closeCategory().then(function (Container) {
return Promise.all([
Invoices.getInvoiceHistory(self.getAttribute('data').hash),
Container
]);
}).then(function(result) {
}).then(function (result) {
new Comments({
comments: result[0]
}).inject(result[1]);
}).then(function() {
}).then(function () {
return self.$openCategory();
}).then(function() {
}).then(function () {
self.Loader.hide();
});
},
......@@ -863,17 +868,17 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
/**
* open comments
*/
openComments: function() {
openComments: function () {
const self = this;
this.Loader.show();
this.getCategory('comments').setActive();
return this.$closeCategory().then(function() {
return this.$closeCategory().then(function () {
self.refreshComments();
}).then(function() {
}).then(function () {
return self.$openCategory();
}).then(function() {
}).then(function () {
self.Loader.hide();
});
},
......@@ -883,7 +888,7 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
*
* @returns {Promise}
*/
openInvoiceFiles: function() {
openInvoiceFiles: function () {
this.Loader.show();
this.getCategory('invoiceFiles').setActive();
......@@ -918,7 +923,7 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
/**
* Refresh the comment display
*/
refreshComments: function() {
refreshComments: function () {
const Container = this.getContent().getElement('.container');
Container.set('html', '');
......@@ -943,13 +948,13 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
/**
* open preview
*/
openPreview: function() {
openPreview: function () {
const self = this;
this.Loader.show();
this.getCategory('preview').setActive();
return this.$closeCategory().then(function(Container) {
return this.$closeCategory().then(function (Container) {
const StatusContainer = new Element('div', {
'class': 'quiqqer-invoice-backend-invoice-statusContainer'
}).inject(Container);
......@@ -977,14 +982,14 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
value: data.processing_status
}).inject(StatusContainer);
return QUI.parse(StatusContainer).then(function() {
return QUI.parse(StatusContainer).then(function () {
const Processing = QUI.Controls.getById(
Container.getElement('[name="processing_status"]').get('data-quiid')
);
Processing.addEvent('onChange', function() {
Processing.addEvent('onChange', function () {
self.Loader.show();
self.setProcessingStatus(Processing.getValue()).then(function() {
self.setProcessingStatus(Processing.getValue()).then(function () {
self.Loader.hide();
self.showSavedIconAnimation();
});
......@@ -992,7 +997,7 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
return Container;
});
}).then(function(Container) {
}).then(function (Container) {
const FrameContainer = new Element('div', {
'class': 'quiqqer-invoice-backend-invoice-previewContainer',
styles: {
......@@ -1004,7 +1009,7 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
Container.setStyle('padding', 0);
Container.setStyle('height', '100%');
return Invoices.getInvoicePreview(self.getAttribute('data').hash).then(function(html) {
return Invoices.getInvoicePreview(self.getAttribute('data').hash).then(function (html) {
new Sandbox({
content: html,
styles: {
......@@ -1013,15 +1018,15 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
width: '100%'
},
events: {
onLoad: function(Box) {
onLoad: function (Box) {
Box.getElm().addClass('quiqqer-invoice-backend-invoice-preview');
}
}
}).inject(FrameContainer);
});
}).then(function() {
}).then(function () {
return self.$openCategory();
}).then(function() {
}).then(function () {
self.Loader.hide();
});
},
......@@ -1031,10 +1036,10 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
*
* @returns {Promise}
*/
$openCategory: function() {
$openCategory: function () {
const self = this;
return new Promise(function(resolve) {
return new Promise(function (resolve) {
const Container = self.getContent().getElement('.container');
if (!Container) {
......@@ -1057,10 +1062,10 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
*
* @returns {Promise}
*/
$closeCategory: function() {
$closeCategory: function () {
this.getContent().setStyle('padding', 0);
return new Promise(function(resolve) {
return new Promise(function (resolve) {
let Container = this.getContent().getElement('.container');
if (!Container) {
......@@ -1082,7 +1087,7 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
top: -50
}, {
duration: 200,
callback: function() {
callback: function () {
Container.set('html', '');
Container.setStyle('padding', 20);
......@@ -1099,7 +1104,7 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
/**
* Open the add dialog window
*/
openAddCommentDialog: function() {
openAddCommentDialog: function () {
const self = this;
new QUIConfirm({
......@@ -1108,17 +1113,17 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
maxHeight: 600,
maxWidth: 800,
events: {
onOpen: function(Win) {
onOpen: function (Win) {
Win.getContent().set('html', '');
Win.Loader.show();
require([
'Editors'
], function(Editors) {
Editors.getEditor(null).then(function(Editor) {
], function (Editors) {
Editors.getEditor(null).then(function (Editor) {
Win.$Editor = Editor;
Win.$Editor.addEvent('onLoaded', function() {
Win.$Editor.addEvent('onLoaded', function () {
Win.$Editor.switchToWYSIWYG();
Win.$Editor.showToolbar();
Win.$Editor.setContent(self.getAttribute('content'));
......@@ -1131,12 +1136,12 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
});
},
onSubmit: function(Win) {
onSubmit: function (Win) {
Win.Loader.show();
self.addComment(Win.$Editor.getContent()).then(function() {
self.addComment(Win.$Editor.getContent()).then(function () {
return self.doRefresh();
}).then(function() {
}).then(function () {
Win.$Editor.destroy();
Win.close();
......@@ -1152,7 +1157,7 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
*
* @param {String} message
*/
addComment: function(message) {
addComment: function (message) {
return Invoices.addComment(this.getAttribute('hash'), message);
},
......@@ -1164,12 +1169,12 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
* @param {Number} processingStatus
* @return {Promise}
*/
setProcessingStatus: function(processingStatus) {
setProcessingStatus: function (processingStatus) {
const self = this;
return new Promise(function(resolve) {
require(['Ajax'], function(QUIAjax) {
QUIAjax.post('package_quiqqer_invoice_ajax_invoices_setStatus', function() {
return new Promise(function (resolve) {
require(['Ajax'], function (QUIAjax) {
QUIAjax.post('package_quiqqer_invoice_ajax_invoices_setStatus', function () {
let data = self.getAttribute('data');
if (typeOf(data) !== 'object') {
......@@ -1195,7 +1200,7 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Invoice', [
/**
* @param Category
*/
$openXmlCategory: function(Category) {
$openXmlCategory: function (Category) {
this.Loader.show();
QUIAjax.get('package_quiqqer_invoice_ajax_invoices_panel_getCategory', (html) => {
......
......@@ -1706,34 +1706,39 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/TemporaryInvoice', [
btnText = QUILocale.get(lg, 'button.unlock.invoice.is.locked');
}
new QUIConfirm({
title: QUILocale.get(lg, 'window.unlock.invoice.title'),
icon: 'fa fa-warning',
texticon: 'fa fa-warning',
text: QUILocale.get(lg, 'window.unlock.invoice.text', this.$locked),
information: QUILocale.get(lg, 'message.invoice.is.locked', this.$locked),
autoclose: false,
maxHeight: 400,
maxWidth: 600,
ok_button: {
text: btnText
},
this.Loader.show();
events: {
onSubmit: function(Win) {
if (!window.USER.isSU) {
Win.close();
return;
}
Users.get(this.$locked).loadIfNotLoaded().then((user) => {
new QUIConfirm({
title: QUILocale.get(lg, 'window.unlock.invoice.title'),
icon: 'fa fa-warning',
texticon: 'fa fa-warning',
text: QUILocale.get(lg, 'window.unlock.invoice.text', user.getAttributes()),
information: QUILocale.get(lg, 'message.invoice.is.locked', user.getAttributes()),
autoclose: false,
maxHeight: 400,
maxWidth: 600,
ok_button: {
text: btnText
},
events: {
onSubmit: function(Win) {
if (!window.USER.isSU) {
Win.close();
return;
}
Win.Loader.show();
Win.Loader.show();
self.unlockPanel().then(function() {
Win.close();
});
self.unlockPanel().then(function() {
Win.close();
});
}
}
}
}).open();
}).open();
this.Loader.hide();
});
},
/**
......
......@@ -10,16 +10,7 @@
text-align: center;
}
.quiqqer-invoice-download-dialog-buttons {
display: flex;
width: 100%;
gap: 1rem;
flex-wrap: wrap;
margin-top: 2rem;
justify-content: center;
.quiqqer-invoice-download-dialog-select {
width: 70%;
margin: 2rem auto;
}
.quiqqer-invoice-download-dialog button {
width: 200px;
}
......@@ -354,13 +354,16 @@ define('package/quiqqer/invoice/bin/backend/utils/Dialogs', [
},
openDownloadDialog: function (hash) {
new QUIPopup({
new QUIConfirm({
icon: 'fa fa-download',
title: QUILocale.get(lg, 'dialog.invoice.download.title'),
autoclose: false,
maxHeight: 400,
maxWidth: 600,
buttons: false,
autoclose: false,
ok_button: {
text: QUILocale.get(lg, 'dialog.invoice.download.button'),
textimage: 'fa fa-download'
},
events: {
onOpen: function (Win) {
Win.Loader.show();
......@@ -373,42 +376,41 @@ define('package/quiqqer/invoice/bin/backend/utils/Dialogs', [
'<h3>' + QUILocale.get(lg, 'dialog.invoice.download.header') + '</h3>' +
QUILocale.get(lg, 'dialog.invoice.download.text') +
'<div class="quiqqer-invoice-download-dialog-buttons">' +
' <button value="PDF" class="qui-button">PDF</button>' +
' <button value="PROFILE_BASIC" class="qui-button">ZUGFeRD Basic</button>' +
' <button value="PROFILE_EN16931" class="qui-button">ZUGFeRD EN16931</button>' +
' <button value="PROFILE_EXTENDED" class="qui-button">ZUGFeRD Extended</button>' +
' <button value="PROFILE_XRECHNUNG_2_3" class="qui-button">XRechnung 2.3</button>' +
' <button value="PROFILE_XRECHNUNG_3" class="qui-button">XRechnung 3</button>' +
'</div>'
'<select class="quiqqer-invoice-download-dialog-select">' +
' <option value="PDF">E-Rechnung (ZUGFeRD EN16931 - PDF)</option>' +
' <option value="PROFILE_BASIC">ZUGFeRD Basic (XML)</option>' +
' <option value="PROFILE_EN16931">ZUGFeRD EN16931 (XML)</option>' +
' <option value="PROFILE_EXTENDED">ZUGFeRD Extended (XML)</option>' +
' <option value="PROFILE_XRECHNUNG_2_3">XRechnung 2.3 (XML)</option>' +
' <option value="PROFILE_XRECHNUNG_3">XRechnung 3 (XML)</option>' +
'</select>'
);
Content.querySelectorAll('button').forEach(function (Button) {
Button.addEventListener('click', function () {
const id = 'download-invoice-' + hash + '-' + Button.value;
new Element('iframe', {
src: URL_OPT_DIR + 'quiqqer/invoice/bin/backend/download.php?' + Object.toQueryString({
invoice: hash,
type: Button.value
}),
id: id,
styles: {
position: 'absolute',
top: -200,
left: -200,
width: 50,
height: 50
}
}).inject(document.body);
(function () {
//document.getElements('#' + id).destroy();
}).delay(1000, this);
});
});
Win.Loader.hide();
},
onSubmit: function (Win) {
const Select = Win.getElm().querySelector('select');
const id = 'download-invoice-' + hash + '-' + Select.value;
new Element('iframe', {
src: URL_OPT_DIR + 'quiqqer/invoice/bin/backend/download.php?' + Object.toQueryString({
invoice: hash,
type: Button.value
}),
id: id,
styles: {
position: 'absolute',
top: -200,
left: -200,
width: 50,
height: 50
}
}).inject(document.body);
(function () {
document.getElements('#' + id).destroy();
}).delay(10000, this);
}
}
}).open();
......