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
8e764b69
Commit
8e764b69
erstellt
4 years ago
von
Henning Leutz
Dateien durchsuchen
Optionen
Downloads
Patches
Einfaches Diff
feat: quiqqer/invoice#104
Übergeordneter
1c695ac4
Keine zugehörigen Branchen gefunden
Branches enthält Commit
Keine zugehörigen Tags gefunden
Tags enthält Commit
Keine zugehörigen Merge Requests gefunden
Änderungen
3
Leerzeichenänderungen ausblenden
Inline
Nebeneinander
3 geänderte Dateien
ajax/products/calc.php
+21
-14
21 Ergänzungen, 14 Löschungen
ajax/products/calc.php
bin/backend/controls/articles/Article.js
+6
-6
6 Ergänzungen, 6 Löschungen
bin/backend/controls/articles/Article.js
src/QUI/ERP/Accounting/Calc.php
+7
-5
7 Ergänzungen, 5 Löschungen
src/QUI/ERP/Accounting/Calc.php
werden angezeigt
mit
34 Ergänzungen
und
25 Löschungen
ajax/products/calc.php
+
21
−
14
Zeige Datei @
8e764b69
...
...
@@ -55,8 +55,9 @@ function ($articles, $user) {
foreach
(
$brutto
[
'articles'
]
as
$k
=>
$article
)
{
$vat
=
$article
[
'vat'
]
/
100
+
1
;
$bruttoSum
=
$result
[
'articles'
][
$k
][
'sum'
];
$quantity
=
$brutto
[
'articles'
][
$k
][
'quantity'
];
$unitPrice
=
$bruttoSum
/
$
brutto
[
'articles'
][
$k
][
'
quantity
'
]
;
$unitPrice
=
$bruttoSum
/
$quantity
;
$unitPrice
=
\round
(
$unitPrice
,
$Currency
->
getPrecision
());
$brutto
[
'articles'
][
$k
][
'unitPrice'
]
=
$unitPrice
;
...
...
@@ -71,26 +72,32 @@ function ($articles, $user) {
$Discount
=
ArticleDiscount
::
unserialize
(
$article
[
'discount'
]);
if
(
$Discount
->
getCalculation
()
!==
QUI\ERP\Accounting\Calc
::
CALCULATION_COMPLEMENT
)
{
$
discount
=
$bruttoSum
*
(
$Discount
->
getValue
()
/
100
)
;
$discount
=
\round
(
$
d
iscount
,
$Currency
->
getPrecision
()
);
$
bruttoSum
=
$bruttoSum
-
$discount
;
$
bruttoUnit
=
$result
[
'articles'
][
$k
][
'unitPrice'
]
*
$vat
;
$discount
=
$bruttoUnit
*
(
$
D
iscount
->
getValue
()
/
100
);
$
uniqueDiscount
=
\round
(
$discount
,
$Currency
->
getPrecision
())
;
$brutto
[
'articles'
][
$k
][
'discount'
]
=
$Discount
->
getValue
()
.
'%'
;
$brutto
[
'articles'
][
$k
][
'display_discount'
]
=
$Discount
->
getValue
()
.
'%'
;
$brutto
[
'articles'
][
$k
][
'display_sum'
]
=
$Currency
->
format
(
$bruttoSum
);
$brutto
[
'articles'
][
$k
][
'sum'
]
=
\round
(
$bruttoSum
,
$Currency
->
getPrecision
());
continue
;
}
else
{
$discount
=
$Discount
->
getValue
()
*
$vat
;
$discount
=
\round
(
$discount
,
$Currency
->
getPrecision
());
$uniqueDiscount
=
$discount
/
$quantity
;
$brutto
[
'articles'
][
$k
][
'discount'
]
=
$discount
;
$brutto
[
'articles'
][
$k
][
'display_discount'
]
=
$Currency
->
format
(
$discount
);
}
$
discount
=
$Discount
->
getValue
()
*
$vat
;
$
discount
=
\round
(
$discount
,
$Currency
->
getPrecision
())
;
$
unitPrice
=
$brutto
[
'articles'
][
$k
][
'unitPrice'
]
;
$
unitPrice
=
$unitPrice
+
$uniqueDiscount
;
$bruttoSum
=
$bruttoSum
-
$discount
;
$brutto
[
'articles'
][
$k
][
'display_sum'
]
=
$Currency
->
format
(
$bruttoSum
);
$brutto
[
'articles'
][
$k
][
'sum'
]
=
\round
(
$bruttoSum
,
$Currency
->
getPrecision
());
$brutto
[
'articles'
][
$k
][
'display_unitPrice'
]
=
$Currency
->
format
(
$unitPrice
);
$brutto
[
'articles'
][
$k
][
'unitPrice'
]
=
\round
(
$unitPrice
,
$Currency
->
getPrecision
());
$brutto
[
'articles'
][
$k
][
'display_quantity_sum'
]
=
$Currency
->
format
(
$unitPrice
*
$quantity
);
$brutto
[
'articles'
][
$k
][
'quantity_sum'
]
=
$unitPrice
*
$quantity
;
$brutto
[
'articles'
][
$k
][
'discount'
]
=
$discount
;
$brutto
[
'articles'
][
$k
][
'display_discount'
]
=
$Currency
->
format
(
$discount
);
$brutto
[
'articles'
][
$k
][
'display_sum'
]
=
$Currency
->
format
(
$bruttoSum
);
$brutto
[
'articles'
][
$k
][
'sum'
]
=
\round
(
$bruttoSum
,
$Currency
->
getPrecision
());
// display_quantity_sum;
}
$result
[
'brutto'
]
=
$brutto
;
...
...
Dieser Diff ist reduziert.
Zum Erweitern klicken.
bin/backend/controls/articles/Article.js
+
6
−
6
Zeige Datei @
8e764b69
...
...
@@ -393,12 +393,6 @@ define('package/quiqqer/erp/bin/backend/controls/articles/Article', [
setElement
(
self
.
$Price
,
price
);
setElement
(
self
.
$VAT
,
product
.
vat
+
'
%
'
);
if
(
typeof
self
.
$bruttoCalc
!==
'
undefined
'
&&
typeof
self
.
$bruttoCalc
.
display_quantity_sum
!==
'
undefined
'
)
{
self
.
$PriceBrutto
.
set
(
'
html
'
,
self
.
$bruttoCalc
.
display_quantity_sum
);
self
.
$PriceBrutto
.
set
(
'
data-value
'
,
self
.
$bruttoCalc
.
quantity_sum
);
}
if
(
typeof
self
.
$bruttoCalc
!==
'
undefined
'
&&
typeof
self
.
$bruttoCalc
.
display_discount
!==
'
undefined
'
)
{
self
.
$DiscountBrutto
.
set
(
'
html
'
,
self
.
$bruttoCalc
.
display_discount
);
...
...
@@ -420,6 +414,12 @@ define('package/quiqqer/erp/bin/backend/controls/articles/Article', [
self
.
$UnitPriceBrutto
.
set
(
'
data-value
'
,
self
.
$bruttoCalc
.
unitPrice
);
}
if
(
typeof
self
.
$bruttoCalc
!==
'
undefined
'
&&
typeof
self
.
$bruttoCalc
.
display_quantity_sum
!==
'
undefined
'
)
{
self
.
$PriceBrutto
.
set
(
'
html
'
,
self
.
$bruttoCalc
.
display_quantity_sum
);
self
.
$PriceBrutto
.
set
(
'
data-value
'
,
self
.
$bruttoCalc
.
quantity_sum
);
}
self
.
hideLoader
();
self
.
fireEvent
(
'
calc
'
,
[
self
]);
...
...
Dieser Diff ist reduziert.
Zum Erweitern klicken.
src/QUI/ERP/Accounting/Calc.php
+
7
−
5
Zeige Datei @
8e764b69
...
...
@@ -434,19 +434,22 @@ public function calcArticlePrice(Article $Article, $callback = false)
}
// discounts
$Discount
=
$Article
->
getDiscount
();
$Discount
=
$Article
->
getDiscount
();
$nettoPriceNotRounded
=
$Article
->
getUnitPriceUnRounded
()
->
getValue
();
if
(
$Discount
)
{
switch
(
$Discount
->
getCalculation
())
{
// einfache Zahl, Währung --- kein Prozent
case
Calc
::
CALCULATION_COMPLEMENT
:
$nettoPrice
=
$nettoPrice
-
(
$Discount
->
getValue
()
/
$Article
->
getQuantity
());
$nettoPrice
=
$nettoPrice
-
(
$Discount
->
getValue
()
/
$Article
->
getQuantity
());
$nettoPriceNotRounded
=
$nettoPriceNotRounded
-
(
$Discount
->
getValue
()
/
$Article
->
getQuantity
());
break
;
// Prozent Angabe
case
Calc
::
CALCULATION_PERCENTAGE
:
$percentage
=
$Discount
->
getValue
()
/
100
*
$nettoPrice
;
$nettoPrice
=
$nettoPrice
-
$percentage
;
$percentage
=
$Discount
->
getValue
()
/
100
*
$nettoPrice
;
$nettoPrice
=
$nettoPrice
-
$percentage
;
$nettoPriceNotRounded
=
$nettoPriceNotRounded
-
$percentage
;
break
;
}
}
...
...
@@ -456,7 +459,6 @@ public function calcArticlePrice(Article $Article, $callback = false)
if
(
!
$isNetto
)
{
// korrektur rechnung / 1 cent problem
$nettoPriceNotRounded
=
$Article
->
getUnitPriceUnRounded
()
->
getValue
();
$checkBrutto
=
$nettoPriceNotRounded
*
(
$vat
/
100
+
1
);
$checkBrutto
=
\round
(
$checkBrutto
,
$Currency
->
getPrecision
());
...
...
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