Implemented browser barcode scanning (closes #102)

This commit is contained in:
Bernd Bestel
2019-09-19 12:48:02 +02:00
parent 9f18b75526
commit 5e9a7fb7ca
14 changed files with 693 additions and 6 deletions

View File

@@ -78,6 +78,16 @@ class StockService extends BaseService
$stockCurrentRow = FindObjectinArrayByPropertyValue($this->GetCurrentStock(), 'product_id', $productId);
if ($stockCurrentRow == null)
{
$stockCurrentRow = new \stdClass();
$stockCurrentRow->amount = 0;
$stockCurrentRow->amount_opened = 0;
$stockCurrentRow->amount_aggregated = 0;
$stockCurrentRow->amount_opened_aggregated = 0;
$stockCurrentRow->is_aggregated_amount = 0;
}
$product = $this->Database->products($productId);
$productLastPurchased = $this->Database->stock_log()->where('product_id', $productId)->where('transaction_type', self::TRANSACTION_TYPE_PURCHASE)->where('undone', 0)->max('purchased_date');
$productLastUsed = $this->Database->stock_log()->where('product_id', $productId)->where('transaction_type', self::TRANSACTION_TYPE_CONSUME)->where('undone', 0)->max('used_date');