MS
Asked
Hello good,
Days ago I told you about the purchase with more than 1332 items that I cannot modify, I checked all the load data on my server, but I noticed when reviewing the purchase that a product with zero quantity was entered and I think that when I try to edit the purchase it is not show me the products.
I am receiving the division by zero error.
I need your urgent help to eliminate two products from that purchase that are affecting the inventory and profits of the business.
that's what happens to me, I analyze the purchase and I see that I have a product on line 298 that is at zero.
https://drive.google.com/file/d/1OH3chXsXmIz8AvDZYrXfCGnDWGlt_Rvz/view
Days ago I told you about the purchase with more than 1332 items that I cannot modify, I checked all the load data on my server, but I noticed when reviewing the purchase that a product with zero quantity was entered and I think that when I try to edit the purchase it is not show me the products.
I am receiving the division by zero error.
I need your urgent help to eliminate two products from that purchase that are affecting the inventory and profits of the business.
that's what happens to me, I analyze the purchase and I see that I have a product on line 298 that is at zero.
https://drive.google.com/file/d/1OH3chXsXmIz8AvDZYrXfCGnDWGlt_Rvz/view
- SHAnsweredHello, we had the same error. I thought it caused by importing wrong data. Since the client does not calculate the tax per product, I solved the issue by editing `app/models/Site.php`. I commented the code `/* + ($pi->item_tax / $pi->quantity) */` in line `72`.
This may works for you if you do not calculate the tax per product, but you still have to wait for the official answer.
Regards - MSAnsweredHello,
Please let me know your installation link with login details in private reply so that I can have look.
Thank you - MSAnsweredHello,
You have too many products and `exceeded the quota`, you can see the error message in console `Message length exceeded maximum allowed length`
The items data can't be saved to localStorage. There is no way to edit that purchase. The only solution is delete the purchase_item row from database.
Thank you - MSAnsweredHello,
You are right I will add the max row limit for csv files. I was not aware some can reach the browser limit. You are the first one in 7+ years.
Thank you - MSAnsweredif i apply this will it work?
Hello, we had the same error. I thought it caused by importing wrong data. Since the client does not calculate the tax per product, I solved the issue by editing app/models/Site.php. I commented the code /* + ($pi->item_tax / $pi->quantity) */ in line 72.
I really need help to edit that purchase, I don't know what to do help me please - MSAnsweredHello,
No. That is nothing to browser localStorage limit :(
You can edit database, the following query will list the products for purchase
```sql
SELECT * FROM sma_purchase_items WHERE purchase_id = 1;
```
You can delete the row for products code `7702024034605` with following query
```sql
DELETE sma_purchase_items FROM sma_purchase_items WHERE purchase_id = 1 AND product_code = '7702024034605';
```
I hope, this is helpful.
Thank you - MSAnsweredapply the queries you show me and the problem continues, it won't let me edit the purchase, can I apply the same query for the other code that I want to delete?
- MSAnsweredHello,
You won't be able to edit it unless you have deleted many and storage limit fall in the allowed size.
That product don't have stock, you can delete any rows but it won't sync your stock. You will need to add adjustment manually to set the correct products quantity or perform stock count.
Thank you - MSAnsweredIf I delete any row with quantity, will the purchase value be affected or will it remain the same?
- MSAnsweredHello,
No. There won't be any change to purchase.
Thank you - Login to Reply