Created
June 26, 2022 11:17
-
-
Save bogordesaincom/bf43b10c64d96225b0a19553f210676e to your computer and use it in GitHub Desktop.
Stock
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$warehouses = Warehouse::where('companies_id', $companies->id)->get(); | |
$stock_array = []; | |
foreach($warehouses as $warehouse) { | |
$stockIn = Stock::where('warehouse_id', $warehouse->id)->where('status', 'stock_in')->sum('kolom table qty') | |
$stockOut = Stock::where('warehouse_id', $warehouse->id)->where('status', 'stock_out')->sum('kolom table qty') | |
$stock_array = $stockIn - $stockOut; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment