Opened 5 years ago
Closed 5 years ago
#1890 closed Bug/Fehler (fixed)
Fehler in Umsatzstatistik für Versand und Sonstiges
| Reported by: | Torsten Riemer | Owned by: | somebody |
|---|---|---|---|
| Priority: | normal | Milestone: | modified-shop-2.0.6.0 |
| Component: | Admin | Version: | trunk |
| Keywords: | Cc: | ||
| Blocked By: | Blocking: |
Description
Stellt ein Händler beispielsweise 4,22€ netto bei den Versandkosten ein, so wird dem Kunden 4,90€ angezeigt und berechnet. Gerundet aus 4,8952€.
In der Umsatzstatistik wird aber nicht mit den gerundeten Werten gerechnet, die der Kunde angezeigt bekommt, sondern mit den tatsächlichen Werten (ot.value vs ot.text) und erst zum Schluss gerundet, was zu Abweichungen einiger Cent führen kann.
Ich schlage daher vor bereits die Einzelwerte zu runden in "/admin/includes/classes/sales_report.php".
Suche:
// query for shipping
$this->queryShipping = "SELECT sum(ot.value/o.currency_value) as shipping
FROM " . TABLE_ORDERS . " o
JOIN " . TABLE_ORDERS_TOTAL . " ot
ON (ot.orders_id = o.orders_id AND ot.class = 'ot_shipping')";
// query for additional
$this->queryAdditional = "SELECT sum(ot.value/o.currency_value) as additional
FROM " . TABLE_ORDERS . " o
JOIN " . TABLE_ORDERS_TOTAL . " ot
ON (ot.orders_id = o.orders_id AND ot.class NOT IN ('ot_subtotal', 'ot_shipping', 'ot_subtotal_no_tax', 'ot_tax', 'ot_total', 'ot_z_bpytc_total', 'ot_z_paylater_total', 'ot_easycredit_fee', 'ot_paypalinstallment_fee'))";
Ersetze mit:
// query for shipping
$this->queryShipping = "SELECT sum(round(ot.value, 2)/o.currency_value) as shipping
FROM " . TABLE_ORDERS . " o
JOIN " . TABLE_ORDERS_TOTAL . " ot
ON (ot.orders_id = o.orders_id AND ot.class = 'ot_shipping')";
// query for additional
$this->queryAdditional = "SELECT sum(round(ot.value, 2)/o.currency_value) as additional
FROM " . TABLE_ORDERS . " o
JOIN " . TABLE_ORDERS_TOTAL . " ot
ON (ot.orders_id = o.orders_id AND ot.class NOT IN ('ot_subtotal', 'ot_shipping', 'ot_subtotal_no_tax', 'ot_tax', 'ot_total', 'ot_z_bpytc_total', 'ot_z_paylater_total', 'ot_easycredit_fee', 'ot_paypalinstallment_fee'))";
Ich denke die anderen Werte in der Umsatzstatistik passen, aber vielleicht kann da auch nochmal jemand rüber schauen?
Irgendwelche Einwände?

In 12889: