Prestashop Core Application V1.5

double value for total_paid_real only in the database

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Labels:
    None
  • Similar issues:
    PSCFV-6582 Double rule for taxes
    PSCFV-4879 How to insert a additional value to the database using web service??
    PSCFV-8904 Warehouses-addresses : database ids incoherencies
    PSCFV-8178 Products doubled only in Featured Products and Rapid search
    PSCFV-7589 Big big big bug with $cart->id_carrier only using "One Page Checkout" on all order steps (javascript issue) that value is not set after choosing the delivery method
    PSCFV-5336 double-click of entries in lists of category/manufacturer Prestashop (1.5.2.)
    PSCFV-1511 AdminCustomer : Incorrect orders amount
    PSCFV-7286 There is lack of foreign keys in database

Description

hi
Using my two payment modules only today (after updated the system with svn checkout comand), I get this error in the "total_paid_real" field of order table, the price is double and to make a test I've tried to pass the total cart value to $this->module->validateOrder with its value and not with the variable and I get the same error
With bankwire is ok, but the structure is the same and some hours ago this problem was not present

  1. 1.png
    19 kB
    29/Mar/12 8:42 PM
  2. 2.png
    11 kB
    29/Mar/12 8:42 PM
  3. 3.png
    10 kB
    29/Mar/12 8:42 PM

Activity

Hide
maofree added a comment - 29/Mar/12 9:06 PM

Hi
I've found where is the problem

is in this code, if I remove it from "validateOrder" the value of "total_paid_real" (the problem is only into the database) return ok like total_paid

// Register Payment only if the order status validate the order
if ($result && $order_status->logable)

{ if (!$order->addOrderPayment($amount_paid)) throw new PrestaShopException('Can\'t save Order Payment'); }
Show
maofree added a comment - 29/Mar/12 9:06 PM Hi I've found where is the problem is in this code, if I remove it from "validateOrder" the value of "total_paid_real" (the problem is only into the database) return ok like total_paid // Register Payment only if the order status validate the order if ($result && $order_status->logable) { if (!$order->addOrderPayment($amount_paid)) throw new PrestaShopException('Can\'t save Order Payment'); }
Hide
Maxence DE FLOTTE added a comment - 30/Mar/12 4:50 PM

Hi,

Thanks for this repport. I do not understand your problem. Is it linked with the issue #PSFV-753?

Best regards,

Show
Maxence DE FLOTTE added a comment - 30/Mar/12 4:50 PM Hi, Thanks for this repport. I do not understand your problem. Is it linked with the issue #PSFV-753? Best regards,
Maxence DE FLOTTE made changes - 30/Mar/12 4:50 PM
Field Original Value New Value
Assignee Maxence DE FLOTTE [ mdeflotte ]
Maxence DE FLOTTE made changes - 30/Mar/12 4:50 PM
Status Open [ 1 ] In Progress [ 3 ]
Maxence DE FLOTTE made changes - 30/Mar/12 4:51 PM
Status In Progress [ 3 ] Need more Infos [ 10000 ]
Hide
maofree added a comment - 30/Mar/12 6:31 PM

no, that error is fixed removing the round parentheses
I get this error after an update of prestashop svn version, when I try a test doing an order with one of my payment modules
(the double value of only total_paid_real field)
That value its strange to create, it doesn't dipend on my modules but in some code chaged in your updating (I think)

Show
maofree added a comment - 30/Mar/12 6:31 PM no, that error is fixed removing the round parentheses I get this error after an update of prestashop svn version, when I try a test doing an order with one of my payment modules (the double value of only total_paid_real field) That value its strange to create, it doesn't dipend on my modules but in some code chaged in your updating (I think)
Hide
maofree added a comment - 30/Mar/12 8:43 PM

Hi Maxence
I found the problem about the double value of "total_paid_real" field in the order table in the database
Try this example with bankwire (this module is ok by it serve to show you tthis bug)
Edit bankwire/controllers/front/payment.php at line 65 and change
Configuration::get('PS_OS_BANKWIRE')
to
Configuration::get('PS_OS_PREPARATION')

After this go in the front-office and make an order with bankwire. At the end it gives an error, ok this is not the error that I want to show you.
Now go in the order table in the database of your website and you can see the order just done with "total_paid_real" field that has a doblue value of "total_paid"

So make another test leaving Configuration::get('PS_OS_PREPARATION') in that file and go to remove this code from classes/paymentmodule.php (202-207 lines)

// Register Payment only if the order status validate the order
if ($result && $order_status->logable)

