Modify

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#183 closed Bug/Fehler (fixed)

preisberechung rundungsfehler

Reported by: christian@… Owned by: Ronald Parcinski
Priority: hoch Milestone: modified-shop-2.0.0.0
Component: Admin Version: 2.0.0.0
Keywords: Cc:
Blocked By: Blocking:

Description

im aktuellen download release gibt es scheinbar einen bug in ./admin/orders_edit.php | ca. zeile: 500

  $products_old_price = $xtPrice->xtcGetPrice($products['products_id'], $format = false, $products['products_quantity'], '', '', '', $order->customer['ID']);

reproduktion des fehlers:

ich gebe einem produkt welches über attribute ohne aufpreis verfügt einen bruttopreis von 135 (netto: 113.4454 )

wenn ich für einen normalen privatkunden aus D eine rechnug im adminbereich erstelle und dieses produkt zuweise,
steht im preisfeld "135.0000" -> wenn ich dann ein attribut (ohne aufpreis) hinzufüge ändert sich der preis auf "135.0100"

ursache ist, dass die variable $products_old_price den wert "113.45" (also einen gerundeten netto-wert) anstatt "113.4454" liefert, auf welchen dann anschliessend noch die steuern gerechnet werden.

Attachments (0)

Change History (9)

comment:1 by Ronald Parcinski, 12 years ago

Owner: changed from somebody to Ronald Parcinski
Status: newaccepted

comment:2 by Ronald Parcinski, 12 years ago

Priority: normalhoch
Version: 1.062.0

comment:3 by Ronald Parcinski, 12 years ago

Der Rundungsfehler tritt auch im Frontend auf bei den Einstellungen:

Preise inkl. MwSt.: Nein
UST in Rechnung ausweisen: Ja

comment:4 by Ronald Parcinski, 12 years ago

Milestone: modified-shop-2.00

comment:5 by Ronald Parcinski, 12 years ago

Resolution: fixed
Status: acceptedclosed

gefixt in r6186

Last edited 12 years ago by Torsten Riemer (previous) (diff)

in reply to:  5 comment:6 by modifiedtrac@…, 12 years ago

Replying to web28:

gefixt in r6186

ist es möglich ein diff vorab zur verfügung zustellen?
es hat etwas gedauert den fehler komplett zulokalisieren, wenn ich mir die arbeit sparen kann den fix zu erdenken, wäre schön.

Last edited 12 years ago by Torsten Riemer (previous) (diff)

comment:7 by Ronald Parcinski, 12 years ago

Änderungen sind nur in der xtcPrice.php

Index: /tags/modified-shop-1.06/includes/classes/xtcPrice.php
===================================================================
--- /tags/modified-shop-1.06/includes/classes/xtcPrice.php	(revision 6185)
+++ /tags/modified-shop-1.06/includes/classes/xtcPrice.php	(revision 6186)
@@ -118,4 +118,6 @@
     }
     
+    $this->show_price_tax = ($tax_class == '') ? 0 : $_SESSION['customers_status']['customers_status_show_price_tax'];
+ 
     // get Tax rate
     if ($cedit_id != 0) {
@@ -195,5 +197,5 @@
     $price += $price / 100 * $tax;
     $price = $this->xtcCalculateCurr($price);
-    return round($price, $this->currencies[$this->actualCurr]['decimal_places']);
+    return $this->show_price_tax ? round($price, $this->currencies[$this->actualCurr]['decimal_places']) : $price;
   }
 
@@ -541,5 +543,5 @@
       }
     } else {
-      return round($price, $decimal_places);
+      return $this->show_price_tax ? round($price, $decimal_places) : $price;
     }
   }
@@ -584,5 +586,5 @@
       }
     } else {
-      return round($sPrice, $this->currencies[$this->actualCurr]['decimal_places']);
+      return $this->show_price_tax ? round($sPrice, $this->currencies[$this->actualCurr]['decimal_places']) : $price;
     }
   }
@@ -626,5 +628,5 @@
       }
     } else {
-      return round($sPrice, $this->currencies[$this->actualCurr]['decimal_places']);
+      return $this->show_price_tax ? round($sPrice, $this->currencies[$this->actualCurr]['decimal_places']) : $price;
     }
   }
@@ -686,5 +688,5 @@
       }
     } else {
-      return round($sPrice, $this->currencies[$this->actualCurr]['decimal_places']);
+      return $this->show_price_tax ? round($sPrice, $this->currencies[$this->actualCurr]['decimal_places']) : $price;
     }
   }

Version 0, edited 12 years ago by Ronald Parcinski (next)

comment:8 by modifiedtrac@…, 12 years ago

hab ich gesehen,
danke - hab mir ne copy gemacht und werf es später mal ein mein git.
das diff kann also aus den kommentaren wenn notwendig wieder entfernt werden.

comment:9 by anonymous, 12 years ago

der fix sieht gut aus,
danke nochmal.

Modify Ticket

Action
as closed The owner will remain Ronald Parcinski.
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.