Modify

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?

Attachments (0)

Change History (1)

comment:1 by Gerhard Waldemair, 5 years ago

Resolution: fixed
Status: newclosed

In 12889:

fix #1890 - round order total value for sales report

Modify Ticket

Action
as closed The owner will remain somebody.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.