{ if (!$order->addOrderPayment($amount_paid)) throw new PrestaShopException('Can\'t save Order Payment'); }

and now redone another order and you will see that in the order table that field has the right value so I think the problem is here
$order->addOrderPayment($amount_paid)
in this function

I get this error with my modules because they use PS_OS_PREPARATION

byeeee

Show
maofree added a comment - 30/Mar/12 8:43 PM Hi Maxence I found the problem about the double value of "total_paid_real" field in the order table in the database Try this example with bankwire (this module is ok by it serve to show you tthis bug) Edit bankwire/controllers/front/payment.php at line 65 and change Configuration::get('PS_OS_BANKWIRE') to Configuration::get('PS_OS_PREPARATION') After this go in the front-office and make an order with bankwire. At the end it gives an error, ok this is not the error that I want to show you. Now go in the order table in the database of your website and you can see the order just done with "total_paid_real" field that has a doblue value of "total_paid" So make another test leaving Configuration::get('PS_OS_PREPARATION') in that file and go to remove this code from classes/paymentmodule.php (202-207 lines) // Register Payment only if the order status validate the order if ($result && $order_status->logable) { if (!$order->addOrderPayment($amount_paid)) throw new PrestaShopException('Can\'t save Order Payment'); } and now redone another order and you will see that in the order table that field has the right value so I think the problem is here $order->addOrderPayment($amount_paid) in this function I get this error with my modules because they use PS_OS_PREPARATION byeeee
Hide
Maxence DE FLOTTE added a comment - 02/Apr/12 10:28 AM

Hi,

I found the problem and fixed it on the SVN.

The total_paid_real was setted twice. The $order->total_paid_real must be set to 0 on PaymentModule.php (l167).

Best regards,

Show
Maxence DE FLOTTE added a comment - 02/Apr/12 10:28 AM Hi, I found the problem and fixed it on the SVN. The total_paid_real was setted twice. The $order->total_paid_real must be set to 0 on PaymentModule.php (l167). Best regards,
Maxence DE FLOTTE made changes - 02/Apr/12 10:28 AM
Status Need more Infos [ 10000 ] Pending verification [ 10001 ]
Hide
maofree added a comment - 02/Apr/12 10:46 AM

Thanks Maxence

Show
maofree added a comment - 02/Apr/12 10:46 AM Thanks Maxence
Hide
maofree added a comment - 02/Apr/12 10:53 AM

A question
but if you set $order->total_paid_real to 0 do you not have problems with this if??

if (number_format($cart_total_paid, 2) != number_format($order->total_paid_real, 2))

Show
maofree added a comment - 02/Apr/12 10:53 AM A question but if you set $order->total_paid_real to 0 do you not have problems with this if?? if (number_format($cart_total_paid, 2) != number_format($order->total_paid_real, 2))
Hide
Maxence DE FLOTTE added a comment - 02/Apr/12 11:38 AM

Hi,

You are right. I fixed the problem.

Best regards,

Show
Maxence DE FLOTTE added a comment - 02/Apr/12 11:38 AM Hi, You are right. I fixed the problem. Best regards,
Alain FOLLETETE made changes - 02/Apr/12 4:05 PM
Status Pending verification [ 10001 ] Closed [ 6 ]
Resolution Fixed [ 1 ]
Hide
maofree added a comment - 10/Apr/12 7:53 PM

hi Maxence
I think this topic is not closed. Look here
http://forge.prestashop.com/browse/PSFV-819

bye

Show
maofree added a comment - 10/Apr/12 7:53 PM hi Maxence I think this topic is not closed. Look here http://forge.prestashop.com/browse/PSFV-819 bye
Vincent AUGAGNEUR made changes - 20/Apr/12 9:43 AM
Resolution Fixed [ 1 ]
Status Closed [ 6 ] Reopened [ 4 ]
Vincent AUGAGNEUR made changes - 20/Apr/12 9:52 AM
Status Reopened [ 4 ] Resolved [ 5 ]
Vincent AUGAGNEUR made changes - 20/Apr/12 9:56 AM
Fix Version/s Semaine 1 [ 10271 ]
Vincent AUGAGNEUR made changes - 20/Apr/12 10:02 AM
Status Resolved [ 5 ] Closed [ 6 ]
Resolution Fixed [ 1 ]
Vincent AUGAGNEUR made changes - 25/Apr/12 5:14 PM
Project Prestashop V1.5 [ 10060 ] Prestashop Core Application V1.5 [ 10101 ]
Key PSFV-755 PSCFV-1331
Affects Version/s V.1.5.0.8 [ 10243 ]
Affected version 1.5.0.9
Fix Version/s Semaine 1 [ 10290 ]
Fix Version/s Semaine 1 [ 10271 ]
Vincent AUGAGNEUR made changes - 29/Aug/12 11:21 AM
Workflow PrestaFlow 42 [ 29166 ] PrestaFlow 42 (Light) [ 35149 ]
KamilS made changes - 05/Dec/12 11:30 PM
Comment [ I also struggle with similar issue. All Prices are doubled, I see that problem appears when I import ps_product_attribute_shop table. Does anybody knows hot to fix the problem and update prices to good level? ]
Damien METZGER made changes - 15/Jan/13 4:27 PM
Labels module order payment
Damien METZGER made changes - 15/Jan/13 7:16 PM
Fix Version/s Semaine 1 [ 10290 ]
Hide
Michael Kubovič added a comment - 05/Mar/13 11:05 AM

