Esempio n. 1
0
 /**
  * Get all tax rates
  * 
  * @param string $filter Filter name (all, sales, purchase, inactive)
  * @return TaxRate_Array
  * @throws InvalidFilterException 
  */
 public function getAll($filter = null)
 {
     $filters = array('all', 'sales', 'purchase', 'inactive');
     if (!in_array($filter, $filters)) {
         $message = 'Unknown filter "' . $filter . '" for TaxRates';
         $message .= '; available filters: ' . implode(', ', $filters);
         throw new InvalidFilterException($message);
     }
     $rates = new TaxRate_Array();
     foreach ($this->connector->getAll('TaxRate') as $rate) {
         if ($filter == 'inactive' && $rate->active || $filter != 'inactive' && !$rate->active) {
             continue;
         }
         if ($filter == 'sales' && $rate->taxRateType != TaxRate::RATE_TYPE_SALES) {
             continue;
         } elseif ($filter == 'purchase' && $rate->taxRateType != TaxRate::RATE_TYPE_PURCHASE) {
             continue;
         }
         $rates->append($rate);
     }
     return $rates;
 }
Esempio n. 2
0
 public function getAll()
 {
     return $this->connector->getAll('Product');
 }
Esempio n. 3
0
 /**
  * Get all contacts
  * 
  * @return Contact_Array
  */
 public function getAll()
 {
     return $this->connector->getAll('Contact');
 }
Esempio n. 4
0
 /**
  * Get all estimates
  * 
  * @param string|integer $filter Filter name or id (advanced filters)
  * @param Estimate_Subject $parent
  * @return Estimate_Array
  * @throws InvalidFilterException 
  */
 public function getAll($filter = null, Estimate_Subject $parent = null)
 {
     return $this->connector->getAll('Estimate', $filter, $parent);
 }
Esempio n. 5
0
 /**
  * Get all invoices
  * 
  * @param string|integer $filter Filter name or id (advanced filters)
  * @param Invoice_Subject $parent
  * @return Invoice_Array
  * @throws InvalidFilterException 
  */
 public function getAll($filter = null, Invoice_Subject $parent = null)
 {
     return $this->connector->getAll('Invoice', $filter, $parent);
 }
Esempio n. 6
0
 public function getAll()
 {
     return $this->connector->getAll('InvoiceProfile');
 }
Esempio n. 7
0
 /**
  * Get all templates
  * 
  * @param string $filter
  * @param RecurringTemplate_Subject $parent
  * @return RecurringTemplate_Array
  * @throws InvalidFilterException 
  */
 public function getAll($filter = null, RecurringTemplate_Subject $parent = null)
 {
     return $this->connector->getAll('RecurringTemplate', $filter, $parent);
 }