Chandra Posted March 13, 2020 Posted March 13, 2020 Changing an order from back office does not update the tb_order_payment table The original amount is retained and printed in the Invoices.
wakabayashi Posted March 13, 2020 Posted March 13, 2020 I am quite sure that, it is not a bug, but bad design. The ps was designed, that every order is paid during checkout. As well they are kind of expecting, that an order doesn't get changed. I know, that my answer isn't really helpful. I am voting for years, for a better way of handling this. But it's very hard to achieve. The concequences are hard to forseen. For the payment case, I believe that a payment module should call a hook, so the amount get's corrected...
Chandra Posted March 13, 2020 Author Posted March 13, 2020 Thanks wakabayashi. From a technical point of view, it seems a straight forward update of the order payment. Did you mean maintaining the order total history when you think of consequences? Count me in if we need to analyze to fix this.
wakabayashi Posted March 13, 2020 Posted March 13, 2020 IMO you need to integreate APIs/Hooks for payment modules. If you edit an order, you can not just assume, that the paid value has changed. In practice there are multiple cases. Sometimes there happens a refund, sometimes the order hasn't been paid at all at this point. 1
toplakd Posted March 14, 2020 Posted March 14, 2020 Datakick just fixed dissapearing "add product / discount" buttons (few hours back) when order was in payment accepted state.
wakabayashi Posted March 14, 2020 Posted March 14, 2020 I don't think this fix will change anything on payment amount...
toplakd Posted March 14, 2020 Posted March 14, 2020 My bad. Posted to wrong section. Intention was to reply to thread where missing add product buttons were. But regarding not updatedinvoice if product added to order, i've never had an issue and i do change a lot of orders ehen cudtomer decides they wanted some more products.
wakabayashi Posted March 14, 2020 Posted March 14, 2020 When you change an order, you will probably also have this red warning like: The amount of payment doesn't fit the order amount.
toplakd Posted March 14, 2020 Posted March 14, 2020 (edited) Thats totaly normal behaviour As if added extra items you also have to add extra payment for it. So once extra is paid, you enter received ammount into payment field. Edited March 14, 2020 by toplakd
Chandra Posted March 14, 2020 Author Posted March 14, 2020 The issue is that the invoice shows the original amount on the left in the payment information box while the bottom total would be the updated amount. Especially a problem with COD if amount is collected based on the invoice.
wakabayashi Posted March 14, 2020 Posted March 14, 2020 25 minutes ago, toplakd said: Thats totaly normal behaviour As if added extra items you also have to add extra payment for it. So once extra is paid, you enter received ammount into payment field. And what would you do, if you remove some products?
toplakd Posted March 14, 2020 Posted March 14, 2020 (edited) I do make payment action (mark as refound) with negative value. Edited March 14, 2020 by toplakd
wakabayashi Posted March 14, 2020 Posted March 14, 2020 The payment value won't be updated in this case, does it?
toplakd Posted March 15, 2020 Posted March 15, 2020 Hmm. That's true. In current state I get following 500 exception If I add negative value of payment (like Payment refound -5€) Decoded exception Property Order->total_paid_real is not valid in file classes/ObjectModel.php at line 1058
toplakd Posted March 15, 2020 Posted March 15, 2020 Just checked back with core updater. How I tested. Changed status to payment accepted. Added 10€ discount Added negative payment -10€ as refound Negative value in payment last working state was on 1.0.1 version and PS 1.6.24. From 1.0.2 and above 500 error is throwing out
wakabayashi Posted March 15, 2020 Posted March 15, 2020 Ah I finally understand how you handle it. Yeah this makes actually sense. 😊 Bad that it's not working as expected 😅 In my use case the problemlays a bit deeper, as my orders often aren't paid when the order gets placed... And you can not add an order with payment amount=0
datakick Posted March 15, 2020 Posted March 15, 2020 The problem is that total_paid_real column is not adjusted when the order is switched to the order status that 'Pays' the order (generate payment + invoice). Tracked here https://github.com/thirtybees/thirtybees/issues/1153
datakick Posted March 15, 2020 Posted March 15, 2020 @toplakd the fix for this issue is committed in branch issue-1153. Could you please verify that it works? Simply use core updater and update to this branch 2 2
toplakd Posted March 15, 2020 Posted March 15, 2020 (edited) Works flawlessly 🙂 Edited March 15, 2020 by toplakd 2 1
toplakd Posted March 15, 2020 Posted March 15, 2020 (edited) Fix is now already included in latest bleeding edge (no branch) and running live. Thank you datakick for quick fix. Edited March 15, 2020 by toplakd
wakabayashi Posted March 15, 2020 Posted March 15, 2020 Thx a lot @toplakd and @datakick! I hope once this corona thing is a bit less severe, I can contribute again some stuff on github myself. So I really appreciate everyone, who drives this project forward 🤗 2
Chandra Posted March 16, 2020 Author Posted March 16, 2020 Indeed, the collaboration on TB is pleasing. I have updated my prod shop to bleeding edge and will test this over the next few days. 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now