Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profit/loss summary #56

Open
blkaleeb opened this issue Jan 9, 2024 · 0 comments
Open

Profit/loss summary #56

blkaleeb opened this issue Jan 9, 2024 · 0 comments

Comments

@blkaleeb
Copy link

blkaleeb commented Jan 9, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant