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
80d02bb4
Commit
80d02bb4
erstellt
4 years ago
von
Henning Leutz
Dateien durchsuchen
Optionen
Downloads
Patches
Einfaches Diff
feat: quiqqer/invoice#104
Übergeordneter
6e4e8ef5
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
2
Leerzeichenänderungen ausblenden
Inline
Nebeneinander
2 geänderte Dateien
ajax/products/calc.php
+20
-16
20 Ergänzungen, 16 Löschungen
ajax/products/calc.php
bin/backend/controls/articles/Article.js
+19
-11
19 Ergänzungen, 11 Löschungen
bin/backend/controls/articles/Article.js
werden angezeigt
mit
39 Ergänzungen
und
27 Löschungen
ajax/products/calc.php
+
20
−
16
Zeige Datei @
80d02bb4
...
...
@@ -49,29 +49,31 @@ function ($articles, $user) {
$brutto
=
$Articles
->
toArray
();
// discount
foreach
(
$brutto
[
'articles'
]
as
$k
=>
$article
)
{
if
(
empty
(
$article
[
'discount'
]))
{
continue
;
}
// discount stuff
$Currency
=
$Articles
->
getCurrency
();
$Discount
=
ArticleDiscount
::
unserialize
(
$article
[
'discount'
]);
$
Currency
=
$Discount
->
getCurrency
()
;
$
vat
=
$article
[
'vat'
]
/
100
+
1
;
foreach
(
$brutto
[
'articles'
]
as
$k
=>
$article
)
{
$
vat
=
$article
[
'vat'
]
/
100
+
1
;
$
bruttoSum
=
$result
[
'articles'
][
$k
][
'sum'
]
;
$nettoSum
=
$result
[
'articles'
][
$k
][
'sum'
];
$unitPrice
=
$bruttoSum
/
$brutto
[
'articles'
][
$k
][
'quantity'
];
$unitPrice
=
\round
(
$unitPrice
,
$Currency
->
getPrecision
());
$brutto
[
'articles'
][
$k
][
'unitPrice'
]
=
$unitPrice
;
$brutto
[
'articles'
][
$k
][
'display_unitPrice'
]
=
$Currency
->
format
(
$unitPrice
);
$brutto
[
'articles'
][
$k
][
'display_quantity_sum'
]
=
$brutto
[
'articles'
][
$k
][
'display_sum'
];
$brutto
[
'articles'
][
$k
][
'quantity_sum'
]
=
$brutto
[
'articles'
][
$k
][
'sum'
];
$unitPrice
=
$brutto
[
'articles'
][
$k
][
'quantity_sum'
]
/
$brutto
[
'articles'
][
$k
][
'quantity'
];
$unitPrice
=
\round
(
$unitPrice
,
$Currency
->
getPrecision
());
if
(
empty
(
$article
[
'discount'
]))
{
continue
;
}
$brutto
[
'articles'
][
$k
][
'unitPrice'
]
=
$unitPrice
;
$brutto
[
'articles'
][
$k
][
'display_unitPrice'
]
=
$Currency
->
format
(
$unitPrice
);
$Discount
=
ArticleDiscount
::
unserialize
(
$article
[
'discount'
]);
if
(
$Discount
->
getCalculation
()
!==
QUI\ERP\Accounting\Calc
::
CALCULATION_COMPLEMENT
)
{
$bruttoSum
=
$nettoSum
*
$vat
;
$discount
=
$bruttoSum
*
(
$Discount
->
getValue
()
/
100
);
$discount
=
\round
(
$discount
,
$Currency
->
getPrecision
());
$bruttoSum
=
$bruttoSum
-
$discount
;
$brutto
[
'articles'
][
$k
][
'discount'
]
=
$Discount
->
getValue
()
.
'%'
;
$brutto
[
'articles'
][
$k
][
'display_discount'
]
=
$Discount
->
getValue
()
.
'%'
;
...
...
@@ -80,8 +82,10 @@ function ($articles, $user) {
continue
;
}
$discount
=
$Discount
->
getValue
()
*
$vat
;
$bruttoSum
=
$nettoSum
*
$vat
;
$discount
=
$Discount
->
getValue
()
*
$vat
;
$discount
=
\round
(
$discount
,
$Currency
->
getPrecision
());
$bruttoSum
=
$bruttoSum
-
$discount
;
$brutto
[
'articles'
][
$k
][
'discount'
]
=
$discount
;
$brutto
[
'articles'
][
$k
][
'display_discount'
]
=
$Currency
->
format
(
$discount
);
...
...
Dieser Diff ist reduziert.
Zum Erweitern klicken.
bin/backend/controls/articles/Article.js
+
19
−
11
Zeige Datei @
80d02bb4
...
...
@@ -403,6 +403,9 @@ define('package/quiqqer/erp/bin/backend/controls/articles/Article', [
typeof
self
.
$bruttoCalc
.
display_discount
!==
'
undefined
'
)
{
self
.
$DiscountBrutto
.
set
(
'
html
'
,
self
.
$bruttoCalc
.
display_discount
);
self
.
$DiscountBrutto
.
set
(
'
data-value
'
,
self
.
$bruttoCalc
.
discount
);
}
else
{
self
.
$DiscountBrutto
.
set
(
'
html
'
,
'
-
'
);
self
.
$DiscountBrutto
.
set
(
'
data-value
'
,
'
-
'
);
}
if
(
typeof
self
.
$bruttoCalc
!==
'
undefined
'
&&
...
...
@@ -417,9 +420,6 @@ define('package/quiqqer/erp/bin/backend/controls/articles/Article', [
self
.
$UnitPriceBrutto
.
set
(
'
data-value
'
,
self
.
$bruttoCalc
.
unitPrice
);
}
console
.
log
(
'
***
'
,
self
.
$bruttoCalc
);
self
.
hideLoader
();
self
.
fireEvent
(
'
calc
'
,
[
self
]);
...
...
@@ -649,19 +649,11 @@ define('package/quiqqer/erp/bin/backend/controls/articles/Article', [
* @return {Promise}
*/
setUnitPrice
:
function
(
price
)
{
var
self
=
this
;
this
.
setAttribute
(
'
unitPrice
'
,
parseFloat
(
price
));
if
(
this
.
$UnitPrice
)
{
this
.
$UnitPrice
.
set
(
'
html
'
,
this
.
getAttribute
(
'
unitPrice
'
));
}
//console.log('###', this.$bruttoCalc);
// if (this.$UnitPriceBrutto) {
// this.getBruttoPrice(price, true).then(function (brutto) {
// self.$UnitPriceBrutto.set('html', brutto);
// });
// }
this
.
fireEvent
(
'
setUnitPrice
'
,
[
this
]);
...
...
@@ -1094,6 +1086,10 @@ define('package/quiqqer/erp/bin/backend/controls/articles/Article', [
return
self
.
setDiscount
(
value
);
}
if
(
parseFloat
(
value
)
===
0
)
{
return
self
.
setDiscount
(
0
);
}
return
self
.
getNettoPrice
(
value
).
then
(
function
(
value
)
{
self
.
setDiscount
(
value
);
});
...
...
@@ -1191,6 +1187,12 @@ define('package/quiqqer/erp/bin/backend/controls/articles/Article', [
if
(
event
.
shift
)
{
Next
=
Cell
.
getPrevious
(
'
.cell-editable
'
);
if
(
Next
&&
Next
.
getStyle
(
'
display
'
)
===
'
none
'
)
{
event
.
target
=
Next
;
this
.
$editNext
(
event
);
return
;
}
if
(
!
Next
)
{
// previous row
Article
=
Cell
.
getParent
(
'
.article
'
);
...
...
@@ -1210,6 +1212,12 @@ define('package/quiqqer/erp/bin/backend/controls/articles/Article', [
Next
=
Cell
.
getNext
(
'
.cell-editable
'
);
}
if
(
Next
&&
Next
.
getStyle
(
'
display
'
)
===
'
none
'
)
{
event
.
target
=
Next
;
this
.
$editNext
(
event
);
return
;
}
if
(
!
Next
)
{
// next row
Article
=
Cell
.
getParent
(
'
.article
'
);
...
...
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