Menu Content

Support

> Forums, FAQs & Paid Support
Welcome, Guest
Username Password: Remember me

Profile for Megaquebec

  • OFFLINE
  • Time Zone: GMT +0:00
  • Local Time: 19:23
  • Posts: 1
  • Profile Views: 2825
  • Location: Unknown
  • Gender: Unknown
  • Birthdate: Unknown

Signature

Posts

Posts

emo
VM Invoice version is 2.0.45

When I edit an order and save it, it calls the storeRulesPerItem function. At the end of the function it deletes "rules for this order/item/shipping/payment that [were] not saved now".

It may be me misunderstanding the actual use of the calculation rules, but it seems to me the function deletes too much. The function is called 3 times, once for general rules, shipments and then payments. The WHERE part of the query for each time looks like this:
-General(-1): WHERE (`virtuemart_order_item_id` IS NULL OR `virtuemart_order_item_id`=0) AND `calc_kind` != 'shipment' AND `calc_kind` != 'payment' AND virtuemart_order_calc_rule_id NOT IN (42, 43)
-Shipment(-2): WHERE `calc_kind` = 'shipment' AND virtuemart_order_calc_rule_id NOT IN (41)
-payment(-3): WHERE `calc_kind` = 'payment' AND virtuemart_order_calc_rule_id NOT IN (40)

At the present time it deletes almost every calculation rules except the #40, #41, #42 and #43. That includes calculation rules linked with other orders, that's where my problem lies. I fail to understand why it does so. Shouldn't the delete just affect the calculation rules linked with the order saved? If so, shouldn't the delete queries have another condition to do so(like "AND `virtuemart_order_id`='.$this->virtuemart_order_id").

Is there a reason why every other calculation rules without a order_item_id attached to it are deleted each time I save an order from the vm_invoice admin? Is it some kind of "garbage collecting" method so that the DB is not filled too much? I'd really like to know why it does act like this because with every other calculation rules being deleted, it also deletes the taxes off my invoices. Adding the query condition I just mentioned seems to me like it would work, but, before doing so, I'd like to be sure that I am right in doing so or if it's just me missing the point.

Thank you.
storeRulesPerItem fu ...
Category: Feature Requests
More
User Login Empty