Example #1
0
 /**
  * 
  * 
  * @param string $request
  * @param QuickBooks_Object $obj
  * @param boolean $continue_on_error
  * @param string $err
  * @return array
  */
 protected function _mapApplicationIDs($request, &$obj, $continue_on_error, &$err)
 {
     foreach ($obj->asList($request) as $key => $value) {
         if (is_array($value)) {
             // this function neeeds to beable to handle arrays, or objects
             /*
             foreach ($value as $subvalue)
             {
             	$err = '';
             	if ($this->_mapApplicationIDs($request, $subvalue, $continue_on_error, $err))
             	{
             		; // do nothing
             	}
             	else if (!$continue_on_error)
             	{
             		$err = 'Recursive map error: ' . $err;
             		return false;
             	}
             }
             */
         } else {
             /*
             				if (substr($key, strlen(QUICKBOOKS_API_APPLICATIONID) * -1, strlen(QUICKBOOKS_API_APPLICATIONID)) == QUICKBOOKS_API_APPLICATIONID)
             				{
             					$type = null;
             					$tag = null;
             					$ID = null;
             					$obj->decodeApplicationID($value, $type, $tag, $ID);
             					
             					if ($ListID_or_TxnID = $this->_mapToQuickBooksID($type, $ID))
             					{
             						$back = substr($key, 0, -1 * (strlen(QUICKBOOKS_API_APPLICATIONID) + 1));
             						
             						$obj->set($back . ' ' . $tag, $ListID_or_TxnID);
             					}
             					else if (!$continue_on_error)
             					{
             						$err = 'Unable to map key: ' . $key;
             						return false;
             					}
             				}*/
         }
     }
     return true;
 }
Example #2
0
 public function asList($request)
 {
     switch ($request) {
         case 'InvoiceAddRq':
             if (isset($this->_object['InvoiceLine'])) {
                 $this->_object['InvoiceLineAdd'] = $this->_object['InvoiceLine'];
             }
             if (isset($this->_object['ShippingLine'])) {
                 $this->_object['ShippingLineAdd'] = $this->_object['ShippingLine'];
             }
             if (isset($this->_object['SalesTaxLine'])) {
                 $this->_object['SalesTaxLineAdd'] = $this->_object['SalesTaxLine'];
             }
             if (isset($this->_object['DiscountLine'])) {
                 $this->_object['DiscountLineAdd'] = $this->_object['DiscountLine'];
             }
             break;
         case 'InvoiceModRq':
             if (isset($this->_object['InvoiceLine'])) {
                 $this->_object['InvoiceLineMod'] = $this->_object['InvoiceLine'];
             }
             break;
     }
     return parent::asList($request);
 }
Example #3
0
 public function asList($request)
 {
     switch ($request) {
         case 'CheckAddRq':
             if (isset($this->_object['ItemLine'])) {
                 $this->_object['ItemLineAdd'] = $this->_object['ItemLine'];
             }
             if (isset($this->_object['ItemGroupLine'])) {
                 $this->_object['ItemGroupLineAdd'] = $this->_object['ItemGroupLine'];
             }
             if (isset($this->_object['ExpenseLine'])) {
                 $this->_object['ExpenseLineAdd'] = $this->_object['ExpenseLine'];
             }
             if (isset($this->_object['AddCheckToTxn'])) {
                 $this->_object['AddCheckToTxnAdd'] = $this->_object['AddCheckToTxn'];
             }
             break;
         case 'CheckModRq':
             break;
     }
     return parent::asList($request);
 }
 public function asList($request)
 {
     switch ($request) {
         case QUICKBOOKS_ADD_INVENTORYADJUSTMENT . 'Rq':
             if (isset($this->_object['InventoryAdjustmentLine'])) {
                 $this->_object['InventoryAdjustmentLineAdd'] = $this->_object['InventoryAdjustmentLine'];
             }
             break;
     }
     return parent::asList($request);
 }
 public function asList($request)
 {
     switch ($request) {
         case 'EstimateAddRq':
             if (isset($this->_object['EstimateLine'])) {
                 $this->_object['EstimateLineAdd'] = $this->_object['EstimateLine'];
             }
             break;
         case 'EstimateModRq':
             if (isset($this->_object['EstimateLine'])) {
                 $this->_object['EstimateLineMod'] = $this->_object['EstimateLine'];
             }
             break;
     }
     return parent::asList($request);
 }
Example #6
0
 public function asList($request)
 {
     switch ($request) {
         case QUICKBOOKS_ADD_RECEIPTITEM . 'Rq':
             if (isset($this->_object['ItemLine'])) {
                 $this->_object['ItemLineAdd'] = $this->_object['ItemLine'];
             }
             if (isset($this->_object['ItemGroupLine'])) {
                 $this->_object['ItemGroupLineAdd'] = $this->_object['ItemGroupLine'];
             }
             if (isset($this->_object['ExpenseLine'])) {
                 $this->_object['ExpenseLineAdd'] = $this->_object['ExpenseLine'];
             }
             break;
         case QUICKBOOKS_MOD_RECEIPTITEM . 'Rq':
             if (isset($this->_object['ItemLine'])) {
                 $this->_object['ItemLineMod'] = $this->_object['ItemLine'];
             }
             if (isset($this->_object['ItemGroupLine'])) {
                 $this->_object['ItemGroupLineMod'] = $this->_object['ItemGroupLine'];
             }
             if (isset($this->_object['ExpenseLine'])) {
                 $this->_object['ExpenseLineMod'] = $this->_object['ExpenseLine'];
             }
             break;
         case QUICKBOOKS_QUERY_RECEIPTITEM . 'Rq':
             if (isset($this->_object['ItemLine'])) {
                 $this->_object['ItemLineQuery'] = $this->_object['ItemLine'];
             }
             if (isset($this->_object['ItemGroupLine'])) {
                 $this->_object['ItemGroupLineQuery'] = $this->_object['ItemGroupLine'];
             }
             if (isset($this->_object['ExpenseLIne'])) {
                 $this->_object['ExpenseLineQuery'] = $this->_object['ExpenseLine'];
             }
             break;
     }
     return parent::asList($request);
 }
 public function asList($request)
 {
     switch ($request) {
         case 'ReceivePaymentAddRq':
             if (isset($this->_object['AppliedToTxn'])) {
                 $this->_object['AppliedToTxnAdd'] = $this->_object['AppliedToTxn'];
             }
             break;
         case 'ReceivePaymentModRq':
             if (isset($this->_object['AppliedToTxn'])) {
                 $this->_object['AppliedToTxnMod'] = $this->_object['AppliedToTxn'];
             }
             break;
     }
     return parent::asList($request);
 }