Skip to content
GitLab
Erkunden
Anmelden
Registrieren
Primärnavigation
Suchen oder aufrufen …
Projekt
erp
Verwalten
Aktivität
Mitglieder
Labels
Planen
Tickets
Ticketübersichten
Meilensteine
Wiki
Code
Merge Requests
Repository
Branch
Commits
Tags
Repository-Diagramm
Revisionen vergleichen
Build
Pipelines
Aufgaben
Pipeline-Zeitpläne
Artefakte
Bereitstellung
Releases
Modell-Registry
Betreiben
Umgebungen
Überwachen
Vorfälle
Service-Desk
Analysieren
Wertschöpfungskettenanalyse
Mitwirkenden-Analyse
CI/CD-Analyse
Repository-Analysen
Modellexperimente
Hilfe
Hilfe
Support
GitLab-Dokumentation
GitLab-Pläne vergleichen
Community-Forum
Zu GitLab beitragen
Feedback geben
Tastenkürzel
?
Code-Schnipsel
Gruppen
Projekte
Show more breadcrumbs
QUIQQER
erp
Commits
964d005a
Bestätigt
Commit
964d005a
erstellt
6 months ago
von
Henning Leutz
Dateien durchsuchen
Optionen
Downloads
Patches
Einfaches Diff
fix(Calc): main calc has its own locale
Übergeordneter
0c18d5a1
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
2 Merge Requests
!150
Next 3.x
,
!140
Update 'next-4.x' with latest changes from 'main'
Pipeline-
Nr. 12186
mit Warnungen bestanden
6 months ago
Phase: lint
Änderungen
1
Pipelines
1
Leerzeichenänderungen ausblenden
Inline
Nebeneinander
1 geänderte Datei
src/QUI/ERP/Accounting/Calc.php
+33
-14
33 Ergänzungen, 14 Löschungen
src/QUI/ERP/Accounting/Calc.php
wird angezeigt
mit
33 Ergänzungen
und
14 Löschungen
src/QUI/ERP/Accounting/Calc.php
+
33
−
14
Zeige Datei @
964d005a
...
...
@@ -99,14 +99,10 @@ class Calc
const
TRANSACTION_ATTR_TARGET_CURRENCY_EXCHANGE_RATE
=
'tx_target_currency_exchange_rate'
;
const
TRANSACTION_ATTR_SHOP_CURRENCY_EXCHANGE_RATE
=
'tx_shop_currency_exchange_rate'
;
/**
* @var ?UserInterface
*/
protected
?UserInterface
$User
=
null
;
/**
* @var null|QUI\ERP\Currency\Currency
*/
protected
?QUI
\Locale
$Locale
=
null
;
protected
?QUI
\ERP\Currency\Currency
$Currency
=
null
;
/**
...
...
@@ -121,6 +117,7 @@ public function __construct(?UserInterface $User = null)
}
$this
->
User
=
$User
;
$this
->
Locale
=
QUI
::
getLocale
();
}
/**
...
...
@@ -163,6 +160,25 @@ public function getUser(): ?UserInterface
return
$this
->
User
;
}
//region locale
public
function
getLocale
():
?Locale
{
return
$this
->
Locale
;
}
public
function
setLocale
(
QUI
\Locale
$Locale
):
void
{
$this
->
Locale
=
$Locale
;
}
public
function
resetLocale
():
void
{
$this
->
Locale
=
QUI
::
getLocale
();
}
//endregion
/**
* Return the currency
*
...
...
@@ -184,7 +200,7 @@ public function getCurrency(): ?QUI\ERP\Currency\Currency
* @param callable|boolean $callback - optional, callback function for the data array
* @return ArticleList
*/
public
function
calcArticleList
(
ArticleList
$List
,
$callback
=
false
):
ArticleList
public
function
calcArticleList
(
ArticleList
$List
,
callable
|
bool
$callback
=
false
):
ArticleList
{
// calc data
if
(
!
is_callable
(
$callback
))
{
...
...
@@ -360,7 +376,7 @@ public function calcArticleList(ArticleList $List, $callback = false): ArticleLi
if
(
!
isset
(
$vatArray
[(
string
)
$vat
]))
{
$vatArray
[(
string
)
$vat
]
=
[
'vat'
=>
$vat
,
'text'
=>
self
::
getVatText
(
$vat
,
$this
->
getUser
())
'text'
=>
$this
->
getVatText
(
$vat
,
$this
->
getUser
()
,
$this
->
Locale
)
];
$vatArray
[(
string
)
$vat
][
'sum'
]
=
0
;
...
...
@@ -394,7 +410,7 @@ public function calcArticleList(ArticleList $List, $callback = false): ArticleLi
$bruttoSum
=
round
(
$bruttoSum
,
$precision
);
foreach
(
$vatLists
as
$vat
=>
$bool
)
{
$vatText
[(
string
)
$vat
]
=
self
::
getVatText
((
float
)
$vat
,
$this
->
getUser
());
$vatText
[(
string
)
$vat
]
=
$this
->
getVatText
((
float
)
$vat
,
$this
->
getUser
()
,
$this
->
Locale
);
}
// delete 0 % vat, 0% vat is allowed to calculate more easily
...
...
@@ -634,7 +650,7 @@ public function calcArticlePrice(Article $Article, $callback = false)
$vatArray
=
[
'vat'
=>
$vat
,
'sum'
=>
$vatSum
,
'text'
=>
$this
->
getVatText
(
$vat
,
$this
->
getUser
())
'text'
=>
$this
->
getVatText
(
$vat
,
$this
->
getUser
()
,
$this
->
Locale
)
];
QUI\ERP\Debug
::
getInstance
()
->
log
(
...
...
@@ -702,7 +718,7 @@ public function getVatTextByUser(): string
return
''
;
}
return
$this
->
getVatText
(
$Tax
->
getValue
(),
$this
->
getUser
());
return
$this
->
getVatText
(
$Tax
->
getValue
(),
$this
->
getUser
()
,
$this
->
Locale
);
}
/**
...
...
@@ -715,10 +731,13 @@ public function getVatTextByUser(): string
*
* @return string
*/
public
static
function
getVatText
(
float
|
int
$vat
,
UserInterface
$User
,
QUI
\Locale
$Locale
=
null
):
string
{
public
static
function
getVatText
(
float
|
int
$vat
,
UserInterface
$User
,
QUI
\Locale
$Locale
=
null
):
string
{
if
(
$Locale
===
null
)
{
$Locale
=
$User
->
getLocale
();
$Locale
=
QUI
::
getLocale
();
}
if
(
QUI\ERP\Utils\User
::
isNettoUser
(
$User
))
{
...
...
Dieser Diff ist reduziert.
Zum Erweitern klicken.
Vorschau
0%
Lade
Wiederholen
oder
Neue Datei anhängen
.
Abbrechen
You are about to add
0
people
to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Kommentar speichern
Abbrechen
Bitte
registrieren
oder
Anmelden
zum Kommentieren