public function getTotalPurchaseByKeyMother($keyMother) { $products = $this->products->filterByKeyMother($keyMother); $restockEntries = $this->restockEntries->filterByArrayIdProduct($products->getPrimaryKeys()); $totalByKeyMother = 0; while ($restockEntries->valid()) { $restockEntry = $restockEntries->read(); $totalByKeyMother += $this->getPurchaseSettedByIdRestockEntry($restockEntry->getIdRestockEntry()); } return $totalByKeyMother; }
public function getTotalImportMaxByKeyMother() { foreach ($this->products->getKeyMother() as $keyMother) { $products = $this->products->filterByKeyMother($keyMother); $restockEntries = $this->restockEntries->filterByArrayIdProduct($products->getPrimaryKeys()); $total = 0; while ($restockEntries->valid()) { $restockEntry = $restockEntries->read(); if (!$restockEntry->isManualRestock()) { $total += $this->getNewImportMaxByIdRestockEntry($restockEntry->getIdRestockEntry()); } } $totalImportMaxByKeyMother[$keyMother] = $total; } return $totalImportMaxByKeyMother; }