Skip to content

Commit

Permalink
Odczytanie cen statystycznych produktu
Browse files Browse the repository at this point in the history
  • Loading branch information
xlawok authored Apr 11, 2018
1 parent 1e01c3f commit 683f364
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/apisubiektgt/subiektgt/product.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,27 @@ protected function getGtObject(){
$this->qty = intval($qty['Dostepne']);
return true;
}
public function getPriceCalculations(){
if(!$this->productGt){
return false;
}
$this->setGtObject();
$this->productGt = $this->subiektGt->Towary->Wczytaj($this->code);


Logger::getInstance()->log('api','Pobrano kalkulacje cen: '.$this->productGt->Symbol,__CLASS__.'->'.__FUNCTION__,__LINE__);

$priceList = $this->productGt->Zakupy;

for ($i = 1, $size = $priceList->Liczba; $i<$size + 1; ++$i)
{
$data[$i]['nazwa'] = $priceList->Element($i)->Nazwa;
$data[$i]['wartosc'] = (string)$priceList->Element($i)->Wartosc;
}


return $data;
}

public function getListByStore(){
$sql = "SELECT tw_Symbol as code ,Rezerwacja as resevation,Dostepne as available FROM vwTowar WHERE st_MagId = ".intval($this->id_store);
Expand Down Expand Up @@ -141,4 +161,4 @@ public function getGt(){
return $this->productGt;
}
}
?>
?>

0 comments on commit 683f364

Please sign in to comment.