You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
foreach ($sales as $sale) { foreach ($sale->saleDetails as $saleDetail) { $product_costs += $saleDetail->product->product_cost; } }
this means if you get have the sales qty above 1, you will get the product cost equal to 1 product.
for example:
A = 130.000, we sell A with price 140.000. so the profit is 10.000 per item
if we create sales with 5 qty, we get 570.000 profit instead of 50.000
The text was updated successfully, but these errors were encountered:
Hi, i think the
profit
data is imprecise.foreach ($sales as $sale) { foreach ($sale->saleDetails as $saleDetail) { $product_costs += $saleDetail->product->product_cost; } }
this means if you get have the sales qty above 1, you will get the product cost equal to 1 product.
for example:
A = 130.000, we sell A with price 140.000. so the profit is 10.000 per item
if we create sales with 5 qty, we get 570.000 profit instead of 50.000
The text was updated successfully, but these errors were encountered: