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
Keine zugehörigen Branchen gefunden
Tags 3.7.5
2 Merge Requests!140Update 'next-4.x' with latest changes from 'main',!136fix: output printing - with entity plugin param
Pipeline-Nr. 10600 mit Warnungen bestanden
...@@ -13,13 +13,17 @@ ...@@ -13,13 +13,17 @@
QUI::$Ajax->registerFunction( QUI::$Ajax->registerFunction(
'package_quiqqer_erp_ajax_output_getEntityData', 'package_quiqqer_erp_ajax_output_getEntityData',
function ($entityId, $entityType) { function ($entityId, $entityType, $entityPlugin) {
$OutputProvider = ERPOutput::getOutputProviderByEntityType(Orthos::clear($entityType)); $OutputProvider = ERPOutput::getOutputProviderByEntityType(Orthos::clear($entityType));
if (empty($OutputProvider)) { if (empty($OutputProvider)) {
return false; return false;
} }
if (empty($entityPlugin)) {
$entityPlugin = false;
}
$hideSystemDefaultTemplate = false; $hideSystemDefaultTemplate = false;
try { try {
...@@ -38,7 +42,7 @@ function ($entityId, $entityType) { ...@@ -38,7 +42,7 @@ function ($entityId, $entityType) {
} }
$Processes = new QUI\ERP\Processes(); $Processes = new QUI\ERP\Processes();
$Entity = $Processes->getEntity($entityId); $Entity = $Processes->getEntity($entityId, $entityPlugin);
return [ return [
'email' => $OutputProvider::getEmailAddress(Orthos::clear($entityId)), 'email' => $OutputProvider::getEmailAddress(Orthos::clear($entityId)),
...@@ -47,6 +51,6 @@ function ($entityId, $entityType) { ...@@ -47,6 +51,6 @@ function ($entityId, $entityType) {
'prefixedNumber' => $Entity->getPrefixedNumber() 'prefixedNumber' => $Entity->getPrefixedNumber()
]; ];
}, },
['entityId', 'entityType'], ['entityId', 'entityType', 'entityPlugin'],
'Permission::checkAdminUser' 'Permission::checkAdminUser'
); );
...@@ -48,6 +48,7 @@ define('package/quiqqer/erp/bin/backend/controls/OutputDialog', [ ...@@ -48,6 +48,7 @@ define('package/quiqqer/erp/bin/backend/controls/OutputDialog', [
options: { options: {
entityId: false, // Clean entity ID WITHOUT prefix and suffix entityId: false, // Clean entity ID WITHOUT prefix and suffix
entityType: false, // Entity type (e.g. "Invoice") 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] 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', [ ...@@ -161,6 +162,7 @@ define('package/quiqqer/erp/bin/backend/controls/OutputDialog', [
new OutputMailEditor({ new OutputMailEditor({
entityId: self.getAttribute('entityId'), entityId: self.getAttribute('entityId'),
entityType: self.getAttribute('entityType'), entityType: self.getAttribute('entityType'),
entityPlugin: self.getAttribute('entityPlugin'),
mailSubject: self.$Mail.subject, mailSubject: self.$Mail.subject,
mailContent: self.$Mail.content, mailContent: self.$Mail.content,
...@@ -453,6 +455,7 @@ define('package/quiqqer/erp/bin/backend/controls/OutputDialog', [ ...@@ -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({ src: URL_OPT_DIR + 'quiqqer/erp/bin/output/backend/print.php?' + Object.toQueryString({
id: entityId, id: entityId,
t: self.getAttribute('entityType'), t: self.getAttribute('entityType'),
ep: self.getAttribute('entityPlugin'),
oid: self.getId(), oid: self.getId(),
tpl: self.$Template.id, tpl: self.$Template.id,
tplpr: self.$Template.provider tplpr: self.$Template.provider
...@@ -510,6 +513,7 @@ define('package/quiqqer/erp/bin/backend/controls/OutputDialog', [ ...@@ -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({ src: URL_OPT_DIR + 'quiqqer/erp/bin/output/backend/download.php?' + Object.toQueryString({
id: entityId, id: entityId,
t: self.getAttribute('entityType'), t: self.getAttribute('entityType'),
ep: self.getAttribute('entityPlugin'),
oid: self.getId(), oid: self.getId(),
tpl: self.$Template.id, tpl: self.$Template.id,
tplpr: self.$Template.provider tplpr: self.$Template.provider
...@@ -629,6 +633,7 @@ define('package/quiqqer/erp/bin/backend/controls/OutputDialog', [ ...@@ -629,6 +633,7 @@ define('package/quiqqer/erp/bin/backend/controls/OutputDialog', [
'package': 'quiqqer/erp', 'package': 'quiqqer/erp',
entityId: self.getAttribute('entityId'), entityId: self.getAttribute('entityId'),
entityType: self.getAttribute('entityType'), entityType: self.getAttribute('entityType'),
entityPlugin: self.getAttribute('entityPlugin'),
onError: reject onError: reject
}); });
}); });
...@@ -646,6 +651,7 @@ define('package/quiqqer/erp/bin/backend/controls/OutputDialog', [ ...@@ -646,6 +651,7 @@ define('package/quiqqer/erp/bin/backend/controls/OutputDialog', [
QUIAjax.get('package_quiqqer_erp_ajax_output_getTemplates', resolve, { QUIAjax.get('package_quiqqer_erp_ajax_output_getTemplates', resolve, {
'package': 'quiqqer/erp', 'package': 'quiqqer/erp',
entityType: self.getAttribute('entityType'), entityType: self.getAttribute('entityType'),
entityPlugin: self.getAttribute('entityPlugin'),
onError: reject onError: reject
}); });
}); });
...@@ -664,7 +670,8 @@ define('package/quiqqer/erp/bin/backend/controls/OutputDialog', [ ...@@ -664,7 +670,8 @@ define('package/quiqqer/erp/bin/backend/controls/OutputDialog', [
'package': 'quiqqer/erp', 'package': 'quiqqer/erp',
entity: JSON.encode({ entity: JSON.encode({
id: self.getAttribute('entityId'), id: self.getAttribute('entityId'),
type: self.getAttribute('entityType') type: self.getAttribute('entityType'),
plugin: self.getAttribute('entityPlugin')
}), }),
template: JSON.encode(self.$Template), template: JSON.encode(self.$Template),
onError: reject onError: reject
...@@ -686,6 +693,7 @@ define('package/quiqqer/erp/bin/backend/controls/OutputDialog', [ ...@@ -686,6 +693,7 @@ define('package/quiqqer/erp/bin/backend/controls/OutputDialog', [
'package': 'quiqqer/erp', 'package': 'quiqqer/erp',
entityId: self.getAttribute('entityId'), entityId: self.getAttribute('entityId'),
entityType: self.getAttribute('entityType'), entityType: self.getAttribute('entityType'),
entityPlugin: self.getAttribute('entityPlugin'),
template: self.$Template.id, template: self.$Template.id,
templateProvider: self.$Template.provider, templateProvider: self.$Template.provider,
mailSubject: self.$Mail.subject, mailSubject: self.$Mail.subject,
......
...@@ -66,7 +66,7 @@ public function getEntity($entityHash, $entityPlugin = false): ErpEntityInterfac ...@@ -66,7 +66,7 @@ public function getEntity($entityHash, $entityPlugin = false): ErpEntityInterfac
if ( if (
($entityPlugin === false || $entityPlugin === 'quiqqer/invoice') ($entityPlugin === false || $entityPlugin === 'quiqqer/invoice')
&& class_exists('QUI\ERP\Accounting\Invoice\Handle') && class_exists('QUI\ERP\Accounting\Invoice\Handler')
) { ) {
try { try {
return QUI\ERP\Accounting\Invoice\Handler::getInstance()->getInvoiceByHash($entityHash); return QUI\ERP\Accounting\Invoice\Handler::getInstance()->getInvoiceByHash($entityHash);
......
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