Skip to content

Commit

Permalink
Přidání filtrování
Browse files Browse the repository at this point in the history
+ Možnost filtrace v seznamu faktur getInvoices(array('id_customer' =>
123))
+ Možnost filtrace v seznamu kontaktů getContacts(array('mail_to' =>
'[email protected]'))
+ Možnost filtrace v seznamu šablon a pravidelných faktur
getTemplates(array('type' => 2,'end_type' => 1))
  • Loading branch information
Dosty85 committed Oct 26, 2016
1 parent f566260 commit 2a5fd3b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ Podrobnou dokumentace k API najdete na [http://docs.vyfakturujcz.apiary.io/](htt

## Changelog

### Verze 2.1.4

+ Možnost filtrace v seznamu faktur getInvoices(array('id_customer' => 123))
+ Možnost filtrace v seznamu kontaktů getContacts(array('mail_to' => '[email protected]'))
+ Možnost filtrace v seznamu šablon a pravidelných faktur getTemplates(array('type' => 2,'end_type' => 1))

### Verze 2.1.3

+ Přidání podpůrné funkce test_invoice__asPdf() - vytvoření faktury a stažení v PDF bez uložení v systému
Expand Down
2 changes: 2 additions & 0 deletions examples/4-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@


$ret3 = $vyfakturuj_api->getTemplate($_ID_ITEM);
// $ret3 = $vyfakturuj_api->getTemplates(); // vrati vsechny sablony a pravidelné faktury
// $ret3 = $vyfakturuj_api->getTemplates(array('type' => 2,'end_type' => 1)); // vrati vsechny pravidelné faktury, které nemají nastaveno datum ukončení

echo '<h2>Načetli jsme data o pravidelné faktuře faktuře ze systému:</h2>';
echo '<pre>'.print_r($ret3,true).'</pre>';
Expand Down
17 changes: 9 additions & 8 deletions libs/VyfakturujAPI.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Třída pro práci s API Vyfakturuj.cz
*
* @author Ing. Martin Dostál <[email protected]>
* @version 2.1.3
* @version 2.1.4
*/
class VyfakturujAPI{

Expand Down Expand Up @@ -59,8 +59,8 @@ public function getInvoice($id){
*
* @return array
*/
public function getInvoices(){
return $this->_get('invoice/');
public function getInvoices($args = array()){
return $this->_get('invoice/?'.http_build_query($args));
}

/**
Expand Down Expand Up @@ -142,12 +142,13 @@ public function getContact($id){
}

/**
* Vrátí seznam všech kontaktů
* Vrátí seznam kontaktů
*
* @param array $args
* @return array
*/
public function getContacts(){
return $this->_get('contact/');
public function getContacts($args = array()){
return $this->_get('contact/?'.http_build_query($args));
}

/**
Expand Down Expand Up @@ -196,8 +197,8 @@ public function getTemplate($id){
*
* @return array
*/
public function getTemplates(){
return $this->_get('template/');
public function getTemplates($args = array()){
return $this->_get('template/?'.http_build_query($args));
}

/**
Expand Down

0 comments on commit 2a5fd3b

Please sign in to comment.