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

Merge branch 'next' into 'master'

Next

See merge request !30
Übergeordnete 12dd54d7 89438b16
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
2 Merge Requests!140Update 'next-4.x' with latest changes from 'main',!30Next
Pipeline-Nr. 4828 bestanden
......@@ -10,13 +10,14 @@
* @param string|int|float $value
* @return int
*/
QUI::$Ajax->registerFunction(
'package_quiqqer_erp_ajax_frontend_showB2BB2CWindow',
function () {
$User = QUI::getUserBySession();
$Package = QUI::getPackage('quiqqer/erp');
// user dont get the window
// user don't get the window
if (!($User instanceof QUI\Users\Nobody)) {
return false;
}
......
......@@ -20,6 +20,11 @@
width: 100%;
}
.quiqqer-erp-backend-erpItems-container-switch--warning {
background: #fcebea;
color: #cc1f1a;
}
.quiqqer-erp-backend-erpItems-container-switch-btn {
display: inline-block;
float: left;
......
......@@ -943,12 +943,56 @@ define('package/quiqqer/erp/bin/backend/controls/articles/ArticleList', [
*/
$refreshNettoBruttoDisplay: function() {
const SwitchDesc = this.$Elm.getElement('.quiqqer-erp-backend-erpItems-container-switch-desc');
const Container = this.$Elm.getElement('.quiqqer-erp-backend-erpItems-container-switch');
Container.removeClass('quiqqer-erp-backend-erpItems-container-switch--warning');
Container.getElements('.netto-warning').destroy();
if (this.getAttribute('nettoinput')) {
SwitchDesc.set('html', QUILocale.get(lg, 'control.articleList.netto.message'));
this.$Switch.setSilentOn();
this.$Elm.addClass('netto-view');
this.$Elm.removeClass('brutto-view');
// hinweis, wenn die grundeinstellung brutto ist
// aber netto angezeigt werden soll, kann dies zu unterschiedlichen anzeigen führen
if (this.$calculations.calculations &&
typeof this.$calculations.calculations.isNetto !== 'undefined' &&
this.$calculations.calculations.isNetto === false
) {
let warning = QUILocale.get(lg, 'control.articleList.brutto.message--nettoWarning');
Container.addClass('quiqqer-erp-backend-erpItems-container-switch--warning');
const Warning = new Element('span', {
html: '<span class="fa fa-warning"></span>',
'class': 'netto-warning',
styles: {
height: 40,
lineHeight: 40,
right: 0,
position: 'absolute',
textAlign: 'center',
top: 0,
width: 40
}
}).inject(Container);
require([
URL_OPT_DIR + 'quiqqer/quiqqer/bin/QUI/lib/tippy/tippy.min.js',
'css!' + URL_OPT_DIR + 'quiqqer/quiqqer/bin/QUI/lib/tippy/tippy.css'
], function(tippy) {
tippy(Warning, {
animateFill: false,
animation: 'shift-away',
allowHTML: true,
content: function() {
return warning.replace(/ +(?= )/g, '').replace('\n', '').trim();
}
});
});
}
} else {
SwitchDesc.set('html', QUILocale.get(lg, 'control.articleList.brutto.message'));
this.$Switch.setSilentOff();
......
......@@ -913,6 +913,18 @@
Attention: The input and display of the prices is currently in <b>brutto</b>.
]]></en>
</locale>
<locale name="control.articleList.brutto.message--nettoWarning" html="true">
<de><![CDATA[
Bitte beachte, dass die aktuelle Liste der Artikel einem Bruttobenutzer zugeordnet ist.
Deine Anzeige hingegen basiert auf Nettoangaben, was zu Abweichungen in den Gesamtbeträgen führen kann.
Berücksichtige bitte, dass ausschließlich die Bruttoanzeige verbindlich ist.
]]></de>
<en><![CDATA[
Please note that the current item list is assigned to a gross user.
Your ad, on the other hand, is based on net data, which may lead to discrepancies in the total amounts.
Please take into account that only the gross display is binding.
]]></en>
</locale>
<locale name="control.window.price.brutto.title">
<de><![CDATA[Brutto Preiseingabe]]></de>
......
......@@ -52,7 +52,7 @@ public function getDisplay($options = []): string
}
$contactPerson = '';
$isCompany = false;
$isCompany = false;
if ($this->User && $this->User->isCompany()) {
$isCompany = $this->User->isCompany();
......@@ -77,14 +77,14 @@ public function getDisplay($options = []): string
}
$salutation = $this->emptyStringCheck($this->getAttribute('salutation'));
$street_no = $this->emptyStringCheck($this->getAttribute('street_no'));
$zip = $this->emptyStringCheck($this->getAttribute('zip'));
$city = $this->emptyStringCheck($this->getAttribute('city'));
$country = $this->emptyStringCheck($this->getAttribute('country'));
$suffix = $this->emptyStringCheck($this->getAttribute('suffix'));
$street_no = $this->emptyStringCheck($this->getAttribute('street_no'));
$zip = $this->emptyStringCheck($this->getAttribute('zip'));
$city = $this->emptyStringCheck($this->getAttribute('city'));
$country = $this->emptyStringCheck($this->getAttribute('country'));
$suffix = $this->emptyStringCheck($this->getAttribute('suffix'));
$firstname = $this->getAttribute('firstname');
$lastname = $this->getAttribute('lastname');
$lastname = $this->getAttribute('lastname');
if (empty($firstname) && $this->User) {
$firstname = $this->User->getAttribute('firstname');
......@@ -96,26 +96,30 @@ public function getDisplay($options = []): string
$Engine->assign([
'User' => $this->User,
'Address' => $this,
'User' => $this->User,
'Address' => $this,
'Countries' => new QUI\Countries\Manager(),
'options' => $options,
'isCompany' => $isCompany,
'salutation' => $salutation,
'firstname' => $this->emptyStringCheck($firstname),
'lastname' => $this->emptyStringCheck($lastname),
'street_no' => $street_no,
'zip' => $zip,
'city' => $city,
'country' => $country,
'options' => $options,
'isCompany' => $isCompany,
'salutation' => $salutation,
'firstname' => $this->emptyStringCheck($firstname),
'lastname' => $this->emptyStringCheck($lastname),
'street_no' => $street_no,
'zip' => $zip,
'city' => $city,
'country' => $country,
'contactPerson' => $this->emptyStringCheck($contactPerson),
'suffix' => $suffix
'suffix' => $suffix
]);
return $Engine->fetch(dirname(__FILE__) . '/Address.html');
}
public function save($PermissionUser = null)
{
}
/**
* @param $value
* @return string
......
......@@ -15,6 +15,7 @@
use function array_flip;
use function class_exists;
use function dirname;
use function explode;
use function is_array;
use function is_string;
use function json_decode;
......@@ -39,9 +40,19 @@ public static function onAdminLoadFooter()
*/
public static function onTemplateGetHeader(QUI\Template $Template)
{
$Template->extendHeaderWithJavaScriptFile(
URL_OPT_DIR . 'quiqqer/erp/bin/frontend.js'
);
try {
$Package = QUI::getPackage('quiqqer/erp');
$areas = $Package->getConfig()->get('general', 'customerRequestWindow');
$areas = explode(',', $areas);
} catch (\QUI\Exception $exception) {
return;
}
if (!empty($areas)) {
$Template->extendHeaderWithJavaScriptFile(
URL_OPT_DIR . 'quiqqer/erp/bin/frontend.js'
);
}
}
/**
......
......@@ -194,7 +194,10 @@ public static function convertUserToErpUser(QUI\Interfaces\Users\User $User)
if (!QUI::getUsers()->isNobodyUser($User) && !QUI::getUsers()->isSystemUser($User)) {
/* @var $Address QUI\Users\Address */
$Address = $User->getStandardAddress();
$address = $Address->getAttributes();
if ($Address) {
$address = $Address->getAttributes();
}
}
$data = $User->getAttributes();
......
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