示例#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;
 }
示例#2
0
 public function getAll()
 {
     return $this->connector->getAll('Product');
 }
示例#3
0
 /**
  * Get all contacts
  * 
  * @return Contact_Array
  */
 public function getAll()
 {
     return $this->connector->getAll('Contact');
 }
示例#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);
 }
示例#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);
 }
示例#6
0
 public function getAll()
 {
     return $this->connector->getAll('InvoiceProfile');
 }
示例#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);
 }