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

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

fix: contact email saving

See merge request !69
Übergeordnete a1e455dd 085a2d4e
Keine zugehörigen Branchen gefunden
Tags 2.1.8
2 Merge Requests!80Update 'next-3.x' with latest changes from 'main',!69fix: contact email saving
Pipeline-Nr. 9153 mit Warnungen bestanden
......@@ -460,6 +460,10 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/TemporaryInvoice', [
self.setAttribute('contactEmail', Customer.contactEmail);
self.setAttribute('invoice_address', Data.getAddress());
if (Customer['quiqqer.erp.standard.payment'] !== '') {
self.getContent().getElement('[name="payment_method"]').value = Customer['quiqqer.erp.standard.payment'];
}
// reset deliver address
if (self.$AddressDelivery) {
self.$AddressDelivery.setAttribute('userId', userId);
......@@ -472,6 +476,10 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/TemporaryInvoice', [
let paymentTime = result[0];
let isNetto = result[1];
if (Customer['quiqqer.erp.customer.payment.term']) {
paymentTime = Customer['quiqqer.erp.customer.payment.term'];
}
Content.getElement('[name="time_for_payment"]').value = paymentTime;
self.setAttribute('isbrutto', !isNetto);
......@@ -556,14 +564,18 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/TemporaryInvoice', [
address.userId = self.getAttribute('customer_id');
address.addressId = self.getAttribute('invoice_address_id');
address.contactPerson = self.getAttribute('contact_person') ? self.getAttribute('contact_person') : '';
address.contactEmail = self.getAttribute('contactEmail') ? self.getAttribute('contactEmail') : '';
if (self.getAttribute('contactEmail')) {
address.contactEmail = self.getAttribute('contactEmail');
}
return Data.setValue(address).then(() => {
if (self.getAttribute('contactEmail')) {
Data.setAttribute('contactEmail', self.getAttribute('contactEmail'));
}
if (self.getAttribute('contact_person')) {
Data.setAttribute('contact_person', self.getAttribute('contact_person'));
}
return Data.setValue(address);
Data.refresh();
});
}).then(function() {
// invoice address
const dataQUIID = self.getContent().getElement(
......@@ -628,6 +640,22 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/TemporaryInvoice', [
let i, len, title;
let current = QUILocale.getCurrent();
// payment sort
payments.sort((a, b) => {
let titleA = a.title[current] ? a.title[current].toLowerCase() : '';
let titleB = b.title[current] ? b.title[current].toLowerCase() : '';
if (titleA < titleB) {
return -1;
}
if (titleA > titleB) {
return 1;
}
return 0;
});
for (i = 0, len = payments.length; i < len; i++) {
title = payments[i].title;
......
......@@ -255,14 +255,18 @@ public function __construct($id, Handler $Handler)
// consider contact person in address
if (
!empty($this->getAttribute('invoice_address')) &&
!empty($this->getAttribute('contact_person'))
) {
if (!empty($this->getAttribute('invoice_address'))) {
$invoiceAddress = $this->getAttribute('invoice_address');
$invoiceAddress = json_decode($invoiceAddress, true);
$invoiceAddress['contactPerson'] = $this->getAttribute('contact_person');
if (!empty($this->getAttribute('contact_person'))) {
$invoiceAddress['contactPerson'] = $this->getAttribute('contact_person');
}
if (!empty($invoiceAddress['contactEmail'])) {
$this->setAttribute('contactEmail', $invoiceAddress['contactEmail']);
}
$this->setAttribute('invoice_address', json_encode($invoiceAddress));
}
......
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