Hi, this bug is still present in my Prestashop 1.5.3.1 installaction. Customer pays right ammount, everything goes fine. Also invoice is fine. The only issue I see is that dashboard stats show double ammounts. I've looked into db and I can see that total_paid_real is twice as much as total_paid. Payment goes through customized cash on delivery module.

screenshots
http://www.cipoandbaxxstore.sk/bugfix/ps_orders.png
http://www.cipoandbaxxstore.sk/bugfix/bo_orders.png
http://www.cipoandbaxxstore.sk/bugfix/bo_stats.png

Show
Michael Kubovič added a comment - 05/Mar/13 11:05 AM Hi, this bug is still present in my Prestashop 1.5.3.1 installaction. Customer pays right ammount, everything goes fine. Also invoice is fine. The only issue I see is that dashboard stats show double ammounts. I've looked into db and I can see that total_paid_real is twice as much as total_paid. Payment goes through customized cash on delivery module. screenshots http://www.cipoandbaxxstore.sk/bugfix/ps_orders.png http://www.cipoandbaxxstore.sk/bugfix/bo_orders.png http://www.cipoandbaxxstore.sk/bugfix/bo_stats.png
Hide
Jose A. Mora added a comment - 27/Mar/13 1:29 PM

Bug is still present in 1.5.3.1. The amount paid is doubled in stats. The table in the Database has the amount paid doubled, isn´t a bug in stats is a bug when is filled the table.

bye

Show
Jose A. Mora added a comment - 27/Mar/13 1:29 PM Bug is still present in 1.5.3.1. The amount paid is doubled in stats. The table in the Database has the amount paid doubled, isn´t a bug in stats is a bug when is filled the table. bye
Hide
Tomasz Słomiński added a comment - 10/Apr/13 10:41 AM

Still present in 1.5.4?

Show
Tomasz Słomiński added a comment - 10/Apr/13 10:41 AM Still present in 1.5.4?
Hide
Tekker added a comment - 13/Apr/13 1:24 AM

I believe yes.
I just updated to 1.5.4
and when I check a user, his total spend table is always doubled ...

Show
Tekker added a comment - 13/Apr/13 1:24 AM I believe yes. I just updated to 1.5.4 and when I check a user, his total spend table is always doubled ...
Hide
maofree added a comment - 13/Apr/13 1:30 AM

hi
I get no more this problem for some time
and on the 1.5.4 it is ok
try to do some tests on your local pc using system like wampserver
bye

Show
maofree added a comment - 13/Apr/13 1:30 AM hi I get no more this problem for some time and on the 1.5.4 it is ok try to do some tests on your local pc using system like wampserver bye
Hide
Tekker added a comment - 13/Apr/13 10:07 AM

Yes on a secondary clean 1.5.3 updated to a 1.5.4 it's working as should.
But another live shop that is an updated 1.3.7 to 1.5.4 it's still there.
I read that I should remove a table, but is it safe to do so ?
The code that is here mentioned is also stated as: $order->total_paid_real 0 on PaymentModule.php
So I have no idea where to go from here ...

Show
Tekker added a comment - 13/Apr/13 10:07 AM Yes on a secondary clean 1.5.3 updated to a 1.5.4 it's working as should. But another live shop that is an updated 1.3.7 to 1.5.4 it's still there. I read that I should remove a table, but is it safe to do so ? The code that is here mentioned is also stated as: $order->total_paid_real 0 on PaymentModule.php So I have no idea where to go from here ...

People

Vote (0)
Watch (2)

Dates

  • Created:
    29/Mar/12 8:42 PM
    Updated:
    13/Apr/13 10:07 AM
    Resolved:
    20/Apr/12 10:02 AM