Skip to content
Code-Schnipsel Gruppen Projekte
Commit 8d411c48 erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

feat: invoice#6

Übergeordneter caf5d702
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
Keine zugehörigen Merge Requests gefunden
<?php
/**
* This file contains package_quiqqer_order_ajax_backend_get
*/
use QUI\ERP\Order\Handler;
/**
* Returns an order
*
* @return array
*/
QUI::$Ajax->registerFunction(
'package_quiqqer_order_ajax_backend_getArticleHtml',
function ($orderId) {
return Handler::getInstance()->get($orderId)->getView()->getArticles()->render();
},
['orderId'],
'Permission::checkAdminUser'
);
......@@ -62,6 +62,23 @@ define('package/quiqqer/order/bin/backend/classes/Orders', [
});
},
/**
* Return the article html from an specific order
*
* @param {Number} orderId
* @return {Promise}
*/
getArticleHtml: function (orderId) {
return new Promise(function (resolve, reject) {
QUIAjax.get('package_quiqqer_order_ajax_backend_getArticleHtml', resolve, {
'package': 'quiqqer/order',
orderId : orderId,
onError : reject,
showError: false
});
});
},
/**
* Return the combined history of the order
* - history, transaction, comments
......
......@@ -47,87 +47,116 @@
font-family: monospace, monospace;
}
/** Invoice details
/** Order details
================================================= */
.orders-order-details,
.orders-order-details-header,
.orders-order-details-article,
.orders-order-details-calculation {
.orders-order-details {
float: left;
margin-bottom: 10px;
max-width: 800px;
width: 100%;
}
.orders-order-details-header-pos,
.orders-order-details-header-articleNo,
.orders-order-details-header-description,
.orders-order-details-header-quantity,
.orders-order-details-header-netto,
.orders-order-details-header-brutto {
border-bottom: 1px solid #dedede;
margin-bottom: 5px !important;
}
.orders-order-details-header-pos,
.orders-order-details-header-articleNo,
.orders-order-details-header-description,
.orders-order-details-header-quantity,
.orders-order-details-header-netto,
.orders-order-details-header-brutto,
.orders-order-details-article-pos,
.orders-order-details-article-articleNo,
.orders-order-details-article-description,
.orders-order-details-article-quantity,
.orders-order-details-article-netto,
.orders-order-details-article-brutto {
float: left;
padding: 0 5px 5px 5px;
}
.orders-order-details-article {
padding: 0 0 5px;
}
.orders-order-details-header-pos,
.orders-order-details-article-pos {
width: 20px;
}
.orders-order-details-header-articleNo,
.orders-order-details-article-articleNo {
width: 100px;
.orders-order-details h1 {
display: none;
}
.orders-order-details-header-description,
.orders-order-details-article-description {
width: 300px;
.orders-order-details .articles-article {
margin-top: 0;
}
.orders-order-details-article-description .description {
clear: both;
display: block;
.orders-order-details .articles-article-header th {
background: #dedede;
line-height: normal;
}
.orders-order-details-header-quantity,
.orders-order-details-article-quantity {
text-align: right;
width: 100px;
.orders-order-details td {
background: #fefefe;
border-right: 0 !important;
}
.orders-order-details-header-netto,
.orders-order-details-article-netto,
.orders-order-details-header-brutto,
.orders-order-details-article-brutto {
.orders-order-details .articles-sum td {
text-align: right;
width: 160px;
}
.orders-order-details-calculation {
border-top: 1px solid #DEDEDE;
padding: 5px 0;
}
.orders-order-details-calculation-container {
text-align: right;
width: 840px;
}
/*.orders-order-details,*/
/*.orders-order-details-header,*/
/*.orders-order-details-article,*/
/*.orders-order-details-calculation {*/
/*float: left;*/
/*width: 100%;*/
/*}*/
/*.orders-order-details-header-pos,*/
/*.orders-order-details-header-articleNo,*/
/*.orders-order-details-header-description,*/
/*.orders-order-details-header-quantity,*/
/*.orders-order-details-header-netto,*/
/*.orders-order-details-header-brutto {*/
/*border-bottom: 1px solid #dedede;*/
/*margin-bottom: 5px !important;*/
/*}*/
/*.orders-order-details-header-pos,*/
/*.orders-order-details-header-articleNo,*/
/*.orders-order-details-header-description,*/
/*.orders-order-details-header-quantity,*/
/*.orders-order-details-header-netto,*/
/*.orders-order-details-header-brutto,*/
/*.orders-order-details-article-pos,*/
/*.orders-order-details-article-articleNo,*/
/*.orders-order-details-article-description,*/
/*.orders-order-details-article-quantity,*/
/*.orders-order-details-article-netto,*/
/*.orders-order-details-article-brutto {*/
/*float: left;*/
/*padding: 0 5px 5px 5px;*/
/*}*/
/*.orders-order-details-article {*/
/*padding: 0 0 5px;*/
/*}*/
/*.orders-order-details-header-pos,*/
/*.orders-order-details-article-pos {*/
/*width: 20px;*/
/*}*/
/*.orders-order-details-header-articleNo,*/
/*.orders-order-details-article-articleNo {*/
/*width: 100px;*/
/*}*/
/*.orders-order-details-header-description,*/
/*.orders-order-details-article-description {*/
/*width: 300px;*/
/*}*/
/*.orders-order-details-article-description .description {*/
/*clear: both;*/
/*display: block;*/
/*}*/
/*.orders-order-details-header-quantity,*/
/*.orders-order-details-article-quantity {*/
/*text-align: right;*/
/*width: 100px;*/
/*}*/
/*.orders-order-details-header-netto,*/
/*.orders-order-details-article-netto,*/
/*.orders-order-details-header-brutto,*/
/*.orders-order-details-article-brutto {*/
/*text-align: right;*/
/*width: 160px;*/
/*}*/
/*.orders-order-details-calculation {*/
/*border-top: 1px solid #DEDEDE;*/
/*padding: 5px 0;*/
/*}*/
/*.orders-order-details-calculation-container {*/
/*text-align: right;*/
/*width: 840px;*/
/*}*/
......@@ -725,30 +725,13 @@ define('package/quiqqer/order/bin/backend/controls/panels/Orders', [
ParentNode.setStyle('padding', 10);
ParentNode.set('html', '<div class="fa fa-spinner fa-spin"></div>');
Orders.get(this.$Grid.getDataByRow(row).id).then(function (result) {
var articles = [];
Orders.getArticleHtml(this.$Grid.getDataByRow(row).id).then(function (result) {
ParentNode.set('html', '');
if ("articles" in result) {
articles = result.articles;
}
var list = articles.articles;
for (var i = 0, len = list.length; i < len; i++) {
list[i].position = i + 1;
list[i].articleNo = list[i].articleNo || '---';
}
ParentNode.set('html', Mustache.render(templateOrderDetails, {
articles : list,
calculations : articles.calculations,
textPosition : '#',
textArticleNo : QUILocale.get(lg, 'order.products.articleNo'),
textDescription: QUILocale.get(lg, 'order.products.description'),
textQuantity : QUILocale.get(lg, 'order.products.quantity'),
textUnitPrice : QUILocale.get(lg, 'order.products.unitPrice'),
textTotalPrice : QUILocale.get(lg, 'order.products.price')
}));
new Element('div', {
'class': 'orders-order-details',
html : result
}).inject(ParentNode);
});
},
......
0% Lade oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren