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

Merge branch 'next-3.x' into 'main'

fix: output printing - with entity plugin param

See merge request !136
Übergeordnete 99048d5c 260c74a6
No related branches found
Tags 3.7.5
2 Merge Requests!140Update 'next-4.x' with latest changes from 'main',!136fix: output printing - with entity plugin param
Pipeline #10600 mit Warnungen bestanden mit Phasen
in 55 Sekunden
......@@ -13,13 +13,17 @@
QUI::$Ajax->registerFunction(
'package_quiqqer_erp_ajax_output_getEntityData',
function ($entityId, $entityType) {
function ($entityId, $entityType, $entityPlugin) {
$OutputProvider = ERPOutput::getOutputProviderByEntityType(Orthos::clear($entityType));
if (empty($OutputProvider)) {
return false;
}
if (empty($entityPlugin)) {
$entityPlugin = false;
}
$hideSystemDefaultTemplate = false;
try {
......@@ -38,7 +42,7 @@ function ($entityId, $entityType) {
}
$Processes = new QUI\ERP\Processes();
$Entity = $Processes->getEntity($entityId);
$Entity = $Processes->getEntity($entityId, $entityPlugin);
return [
'email' => $OutputProvider::getEmailAddress(Orthos::clear($entityId)),
......@@ -47,6 +51,6 @@ function ($entityId, $entityType) {
'prefixedNumber' => $Entity->getPrefixedNumber()
];
},
['entityId', 'entityType'],
['entityId', 'entityType', 'entityPlugin'],
'Permission::checkAdminUser'
);
......@@ -48,6 +48,7 @@ define('package/quiqqer/erp/bin/backend/controls/OutputDialog', [
options: {
entityId: false, // Clean entity ID WITHOUT prefix and suffix
entityType: false, // Entity type (e.g. "Invoice")
entityPlugin: false,
comments: false, // Comments as array [must be readble by package/quiqqer/erp/bin/backend/controls/Comments]
......@@ -161,6 +162,7 @@ define('package/quiqqer/erp/bin/backend/controls/OutputDialog', [
new OutputMailEditor({
entityId: self.getAttribute('entityId'),
entityType: self.getAttribute('entityType'),
entityPlugin: self.getAttribute('entityPlugin'),
mailSubject: self.$Mail.subject,
mailContent: self.$Mail.content,
......@@ -453,6 +455,7 @@ define('package/quiqqer/erp/bin/backend/controls/OutputDialog', [
src: URL_OPT_DIR + 'quiqqer/erp/bin/output/backend/print.php?' + Object.toQueryString({
id: entityId,
t: self.getAttribute('entityType'),
ep: self.getAttribute('entityPlugin'),
oid: self.getId(),
tpl: self.$Template.id,
tplpr: self.$Template.provider
......@@ -510,6 +513,7 @@ define('package/quiqqer/erp/bin/backend/controls/OutputDialog', [
src: URL_OPT_DIR + 'quiqqer/erp/bin/output/backend/download.php?' + Object.toQueryString({
id: entityId,
t: self.getAttribute('entityType'),
ep: self.getAttribute('entityPlugin'),
oid: self.getId(),
tpl: self.$Template.id,
tplpr: self.$Template.provider
......@@ -629,6 +633,7 @@ define('package/quiqqer/erp/bin/backend/controls/OutputDialog', [
'package': 'quiqqer/erp',
entityId: self.getAttribute('entityId'),
entityType: self.getAttribute('entityType'),
entityPlugin: self.getAttribute('entityPlugin'),
onError: reject
});
});
......@@ -646,6 +651,7 @@ define('package/quiqqer/erp/bin/backend/controls/OutputDialog', [
QUIAjax.get('package_quiqqer_erp_ajax_output_getTemplates', resolve, {
'package': 'quiqqer/erp',
entityType: self.getAttribute('entityType'),
entityPlugin: self.getAttribute('entityPlugin'),
onError: reject
});
});
......@@ -664,7 +670,8 @@ define('package/quiqqer/erp/bin/backend/controls/OutputDialog', [
'package': 'quiqqer/erp',
entity: JSON.encode({
id: self.getAttribute('entityId'),
type: self.getAttribute('entityType')
type: self.getAttribute('entityType'),
plugin: self.getAttribute('entityPlugin')
}),
template: JSON.encode(self.$Template),
onError: reject
......@@ -686,6 +693,7 @@ define('package/quiqqer/erp/bin/backend/controls/OutputDialog', [
'package': 'quiqqer/erp',
entityId: self.getAttribute('entityId'),
entityType: self.getAttribute('entityType'),
entityPlugin: self.getAttribute('entityPlugin'),
template: self.$Template.id,
templateProvider: self.$Template.provider,
mailSubject: self.$Mail.subject,
......
......@@ -66,7 +66,7 @@ public function getEntity($entityHash, $entityPlugin = false): ErpEntityInterfac
if (
($entityPlugin === false || $entityPlugin === 'quiqqer/invoice')
&& class_exists('QUI\ERP\Accounting\Invoice\Handle')
&& class_exists('QUI\ERP\Accounting\Invoice\Handler')
) {
try {
return QUI\ERP\Accounting\Invoice\Handler::getInstance()->getInvoiceByHash($entityHash);
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren