AAAAPK!?\- AvaTax.phpnuW+AasXML()); $indent_level = 0; $new_xml_lines = array(); foreach ($xml_lines as $xml_line) { if (preg_match('#(<[a-z0-9:-]+((s+[a-z0-9:-]+="[^"]+")*)?>.*]+>)|(<[a-z0-9:-]+((s+[a-z0-9:-]+="[^"]+")*)?s*/s*>)#i', $xml_line)) { $new_line = str_pad('', $indent_level*4) . $xml_line; $new_xml_lines[] = $new_line; } elseif (preg_match('#<[a-z0-9:-]+((s+[a-z0-9:-]+="[^"]+")*)?>#i', $xml_line)) { $new_line = str_pad('', $indent_level*4) . $xml_line; $indent_level++; $new_xml_lines[] = $new_line; } elseif (preg_match('#/]+>#i', $xml_line)) { $indent_level--; if (trim($new_xml_lines[sizeof($new_xml_lines)-1]) == trim(str_replace("/", "", $xml_line))) { $new_xml_lines[sizeof($new_xml_lines)-1] .= $xml_line; } else { $new_line = str_pad('', $indent_level*4) . $xml_line; $new_xml_lines[] = $new_line; } } else { $new_line = str_pad('', $indent_level*4) . $xml_line; $new_xml_lines[] = $new_line; } } $xml = join("n", $new_xml_lines); return ($html_output) ? '
' . htmlentities($xml) . '
' : $xml; } function getDefaultDate() { $dateTime=new DateTime(); $dateTime->setDate(1900,01,01); return $dateTime->format("Y-m-d"); } function getCurrentDate() { $dateTime=new DateTime(); return $dateTime->format("Y-m-d"); } ?>PK!?\ avalara.phpnuW+A array(0, 'int'), 'company_code' => array('', 'char'), 'account' => array('', 'char'), 'license' => array('', 'char'), 'committ' => array(0,'int'), 'only_cart' => array(1,'int'), 'dev' => array(0,'int'), 'avatax_virtuemart_country_id' => array(0,'int'), 'avatax_virtuemart_state_id' => array(0,'int'), 'accrual' => array(0,'int'), 'prevCheckoutAddInv' => array(1,'int') ); $this->setConfigParameterable ('calc_params', $varsToPush); $this->setPluginLoggable(); $this->tableFields = array('id', 'virtuemart_order_id', 'client_ip', 'sentValue','recievedValue'); $this->_tableId = 'id'; $this->_tablepkey = 'id'; $this->_tableId = 'id'; if (JVM_VERSION === 2) { define ('VMAVALARA_PATH', JPATH_ROOT . DS . 'plugins' . DS . 'vmcalculation' . DS . 'avalara' ); } else { define ('VMAVALARA_PATH', JPATH_ROOT . DS . 'plugins' . DS . 'vmcalculation' ); } define('VMAVALARA_CLASS_PATH', VMAVALARA_PATH . DS . 'classes' ); require(VMAVALARA_PATH.DS.'AvaTax.php'); // include in all Avalara Scripts if(!class_exists('ATConfig')) require (VMAVALARA_CLASS_PATH.DS.'ATConfig.class.php'); } function plgVmOnStoreInstallPluginTable($jplugin_name) { } /** * Gets the sql for creation of the table * @author Max Milbers */ public function getVmPluginCreateTableSQL() { return "CREATE TABLE IF NOT EXISTS `" . $this->_tablename . "` ( `id` mediumint(1) unsigned NOT NULL AUTO_INCREMENT , `virtuemart_calc_id` mediumint(1) UNSIGNED DEFAULT NULL, `activated` int(1), `account` char(255), `license` char(255), `created_on` datetime NOT NULL default '0000-00-00 00:00:00', `created_by` int(11) NOT NULL DEFAULT 0, `modified_on` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `modified_by` int(11) NOT NULL DEFAULT 0, `locked_on` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `locked_by` int(11) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `idx_virtuemart_calc_id` (`virtuemart_calc_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Table for avalara' AUTO_INCREMENT=1 ;"; } function plgVmAddMathOp(&$entryPoints){ $entryPoints[] = array('calc_value_mathop' => 'avalara', 'calc_value_mathop_name' => 'Avalara'); } function plgVmOnDisplayEdit(&$calc,&$html){ $html .= '
'.JText::_('VMCALCULATION_AVALARA').' '; $html .= VmHTML::row('checkbox','VMCALCULATION_AVALARA_ACTIVATED','activated',$calc->activated); $html .= VmHTML::row('input','VMCALCULATION_AVALARA_COMPANY_CODE','company_code',$calc->company_code); $html .= VmHTML::row('input','VMCALCULATION_AVALARA_ACCOUNT','account',$calc->account); $html .= VmHTML::row('input','VMCALCULATION_AVALARA_LICENSE','license',$calc->license); $html .= VmHTML::row('checkbox','VMCALCULATION_AVALARA_COMMITT','committ',$calc->committ); $html .= VmHTML::row('checkbox','VMCALCULATION_AVALARA_ONLYCART','only_cart',$calc->only_cart); $html .= VmHTML::row('checkbox','VMCALCULATION_AVALARA_ACCRUAL','accrual',$calc->accrual); $html .= VmHTML::row('checkbox','VMCALCULATION_AVALARA_DEV','dev',$calc->dev); $html .= VmHTML::row('checkbox','VMCALCULATION_AVALARA_PREVCHECKOUT_AD_INVALID','prevCheckoutAddInv',$calc->prevCheckoutAddInv); $label = 'VMCALCULATION_AVALARA_VADDRESS'; $lang =JFactory::getLanguage(); $label = $lang->hasKey($label.'_TIP') ? ''.JText::_($label).'' : JText::_($label) ; $html .= ' '; /* $countriesList = ShopFunctions::renderCountryList($calc->calc_countries,True); $this->assignRef('countriesList', $countriesList); $statesList = ShopFunctions::renderStateList($calc->virtuemart_state_ids,'', True); $this->assignRef('statesList', $statesList); $label = 'VMCALCULATION_AVALARA_VADDRESS'; $lang =JFactory::getLanguage(); $label = $lang->hasKey($label.'_TIP') ? ''.JText::_($label).'' : JText::_($label) ; $html .= ' */ $html .= ''; //$html .= VmHTML::row('checkbox','VMCALCULATION_AVALARA_VADDRESS','vAddress',$calc->vAddress); // $html .= VmHTML::row('checkbox','VMCALCULATION_ISTRAXX_AVALARA_TRACE','trace',$calc->trace); $html .= '
'.$label.' '.shopfunctions::renderCountryList($calc->avatax_virtuemart_country_id,TRUE,array(),'avatax_').' '.shopfunctions::renderStateList($calc->avatax_virtuemart_state_id,'avatax_',TRUE).'
'; if ($calc->activated) { $html .= $this->ping($calc); } $html .= JText::_('VMCALCULATION_AVALARA_MANUAL').'
'; return TRUE; } /** * We can only calculate it for the productdetails view * @param $calculationHelper * @param $rules */ public function plgVmInGatherEffectRulesProduct(&$calculationHelper,&$rules){ //If in cart, the tax is calculated per bill, so the rule per product must be removed if($calculationHelper->inCart){ foreach($rules as $k=>$rule){ if($rule['calc_value_mathop']=='avalara'){ unset($rules[$k]); } } } } public function plgVmStorePluginInternalDataCalc(&$data){ if (!class_exists ('TableCalcs')) { require(JPATH_VM_ADMINISTRATOR . DS . 'tables' . DS . 'calcs.php'); } if(!empty($data['avatax_virtuemart_country_id'])){ $data['avatax_virtuemart_country_id'] = serialize($data['avatax_virtuemart_country_id']); } $db = JFactory::getDBO (); $table = new TableCalcs($db); $table->setUniqueName('calc_name'); $table->setObligatoryKeys('calc_kind'); $table->setLoggable(); $table->setParameterable ($this->_xParams, $this->_varsToPushParam); $table->bindChecknStore($data); } public function plgVmGetPluginInternalDataCalc(&$calcData){ $calcData->setParameterable ($this->_xParams, $this->_varsToPushParam); if (!class_exists ('VmTable')) { require(JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'vmtable.php'); } VmTable::bindParameterable ($calcData, $this->_xParams, $this->_varsToPushParam); if(!is_array($calcData->avatax_virtuemart_country_id)){ //Suppress Warning $calcData->avatax_virtuemart_country_id = @unserialize($calcData->avatax_virtuemart_country_id); } return TRUE; } public function plgVmDeleteCalculationRow($id){ $this->removePluginInternalData($id); } function newATConfig($calc){ if(is_object($calc)){ $calc = get_object_vars($calc); } if(!empty($calc['dev'])){ $this->_connectionType = 'Development'; } else { $this->_connectionType = 'Production'; } if(!class_exists('TextCase')) require (VMAVALARA_CLASS_PATH.DS.'TextCase.class.php'); $__wsdldir = VMAVALARA_CLASS_PATH."/wsdl"; $standard = array( 'url' => 'no url specified', 'addressService' => '/Address/AddressSvc.asmx', 'taxService' => '/Tax/TaxSvc.asmx', 'batchService'=> '/Batch/BatchSvc.asmx', 'avacertService'=> '/AvaCert/AvaCertSvc.asmx', 'addressWSDL' => 'file://'.$__wsdldir.'/Address.wsdl', 'taxWSDL' => 'file://'.$__wsdldir.'/Tax.wsdl', 'batchWSDL' => 'file://'.$__wsdldir.'/BatchSvc.wsdl', 'avacertWSDL' => 'file://'.$__wsdldir.'/AvaCertSvc.wsdl', 'account' => '', 'license' => '', 'adapter' => 'avatax4php,5.10.0.0', 'client' => 'VirtueMart'.$this->vmVersion, 'name' => 'PHPAdapter', 'TextCase' => TextCase::$Mixed, 'trace' => TRUE); //VmConfig::$echoDebug = TRUE; //if(!is_object())avadebug($calc); if(!class_exists('ATConfig')) require (VMAVALARA_CLASS_PATH.DS.'ATConfig.class.php'); if($this->_connectionType == 'Development'){ $devValues = array( 'url' => 'https://development.avalara.net', 'account' => $calc['account'], 'license' => $calc['license'], 'trace' => TRUE); // change to false for production $resultingConfig = array_merge($standard,$devValues); $config = new ATConfig($this->_connectionType, $resultingConfig); } else { $prodValues = array( 'url' => 'https://avatax.avalara.net', 'account' => $calc['account'], 'license' => $calc['license'], 'trace' => FALSE); $resultingConfig = array_merge($standard,$prodValues); $config = new ATConfig($this->_connectionType, $resultingConfig); } return $config; } function ping ($calc) { $html = ''; $this->newATConfig($calc); if(!class_exists('TaxServiceSoap')) require (VMAVALARA_CLASS_PATH.DS.'TaxServiceSoap.class.php'); $client = new TaxServiceSoap($this->_connectionType); try { if(!class_exists('PingResult')) require (VMAVALARA_CLASS_PATH.DS.'PingResult.class.php'); $result = $client->ping("TEST"); vmInfo('Avalara Ping ResultCode is: '. $result->getResultCode() ); if(!class_exists('SeverityLevel')) require (VMAVALARA_CLASS_PATH.DS.'SeverityLevel.class.php'); if($result->getResultCode() != SeverityLevel::$Success){ foreach($result->Messages() as $msg){ $html .= $msg->Name().": ".$msg->Summary()."
"; } } else { vmInfo('Avalara used Ping Version is: '. $result->getVersion() ); } } catch(SoapFault $exception) { $err = "Exception: ping "; if($exception) $err .= $exception->faultstring; $err .='
'; $err .='last request: '. $client->__getLastRequest().'
'; $err .='last response: '. $client->__getLastResponse().'
'; vmError($err); avadebug('AvaTax the ping throws exception ',$exception); } return $html; } public function plgVmInterpreteMathOp ($calculationHelper, $rule, $price,$revert){ $rule = (object)$rule; if(empty($rule->published)) return $price; $mathop = $rule->calc_value_mathop; $tax = 0.0; if ($mathop=='avalara') { $requestedProductId = JRequest::getVar ('virtuemart_product_id',0); if(is_array($requestedProductId) and count($requestedProductId) > 0) { $requestedProductId = $requestedProductId[0]; } $requestedProductId = (int) $requestedProductId; if(isset($calculationHelper->_product)){ $productId = $calculationHelper->_product->virtuemart_product_id; } else { $productId = $requestedProductId; } if($calculationHelper->inCart){ $products = $this->getCartProducts($calculationHelper); if(!$products){ $this->blockCheckout(); return $price; } } //avadebug('plgVmInterpreteMathOp avalara ',$rule); if(($productId!=0 and $productId==$requestedProductId) or $calculationHelper->inCart ){ VmTable::bindParameterable ($rule, $this->_xParams, $this->_varsToPushParam); if($rule->activated==0) return $price; if(empty($this->addresses)){ $vmadd = $this->getShopperDataFromCart($rule); $this->addresses = $this->fillValidateAvalaraAddress($rule,$vmadd); } if($this->addresses){ if(empty($products))$products = $this->prepareSingleProduct($calculationHelper,$price); if($calculationHelper->inCart){ $prices = $calculationHelper->getCartPrices(); if(!empty($prices['salesPriceCoupon'])){ if(!isset($products['discountAmount'])) $products['discountAmount'] = 0.0; $products['discountAmount'] -= $prices['salesPriceCoupon']; vmdebug('Adding couponvalue to discount '.$products['discountAmount']); } } $tax = $this->getAvaTax( $rule,$products); if($calculationHelper->inCart){ $prices = $calculationHelper->getCartPrices(); if(isset($prices['shipmentValue']) and isset(self::$_taxResult['shipmentTax'] )) { self::$_taxResult['salesPriceShipment'] = ($prices['shipmentValue'] + self::$_taxResult['shipmentTax'] ); //self::$_taxResult['paymentTax'] = 0.0; } /*if(isset($prices['paymentValue']) and isset(self::$_taxResult['paymentTax'] )) { self::$_taxResult['paymentTax'] = 0.0; self::$_taxResult['salesPricePayment'] = ($prices['paymentValue'] + self::$_taxResult['paymentTax'] ); }*/ $calculationHelper->setCartPricesMerge(self::$_taxResult); } } else if($rule->prevCheckoutAddInv){ if($calculationHelper->inCart){ VmInfo('VMCALCULATION_AVALARA_INVALID_INFO'); } $this->blockCheckout(); } } } if($revert){ $tax = -$tax; } return $price + (float)$tax; } function plgVmConfirmedOrder ($cart, $order) { $avaTaxRule = 0; if(isset($order['calc_rules'])){ foreach($order['calc_rules'] as $rule){ if($rule->calc_mathop == 'avalara' and $rule->calc_kind == 'taxRulesBill'){ $avaTaxRule=$rule; break; } } } if($avaTaxRule!==0){ if(!empty($avaTaxRule->calc_params)){ VmTable::bindParameterable ($avaTaxRule, $this->_xParams, $this->_varsToPushParam); if($rule->activated==0)return false; if($rule->accrual==0)return false; if(empty($this->addresses)){ $vmadd = $this->getShopperDataFromCart($rule); $this->addresses = $this->fillValidateAvalaraAddress($rule,$vmadd); } if($this->addresses){ if (!class_exists ('calculationHelper')) require(JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'calculationh.php'); $calculator = calculationHelper::getInstance (); $orderModel = VmModel::getModel('orders'); $invoiceNumber = 'onr_'.$order['details']['BT']->order_number; JRequest::setVar('create_invoice',1); $orderModel -> createInvoiceNumber($order['details']['BT'],$invoiceNumber); avadebug('avatax plgVmConfirmedOrder $order',$invoiceNumber,$order); if(is_array($invoiceNumber)) $invoiceNumber = $invoiceNumber[0]; $products = $this->getCartProducts($calculator); $tax = $this->getAvaTax( $rule,$products,$invoiceNumber,$order['details']['BT']->order_number); //Todo adjust for BE $prices = $calculator->getCartPrices(); if($prices) { self::$_taxResult['salesPriceShipment'] = ($prices['shipmentValue'] + self::$_taxResult['shipmentTax'] ); self::$_taxResult['paymentTax'] = 0.0; } $calculator->setCartPricesMerge(self::$_taxResult); } } } } static $vmadd = NULL; private function getShopperDataFromCart($calc){ if(!isset(self::$vmadd)){ $view = JRequest::getWord('view',0); if($calc->only_cart == 1 and $view != 'cart'){ self::$vmadd = FALSE; return self::$vmadd; } //We need for the tax calculation the shipment Address //We have this usually in our cart. if (!class_exists('VirtueMartCart')) require(JPATH_VM_SITE . DS . 'helpers' . DS . 'cart.php'); $cart = VirtueMartCart::getCart(); //Test first for ST if($cart->STsameAsBT){ if(!empty($cart->BT)) $vmadd = $cart->BT; } else if(!empty($cart->ST)){ $vmadd = $cart->ST; } else { if(!empty($cart->BT)) $vmadd = $cart->BT; } $vmadd['customer_number'] = $cart->customer_number; if(empty($vmadd) or !is_array($vmadd) or (is_array($vmadd) and count($vmadd) <2) ){ vmInfo('VMCALCULATION_AVALARA_INSUF_INFO'); $vmadd=FALSE; } self::$vmadd = $vmadd; } return self::$vmadd; } static $validatedAddresses = NULL; private function fillValidateAvalaraAddress($calc,$vmadd){ if(!empty($vmadd)){ if(is_object($vmadd)){ $vmadd = get_object_vars($vmadd); } if(is_object($calc)){ $calc = get_object_vars($calc); } //avadebug('my $vmadd',$vmadd); //First country check if(empty($vmadd['virtuemart_country_id'])){ self::$validatedAddresses = FALSE; return self::$validatedAddresses; } else { if(empty($calc['avatax_virtuemart_country_id'])){ vmError('AvaTax, please select countries, to validate. Use fallback for USA and Canada'); //But lets use a fallback $calc['avatax_virtuemart_country_id'] = array('223','38'); //For USA and Canada } if(!is_array($calc['avatax_virtuemart_country_id'])){ //Suppress Warning $calc['avatax_virtuemart_country_id'] = @unserialize($calc['avatax_virtuemart_country_id']); } if(!in_array($vmadd['virtuemart_country_id'],$calc['avatax_virtuemart_country_id'])){ avadebug('fillValidateAvalaraAddress not validated, country not set',$vmadd['virtuemart_country_id'],$calc['avatax_virtuemart_country_id']); self::$validatedAddresses = FALSE; return self::$validatedAddresses; } } if(!class_exists('Address')) require (VMAVALARA_CLASS_PATH.DS.'Address.class.php'); $address = new Address(); if(isset($vmadd['address_1'])) $address->setLine1($vmadd['address_1']); if(isset($vmadd['address_2'])) $address->setLine2($vmadd['address_2']); if(isset($vmadd['city'])) $address->setCity($vmadd['city']); if(isset($vmadd['virtuemart_country_id'])){ $vmadd['country'] = ShopFunctions::getCountryByID($vmadd['virtuemart_country_id'],'country_2_code'); if(isset($vmadd['country'])) $address->setCountry($vmadd['country']); } if(isset($vmadd['virtuemart_state_id'])){ $vmadd['state'] = ShopFunctions::getStateByID($vmadd['virtuemart_state_id'],'state_2_code'); if(isset($vmadd['state'])) $address->setRegion($vmadd['state']); } if(isset($vmadd['zip'])) $address->setPostalCode($vmadd['zip']); $hash = md5(implode($vmadd,',')); $session = JFactory::getSession (); $validatedAddress = $session->get ('vm_avatax_address_checked.' . $hash, FALSE, 'vm'); if(!$validatedAddress){ $config = $this->newATConfig($calc); if(!class_exists('AddressServiceSoap')) require (VMAVALARA_CLASS_PATH.DS.'AddressServiceSoap.class.php'); $client = new AddressServiceSoap($this->_connectionType,$config); if(!class_exists('SeverityLevel')) require (VMAVALARA_CLASS_PATH.DS.'SeverityLevel.class.php'); if(!class_exists('Message')) require (VMAVALARA_CLASS_PATH.DS.'Message.class.php'); //if($calc->vAddress==0){ /* if(isset($vmadd['country']) and $vmadd['country']!= 'US' and $vmadd['country']!= 'CA'){ self::$validatedAddresses = array($address); return self::$validatedAddresses; }*/ $address->Coordinates = 1; $address->Taxability = TRUE; $textCase = TextCase::$Mixed; $coordinates = 1; if(!class_exists('ValidateResult')) require (VMAVALARA_CLASS_PATH.DS.'ValidateResult.class.php'); if(!class_exists('ValidateRequest')) require (VMAVALARA_CLASS_PATH.DS.'ValidateRequest.class.php'); if(!class_exists('ValidAddress')) require (VMAVALARA_CLASS_PATH.DS.'ValidAddress.class.php'); //TODO add customer code //shopper_number try { $request = new ValidateRequest($address, ($textCase ? $textCase : TextCase::$Default), $coordinates); vmSetStartTime('avaValAd'); //avadebug('my request for validate address ',$request); $result = $client->Validate($request); vmTime('Avatax validate Address','avaValAd'); //avadebug('Validate ResultCode is: '. $result->getResultCode());; if($result->getResultCode() != SeverityLevel::$Success) { foreach($result->getMessages() as $msg) { avadebug('fillValidateAvalaraAddress ' . $msg->getName().": ".$msg->getSummary()."\n"); } } else { self::$validatedAddresses = $result->getvalidAddresses(); $session->set ('vm_avatax_address_checked.' . $hash, TRUE, 'vm'); } } catch(SoapFault $exception) { $msg = "Exception: fillValidateAvalaraAddress "; if($exception) $msg .= $exception->faultstring; $msg .= "\n"; $msg .= $client->__getLastRequest()."\n"; $msg .= $client->__getLastResponse()."\n"; vmError($msg); } } else { self::$validatedAddresses[] = $address; } //then for BT and/or $cart->STsameAsBT } if(empty(self::$validatedAddresses)){ self::$validatedAddresses = FALSE; } return self::$validatedAddresses; } private function getCartProducts($calculationHelper){ if(!class_exists('VirtueMartCart')) require(JPATH_VM_SITE.DS.'helpers'.DS.'cart.php'); $cart = VirtueMartCart::getCart(); $count = count($cart->products); if($count===0){ avadebug('getCartProducts No Product'); return false; } $products = $cart->products; $prices = $calculationHelper->getCartPrices(); foreach($products as $k => &$product){ $product = (array) $product; /* if(!empty($prices[$k]['discountedPriceWithoutTax'])){ $price = $prices[$k]['discountedPriceWithoutTax']; avadebug('getAvatax getCartProducts take discountedPriceWithoutTax for i='.$k.' '.$price); } else */ if(!empty($prices[$k]['basePriceVariant'])){ $price = $prices[$k]['basePriceVariant']; } else { avadebug('There is no price in getTax for product '.$k.' ',$prices); $price = 0.0; } $product['price'] = $price; if(!empty($prices[$k]['discountAmount'])){ $product['discount'] = $prices[$k]['discountAmount']; } else { //avadebug('no discount for '.$k,$prices[$k]); $product['discount'] = FALSE; } } if(!empty($cart->virtuemart_shipmentmethod_id)){ $shipment = array(); $shipment['product_sku'] = 'VMShipmentId_'.$cart->virtuemart_shipmentmethod_id; $shipmentModel = VmModel::getModel('Shipmentmethod'); $shipmentModel->setId($cart->virtuemart_shipmentmethod_id); $shipmentMethod = $shipmentModel->getShipment(); $shipment['product_name'] = $shipmentMethod->shipment_name; $shipment['amount'] = 1; $shipment['price'] = $prices['shipmentValue']; //decimal // TotalAmmount $shipment['discount'] = 0.0; $products[] = $shipment; } /*if(!empty($cart->virtuemart_paymentmethod_id)){ $payment = array(); $payment['product_sku'] = 'VMPaymentId_'.$cart->virtuemart_paymentmethod_id; $paymentModel = VmModel::getModel('Paymentmethod'); $paymentModel->setId($cart->virtuemart_paymentmethod_id); $paymentMethod = $paymentModel->getPayment(); $payment['product_name'] = $paymentMethod->payment_name; $payment['amount'] = 1; if(isset($prices['paymentValue'])){ $payment['price'] = $prices['paymentValue']; //decimal // TotalAmmount } else { $payment['price'] = 0.0; } $payment['discount'] = 0.0; $products[] = $payment; }*/ $products['discountAmount'] = $prices['discountAmount']; return $products; } function prepareSingleProduct($calculationHelper,$price){ $products = array(); $calculationHelper->_product->price = $price; $products[0] = $calculationHelper->_product; if(!isset($products[0]->amount)){ $products[0]->amount = 1; } if(isset($calculationHelper->productPrices['discountAmount'])){ $products[0]->discount = $calculationHelper->productPrices['discountAmount']; } else { $products[0]->discount = FALSE; } return $products; } private static $_taxResult = NULL; function getAvaTax($calc,$products,$invoiceNumber=false,$orderNumber = false){ if($calc->activated==0) return false; if(count($products) == 0){ $this->blockCheckout(); return false; } if(!self::$validatedAddresses and $calc->prevCheckoutAddInv){ $this->blockCheckout(); return false; } $request = $this->createStandardRequest($calc,$products); if($orderNumber){ $request->setPurchaseOrderNo($orderNumber); //string Optional } $totalTax = 0.0; $hash = ''; $session = JFactory::getSession (); if($calc->committ and $invoiceNumber){ $request->setDocType(DocumentType::$SalesInvoice); // Only supported types are SalesInvoice or SalesOrder $request->setCommit(true); //invoice number, problem is that the invoice number is at this time not known, but the order_number may reachable $request->setDocCode($invoiceNumber); self::$_taxResult = FALSE; avadebug('Request as SalesInvoice with invoiceNumber '.$invoiceNumber); } else { $hash = serialize(self::$vmadd). serialize($request->getLines()). serialize($request->getDiscount()); $hash = md5($hash); $request->setDocType(DocumentType::$SalesOrder); $request->setCommit(false); //invoice number, problem is that the invoice number is at this time not known, neither the order_number $request->setDocCode('VM'.$this->vmVersion.'_order_request'); //Requests are allowed to be cached if(!AVATAX_DEBUG) self::$_taxResult = $session->get ('vm_avatax_tax.' . $hash, FALSE, 'vm'); } if(!self::$_taxResult){ vmSetStartTime('avagetTax'); self::$_taxResult = $this->executeRequest($request); vmTime('Avalara executeRequest hash '.$hash,'avagetTax'); if(self::$_taxResult!==FALSE){ $session->set ('vm_avatax_tax.' . $hash, serialize(self::$_taxResult), 'vm'); } } else { if(is_string(self::$_taxResult )){ self::$_taxResult = unserialize(self::$_taxResult); } } if(self::$_taxResult){ if(isset(self::$_taxResult['totalTax'])){ $totalTax = self::$_taxResult['totalTax']; } } return $totalTax; } function createStandardRequest($calc,$products,$sign=1){ if(!class_exists('TaxServiceSoap')) require (VMAVALARA_CLASS_PATH.DS.'TaxServiceSoap.class.php'); if(!class_exists('DocumentType')) require (VMAVALARA_CLASS_PATH.DS.'DocumentType.class.php'); if(!class_exists('DetailLevel')) require (VMAVALARA_CLASS_PATH.DS.'DetailLevel.class.php'); if(!class_exists('Line')) require (VMAVALARA_CLASS_PATH.DS.'Line.class.php'); if(!class_exists('ServiceMode')) require (VMAVALARA_CLASS_PATH.DS.'ServiceMode.class.php'); if(!class_exists('Line')) require (VMAVALARA_CLASS_PATH.DS.'Line.class.php'); if(!class_exists('GetTaxRequest')) require (VMAVALARA_CLASS_PATH.DS.'GetTaxRequest.class.php'); if(!class_exists('GetTaxResult')) require (VMAVALARA_CLASS_PATH.DS.'GetTaxResult.class.php'); if(!class_exists('Address')) require (VMAVALARA_CLASS_PATH.DS.'Address.class.php'); if(is_object($calc)){ $calc = get_object_vars($calc); } $request= new GetTaxRequest(); $origin = new Address(); //In Virtuemart we have not differenct warehouses, but we have a shipment address //So when the vendor has a shipment address, we assume that it is his warehouse //Later we can combine products with shipment addresses for different warehouse (yehye, future music) //But for now we just use the BT address if (!class_exists ('VirtueMartModelVendor')) require(JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'vendor.php'); $userId = VirtueMartModelVendor::getUserIdByVendorId ($calc['virtuemart_vendor_id']); $userModel = VmModel::getModel ('user'); $virtuemart_userinfo_id = $userModel->getBTuserinfo_id ($userId); // this is needed to set the correct user id for the vendor when the user is logged $userModel->getVendor($calc['virtuemart_vendor_id']); $vendorFieldsArray = $userModel->getUserInfoInUserFields ('mail', 'BT', $virtuemart_userinfo_id, FALSE, TRUE); $vendorFields = $vendorFieldsArray[$virtuemart_userinfo_id]; $origin->setLine1($vendorFields['fields']['address_1']['value']); $origin->setLine2($vendorFields['fields']['address_2']['value']); $origin->setCity($vendorFields['fields']['city']['value']); $origin->setCountry($vendorFields['fields']['virtuemart_country_id']['country_2_code']); $origin->setRegion($vendorFields['fields']['virtuemart_state_id']['state_2_code']); $origin->setPostalCode($vendorFields['fields']['zip']['value']); $request->setOriginAddress($origin); //Address if(isset($this->addresses[0])){ $destination = $this->addresses[0]; } else { return FALSE; } if (!class_exists ('calculationHelper')) require(JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'calculationh.php'); $calculator = calculationHelper::getInstance (); $request->setCurrencyCode($calculator->_currencyDisplay->_vendorCurrency_code_3); //CurrencyCode $request->setDestinationAddress ($destination); //Address $request->setCompanyCode($calc['company_code']); // Your Company Code From the Dashboard $request->setDocDate(date('Y-m-d')); //date, checked $request->setCustomerCode(self::$vmadd['customer_number']); //string Required if(isset(self::$vmadd['tax_usage_type'])){ $request->setCustomerUsageType(self::$vmadd['tax_usage_type']); //string Entity Usage } if(isset(self::$vmadd['tax_exemption_number'])){ $request->setExemptionNo(self::$vmadd['tax_exemption_number']); //string if not using ECMS which keys on customer code } if(isset(self::$vmadd['taxOverride'])){ $request->setTaxOverride(self::$vmadd['taxOverride']); avadebug('I set tax override ',self::$vmadd['taxOverride']); } $setAllDiscounted = false; if(isset($products['discountAmount'])){ if(!empty($products['discountAmount'])){ //$request->setDiscount($sign * $products['discountAmount'] * (-1)); //decimal $request->setDiscount($sign * $products['discountAmount'] ); //decimal vmdebug('We sent as discount '.$request->getDiscount()); $setAllDiscounted = true; } unset($products['discountAmount']); } $request->setDetailLevel('Tax'); //Summary or Document or Line or Tax or Diagnostic $lines = array(); $n = 0; $this->_lineNumbersToCartProductId = array(); foreach($products as $k=>$product){ $n++; $this->_lineNumbersToCartProductId[$n] = $k; $line = new Line(); $line->setNo ($n); //string // line Number of invoice $line->setItemCode($product['product_sku']); //string $line->setDescription($product['product_name']); //product description, like in cart, atm only the name, todo add customfields if(!empty($product['categories'])){ //avadebug('AvaTax setTaxCode Product has categories !',$catNames); if (!class_exists ('TableCategories')) { require(JPATH_VM_ADMINISTRATOR . DS . 'tables' . DS . 'categories.php'); } $db = JFactory::getDbo(); $catTable = new TableCategories($db); foreach($product['categories'] as $cat){ $catTable->load ($cat); $catslug = $catTable->slug; if(strpos($catslug,'avatax-')!==FALSE){ $taxCode = substr($catslug,7); if(!empty($taxCode)){ $line->setTaxCode($taxCode); } else { vmError('AvaTax setTaxCode, category could not be parsed '.$catslug); } break; } } } //$line->setTaxCode(""); //string $line->setQty($product['amount']); //decimal $line->setAmount($sign * $product['price'] * $product['amount']); //decimal // TotalAmmount if($setAllDiscounted or !empty($product['discount'])) { $line->setDiscounted(1); } else { $line->setDiscounted(0); } $line->setRevAcct(""); //string $line->setRef1(""); //string $line->setRef2(""); //string if(isset(self::$vmadd['tax_usage_type'])){ $line->setCustomerUsageType(self::$vmadd['tax_usage_type']); //string Entity Usage } if(isset(self::$vmadd['tax_exemption_number'])){ $line->setExemptionNo(self::$vmadd['tax_exemption_number']); //string if not using ECMS which keys on customer code } if(isset(self::$vmadd['taxOverride'])){ //create new TaxOverride Object set //$line->setTaxOverride(self::$vmadd['taxOverride']); } $lines[] = $line; } $this->newATConfig($calc); $request->setLines($lines); return $request; } function executeRequest($request){ $prices = array(); $client = new TaxServiceSoap($this->_connectionType); try { if(!class_exists('TaxLine')) require (VMAVALARA_CLASS_PATH.DS.'TaxLine.class.php'); if(!class_exists('TaxDetail')) require (VMAVALARA_CLASS_PATH.DS.'TaxDetail.class.php'); if(!class_exists('SeverityLevel')) require (VMAVALARA_CLASS_PATH.DS.'SeverityLevel.class.php'); //avadebug('executeRequest $request',$request); $_taxResult = $client->getTax($request); //avadebug('executeRequest $_taxResult',$_taxResult); if ( $_taxResult->getResultCode() == SeverityLevel::$Success){ //avadebug("DocCode: ".$request->getDocCode() ); //avadebug("DocId: ".self::$_taxResult->getDocId()."\n"); //avadebug("TotalAmount: ".self::$_taxResult->getTotalAmount() ); $totalTax = $_taxResult->getTotalTax(); $taxlines = $_taxResult->getTaxLines(); $taxlinexCount = count($taxlines); //avadebug('my $request, $taxlines',$taxlines); foreach($taxlines as $ctl){ $nr = $ctl->getNo(); if(isset($this->_lineNumbersToCartProductId[$nr]) and $nr <= $taxlinexCount){ $line = $request->getLine($nr); //vmdebug('my $line',$line); if(strpos($line->getItemCode(),'VMShipmentId')===0){ $prices['shipmentTax'] = $ctl->getTax(); $totalTax = $totalTax - $ctl->getTax(); /*} else if(strpos($line->getItemCode(),'VMPaymentId')===0){ $prices['paymentTax'] = $ctl->getTax(); $totalTax = $totalTax - $ctl->getTax(); vmdebug('VMPaymentId '.$prices['paymentTax']);*/ }else { $quantity = $line->getQty(); //avadebug('my $request qty ',$quantity); //on the long hand, the taxAmount must be replaced by taxAmountQuantity to avoid rounding errors $prices[$this->_lineNumbersToCartProductId[$nr]]['taxAmount'] = $ctl->getTax()/$quantity; $prices[$this->_lineNumbersToCartProductId[$nr]]['taxAmountQuantity'] = $ctl->getTax(); } } else { avadebug('got more lines back, then requested => my $ctl',$ctl); } } $prices['totalTax'] = $totalTax; } else { $this->blockCheckout(); foreach($_taxResult->getMessages() as $msg){ vmError($msg->getName().": ".$msg->getSummary(),'AvaTax Error '.$msg->getSummary()); } vmdebug('Error, but no exception in getAvaTax '.SeverityLevel::$Success,$_taxResult); return false; } } catch(SoapFault $exception) { $this->blockCheckout(); $msg = "Exception: in getAvaTax, while executeRequest "; if($exception) $msg .= $exception->faultstring; avadebug( $msg,$request); return false; } return $prices; } public function plgVmOnUpdateOrderPayment($data,$old_order_status){ if($data->order_status=='X'){ avadebug('plgVmOnUpdateOrderPayment cancel order for Avatax '.$old_order_status,$data->order_status); $this->cancelOrder($data,$old_order_status); } $toInvoice = VmConfig::get('inv_os',array('C')); if(!is_array($toInvoice)) $toInvoice = (array)$toInvoice; if($data->order_status=='R' or in_array($data->order_status,$toInvoice)){ $this->creditMemo($data); } } private function creditMemo($data){ $orderModel = VmModel::getModel('orders'); $orderDetails = $orderModel->getOrder($data->virtuemart_order_id); $calc = $this->getOrderCalc($orderDetails); if(!$calc) return false; if(!is_array($calc['avatax_virtuemart_country_id'])){ $calc['avatax_virtuemart_country_id'] = @unserialize($calc['avatax_virtuemart_country_id']); } if($calc['activated']==0){ avadebug('Avatax creditMemo rule not activated',$calc); return false; } if($calc['accrual'] and $data->order_status != 'R'){ avadebug('Avatax creditMemo, type is accrual and not a Refund',$calc); return false; } if(!class_exists('TaxServiceSoap')) require (VMAVALARA_CLASS_PATH.DS.'TaxServiceSoap.class.php'); if(!class_exists('DocumentType')) require (VMAVALARA_CLASS_PATH.DS.'DocumentType.class.php'); if(!class_exists('DetailLevel')) require (VMAVALARA_CLASS_PATH.DS.'DetailLevel.class.php'); if(!class_exists('Line')) require (VMAVALARA_CLASS_PATH.DS.'Line.class.php'); if(!class_exists('ServiceMode')) require (VMAVALARA_CLASS_PATH.DS.'ServiceMode.class.php'); if(!class_exists('Line')) require (VMAVALARA_CLASS_PATH.DS.'Line.class.php'); if(!class_exists('GetTaxResult')) require (VMAVALARA_CLASS_PATH.DS.'GetTaxResult.class.php'); $this->addresses = $this->fillValidateAvalaraAddress($calc,$orderDetails['details']['BT']); if(!$this->addresses){ vmdebug('Avatax: on order status update: no valid addresses'); return false; } if(is_object($orderDetails['details']['BT'])){ self::$vmadd = get_object_vars($orderDetails['details']['BT']); } else { self::$vmadd = $orderDetails['details']['BT']; } $toInvoice = VmConfig::get('inv_os',array('C')); if(!is_array($toInvoice)) $toInvoice = (array)$toInvoice; //Lets find first if the committ was already done, the committ was already done, if one of history orderstatuses //have one status for create invoice. //vmdebug('my orderDetails ',$orderDetails); self::$vmadd['taxOverride'] = null; foreach($orderDetails['history'] as $item){ if(in_array($item->order_status_code,$toInvoice)){ //the date of the order status used to create the invoice self::$vmadd['taxOverride'] = $this->createTaxOverride(substr($item->created_on,0,10),$data->order_status,$item->comments); //self::$vmadd['paymentDate'] = substr($item->created_on,0,10); //Date when order is created //self::$vmadd['taxOverride'] = $orderDetails['details']['BT']->created_on; break; } } //Accrual Accounting means the committ is done directly after pressing the confirm button in the cart //Therefore the date of the committ/invoice is the first order date and we dont need to check the order history if(empty(self::$vmadd['taxOverride']) and $calc['accrual']){ self::$vmadd['taxOverride'] = $this->createTaxOverride($orderDetails['details']['BT']->created_on,$data->order_status); } //create the products $products = array(); foreach($orderDetails['items'] as $k => $item){ $product = array(); $item = (array)$item; //vmdebug('my item',$item); $product['product_sku'] = $item['order_item_sku']; $product['product_name'] = $item['order_item_name']; $product['amount'] = $item['product_quantity']; //$product['price'] = $item['product_final_price']; $product['price'] = $item['product_item_price']; $product['discount'] = $item['product_subtotal_discount']; $model = VmModel::getModel('product'); $rProduct = $model->getProduct($item['virtuemart_product_id']); $product['categories'] = $rProduct->categories; $products[] = $product; } if(!empty($orderDetails['details']['BT']->virtuemart_shipmentmethod_id)){ $shipment = array(); $shipment['product_sku'] = 'VMShipmentId_'.$orderDetails['details']['BT']->virtuemart_shipmentmethod_id; $shipmentModel = VmModel::getModel('Shipmentmethod'); $shipmentModel->setId($orderDetails['details']['BT']->virtuemart_shipmentmethod_id); $shipmentMethod = $shipmentModel->getShipment(); $shipment['product_name'] = $shipmentMethod->shipment_name; $shipment['amount'] = 1; $shipment['price'] = $orderDetails['details']['BT']->order_shipment; //decimal // TotalAmmount $shipment['discount'] = 0.0; $products[] = $shipment; } $products['discountAmount'] = $orderDetails['details']['BT']->order_discountAmount - $orderDetails['details']['BT']->coupon_discount; if($data->order_status=='R') { $sign = -1; } else { $sign = 1; } $request = $this->createStandardRequest($calc,$products,$sign); $request->setCompanyCode($calc['company_code']); // Your Company Code From the Dashboard $request->setDocDate(date('Y-m-d')); //date $request->setCustomerCode($orderDetails['details']['BT']->customer_number); //string Required if($orderDetails['details']['BT']->order_number){ $request->setPurchaseOrderNo($orderDetails['details']['BT']->order_number); //string Optional } $totalTax = 0.0; $invoiceNumber = 'onr_'.$orderDetails['details']['BT']->order_number; JRequest::setVar('create_invoice',1); $orderModel -> createInvoiceNumber($orderDetails['details']['BT'],$invoiceNumber); if(is_array($invoiceNumber)) $invoiceNumber = $invoiceNumber[0]; if($calc['committ'] and $invoiceNumber){ if($data->order_status=='R') { $request->setDocType(DocumentType::$ReturnInvoice); } else { $request->setDocType(DocumentType::$SalesInvoice); } // Only supported types are SalesInvoice or SalesOrder $request->setCommit(true); $request->setDocCode($invoiceNumber); self::$_taxResult = FALSE; } vmSetStartTime('avagetTax'); self::$_taxResult = $this->executeRequest($request); vmTime('Avalara executeRequest ','avagetTax'); if(self::$_taxResult){ if(isset(self::$_taxResult['totalTax'])){ $totalTax = self::$_taxResult['totalTax']; } } return $totalTax; } private function cancelOrder($data,$old_order_status){ // vmdebug('my data on cancelOrder ',$data); // if(empty($data->invoice_number)) return false; $orderModel = VmModel::getModel('orders'); $orderDetails = $orderModel->getOrder($data->virtuemart_order_id); $calc = $this->getOrderCalc($orderDetails); if(!$calc) return false; $invoiceNumber = 'onr_'.$orderDetails['details']['BT']->order_number; $orderModel -> createInvoiceNumber($orderDetails['details']['BT'],$invoiceNumber); if(!$invoiceNumber){ vmInfo('No invoice created, no reason to cancel at Avatax'); return false; } if(is_array($invoiceNumber)) $invoiceNumber = $invoiceNumber[0];# if(!function_exists('EnsureIsArray')) require(VMAVALARA_PATH.DS.'AvaTax.php'); // include in all Avalara Scripts if(!class_exists('TaxServiceSoap')) require (VMAVALARA_CLASS_PATH.DS.'TaxServiceSoap.class.php'); if(!class_exists('CancelTaxRequest')) require (VMAVALARA_CLASS_PATH.DS.'CancelTaxRequest.class.php'); $this->newATConfig($calc); $client = new TaxServiceSoap($this->_connectionType); $request= new CancelTaxRequest(); $request->setDocCode($invoiceNumber); $request->setDocType(DocumentType::$SalesInvoice); $request->setCompanyCode($calc['company_code']); // Dashboard Company Code if($calc['committ']==0) return false; //CancelCode: Enter D for DocDeleted, or P for PostFailed: [D] //I do not know the difference, I use always D (I assume this means order got deleted, cancelled, or refund) $code = CancelCode::$DocDeleted; $request->setCancelCode($code); try { avadebug('plgVmOnCancelPayment used request',$request); $result = $client->cancelTax($request); if ($result->getResultCode() != "Success") { $msg = ''; foreach($result->getMessages() as $rmsg) { $msg .= $rmsg->getName().": ".$rmsg->getSummary()."\n"; } vmError($msg); } else { vmInfo('CancelTax ResultCode is: '.$result->getResultCode()); } } catch(SoapFault $exception) { $msg = "Exception: "; if($exception) $msg .= $exception->faultstring; $msg .="\n"; $msg .= $client->__getLastRequest()."\n"; $msg .= $client->__getLastResponse()."\n"; vmError($msg); } } private function getOrderCalc($orderDetails){ $calc = 0; if(!empty($orderDetails['calc_rules'])){ foreach($orderDetails['calc_rules'] as $rule){ if($rule->calc_kind=='taxRulesBill' and $rule->calc_mathop == 'avalara'){ $calc = $rule; break; } } } if(empty($calc)){ avadebug('Retrieving calculation rule for avatax failed',$orderDetails->virtuemart_order_id); return false; } if(is_object($calc)){ $calc = get_object_vars($calc); } if(!empty($calc['calc_params'])){ VmTable::bindParameterable ($calc, $this->_xParams, $this->_varsToPushParam); return $calc; } else { avadebug('rule had no parameters',$calc); return false; } } private function createTaxOverride($date,$orderStatus='R',$reason=''){ if(!class_exists('TaxOverride')) require (VMAVALARA_CLASS_PATH.DS.'TaxOverride.class.php'); if(!class_exists('TaxOverrideType')) require (VMAVALARA_CLASS_PATH.DS.'TaxOverrideType.class.php'); $taxOverride = new TaxOverride(); $taxOverride->setTaxOverrideType(TaxOverrideType::$TaxDate); //TaxOverrideType $None, $TaxAmount, $Exemption, $TaxDate ??? //$taxOverride->setTaxAmount($value); //decimal $taxOverride->setTaxDate($date); //date format? if(empty($reason)){ $user = JFactory::getUser(); $reason = 'Vm_'.$orderStatus.'_by_'.$user->name; } $taxOverride->setReason($reason); return $taxOverride; } public function blockCheckout(){ $app = JFactory::getApplication(); if($app->isSite()){ if (!class_exists('VirtueMartCart')) require(JPATH_VM_SITE . DS . 'helpers' . DS . 'cart.php'); $cart = VirtueMartCart::getCart(); $cart->blockConfirm(); } } } // No closing tag PK!?\nll avalara.xmlnuW+A VM - Calculation Avalara Tax February 2013 Max Milbers http://virtuemart.net Copyright (C) 2013 iStraxx UG (haftungsbeschränkt). All rights reserved http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL 2.0.18b On demand tax calculation for whole U.S.A. en-GB.plg_vmcalculation_avalara.ini avalara.php AvaTax.php classes PK!?\V index.htmlnuW+A PK!?\) .htaccessnuW+A Order allow,deny Deny from all PK!?\R classes/DetailLevel.class.phpnuW+APK!?\%eeclasses/DocStatus.class.phpnuW+ADocStatus::$Any) * and indicates the state of the document in tax history. * * @author Avalara * @copyright � 2004 - 2011 Avalara, Inc. All rights reserved. * @package Tax */ class DocStatus extends Enum { /** * A temporary document not saved (DocumentType was SalesOrder, PurchaseOrder, ReturnOrder) * * @var unknown_type */ public static $Temporary= 'Temporary'; /** * A saved document (DocumentType was SalesInvoice, PurchaseInvoice, ReturnInvoice) ready to be posted. * * @var DocStatus */ public static $Saved = 'Saved'; /** * A posted document (not committed). * * @var DocStatus */ public static $Posted = 'Posted'; /** * A posted document that has been committed. * * @var DocStatus */ public static $Committed = 'Committed'; /** * A committed document that has been cancelled. * * @var DocStatus */ public static $Cancelled = 'Cancelled'; /** * Enter description here... * * @var DocStatus */ public static $Adjusted = 'Adjusted'; /** * Any status (used for searching) * * @var DocStatus */ public static $Any = 'Any'; public static function Values() { return array( DocStatus::$Temporary, DocStatus::$Saved, DocStatus::$Posted, DocStatus::$Committed, DocStatus::$Cancelled, DocStatus::$Adjusted, DocStatus::$Any ); } // Unfortunate boiler plate due to polymorphism issues on static functions public static function Validate($value) { self::__Validate($value,self::Values(),__CLASS__); } } ?>PK!?\xJclasses/BaseResult.class.phpnuW+ATransactionId; } /** * Indicates whether operation was successfully completed or not. * @return string */ public function getResultCode() { return $this->ResultCode; } /** * Accessor * @return array */ public function getMessages() { return EnsureIsArray($this->Messages->Message); } } ?>PK!?\ Y #classes/DynamicSoapClient.class.phpnuW+Aconfig = $config; } public function __call($n,$args) { if(!class_exists('CancelTaxResult')) require (VMAVALARA_CLASS_PATH.DS.'CancelTaxResult.class.php'); $result = null; $profileHeader = new SoapHeader('http://avatax.avalara.com/services','Profile',new SoapVar($this->profileXML(),XSD_ANYXML)); $securityHeader = new SoapHeader('http://avatax.avalara.com/services','Security',new SoapVar($this->securityXML(),XSD_ANYXML)); if(!class_exists('Message')) require (VMAVALARA_CLASS_PATH.DS.'Message.class.php'); $result = $this->__soapCall($n,$args,NULL,array($securityHeader,$profileHeader)); return $result; } private function securityXML() { return ''. ''. ''.$this->config->account.''. ''.$this->config->license.''. //2005-11-22T06:33:26.203Z ''. ''; } private function profileXML() { return ''. ''.$this->config->name.''. ''.$this->config->client.''. ''.$this->config->adapter.''. ''; } } ?> PK!?\&classes/ExemptionCertificate.class.phpnuW+AAvaCertId=$value;} // string public function getAvaCertId(){return $this->AvaCertId;} // string public function setJurisdictions($value){$this->Jurisdictions=$value;} // ArrayOfJurisdiction public function getJurisdictions(){return $this->Jurisdictions;} // ArrayOfJurisdiction public function setCustomerCodes($value){$this->CustomerCodes=$value;} // ArrayOfString public function getCustomerCodes(){return $this->CustomerCodes;} // ArrayOfString public function setCustomerType($value){$this->CustomerType=$value;} // string public function getCustomerType(){return $this->CustomerType;} // string public function setLocationName($value){$this->LocationName=$value;} // string public function getLocationName(){return $this->LocationName;} // string public function setLocationCode($value){$this->LocationCode=$value;} // string public function getLocationCode(){return $this->LocationCode;} // string public function setCertificateStatus($value){$this->CertificateStatus=$value;} // CertificateStatus public function getCertificateStatus(){return $this->CertificateStatus;} // CertificateStatus public function setReviewStatus($value){$this->ReviewStatus=$value;} // ReviewStatus public function getReviewStatus(){return $this->ReviewStatus;} // ReviewStatus public function setCreatedDate($value){$this->CreatedDate=$value;} // dateTime public function getCreatedDate(){return $this->CreatedDate;} // dateTime public function setModifiedDate($value){$this->ModifiedDate=$value;} // dateTime public function getModifiedDate(){return $this->ModifiedDate;} // dateTime public function setReceivedDate($value){$this->ReceivedDate=$value;} // dateTime public function getReceivedDate(){return $this->ReceivedDate;} // dateTime public function setBusinessName($value){$this->BusinessName=$value;} // string public function getBusinessName(){return $this->BusinessName;} // string public function setAddress1($value){$this->Address1=$value;} // string public function getAddress1(){return $this->Address1;} // string public function setAddress2($value){$this->Address2=$value;} // string public function getAddress2(){return $this->Address2;} // string public function setCity($value){$this->City=$value;} // string public function getCity(){return $this->City;} // string public function setRegion($value){$this->Region=$value;} // string public function getRegion(){return $this->Region;} // string public function setCountry($value){$this->Country=$value;} // string public function getCountry(){return $this->Country;} // string public function setPostalCode($value){$this->PostalCode=$value;} // string public function getPostalCode(){return $this->PostalCode;} // string public function setPhone($value){$this->Phone=$value;} // string public function getPhone(){return $this->Phone;} // string public function setEmail($value){$this->Email=$value;} // string public function getEmail(){return $this->Email;} // string public function setSignedDate($value){$this->SignedDate=$value;} // dateTime public function getSignedDate(){return $this->SignedDate;} // dateTime public function setSignerName($value){$this->SignerName=$value;} // string public function getSignerName(){return $this->SignerName;} // string public function setSignerTitle($value){$this->SignerTitle=$value;} // string public function getSignerTitle(){return $this->SignerTitle;} // string public function setBusinessDescription($value){$this->BusinessDescription=$value;} // string public function getBusinessDescription(){return $this->BusinessDescription;} // string public function setSellerPropertyDescription($value){$this->SellerPropertyDescription=$value;} // string public function getSellerPropertyDescription(){return $this->SellerPropertyDescription;} // string public function setCertificateUsage($value){$this->CertificateUsage=$value;} // CertificateUsage public function getCertificateUsage(){return $this->CertificateUsage;} // CertificateUsage public function setIsPartialExemption($value){$this->IsPartialExemption=$value;} // boolean public function getIsPartialExemption(){return $this->IsPartialExemption;} // boolean public function setExemptReasonCode($value){$this->ExemptReasonCode=$value;} // string public function getExemptReasonCode(){return $this->ExemptReasonCode;} // string public function setExemptFormName($value){$this->ExemptFormName=$value;} // string public function getExemptFormName(){return $this->ExemptFormName;} // string public function setCustom1($value){$this->Custom1=$value;} // string public function getCustom1(){return $this->Custom1;} // string public function setCustom2($value){$this->Custom2=$value;} // string public function getCustom2(){return $this->Custom2;} // string public function setCustom3($value){$this->Custom3=$value;} // string public function getCustom3(){return $this->Custom3;} // string } ?> PK!?\*SJJ%classes/GetTaxHistoryResult.class.phpnuW+AGetTaxRequest; } /** * Gets the original {@link GetTaxResult} for the document. * * @return GetTaxResult */ public function getGetTaxResult() { return $this->GetTaxResult; } // BaseResult innards - work around a bug in SoapClient /** * @var string */ private $TransactionId; /** * @var string must be one of the values defined in {@link SeverityLevel}. */ private $ResultCode = 'Success'; /** * @var array of Message. */ private $Messages = array(); /** * Accessor * @return string */ public function getTransactionId() { return $this->TransactionId; } /** * Accessor * @return string */ public function getResultCode() { return $this->ResultCode; } /** * Accessor * @return array */ public function getMessages() { return EnsureIsArray($this->Messages->Message); } } ?>PK!?\$uH<<classes/PostTaxResult.class.phpnuW+ATransactionId; } /** * Accessor * @return string */ public function getResultCode() { return $this->ResultCode; } /** * Accessor * @return array */ public function getMessages() { return EnsureIsArray($this->Messages->Message); } } ?>PK!?\\%classes/ApplyPaymentRequest.class.phpnuW+ADocType=DocumentType::$SalesOrder; } /** * Sets the companyCode value for this ApplyPaymentRequest. * * @param string $value */ public function setCompanyCode($value){ $this->CompanyCode=$value;} //string /** * Sets the docCode value for this ApplyPaymentRequest. * * @param DocumentType $value */ public function setDocType($value){ $this->DocType=$value;} //DocumentType /** * Sets the docType value for this ApplyPaymentRequest. * * @param string $value */ public function setDocCode($value){ $this->DocCode=$value;} //string /** * PaymentDate should be in the format yyyy-mm-dd * * @param date $value */ public function setPaymentDate($value){ $this->PaymentDate=$value;} //date /** * Gets the companyCode value for this ApplyPaymentRequest. * * @return string */ public function getCompanyCode(){ return $this->CompanyCode;} //string /** * Gets the docType value for this ApplyPaymentRequest. * * @return DocumentType */ public function getDocType(){ return $this->DocType;} //DocumentType /** * Gets the docCode value for this ApplyPaymentRequest. * * @return unknown */ public function getDocCode(){ return $this->DocCode;} //string /** * PaymentDate should be in the format yyyy-mm-dd * * @param date $value */ public function getPaymentDate(){ return $this->PaymentDate;} //date } ?>PK!?\jV[[!classes/ValidateRequest.class.phpnuW+A * Example: * $svc = new AddressServiceSoap(); * * $address = new Address(); * $address->setLine1("900 Winslow Way"); * $address->setCity("Bainbridge Island"); * $address->setRegion("WA"); * $address->setPostalCode("98110"); * * ValidateRequest validateRequest = new ValidateRequest(); * validateRequest.setAddress(address); * validateRequest.setTextCase(TextCase.Upper); * * ValidateResult result = svc.validate(validateRequest); * ArrayOfValidAddress arrValids = result.getValidAddresses(); * int numAddresses = (arrValids == null || * arrValids.getValidAddress() == null ? 0 : * arrValids.getValidAddress().length); * System.out.println("Number of Addresses is " + numAddresses); * * * @author Avalara * @copyright � 2004 - 2011 Avalara, Inc. All rights reserved. * @package Address */ //public function validate($address, $textCase = 'Default', $coordinates = false) //{ // $request = new ValidateRequest($address, ($textCase ? $textCase : TextCase::$Default), $coordinates); // return $this->client->Validate(array('ValidateRequest' => $request))->ValidateResult; //} class ValidateRequest { private $Address; private $TextCase = 'Default'; private $Coordinates = false; private $Taxability=false; public function __construct($address = null, $textCase = 'Default', $coordinates = false) { $this->setAddress($address); $this->setTextCase($textCase); $this->setCoordinates($coordinates); } // mutators /** * The address to Validate. *
     * Example:
     * $address = new Address();
     * $address->setLine1("900 Winslow Way");
     * $address->setCity("Bainbridge Island");
     * $address->setRegion("WA");
     * $address->setPostalCode("98110");
     *
     * $validateRequest = new ValidateRequest();
     * $validateRequest->setAddress(address);
     * $validateRequest->setTextCase(TextCase::$Upper);
     *
     * $result = svc->validate(validateRequest);
     * 
* * @var Address */ public function setAddress(&$value) { $this->Address = $value; return $this; } /** * The casing to apply to the validated address(es). *
     * Example:
     * Example:
     * $address = new Address();
     * $address->setLine1("900 Winslow Way");
     * $address->setCity("Bainbridge Island");
     * $address->setRegion("WA");
     * $address->setPostalCode("98110");
     *
     * $validateRequest = new ValidateRequest();
     * $validateRequest->setAddress(address);
     * $validateRequest->setTextCase(TextCase::$Upper);
     *
     * $result = svc->validate(validateRequest);
     * 
* * @var string * @see TextCase */ public function setTextCase($value) { if($value) { TextCase::Validate($value); $this->TextCase = $value; } else { $this->TextCase = TextCase::$Default; } return $this; } /** * Sets whether to fetch the coordinates value for this ValidateRequest. *

* True will return the @see ValidAddress#Latitude and @see ValidAddress#Longitude values for the @see ValidAddresses * Default value is false *

* @var boolean */ public function setCoordinates($value) { $this->Coordinates = ($value ? true : false); return $this; } //@author:swetal public function setTaxability($value) { $this->Taxability=$value; } // accessors /** * The address to Validate. *
     * Example:
     * $address = new Address();
     * $address->setLine1("900 Winslow Way");
     * $address->setCity("Bainbridge Island");
     * $address->setRegion("WA");
     * $address->setPostalCode("98110");
     *
     * $validateRequest = new ValidateRequest();
     * $validateRequest->setAddress(address);
     * $validateRequest->setTextCase(TextCase::$Upper);
     *
     * $result = svc->validate(validateRequest);
     * 
* * @return Address */ public function getAddress() { return $this->Address; } /** * The casing to apply to the validated address(es). *
     * Example:
     * Example:
     * $address = new Address();
     * $address->setLine1("900 Winslow Way");
     * $address->setCity("Bainbridge Island");
     * $address->setRegion("WA");
     * $address->setPostalCode("98110");
     *
     * $validateRequest = new ValidateRequest();
     * $validateRequest->setAddress(address);
     * $validateRequest->setTextCase(TextCase::$Upper);
     *
     * $result = svc->validate(validateRequest);
     * 
* * @return string * @see TextCase */ public function getTextCase() { return $this->TextCase; } /** * Returns whether to return the coordinates value for this ValidateRequest. *

* True will return the @see ValidAddress#Latitude and @see ValidAddress#Longitude values for the @see ValidAddresses * Default value is false *

* @return boolean */ public function getCoordinates() { return $this->Coordinates; } } ?> PK!?\8`? ? classes/Customer.class.phpnuW+ACompanyCode=$value;} // string public function getCompanyCode(){return $this->CompanyCode;} // string public function setCustomerCode($value){$this->CustomerCode=$value;} // string public function getCustomerCode(){return $this->CustomerCode;} // string public function setNewCustomerCode($value){$this->NewCustomerCode=$value;} // string public function getNewCustomerCode(){return $this->NewCustomerCode;} // string public function setCustomerType($value){$this->CustomerType=$value;} // string public function getCustomerType(){return $this->CustomerType;} // string public function setCustomerName($value){$this->CustomerName=$value;} // string public function getCustomerName(){return $this->CustomerName;} // string public function setAttn($value){$this->Attn=$value;} // string public function getAttn(){return $this->Attn;} // string public function setAddress1($value){$this->Address1=$value;} // string public function getAddress1(){return $this->Address1;} // string public function setAddress2($value){$this->Address2=$value;} // string public function getAddress2(){return $this->Address2;} // string public function setCity($value){$this->City=$value;} // string public function getCity(){return $this->City;} // string public function setRegion($value){$this->Region=$value;} // string public function getRegion(){return $this->Region;} // string public function setPostalCode($value){$this->PostalCode=$value;} // string public function getPostalCode(){return $this->PostalCode;} // string public function setCountry($value){$this->Country=$value;} // string public function getCountry(){return $this->Country;} // string public function setPhone($value){$this->Phone=$value;} // string public function getPhone(){return $this->Phone;} // string public function setFax($value){$this->Fax=$value;} // string public function getFax(){return $this->Fax;} // string public function setEmail($value){$this->Email=$value;} // string public function getEmail(){return $this->Email;} // string public function setParentCustomerCode($value){$this->ParentCustomerCode=$value;} // string public function getParentCustomerCode(){return $this->ParentCustomerCode;} // string } ?> PK!?\classes/AddressType.class.phpnuW+A AddressType::$FirmOrCompany, 'GeneralDelivery' => AddressType::$GeneralDelivery, 'HighRise' => AddressType::$HighRise, 'POBox' => AddressType::$POBox, 'RuralRoute' => AddressType::$RuralRoute, 'StreetOrResidential' => AddressType::$StreetOrResidential ); } // Unfortunate boiler plate due to polymorphism issues on static functions public static function Validate($value) { self::__Validate($value,self::Values(),__CLASS__); } } ?> PK!?\ڇ!classes/TaxOverrideType.class.phpnuW+APK!?\R R classes/Message.class.phpnuW+ASummary; } /** * Gets the details of the message. * * @return string */ public function getDetails() { return $this->Details; } /** *Gets the URL to help page for this message. * * @return unknown */ public function getHelpLink() { return $this->HelpLink; } /** * Gets the item the message refers to, if applicable. Used to indicate a missing or incorrect value. * * @return unknown */ public function getRefersTo() { return $this->RefersTo; } /** * Gets the Severity Level of the message. * * @return unknown */ public function getSeverity() { return $this->Severity; } /** * Gets the source of the message. * * @return unknown */ public function getSource() { return $this->Source; } /** * Gets the name of the message. * * @return unknown */ public function getName() { return $this->Name; } // mutators public function setSummary($value) { $this->Summary = $value; return $this; } public function setDetails($value) { $this->Details = $value; return $this; } public function setHelpLink($value) { $this->HelpLink = $value; return $this; } public function setRefersTo($value) { $this->RefersTo = $value; return $this; } public function setSeverity($value) { SeverityLevel::Validate($value); $this->Severity = $value; return $this; } public function setSource($value) { $this->Source = $value; return $this; } public function setName($value) { $this->Name = $value; return $this; } } ?>PK!?\릵B"classes/JurisdictionType.class.phpnuW+APK!?\}classes/DocumentType.class.phpnuW+APK!?\NH$classes/AddCustomerRequest.class.phpnuW+ACustomer=$value;} // Customer /** * Gets the customer value for this AddCustomerRequest. * @return Customer */ public function getCustomer(){return $this->Customer;} // Customer } ?> PK!?\x"ii$classes/ApplyPaymentResult.class.phpnuW+APK!?\ĩKclasses/TaxRequest.class.phpnuW+A * This is a unique AvaTax identifier for this document. If known, the * CompanyCode, DocCode, and DocType are not needed. * * @access public * @var string */ //protected $DocId; /** * Sets the client application company reference code. *
If docId is specified, this is not needed. * * @param string */ protected $HashCode; public function setCompanyCode($value) { $this->CompanyCode = $value; return $this; } /** * The original document's type, such as Sales Invoice or Purchase Invoice. * * @var string * @see DocumentType */ public function setDocType($value) { DocumentType::Validate($value); $this->DocType=$value; return $this; } /** * Sets the Document Code, that is the internal reference code used by the client application. *
If docId is specified, this is not needed. * * @var string */ public function setDocCode($value) { $this->DocCode = $value; return $this; } /** * A unique document ID. *

* This is a unique AvaTax identifier for this document. If known, the * CompanyCode, DocCode, and DocType are not needed. * * @var string * @see GetTaxResult#DocId */ //public function setDocId($value) { $this->DocId = $value; return $this; } /** * Sets the hashCode value for this GetTaxRequest. *

* This should be computed by an SDK developer using some standard algorithm out of the content of the object. This value gets stored in the system and can be retrieved for the cross checking [Internal Reconciliation purpose]. * See sample code for more details *

* @var int */ public function setHashCode($value) { $this->HashCode = $value; return $this; } // Accessors /** * Gets the client application company reference code. * * @return string */ public function getCompanyCode() { return $this->CompanyCode; } /** * Gets the hashCode value for this GetTaxRequest. *

* This should be computed by an SDK developer using some standard algorithm out of the content of the object. This value gets stored in the system and can be retrieved for the cross checking [Internal Reconciliation purpose]. * See sample code for more details *

* @return int */ public function getHashCode() { return $this->HashCode; } /** * The original document's type, such as Sales Invoice or Purchase Invoice. * * @return string * @see DocumentType */ public function getDocType() { return $this->DocType; } /** * Gets the Document Code, that is the internal reference code used by the client application. *
If docId is specified, this is not needed. * * @return string */ public function getDocCode() { return $this->DocCode; } /** * A unique document ID. *

* This is a unique AvaTax identifier for this document. If known, the * CompanyCode, DocCode, and DocType are not needed. * * @return string * @see GetTaxResult#DocId */ //public function getDocId() { return $this->DocId; } public function __construct() { $this->DocType = DocumentType::$SalesOrder; // this is right Document $this->HashCode= 0; } } ?>PK!?\"Xclasses/GetTaxResult.class.phpnuW+A * See {@link GetTaxRequest#getDocCode} on GetTaxRequest for more information about this member. *

* * @return string */ public function getDocCode() {return $this->DocCode; } /** * AdjustmentDescription set while making AdjustTax call. * * @return string */ public function getAdjustmentDescription() { return $this->AdjustmentDescription; } /** * AdjustmentReason set while making AdjustTax call. It is a high level classification of why an Original Document is being modified. * * @return int */ public function getAdjustmentReason(){ return $this->AdjustmentReason; } /** * Gets the date on the invoice, purchase order, etc. *

* See {@link GetTaxRequest#getDocDate} on GetTaxRequest for more information about this member. *

* * @return date */ public function getDocDate() {return $this->DocDate; } /** * Tax Date is the date used to calculate tax on the Document. *

* See {@link GetTaxRequest#taxDate} on GetTaxRequest for more information about this member. *

* * @return date */ public function getTaxDate() {return $this->TaxDate; } /** * Gets the Document Type. *

* See {@link GetTaxRequest#DocType} on GetTaxRequest for more information about this member. *

* * @return DocumentType */ public function getDocType() {return $this->DocType; } /** * Gets the document's status after the tax calculation. * * @return DocStatus */ public function getDocStatus() {return $this->DocStatus; } /** * True if the document has been reconciled; Only committed documents can be reconciled. *

* For information on committing documents, see the TaxSvc's * {@link TaxSvcSoap#commitTax} method. For information * on reconciling documents, see the {@link TaxSvcSoap#reconcileTaxHistory} method. *

* * @return boolean */ public function getIsReconciled() {return $this->Reconciled; } /** * Flag indicating if a Document has been locked by Avalara's MRS process. Locked documents can not be modified and can not be cancelled because they have been reported on Tax Return. * * @return boolean */ public function getLocked() {return $this->Locked; } /** * Date of the last status change on the document (i.e. Save date, Post date, Commit date, Cancel date). * * @return dateTime */ public function getTimestamp() {return $this->Timestamp; } /** * The sum of all line {@link Line#getAmount} values. * * @param decimal */ public function getTotalAmount() {return $this->TotalAmount; } /** * Gets the sum of all TaxLine {@link TaxLine#getDiscount} amounts; Typically it * will equal the requested Discount, but, but it is possible that no lines were marked as discounted. * * @return decimal */ public function getTotalDiscount() {return $this->TotalDiscount; } /** * Gets the sum of all TaxLine {@link TaxLine#getExemption} amounts. * * @return decimal * @deprecated See {@link TaxDetail#getExemption}. */ public function getTotalExemption() {return $this->TotalExemption; } /** * Gets the amount the tax is based on; This is the total of all {@link Line} Base amounts; * Typically it will be equal to the document * {@link GetTaxResult#getTotalAmount} - {@link GetTaxRequest#getDiscount} - {@link #getTotalExemption}. * * @return decimal * @deprecated See {@link TaxDetail#getTaxable}. */ public function getTotalTaxable() {return $this->TotalTaxable; } /** * Gets the total tax for the document. * * @return decimal */ public function getTotalTax() {return $this->TotalTax; } /** * HashCode to support Reconciliation. * * @return hashCode */ public function getHashCode() {return $this->HashCode; } /** * Current version of the document. * * @return int */ public function getVersion() {return $this->Version; } /** * Gets the Tax broken down by individual {@link TaxLine}. * * @return taxLines */ public function getTaxLines() {return EnsureIsArray($this->TaxLines->TaxLine); } /** * TotalTaxCalculated indicates the total tax calculated by AvaTax. This is usually the same as the TotalTax, except when a tax override amount is specified. * This is for informational purposes.The TotalTax will still be used for reporting * * @return unknown */ public function getTotalTaxCalculated(){ return $this->TotalTaxCalculated;} /** * TaxSummary is now returned when GetTaxRequest.DetailLevel == DetailLevel.Line in addition to DetailLevel.Summary. * It is not returned for DetailLevel.Document or DetailLevel.TaxDetail. * * @return ArrayOfTaxDetail */ public function getTaxSummary() {return EnsureIsArray($this->TaxSummary->TaxDetail);} public function getTaxLine($lineNo) { if($this->getTaxLines() != null) { foreach($this->getTaxLines() as $taxLine) { if($lineNo == $taxLine->getNo()) { return $taxLine; } } } } /////////////////////////////////////////////PHP bug requires this copy from BaseResult /////////// /** * @var string */ private $TransactionId; /** * @var string must be one of the values defined in {@link SeverityLevel}. */ private $ResultCode = 'Success'; /** * @var array of Message. */ private $Messages = array(); /** * Accessor * @return string */ public function getTransactionId() { return $this->TransactionId; } /** * Accessor * @return string */ public function getResultCode() { return $this->ResultCode; } /** * Accessor * @return array */ public function getMessages() { return EnsureIsArray($this->Messages->Message); } } ?>PK!?\  *classes/GetExemptionCertificates.class.phpnuW+AGetExemptionCertificatesRequest=$value;} // GetExemptionCertificatesRequest public function getGetExemptionCertificatesRequest(){return $this->GetExemptionCertificatesRequest;} // GetExemptionCertificatesRequest } ?> PK!?\Xׯclasses/ATConfig.class.phpnuW+A_ivars = ATConfig::$Configurations[$name]; } public function __get($n) { if($n == '_ivars') { return parent::__get($n); } if(isset($this->_ivars[$n])) { return $this->_ivars[$n]; } else if(isset(ATConfig::$Configurations['Default'][$n])) // read missing values from default { return ATConfig::$Configurations['Default'][$n]; } else { return null; } } } /* Specify configurations by name here. You can specify as many as you like */ $__wsdldir = dirname(__FILE__)."/wsdl"; /* This is the default configuration - it is used if no other configuration is specified */ new ATConfig('Default', array( 'url' => 'no url specified', 'addressService' => '/Address/AddressSvc.asmx', 'taxService' => '/Tax/TaxSvc.asmx', 'batchService'=> '/Batch/BatchSvc.asmx', 'avacertService'=> '/AvaCert/AvaCertSvc.asmx', 'addressWSDL' => 'file://'.$__wsdldir.'/Address.wsdl', 'taxWSDL' => 'file://'.$__wsdldir.'/Tax.wsdl', 'batchWSDL' => 'file://'.$__wsdldir.'/BatchSvc.wsdl', 'avacertWSDL' => 'file://'.$__wsdldir.'/AvaCertSvc.wsdl', 'account' => '', 'license' => '', 'adapter' => 'avatax4php,5.10.0.0', 'client' => 'VirtueMart2.0.16', 'name' => 'PHPAdapter', 'trace' => true) // change to false for production ); ?> PK!?\  "classes/CancelTaxRequest.class.phpnuW+A * A document can be indicated solely by the DocId if it is known. * Otherwise the request must specify all of CompanyCode, * DocCode, and * DocType in order to uniquely identify the document. *

* * @see CancelTaxResult, DocumentType * * @author Avalara * @copyright � 2004 - 2011 Avalara, Inc. All rights reserved. * @package Tax */ if(!class_exists('TaxRequest')) require (VMAVALARA_CLASS_PATH.DS.'TaxRequest.class.php'); class CancelTaxRequest extends TaxRequest { private $CancelCode; //Unspecified or PostFailed or DocDeleted or DocVoided or AdjustmentCancelled public function __construct() { if(!class_exists('DocumentType')) require (VMAVALARA_CLASS_PATH.DS.'DocumentType.class.php'); if(!class_exists('CancelCode')) require (VMAVALARA_CLASS_PATH.DS.'CancelCode.class.php'); $this->DocType = DocumentType::$SalesInvoice; // this is right Document $this->CancelCode = CancelCode::$Unspecified; } /** * A code indicating the reason the document is getting canceled. * * @return string * @see CancelCode */ public function getCancelCode() { return $this->CancelCode; } /** * A code indicating the reason the document is getting canceled. * * @var string * @see CancelCode */ public function setCancelCode($value) { CancelCode::Validate($value); $this->CancelCode = $value; return $this; } } ?>PK!?\ !$!$classes/AvaCertSvc.class.phpnuW+ANote: This web service is only available to accounts that have enrolled in the AvaCert service.

* *

* Example: *

 *  $avacertService = new AvaCertSvc('Development');
 *  $result = $avacertService->ping();
 * 
* @author Avalara * @copyright � 2004 - 2011 Avalara, Inc. All rights reserved. * @package AvaCert */ class AvaCertSvc extends AvalaraSoapClient { private static $classmap = array( 'AddCustomerRequest' => 'AddCustomerRequest', 'Customer' => 'Customer', 'ExemptionCertificate' => 'ExemptionCertificate', 'Jurisdiction' => 'Jurisdiction', 'CertificateStatus' => 'CertificateStatus', 'ReviewStatus' => 'ReviewStatus', 'CertificateUsage' => 'CertificateUsage', 'RequestType' => 'RequestType', 'AddCustomerResult' => 'AddCustomerResult', 'BaseResult' => 'BaseResult', 'SeverityLevel' => 'SeverityLevel', 'Message' => 'Message', 'Profile' => 'Profile', 'InitiateExemptCert' => 'InitiateExemptCert', 'InitiateExemptCertRequest' => 'InitiateExemptCertRequest', 'GetExemptionCertificates' => 'GetExemptionCertificates', 'GetExemptionCertificatesRequest' => 'GetExemptionCertificatesRequest', 'GetExemptionCertificatesResult' => 'GetExemptionCertificatesResult', 'BaseRequest' => 'BaseRequest', 'CommunicationMode' => 'CommunicationMode', 'InitiateExemptCertResult' => 'InitiateExemptCertResult', 'Ping' => 'Ping', 'PingResult' => 'PingResult', 'IsAuthorized' => 'IsAuthorized', 'IsAuthorizedResult' => 'IsAuthorizedResult', ); public function __construct($configurationName = 'Default') { $config = new ATConfig($configurationName); $this->client = new DynamicSoapClient ( $config->avacertWSDL, array ( 'location' => $config->url.$config->avacertService, 'trace' => $config->trace, 'classmap' => AvaCertSvc::$classmap ), $config ); } /** * This method adds an exempt customer record to AvaCert. This can also be done * within the initiateExemptCert method. It should be used when you only wish to * add the customer and are not yet ready to request a certificate. Use initiateExemptCert * if you wish to both add a customer and request an exempt certificate. * *
   * $customer = new Customer();
   * $customer->setCompanyCode("DEFAULT");
   * $customer->setCustomerCode("AVALARA");
   * $customer->setCustomerName("Avalara, Inc.");
   * $customer->setAddress1("435 Ericksen Ave NE");
   * $customer->setCity("Bainbridge Island");
   * $customer->setRegion("WA");
   * $customer->setPostalCode("98110");
   * $customer->setCountry("US");
   * $customer->setEmail("info@avalara.com");
   * $customer->setPhone("206-826-4900");
   * $customer->setFax("206-780-5011");
   * $customer->setCustomerType("Bill_To");
   *
   * $addCustomerRequest = new AddCustomerRequest();
   * $addCustomerRequest->setCustomer($customer);
   * 
   * $addCustomerResult= $avacertService->addCustomer($addCustomerRequest);
   * 
* * @param AddCustomer $parameters * @return AddCustomerResponse */ public function AddCustomer(AddCustomerRequest $addCustomerRequest) { return $this->client->AddCustomer(array('AddCustomerRequest' => $addCustomerRequest))->AddCustomerResult; } /** * This method initiates a request from AvaCert to the customer for an exemption certificate. * The request will be sent using the designated method (email, fax, post). * It creates or updates the included customer record in the process. * *
   * $customer = new Customer();
   * $customer->setCompanyCode("DEFAULT");
   * $customer->setCustomerCode("AVALARA");
   * $customer->setCustomerName("Avalara, Inc.");
   * $customer->setAddress1("435 Ericksen Ave NE");
   * $customer->setCity("Bainbridge Island");
   * $customer->setRegion("WA");
   * $customer->setPostalCode("98110");
   * $customer->setCountry("US");
   * $customer->setEmail("info@avalara.com");
   * $customer->setPhone("206-826-4900");
   * $customer->setFax("206-780-5011");
   * $customer->setCustomerType("Bill_To");
   *
   * $initiateExemptCertRequest=new InitiateExemptCertRequest();
   * $initiateExemptCertRequest->setCustomer($customer);
   * $initiateExemptCertRequest->setCommunicationMode(CommunicationMode::$Email);
   * $initiateExemptCertRequest->setCustomMessage("Thank you!");
   *
   * $initiateExemptCertResult= $avacertService->initiateExemptCert($initiateExemptCertRequest); 
   * 
* * @param InitiateExemptCert $parameters * @return InitiateExemptCertResponse */ public function InitiateExemptCert(InitiateExemptCertRequest $initiateExemptCertRequest) { return $this->client->InitiateExemptCert(array('InitiateExemptCertRequest' => $initiateExemptCertRequest))->InitiateExemptCertResult; } /** * This method retrieves all certificates from vCert for a particular customer. *

* If only Customer.CustomerCode and Customer.CompanyCode are set, and all other properties in InitiateExemptCertRequest.Customer are empty then the InitiateExemptCert method will not attempt to create/update the customer record in vCert. It will simply initiate a request in vCert. * If any additional properties on InitiateExemptCertRequest.Customer are set then the method will either create/update the customer record in vCert, and then initiate a request in vCert. *

* *
   * $getExemptionCertificatesRequest=new GetExemptionCertificatesRequest();
   * $getExemptionCertificatesRequest->setCompanyCode("Default");	        
   * $dateTime=new DateTime();	    
   * $getExemptionCertificatesRequest->setToDate(date_format($dateTime,"Y-m-d"));	        
   * $dateTime->modify("-10 day");	    
   * $getExemptionCertificatesRequest->setFromDate(date_format($dateTime,"Y-m-d"));
   * $getExemptionCertificatesRequest->setRegion("WA");
   *
   * $getExemptionCertificatesResult = $avacertService->getExemptionCertificates($getExemptionCertificatesRequest);
   * 
* * @param GetExemptionCertificates $parameters * @return GetExemptionCertificatesResponse */ public function GetExemptionCertificates(GetExemptionCertificatesRequest $getExemptionCertificatesRequest) { return $this->client->GetExemptionCertificates(array('GetExemptionCertificatesRequest' => $getExemptionCertificatesRequest))->GetExemptionCertificatesResult; } /** * Verifies connectivity to the web service and returns version information about the service. * * @param Ping $parameters * @return PingResponse */ public function Ping($message = '') { return $this->client->Ping(array('Message' => $message))->PingResult; } /** * Checks authentication of and authorization to one or more operations on the service. *

* This operation allows pre-authorization checking of any or all operations. * It will return a comma delimited set of operation names which will be all or a subset * of the requested operation names. For security, it will never return operation names * other than those requested, i.e. protects against phishing. *

* Example:
* isAuthorized("GetTax,PostTax") * @param IsAuthorized $parameters * @return IsAuthorizedResponse */ public function IsAuthorized(IsAuthorized $parameters) { return $this->client->IsAuthorized(array('Operations' => $operations))->IsAuthorizedResult; } } ?> PK!?\zmP  classes/TaxType.class.phpnuW+APK!?\Jclasses/SeverityLevel.class.phpnuW+APK!?\cxH66classes/PingResult.class.phpnuW+AExample:
*
 *  $svc = new AddressServiceSoap();
 *
 *  $result = svc->ping();
 *  $numMessages = sizeof($result->getMessages());
 *
 * 
* * @author Avalara * @copyright � 2004 - 2011 Avalara, Inc. All rights reserved. * @package Base */ class PingResult //extends BaseResult { /** * Version string of the pinged service. * @var string */ private $Version; /** * Method returning version string of the pinged service. * @return string */ public function getVersion() { return $this->Version; } // BaseResult innards - workaround a bug in SoapClient /** * @var string */ private $TransactionId; /** * @var string must be one of the values defined in {@link SeverityLevel}. */ private $ResultCode = 'Success'; /** * @var array of Message. */ private $Messages = array(); /** * Accessor * @return string */ public function getTransactionId() { return $this->TransactionId; } /** * Accessor * @return string */ public function getResultCode() { return $this->ResultCode; } /** * Accessor * @return array */ public function getMessages() { return EnsureIsArray($this->Messages->Message); } } ?>PK!?\| > >classes/GetTaxRequest.class.phpnuW+ADocDate = date("Y-m-d"); $this->Commit=false; $this->HashCode=0; $this->Discount=0.0; $this->DocType=DocumentType::$SalesInvoice; $this->DetailLevel=DetailLevel::$Document; $this->DocCode = date("Y-m-d-H-i-s.u"); $this->CustomerCode='CustomerCodeString'; $this->Lines=array(new Line()); $this->ServiceMode=ServiceMode::$Automatic; $this->ExchangeRate=1.0; $dateTime=new DateTime(); $dateTime->setDate(1900,01,01); $this->ExchangeRateEffDate=$dateTime->format("Y-m-d"); $this->PaymentDate=$dateTime->format("Y-m-d"); } public function prepare() { $this->Addresses = array(); $this->OriginCode = $this->registerAddress($this->OriginAddress); $this->DestinationCode = $this->registerAddress($this->DestinationAddress); foreach($this->Lines as &$line) { $line->registerAddressesIn($this); } return $this; } public function registerAddress(&$address) { if($address == null) { return null; } $index = sizeof($this->Addresses); foreach($this->Addresses as $index=>$a) { if($address->equals($a)) { return $index; } } $index = sizeof($this->Addresses); $this->Addresses[] = $address; $address->setAddressCode ( $index); return $index; } public function postFetch() { $addresses = $this->getAddresses(); $this->OriginAddress = $addresses[$this->OriginCode]; $this->DestinationAddress = $addresses[$this->DestinationCode]; //@author: Swetal //Commenting following foreach loop //Reason is postFetch function is called after getTaxHistory to populate origin and destination address //but taxHistory does not return origin and destination code so with followign loop we can not retrive origin //and destination adress for line. This gives invalid index error if not commented /*foreach($this->getLines() as $line) { $line->postFetchWithAddresses($addresses); }*/ return $this; } /** * Enter description here... * * @param string $value */ public function setAddressCode($value) { $this->AddressCode = $value; return $this; } /** * Enter description here... * * @param string $value */ public function setLine1($value) { $this->Line1 = $value; return $this; } /** * Enter description here... * * @param string $value */ public function setLine2($value) { $this->Line2 = $value; return $this; } /** * Enter description here... * * @param string $value */ public function setLine3($value) { $this->Line3 = $value; return $this; } /** * Enter description here... * * @param string $value */ public function setCity($value) { $this->City = $value; return $this; } /** * Enter description here... * * @param string $value */ public function setRegion($value) { $this->Region = $value; return $this; } /** * Enter description here... * * @param string $value */ public function setPostalCode($value) { $this->PostalCode = $value; return $this; } /** * Enter description here... * * @param string $value */ public function setCountry($value) { $this->Country = $value; return $this; } /** * Mutator * @access public * @param integer */ /** * DocDate should be in the format yyyy-mm-dd * * @param date $value */ public function setDocDate($value) { $this->DocDate = $value; return $this; } //date /** * Sets the client application company reference code. * * @param string $value * */ public function setCompanyCode($value) { $this->CompanyCode = $value; return $this; } //string /** * The document type specifies the category of the document and affects how the document is treated after a tax calculation; see DocumentType for more information about the specific document types. * * @param DocumentType $value * */ public function setDocType($value) { DocumentType::Validate($value); $this->DocType = $value; return $this; } //SalesOrder or SalesInvoice or PurchaseOrder or PurchaseInvoice or ReturnOrder or ReturnInvoice /** * Specifies the level of detail to return. * * @param DetailLevel $value */ public function setDetailLevel($value) { DetailLevel::Validate($value); $this->DetailLevel = $value; return $this; } //Summary or Document or Line or Tax or Diagnostic - enum /** * Sets the Document Code, i.e. the internal reference code used by the client application. * * @param string $value */ public function setDocCode($value) { $this->DocCode = $value; return $this; } //string invoice number /** * The client application salesperson reference code. * * @param string $value */ public function setSalespersonCode($value) { $this->SalespersonCode = $value; return $this; } //string /** * The client application customer reference code. * * @param string $value */ public function setCustomerCode($value) { $this->CustomerCode = $value; return $this; } //string /** * The client application customer or usage type. *

* This is used to determine the exempt status of the transaction based on the exemption tax rules for the * jurisdictions involved. This may also be set at the line level. *

*

* The standard values for the CustomerUsageType (A-L).
A � Federal Government
B � State/Local Govt.
C � Tribal Government
D � Foreign Diplomat
E � Charitable Organization
F � Religious/Education
G � Resale
H � Agricultural Production
I � Industrial Prod/Mfg.
J � Direct Pay Permit
K � Direct Mail
L - Other
*

* @param customerUsageType */ public function setCustomerUsageType($value) { $this->CustomerUsageType = $value; return $this; } //string Entity Usage /** *Purchase Order Number for this document. * * @param string $value */ public function setPurchaseOrderNo($value) { $this->PurchaseOrderNo = $value; return $this; } //string /** * Exemption Number for this document * * @param string $value */ public function setExemptionNo($value) { $this->ExemptionNo = $value; return $this; } //string if not using ECMS which keys on customer code /** * Also referred to as a Store Location, Outlet Id, or Outlet code is a number assigned by the State which identifies a Store location. Some state returns require taxes are broken out separatly for Store Locations. * * @param string $value */ public function setLocationCode($value) { $this->LocationCode = $value; return $this; } //string public function setBatchCode($value) { $this->BatchCode = $value; return $this; } //string /** * The discount amount to apply to the document. * * @param decimal $value */ public function setDiscount($value) { $this->Discount = $value; return $this; } //decimal //public function setTotalTaxOverride($value) { $this->TotalTaxOverride = $value; return $this; } //decimal /** * Set addresses * * @param array $value */ public function setAddresses($value) { $this->Addresses = $value; return $this; } //array /** * Set tax lines * * @param array $value */ public function setLines($value) { $this->Lines = $value; return $this; } //array public function setHashCode($value) { $this->HashCode = $value; return $this; } //int /** * This has been defaulted to False ; invoice will be committed if this flag has been set to True. * * @param boolean $value * */ public function setCommit($value) { $this->Commit = $value; return $this; } //boolean //public function setIsTotalTaxOverriden($value) { $this->IsTotalTaxOverriden = ($value ? true : false); return $this; } //boolean /** * Set ship from address * * @param Address $value */ public function setOriginAddress($value) { $this->OriginAddress = $value; return $this; } //address /** * set ship to address * * @param Address $value */ public function setDestinationAddress($value) { $this->DestinationAddress = $value; return $this; } //address //@author:swetal /** * ExchangeRate indicates the currency exchange rate from the transaction currency (indicated by CurrencyCode) to the company base currency. * This only needs to be set if the transaction currency is different than the company base currency. It defaults to 1.0. * * @param decimal $value */ public function setExchangeRate($value) { $this->ExchangeRate = $value; return $this; } //decimal /** * 3 character ISO 4217 currency code. * * @param string $value */ public function setCurrencyCode($value) { $this->CurrencyCode = $value; return $this; } //string /** * It provides the ability to controls whether tax is calculated locally or remotely when using an AvaLocal server. * The default is Automatic which calculates locally unless remote is necessary for non-local addresses. * * @param ServiceMode $value */ public function setServiceMode($value) { $this->ServiceMode = $value; return $this; } //type: ServiceMode /** * PaymentDate indicates the date when payment was received for the document. It is only applicable for cash-basis accounting and does not need to be set otherwise. * It defaults to 1/1/1900 which indicates no payment. The new TaxSvc.ApplyPayment method may be used to apply a payment to an existing invoice. * * @param date $value */ public function setPaymentDate($value) { $this->PaymentDate = $value; return $this; } //date /** * ExchangeRateEffDate indicates the effective date of the exchange rate. * It should be set in conjunction with ExchangeRate. It will default to the DocDate if not set. * * @param date $value */ public function setExchangeRateEffDate($value){ $this->ExchangeRateEffDate = $value; return $this; } //date /** *TaxOverride for the document. * * @param TaxOverride $value */ public function setTaxOverride($value){ $this->TaxOverride=$value;} //tax override public function setReferenceCode($value) { $this->ReferenceCode=$value; } /**#@+ * Accessor * @access public * @return string */ public function getCompanyCode() { return $this->CompanyCode;} //string public function getDocType() { return $this->DocType;} //SalesOrder or SalesInvoice or PurchaseOrder or PurchaseInvoice or ReturnOrder or ReturnInvoice public function getDocCode() { return $this->DocCode;} //string invoice number public function getDocDate() { return $this->DocDate;} //date public function salespersonCode() { return $this->SalespersonCode;} //string public function getCustomerCode() { return $this->CustomerCode;} //string public function getCustomerUsageType() { return $this->CustomerUsageType;} //string Entity Usage public function getDiscount() { return $this->Discount;} //decimal //public function getTotalTaxOverride() { return $this->TotalTaxOverride;} //decimal public function getPurchaseOrderNo() { return $this->PurchaseOrderNo;} //string public function getExemptionNo() { return $this->ExemptionNo;} //string if not using ECMS which keys on customer code public function getAddresses() { // this is kind of icky // when we build one of these to send, it is an array of Address // however, when it is fetched, there is an extra std::Object stuck in place to represent the array // which contains the array in an ivar called Address. Such are the vagaries of // the php SoapClient. //@swetal //Changed from $this->Addresses to $this->Addresses->BaseAddress return is_array($this->Addresses) ? $this->Addresses : EnsureIsArray($this->Addresses->BaseAddress); } //array public function getLines() { return is_array($this->Lines) ? $this->Lines : EnsureIsArray($this->Lines->Line); } //array public function getDetailLevel() { return $this->DetailLevel;} //Summary or Document or Line or Tax or Diagnostic ********************************** make class public function getHashCode() { return $this->HashCode;} //int public function getLocationCode() { return $this->LocationCode;} //string public function getBatchCode() { return $this->BatchCode;} //string public function getCommit() { return $this->Commit;} //boolean //public function getIsTotalTaxOverriden() { return $this->IsTotalTaxOverriden;} //boolean public function getOriginAddress() { return $this->OriginAddress;} //address public function getDestinationAddress() { return $this->DestinationAddress;} //address //@author:swetal public function getExchangeRate() { return $this->ExchangeRate; } //decimal public function getCurrencyCode() { return $this->CurrencyCode; } //string public function getServiceMode() { return $this->ServiceMode; } //type: ServiceMode public function getPaymentDate() { return $this->PaymentDate; } //date public function getExchangeRateEffDate(){ return $this->ExchangeRateEffDate; } //date public function getTaxOverride(){ return $this->TaxOverride;} public function getReferenceCode() { return $this->ReferenceCode; } //@author:swetal //Adding getLine function which returns line based on line number public function getLine($lineNo) { if($this->Lines != null) { foreach($this->getLines() as $line) { if($lineNo == $line->getNo()) { return $line; } } } } /**#@-*/ } ?>PK!?\*-.y y (classes/SearchTaxHistoryResult.class.phpnuW+A * If LastDocId was not specified by the {@link ReconcileTaxHistoryRequest}, * then this is the first set of records that need reconciliation. If LastDocId was specified, * the collection represents the next set of records after LastDocId. If the collection is * empty, then all records have been reconciled and the result's LastDocId will be set to the * last record of the last result set. *
* The GetTaxResults are returned in an Axis wrapper {@link ArrayOfGetTaxResult}, which has a * raw GetTaxResult[] array accessible via its {@link ArrayOfGetTaxResult#getGetTaxResult} method. *
     * Example:
     * $result = $taxSvc->reconcileTaxHistory($request);
     * foreach($result->getTaxResults() as $taxResult)
     * {
     *      ...
     * }
     *
     * 
* @see GetTaxResult * @return array */ public function getTaxResults() { return EnsureIsArray($this->GetTaxResults->GetTaxResult); } /** * Indicates the last Document Code ({@link GetTaxResult#getDocId}) the results list. *

* If {@link #getGetTaxResults} is not empty, then this * LastDocId should be passed to the next {@link ReconcileTaxHistoryRequest}. * If {@link #getGetTaxResults} is empty, then this LastDocId can be * passed to {@link ReconcileTaxHistoryRequest} with the request's * {@link ReconcileTaxHistoryRequest#isReconciled} flag * set to true in order to reconcile all documents up to and including the LastDocId. *

* * @see ReconcileTaxHistoryResult * @return string */ public function getLastDocId() { return $this->LastDocId; } // BaseResult innards - work around a bug in SoapClient /** * @var string */ private $TransactionId; /** * @var string must be one of the values defined in {@link SeverityLevel}. */ private $ResultCode = 'Success'; /** * @var array of Message. */ private $Messages = array(); /** * Accessor * @return string */ public function getTransactionId() { return $this->TransactionId; } /** * Accessor * @return string */ public function getResultCode() { return $this->ResultCode; } /** * Accessor * @return array */ public function getMessages() { return EnsureIsArray($this->Messages->Message); } } ?>PK!?\`3::classes/Jurisdiction.class.phpnuW+AJurisdictionCode=$value;} // string public function getJurisdictionCode(){return $this->JurisdictionCode;} // string public function setCountry($value){$this->Country=$value;} // string public function getCountry(){return $this->Country;} // string public function setExpiryDate($value){$this->ExpiryDate=$value;} // dateTime public function getExpiryDate(){return $this->ExpiryDate;} // dateTime public function setDoesNotExpire($value){$this->DoesNotExpire=$value;} // boolean public function getDoesNotExpire(){return $this->DoesNotExpire;} // boolean public function setPermitNumbers($value){$this->PermitNumbers=$value;} // ArrayOfString public function getPermitNumbers(){return $this->PermitNumbers;} // ArrayOfString } ?> PK!?\$E#classes/AvalaraSoapClient.class.phpnuW+Aclient->__getLastRequest(); } public function __getLastResponse() { return $this->client->__getLastResponse(); } public function __getLastRequestHeaders() { return $this->client->__getLastRequestHeaders(); } public function __getLastResponseHeaders() { return $this->client->__getLastResponseHeaders(); } } ?> PK!?\m"classes/CertificateUsage.class.phpnuW+APK!?\IC C classes/CancelCode.class.phpnuW+ASaved. */ public static $PostFailed = 'PostFailed'; /** * Specifies the document was deleted within the client's application and * should be removed from the AvaTax records; If the document within AvaTax * is already committed, the document status will be changed to Cancelled * and retained for historical records; If the document was not committed, * (was Saved or Posted) the document will be deleted within AvaTax. */ public static $DocDeleted = 'DocDeleted'; /** * Specifies the document was voided within the client's application and * should be removed from the AvaTax records; If the document within AvaTax * is already committed, the document status will be changed to Cancelled * and retained for historical records; If the document was not committed, * (was Saved or Posted) the document will be deleted within AvaTax. */ public static $DocVoided = 'DocVoided'; public static $AdjustmentCancelled = 'AdjustmentCancelled'; public static function Values() { return array( CancelCode::$Unspecified, CancelCode::$PostFailed, CancelCode::$DocDeleted, CancelCode::$DocVoided, CancelCode::$AdjustmentCancelled ); } // Unfortunate boiler plate due to polymorphism issues on static functions public static function Validate($value) { self::__Validate($value,self::Values(),__CLASS__); } } ?>PK!?\ "classes/CommitTaxRequest.class.phpnuW+A * A document can be indicated solely by the {@link CommitTaxRequest#DocId} if it is known. * Otherwise the request must specify all of {@link CommitTaxRequest#CompanyCode}, * {@link CommitTaxRequest#DocCode}, and * {@link CommitTaxRequest#tDocType} in order to uniquely identify the document. *

* * @see CommitTaxResult * * @author Avalara * @copyright � 2004 - 2011 Avalara, Inc. All rights reserved. * @package Tax */ class CommitTaxRequest extends TaxRequest { private $NewDocCode; //string /** * As on this version of SDK DocCode can be changed during commit using NewDocCode. * * @return string */ public function getNewDocCode() { return $this->NewDocCode; } /** * As on this version of SDK DocCode can be changed during commit using NewDocCode. * * @param string $value */ public function setNewDocCode($value) { $this->NewDocCode = $value; } } ?>PK!?\Vclasses/index.htmlnuW+A PK!?\!classes/AdjustTaxResult.class.phpnuW+A * See {@link GetTaxRequest#getDocCode} on GetTaxRequest for more information about this member. *

* * @return string */ public function getDocCode() {return $this->DocCode; } /** * AdjustmentDescription set while making AdjustTax call. * * @return string */ public function getAdjustmentDescription() { return $this->AdjustmentDescription; } /** * AdjustmentReason set while making AdjustTax call. It is a high level classification of why an Original Document is being modified. * * @return int */ public function getAdjustmentReason(){ return $this->AdjustmentReason; } /** * Gets the date on the invoice, purchase order, etc. *

* See {@link GetTaxRequest#getDocDate} on GetTaxRequest for more information about this member. *

* * @return date */ public function getDocDate() {return $this->DocDate; } /** * Tax Date is the date used to calculate tax on the Document. *

* See {@link GetTaxRequest#taxDate} on GetTaxRequest for more information about this member. *

* * @return date */ public function getTaxDate() {return $this->TaxDate; } /** * Gets the Document Type. *

* See {@link GetTaxRequest#DocType} on GetTaxRequest for more information about this member. *

* * @return DocumentType */ public function getDocType() {return $this->DocType; } /** * Gets the document's status after the tax calculation. * * @return DocStatus */ public function getDocStatus() {return $this->DocStatus; } /** * True if the document has been reconciled; Only committed documents can be reconciled. *

* For information on committing documents, see the TaxSvc's * {@link TaxSvcSoap#commitTax} method. For information * on reconciling documents, see the {@link TaxSvcSoap#reconcileTaxHistory} method. *

* * @return boolean */ public function getIsReconciled() {return $this->Reconciled; } /** * Flag indicating if a Document has been locked by Avalara's MRS process. Locked documents can not be modified and can not be cancelled because they have been reported on Tax Return. * * @return boolean */ public function getLocked() {return $this->Locked; } /** * Date of the last status change on the document (i.e. Save date, Post date, Commit date, Cancel date). * * @return dateTime */ public function getTimestamp() {return $this->Timestamp; } /** * The sum of all line {@link Line#getAmount} values. * * @param decimal */ public function getTotalAmount() {return $this->TotalAmount; } /** * Gets the sum of all TaxLine {@link TaxLine#getDiscount} amounts; Typically it * will equal the requested Discount, but, but it is possible that no lines were marked as discounted. * * @return decimal */ public function getTotalDiscount() {return $this->TotalDiscount; } /** * Gets the sum of all TaxLine {@link TaxLine#getExemption} amounts. * * @return decimal * @deprecated See {@link TaxDetail#getExemption}. */ public function getTotalExemption() {return $this->TotalExemption; } /** * Gets the amount the tax is based on; This is the total of all {@link Line} Base amounts; * Typically it will be equal to the document * {@link GetTaxResult#getTotalAmount} - {@link GetTaxRequest#getDiscount} - {@link #getTotalExemption}. * * @return decimal * @deprecated See {@link TaxDetail#getTaxable}. */ public function getTotalTaxable() {return $this->TotalTaxable; } /** * Gets the total tax for the document. * * @return decimal */ public function getTotalTax() {return $this->TotalTax; } /** * HashCode to support Reconciliation. * * @return hashCode */ public function getHashCode() {return $this->HashCode; } /** * Current version of the document. * * @return int */ public function getVersion() {return $this->Version; } /** * Gets the Tax broken down by individual {@link TaxLine}. * * @return taxLines */ public function getTaxLines() {return EnsureIsArray($this->TaxLines->TaxLine); } /** * TotalTaxCalculated indicates the total tax calculated by AvaTax. This is usually the same as the TotalTax, except when a tax override amount is specified. * This is for informational purposes.The TotalTax will still be used for reporting * * @return unknown */ public function getTotalTaxCalculated(){ return $this->TotalTaxCalculated;} /** * TaxSummary is now returned when GetTaxRequest.DetailLevel == DetailLevel.Line in addition to DetailLevel.Summary. * It is not returned for DetailLevel.Document or DetailLevel.TaxDetail. * * @return ArrayOfTaxDetail */ public function getTaxSummary() {return EnsureIsArray($this->TaxSummary->TaxDetail);} public function getTaxLine($lineNo) { if($this->getTaxLines() != null) { foreach($this->getTaxLines() as $taxLine) { if($lineNo == $taxLine->getNo()) { return $taxLine; } } } } /////////////////////////////////////////////PHP bug requires this copy from BaseResult /////////// /** * @var string */ private $TransactionId; /** * @var string must be one of the values defined in {@link SeverityLevel}. */ private $ResultCode = 'Success'; /** * @var array of Message. */ private $Messages = array(); /** * Accessor * @return string */ public function getTransactionId() { return $this->TransactionId; } /** * Accessor * @return string */ public function getResultCode() { return $this->ResultCode; } /** * Accessor * @return array */ public function getMessages() { return EnsureIsArray($this->Messages->Message); } } ?>PK!?\]eDD$classes/InitiateExemptCert.class.phpnuW+AInitiateExemptCertRequest=$value;} // InitiateExemptCertRequest public function getInitiateExemptCertRequest(){return $this->InitiateExemptCertRequest;} // InitiateExemptCertRequest } ?> PK!?\ M0classes/GetExemptionCertificatesResult.class.phpnuW+AExemptionCertificates;} // ArrayOfExemptionCertificate public function getRecordCount(){return $this->RecordCount;} // int } ?> PK!?\$classes/IsAuthorizedResult.class.phpnuW+AExample:
*
 *  $port = new AddressServiceSoap();
 *
 *  $result = port->ping("");
 *  $numMessages = sizeof($result->Messages);
 *  print('Ping Result # of messages is '.$numMessages);
 * 
* * @author Avalara * @copyright � 2004 - 2011 Avalara, Inc. All rights reserved. * @package Address */ class IsAuthorizedResult //extends BaseResult { private $Operations; private $Expires; /** * Authorized operations for the user. * * @return string */ public function getOperations() { return $this->Operations; } /** * Indicates the subscription expiration date in yyyy-mm-dd format * * @return date */ public function getExpires() { return $this->Expires; } public function setOperations($value) { $this->Operations = $value; return $this; } public function setExpires($value) { $this->Expires = $value; return $this; } //BaseResult innards - workaround for SoapClient bug /** * @var string */ private $TransactionId; /** * @var string must be one of the values defined in {@link SeverityLevel}. */ private $ResultCode = 'Success'; /** * @var array of Message. */ private $Messages = array(); /** * Accessor * @return string */ public function getTransactionId() { return $this->TransactionId; } /** * Accessor * @return string */ public function getResultCode() { return $this->ResultCode; } /** * Accessor * @return array */ public function getMessages() { return EnsureIsArray($this->Messages->Message); } } ?>PK!?\g#classes/CommunicationMode.class.phpnuW+A PK!?\i844classes/wsdl/Tax.wsdlnuW+A Calculates taxes on a document Retrieves a previously calculated tax document Posts a previously calculated tax Commits a previously posted tax Cancels a previously calculated tax. This is for use as a compensating action when posting on the client fails to complete. Reconciles tax history to ensure the client data matches the AvaTax history. Adjusts taxes on an existing invoice Applies a payment date to an existing invoice Submits a batch of TaxSvc requests to be processed. Gets the status and results of a submitted batch. Cancels an incomplete batch operation. Tests connectivity and version of the service Checks authentication and authorization to one or more operations on the service. PK!?\H5H5classes/wsdl/Address.wsdlnuW+A Validate an Address Tests connectivity and version of the service Checks authentication and authorization to one or more operations on the service. PK!?\)classes/wsdl/.htaccessnuW+A Order allow,deny Deny from all PK!?\Vclasses/wsdl/index.htmlnuW+A PK!?\5=uuclasses/wsdl/BatchSvc.wsdlnuW+A Fetches one or more Batch Saves a Batch entry Deletes one or more Batches Processes one or more Batches Fetches one or more BatchFiles Saves a Batch File Deletes one or more BatchFiles Tests connectivity and version of the service Checks authentication and authorization to one or more operations on the service. PK!?\v$$classes/wsdl/AvaCertSvc.wsdlnuW+A PK!?\\PiXXclasses/RequestType.class.phpnuW+APK!?\{\BB!classes/CommitTaxResult.class.phpnuW+ATransactionId; } /** * Accessor * @return string */ public function getResultCode() { return $this->ResultCode; } /** * Accessor * @return array */ public function getMessages() { return EnsureIsArray($this->Messages->Message); } } ?>PK!?\=ͮclasses/Enum.class.phpnuW+APK!?\%mclasses/TaxOverride.class.phpnuW+ATaxAmount=0.0; $dateTime=new DateTime(); $dateTime->setDate(1900,01,01); $this->TaxDate=$dateTime->format("Y-m-d"); } public function setTaxOverrideType($value){ $this->TaxOverrideType=$value; } //TaxOverrideType public function setTaxAmount($value){$this->TaxAmount=$value;} //decimal public function setTaxDate($value){$this->TaxDate=$value;} //date public function setReason($value){$this->Reason=$value;} //string public function getTaxOverrideType(){ return $this->TaxOverrideType; } //TaxOverrideType public function getTaxAmount(){return $this->TaxAmount;} //decimal public function getTaxDate(){return $this->TaxDate;} //date public function getReason(){return $this->Reason;} //string } ?>PK!?\ iclasses/TextCase.class.phpnuW+APK!?\DI classes/ValidateResult.class.phpnuW+A * $port = new AddressServiceSoap(); * * $address = new Address(); * $address->setLine1("900 Winslow Way"); * $address->setLine2("Suite 130"); * $address->setCity("Bainbridge Is"); * $address->setRegion("WA"); * $address->setPostalCode("98110-2450"); * * $result = $port->validate($address,TextCase::$Upper); * $addresses = $result->ValidAddresses; * print("Number of addresses returned is ". sizeoof($addresses)); * * * * @see ValidAddress * * @author Avalara * @copyright � 2004 - 2011 Avalara, Inc. All rights reserved. * @package Address */ class ValidateResult// extends BaseResult { /** * Array of matching {@link ValidAddress}'s. * @var array */ private $ValidAddresses; /** * Method returning array of matching {@link ValidAddress}'s. * @return array */ public function getValidAddresses() { return EnsureIsArray($this->ValidAddresses->ValidAddress); } /** * @var string */ private $TransactionId; /** * @var string must be one of the values defined in {@link SeverityLevel}. */ private $ResultCode = 'Success'; /** * @var array of Message. */ private $Messages = array(); /** * Accessor * @return string */ public function getTransactionId() { return $this->TransactionId; } /** * Accessor * @return string */ public function getResultCode() { return $this->ResultCode; } /** * Accessor * @return array */ public function getMessages() { return EnsureIsArray($this->Messages->Message); } //@author:swetal public function isTaxable() { return $this->Taxable; } } ?>PK!?\;*classes/InitiateExemptCertResult.class.phpnuW+ATrackingCode;} // string public function getWizardLaunchUrl(){return $this->WizardLaunchUrl;} // string } ?> PK!?\c\\classes/ServiceMode.class.phpnuW+APK!?\Ql l classes/TaxLine.class.phpnuW+ANo; } /** * Accessor * @return string */ public function getTaxCode() { return $this->TaxCode; } /** * Accessor * @return boolean */ public function getTaxability() { return $this->Taxability; } /** * Accessor * @see BoundaryLevel * @return string */ public function getBoundaryLevel() { return $this->BoundaryLevel; } /** * Accessor * @return decimal */ public function getExemption() { return $this->Exemption; } /** * Accessor * @return decimal */ public function getDiscount() { return $this->Discount; } /** * Accessor * @return decimal */ public function getTaxable() { return $this->Taxable; } /** * Accessor * @return decimal */ public function getRate() { return $this->Rate; } /** * Accessor * @return string */ public function getTax() { return $this->Tax; } /** * Accessor * @return decimal */ public function getTaxDetails() { return EnsureIsArray($this->TaxDetails->TaxDetail); } /** * Accessor * @return int */ public function getExemptCertId() { return $this->ExemptCertId; } /** * Accessor * @return decimal */ public function getTaxCalculated(){ return $this->TaxCalculated; } //decimalt public function getReportingDate(){ return $this->ReportingDate;} //date public function getAccountingMethod(){ return $this->AccountingMethod;}//String /** * True if tax is included in the line. * @param boolean */ public function setTaxIncluded($value) { $this->TaxIncluded=$value; } /** * True if tax is included in the line. * @return boolean */ public function getTaxIncluded() { return $this->TaxIncluded; } } ?>PK!?\tѝclasses/ReviewStatus.class.phpnuW+APK!?\l00+classes/InitiateExemptCertRequest.class.phpnuW+ACommunicationMode = CommunicationMode::$Email; $this->Type=RequestType::$STANDARD; } public function setCustomer($value){$this->Customer=$value;} // Customer public function getCustomer(){return $this->Customer;} // Customer public function setLocationCode($value){$this->LocationCode=$value;} // string public function getLocationCode(){return $this->LocationCode;} // string public function setCustomMessage($value){$this->CustomMessage=$value;} // string public function getCustomMessage(){return $this->CustomMessage;} // string public function setCommunicationMode($value){$this->CommunicationMode=$value;} // CommunicationMode public function getCommunicationMode(){return $this->CommunicationMode;} // CommunicationMode public function setType($value){$this->Type=$value;} // RequestType public function getType(){return $this->Type;} // RequestType } ?> PK!?\'classes/BatchSvc/AuditMessage.class.phpnuW+AMessage=$value;} // string public function getMessage(){return $this->Message;} // string } ?> PK!?\)classes/BatchSvc/.htaccessnuW+A Order allow,deny Deny from all PK!?\HC#classes/BatchSvc/AvaTaxBatchSvc.phpnuW+AasXML()); $indent_level = 0; $new_xml_lines = array(); foreach ($xml_lines as $xml_line) { if (preg_match('#(<[a-z0-9:-]+((s+[a-z0-9:-]+="[^"]+")*)?>.*]+>)|(<[a-z0-9:-]+((s+[a-z0-9:-]+="[^"]+")*)?s*/s*>)#i', $xml_line)) { $new_line = str_pad('', $indent_level*4) . $xml_line; $new_xml_lines[] = $new_line; } elseif (preg_match('#<[a-z0-9:-]+((s+[a-z0-9:-]+="[^"]+")*)?>#i', $xml_line)) { $new_line = str_pad('', $indent_level*4) . $xml_line; $indent_level++; $new_xml_lines[] = $new_line; } elseif (preg_match('#/]+>#i', $xml_line)) { $indent_level--; if (trim($new_xml_lines[sizeof($new_xml_lines)-1]) == trim(str_replace("/", "", $xml_line))) { $new_xml_lines[sizeof($new_xml_lines)-1] .= $xml_line; } else { $new_line = str_pad('', $indent_level*4) . $xml_line; $new_xml_lines[] = $new_line; } } else { $new_line = str_pad('', $indent_level*4) . $xml_line; $new_xml_lines[] = $new_line; } } $xml = join("n", $new_xml_lines); return ($html_output) ? '
' . htmlentities($xml) . '
' : $xml; } ?>PK!?\WE  &classes/BatchSvc/BatchDelete.class.phpnuW+ADeleteRequest=$value;} // DeleteRequest public function getDeleteRequest(){return $this->DeleteRequest;} // DeleteRequest } ?> PK!?\#w$classes/BatchSvc/BatchSave.class.phpnuW+ABatch=$value;} // Batch public function getBatch(){return $this->Batch;} // Batch } ?> PK!?\m::#classes/BatchSvc/BatchSvc.class.phpnuW+A 'BatchFetch', 'FetchRequest' => 'FetchRequest', 'BatchFetchResponse' => 'BatchFetchResponse', 'BatchFetchResult' => 'BatchFetchResult', 'BaseResult' => 'BaseResult', 'SeverityLevel' => 'SeverityLevel', 'Message' => 'Message', 'Batch' => 'Batch', 'BatchFile' => 'BatchFile', 'Profile' => 'Profile', 'BatchSave' => 'BatchSave', 'BatchSaveResponse' => 'BatchSaveResponse', 'BatchSaveResult' => 'BatchSaveResult', 'AuditMessage' => 'AuditMessage', 'BatchDelete' => 'BatchDelete', 'DeleteRequest' => 'DeleteRequest', 'FilterRequest' => 'FilterRequest', 'BatchDeleteResponse' => 'BatchDeleteResponse', 'DeleteResult' => 'DeleteResult', 'FilterResult' => 'FilterResult', 'BatchProcess' => 'BatchProcess', 'BatchProcessRequest' => 'BatchProcessRequest', 'BatchProcessResponse' => 'BatchProcessResponse', 'BatchProcessResult' => 'BatchProcessResult', 'BatchFileFetch' => 'BatchFileFetch', 'BatchFileFetchResponse' => 'BatchFileFetchResponse', 'BatchFileFetchResult' => 'BatchFileFetchResult', 'BatchFileSave' => 'BatchFileSave', 'BatchFileSaveResponse' => 'BatchFileSaveResponse', 'BatchFileSaveResult' => 'BatchFileSaveResult', 'BatchFileDelete' => 'BatchFileDelete', 'BatchFileDeleteResponse' => 'BatchFileDeleteResponse', 'Ping' => 'Ping', 'PingResponse' => 'PingResponse', 'PingResult' => 'PingResult', 'IsAuthorized' => 'IsAuthorized', 'IsAuthorizedResponse' => 'IsAuthorizedResponse', 'IsAuthorizedResult' => 'IsAuthorizedResult', ); public function __construct($configurationName = 'Default') { $config = new ATConfig($configurationName); $this->client = new DynamicSoapClient ( $config->batchWSDL, array ( 'location' => $config->url.$config->batchService, 'trace' => $config->trace, 'classmap' => BatchSvc::$classmap ), $config ); } /** * Fetches one or more Batch * * @param BatchFetch $parameters * @return BatchFetchResponse */ public function BatchFetch(&$fetchRequest) { return $this->client->BatchFetch(array('FetchRequest' => $fetchRequest))->getBatchFetchResult(); } /** * Saves a Batch entry * * @param BatchSave $parameters * @return BatchSaveResponse */ public function BatchSave(&$batch) { return $this->client->BatchSave(array('Batch' => $batch))->getBatchSaveResult(); } /** * Deletes one or more Batches * * @param BatchDelete $parameters * @return BatchDeleteResponse */ public function BatchDelete(&$deleteRequest) { return $this->client->BatchDelete(array('DeleteRequest' => $deleteRequest))->getBatchDeleteResult(); } /** * Processes one or more Batches * * @param BatchProcess $parameters * @return BatchProcessResponse */ public function BatchProcess(&$batchProcessRequest) { return $this->client->BatchProcess(array('BatchProcessRequest' => $batchProcessRequest))->getBatchProcessResult(); } /** * Fetches one or more BatchFiles * * @param BatchFileFetch $parameters * @return BatchFileFetchResponse */ public function BatchFileFetch(&$fetchRequest) { return $this->client->BatchFileFetch(array('FetchRequest' => $fetchRequest))->getBatchFileFetchResult(); } /** * Saves a Batch File * * @param BatchFileSave $parameters * @return BatchFileSaveResponse */ public function BatchFileSave(&$batchFile) { return $this->client->BatchFileSave(array('BatchFile' => $batchFile))->getBatchFileSaveResult(); } /** * Deletes one or more BatchFiles * * @param BatchFileDelete $parameters * @return BatchFileDeleteResponse */ public function BatchFileDelete(&$deleteRequest) { return $this->client->BatchFileDelete(array('DeleteRequest' => $deleteRequest))->getBatchFileDeleteResult(); } /** * Tests connectivity and version of the service * * @param Ping $parameters * @return PingResponse */ public function Ping($message = '') { return $this->client->Ping(array('Message' => $message))->getPingResult(); } /** * Checks authentication and authorization to one or more operations on the service. * * @param IsAuthorized $parameters * @return IsAuthorizedResponse */ public function IsAuthorized($operations) { return $this->client->IsAuthorized(array('Operations' => $operations))->getIsAuthorizedResult(); } } ?> PK!?\<֩(classes/BatchSvc/SeverityLevel.class.phpnuW+A PK!?\EE/classes/BatchSvc/IsAuthorizedResponse.class.phpnuW+AIsAuthorizedResult=$value;} // IsAuthorizedResult public function getIsAuthorizedResult(){return $this->IsAuthorizedResult;} // IsAuthorizedResult } ?> PK!?\ŠY Y classes/BatchSvc/Batch.class.phpnuW+AAccountId=0; $this->BatchId=0; $this->CreatedUserId=0; $this->ModifiedUserId=0; $this->RecordCount=0; $this->CurrentRecord=0; $this->CreatedDate=getCurrentDate(); $this->CompletedDate=getCurrentDate(); $this->ModifiedDate=getCurrentDate(); } public function setAccountId($value){$this->AccountId=$value;} // int public function getAccountId(){return $this->AccountId;} // int public function setBatchId($value){$this->BatchId=$value;} // int public function getBatchId(){return $this->BatchId;} // int public function setBatchStatusId($value){$this->BatchStatusId=$value;} // string public function getBatchStatusId(){return $this->BatchStatusId;} // string public function setBatchTypeId($value){$this->BatchTypeId=$value;} // string public function getBatchTypeId(){return $this->BatchTypeId;} // string public function setCompanyId($value){$this->CompanyId=$value;} // int public function getCompanyId(){return $this->CompanyId;} // int public function setCreatedDate($value){$this->CreatedDate=$value;} // dateTime public function getCreatedDate(){return $this->CreatedDate;} // dateTime public function setCreatedUserId($value){$this->CreatedUserId=$value;} // int public function getCreatedUserId(){return $this->CreatedUserId;} // int public function setCompletedDate($value){$this->CompletedDate=$value;} // dateTime public function getCompletedDate(){return $this->CompletedDate;} // dateTime public function setFiles($value){$this->Files=$value;} // ArrayOfBatchFile public function getFiles(){return $this->Files;} // ArrayOfBatchFile public function setModifiedDate($value){$this->ModifiedDate=$value;} // dateTime public function getModifiedDate(){return $this->ModifiedDate;} // dateTime public function setModifiedUserId($value){$this->ModifiedUserId=$value;} // int public function getModifiedUserId(){return $this->ModifiedUserId;} // int public function setName($value){$this->Name=$value;} // string public function getName(){return $this->Name;} // string public function setOptions($value){$this->Options=$value;} // string public function getOptions(){return $this->Options;} // string public function setRecordCount($value){$this->RecordCount=$value;} // int public function getRecordCount(){return $this->RecordCount;} // int public function setCurrentRecord($value){$this->CurrentRecord=$value;} // int public function getCurrentRecord(){return $this->CurrentRecord;} // int } ?> PK!?\NN-classes/BatchSvc/BatchProcessResult.class.phpnuW+A PK!?\G$classes/BatchSvc/BatchFile.class.phpnuW+ABatchFileId=0; $this->BatchId=0; $this->ErrorCount=0; } public function setBatchFileId($value){$this->BatchFileId=$value;} // int public function getBatchFileId(){return $this->BatchFileId;} // int public function setBatchId($value){$this->BatchId=$value;} // int public function getBatchId(){return $this->BatchId;} // int public function setContent($value){$this->Content=$value;} // base64Binary public function getContent(){return $this->Content;} // base64Binary public function setContentType($value){$this->ContentType=$value;} // string public function getContentType(){return $this->ContentType;} // string public function setExt($value){$this->Ext=$value;} // string public function getExt(){return $this->Ext;} // string public function setFilePath($value){$this->FilePath=$value;} // string public function getFilePath(){return $this->FilePath;} // string public function setName($value){$this->Name=$value;} // string public function getName(){return $this->Name;} // string public function setSize($value){$this->Size=$value;} // int public function getSize(){return $this->Size;} // int public function setErrorCount($value){$this->ErrorCount=$value;} // int public function getErrorCount(){return $this->ErrorCount;} // int } ?> PK!?\]  )classes/BatchSvc/BatchFileFetch.class.phpnuW+AFetchRequest=$value;} // FetchRequest public function getFetchRequest(){return $this->FetchRequest;} // FetchRequest } ?> PK!?\.g/classes/BatchSvc/BatchFileFetchResult.class.phpnuW+ABatchFiles=$value;} // ArrayOfBatchFile public function getBatchFiles(){return $this->BatchFiles;} // ArrayOfBatchFile public function setRecordCount($value){$this->RecordCount=$value;} // int public function getRecordCount(){return $this->RecordCount;} // int } ?> PK!?\@z.classes/BatchSvc/BatchFileSaveResult.class.phpnuW+ABatchFileId=$value;} // int public function getBatchFileId(){return $this->BatchFileId;} // int } ?> PK!?\1<(classes/BatchSvc/BatchFileSave.class.phpnuW+ABatchFile=$value;} // BatchFile public function getBatchFile(){return $this->BatchFile;} // BatchFile } ?> PK!?\X.classes/BatchSvc/BatchProcessRequest.class.phpnuW+AMaxCount=0; } public function setFilters($value){$this->Filters=$value;} // string public function getFilters(){return $this->Filters;} // string public function setMaxCount($value){$this->MaxCount=$value;} // int public function getMaxCount(){return $this->MaxCount;} // int } ?> PK!?\r!"classes/BatchSvc/Message.class.phpnuW+ASummary=$value;} // string public function getSummary(){return $this->Summary;} // string public function setDetails($value){$this->Details=$value;} // string public function getDetails(){return $this->Details;} // string public function setHelpLink($value){$this->HelpLink=$value;} // string public function getHelpLink(){return $this->HelpLink;} // string public function setRefersTo($value){$this->RefersTo=$value;} // string public function getRefersTo(){return $this->RefersTo;} // string public function setSeverity($value){$this->Severity=$value;} // SeverityLevel public function getSeverity(){return $this->Severity;} // SeverityLevel public function setSource($value){$this->Source=$value;} // string public function getSource(){return $this->Source;} // string public function setName($value){$this->Name=$value;} // string public function getName(){return $this->Name;} // string } ?> PK!?\/classes/BatchSvc/Ping.class.phpnuW+AMessage=$value;} // string public function getMessage(){return $this->Message;} // string } ?> PK!?\&;HYY1classes/BatchSvc/BatchFileFetchResponse.class.phpnuW+ABatchFileFetchResult=$value;} // BatchFileFetchResult public function getBatchFileFetchResult(){return $this->BatchFileFetchResult;} // BatchFileFetchResult } ?> PK!?\OEE/classes/BatchSvc/BatchProcessResponse.class.phpnuW+ABatchProcessResult=$value;} // BatchProcessResult public function getBatchProcessResult(){return $this->BatchProcessResult;} // BatchProcessResult } ?> PK!?\W*'classes/BatchSvc/PingResponse.class.phpnuW+APingResult=$value;} // PingResult public function getPingResult(){return $this->PingResult;} // PingResult } ?> PK!?\pUOO0classes/BatchSvc/BatchFileSaveResponse.class.phpnuW+ABatchFileSaveResult=$value;} // BatchFileSaveResult public function getBatchFileSaveResult(){return $this->BatchFileSaveResult;} // BatchFileSaveResult } ?> PK!?\h(classes/BatchSvc/FilterRequest.class.phpnuW+AMaxCount=0; } public function setFilters($value){$this->Filters=$value;} // string public function getFilters(){return $this->Filters;} // string public function setMaxCount($value){$this->MaxCount=$value;} // int public function getMaxCount(){return $this->MaxCount;} // int } ?> PK!?\Lu'',classes/BatchSvc/BatchSaveResponse.class.phpnuW+ABatchSaveResult=$value;} // BatchSaveResult public function getBatchSaveResult(){return $this->BatchSaveResult;} // BatchSaveResult } ?> PK!?\;-BB'classes/BatchSvc/DeleteResult.class.phpnuW+A PK!?\*classes/BatchSvc/BatchFileDelete.class.phpnuW+ADeleteRequest=$value;} // DeleteRequest public function getDeleteRequest(){return $this->DeleteRequest;} // DeleteRequest } ?> PK!?\]Q*classes/BatchSvc/BatchSaveResult.class.phpnuW+ABatchId=$value;} // int public function getBatchId(){return $this->BatchId;} // int public function setEstimatedCompletion($value){$this->EstimatedCompletion=$value;} // dateTime public function getEstimatedCompletion(){return $this->EstimatedCompletion;} // dateTime } ?> PK!?\ɣ,((%classes/BatchSvc/PingResult.class.phpnuW+AVersion=$value;} // string public function getVersion(){return $this->Version;} // string //public function getTransactionId() { return $this->TransactionId; } /** * Accessor * @return string */ //public function getResultCode() { return $this->ResultCode; } /** * Accessor * @return array */ //public function getMessages() { return EnsureIsArray($this->Messages->Message);} } ?> PK!?\%classes/BatchSvc/BatchFetch.class.phpnuW+AFetchRequest=$value;} // FetchRequest public function getFetchRequest(){return $this->FetchRequest;} // FetchRequest } ?> PK!?\f]11-classes/BatchSvc/BatchFetchResponse.class.phpnuW+ABatchFetchResult=$value;} // BatchFetchResult public function getBatchFetchResult(){return $this->BatchFetchResult;} // BatchFetchResult } ?> PK!?\{'classes/BatchSvc/IsAuthorized.class.phpnuW+AOperations=$value;} // string public function getOperations(){return $this->Operations;} // string } ?> PK!?\ Ok+classes/BatchSvc/BatchFetchResult.class.phpnuW+ABatches=$value;} // ArrayOfBatch public function getBatches(){return $this->Batches;} // ArrayOfBatch public function setRecordCount($value){$this->RecordCount=$value;} // int public function getRecordCount(){return $this->RecordCount;} // int } ?> PK!?\4fHH2classes/BatchSvc/BatchFileDeleteResponse.class.phpnuW+ABatchFileDeleteResult=$value;} // DeleteResult public function getBatchFileDeleteResult(){return $this->BatchFileDeleteResult;} // DeleteResult } ?> PK!?\pTT'classes/BatchSvc/FetchRequest.class.phpnuW+AMaxCount=0; $this->PageIndex=0; $this->PageSize=0; $this->RecordCount=0; } public function setFields($value){$this->Fields=$value;} // string public function getFields(){return $this->Fields;} // string public function setFilters($value){$this->Filters=$value;} // string public function getFilters(){return $this->Filters;} // string public function setSort($value){$this->Sort=$value;} // string public function getSort(){return $this->Sort;} // string public function setMaxCount($value){$this->MaxCount=$value;} // int public function getMaxCount(){return $this->MaxCount;} // int public function setPageIndex($value){$this->PageIndex=$value;} // int public function getPageIndex(){return $this->PageIndex;} // int public function setPageSize($value){$this->PageSize=$value;} // int public function getPageSize(){return $this->PageSize;} // int public function setRecordCount($value){$this->RecordCount=$value;} // int public function getRecordCount(){return $this->RecordCount;} // int } ?> PK!?\-*'classes/BatchSvc/FilterResult.class.phpnuW+ACount=$value;} // int public function getCount(){return $this->Count;} // int } ?> PK!?\ח=='classes/BatchSvc/BatchProcess.class.phpnuW+ABatchProcessRequest=$value;} // BatchProcessRequest public function getBatchProcessRequest(){return $this->BatchProcessRequest;} // BatchProcessRequest } ?> PK!?\Z-classes/BatchSvc/IsAuthorizedResult.class.phpnuW+AOperations=$value;} // string public function getOperations(){return $this->Operations;} // string public function setExpires($value){$this->Expires=$value;} // dateTime public function getExpires(){return $this->Expires;} // dateTime } ?> PK!?\\(classes/BatchSvc/DeleteRequest.class.phpnuW+AMaxCount=0; } public function setFilters($value){$this->Filters=$value;} // string public function getFilters(){return $this->Filters;} // string public function setMaxCount($value){$this->MaxCount=$value;} // int public function getMaxCount(){return $this->MaxCount;} // int } ?> PK!?\ ޽"classes/BatchSvc/Profile.class.phpnuW+AName=$value;} // string public function getName(){return $this->Name;} // string public function setClient($value){$this->Client=$value;} // string public function getClient(){return $this->Client;} // string public function setAdapter($value){$this->Adapter=$value;} // string public function getAdapter(){return $this->Adapter;} // string public function setMachine($value){$this->Machine=$value;} // string public function getMachine(){return $this->Machine;} // string } ?> PK!?\Vclasses/BatchSvc/index.htmlnuW+A PK!?\#%classes/BatchSvc/BaseResult.class.phpnuW+ATransactionId=$value;} // string public function getTransactionId(){return $this->TransactionId;} // string public function setResultCode($value){$this->ResultCode=$value;} // SeverityLevel public function getResultCode(){return $this->ResultCode;} // SeverityLevel public function setMessages($value){$this->Messages=$value;} // ArrayOfMessage public function getMessages(){return $this->Messages;} // ArrayOfMessage } ?> PK!?\wj_**.classes/BatchSvc/BatchDeleteResponse.class.phpnuW+ABatchDeleteResult=$value;} // DeleteResult public function getBatchDeleteResult(){return $this->BatchDeleteResult;} // DeleteResult } ?> PK!?\(u CC!classes/CancelTaxResult.class.phpnuW+ATransactionId; } /** * Accessor * @return string */ public function getResultCode() { return $this->ResultCode; } /** * Accessor * @return array */ public function getMessages() { return EnsureIsArray($this->Messages->Message); } } ?>PK!?\3\#classes/AddCustomerResult.class.phpnuW+A PK!?\| +classes/ReconcileTaxHistoryResult.class.phpnuW+A * If LastDocId was not specified by the {@link ReconcileTaxHistoryRequest}, * then this is the first set of records that need reconciliation. If LastDocId was specified, * the collection represents the next set of records after LastDocId. If the collection is * empty, then all records have been reconciled and the result's LastDocId will be set to the * last record of the last result set. *
* The GetTaxResults are returned in an Axis wrapper {@link ArrayOfGetTaxResult}, which has a * raw GetTaxResult[] array accessible via its {@link ArrayOfGetTaxResult#getGetTaxResult} method. *
     * Example:
     * $result = $taxSvc->reconcileTaxHistory($request);
     * foreach($result->getTaxResults() as $taxResult)
     * {
     *      ...
     * }
     *
     * 
* @see GetTaxResult * @return array */ public function getGetTaxResults() { if(isset($this->GetTaxResults->GetTaxResult)) { return EnsureIsArray($this->GetTaxResults->GetTaxResult); } else { return null; } } public function setRecordCount($value){$this->RecordCount=$value;} // int public function getRecordCount(){return $this->RecordCount;} // int public function setLastDocCode($value) { $this->LastDocCode=$value; } public function getLastDocCode() { return $this->LastDocCode; } // BaseResult innards - work around a bug in SoapClient /** * @var string */ private $TransactionId; /** * @var string must be one of the values defined in {@link SeverityLevel}. */ private $ResultCode = 'Success'; /** * @var array of Message. */ private $Messages = array(); /** * Accessor * @return string */ public function getTransactionId() { return $this->TransactionId; } /** * Accessor * @return string */ public function getResultCode() { return $this->ResultCode; } /** * Accessor * @return array */ public function getMessages() { return EnsureIsArray($this->Messages->Message); } } ?>PK!?\j44 classes/TaxServiceSoap.class.phpnuW+A * Example: *
 *  $taxService = new TaxServiceSoap();
 *  $result = $taxService->ping();
 * 
* * @author Avalara * @copyright � 2004 - 2011 Avalara, Inc. All rights reserved. * @package Tax */ if(!class_exists('AvalaraSoapClient')) require (VMAVALARA_CLASS_PATH.DS.'AvalaraSoapClient.class.php'); class TaxServiceSoap extends AvalaraSoapClient { static $servicePath = '/Tax/TaxSvc.asmx'; static protected $classmap = array( 'BaseAddress' => 'Address', 'ValidAddress' => 'ValidAddress', 'Message' => 'Message', 'ValidateRequest' => 'ValidateRequest', 'IsAuthorizedResult' => 'IsAuthorizedResult', 'PingResult' => 'PingResult', 'ValidateResult' => 'ValidateResult', 'Line'=>'Line', 'AdjustTaxRequest'=>'AdjustTaxRequest', 'AdjustTaxResult'=>'AdjustTaxResult', 'CancelTaxRequest'=>'CancelTaxRequest', 'CancelTaxResult'=>'CancelTaxResult', 'CommitTaxRequest'=>'CommitTaxRequest', 'CommitTaxResult'=>'CommitTaxResult', 'GetTaxRequest'=>'GetTaxRequest', 'GetTaxResult'=>'GetTaxResult', 'GetTaxHistoryRequest'=>'GetTaxHistoryRequest', 'GetTaxHistoryResult'=>'GetTaxHistoryResult', 'PostTaxRequest'=>'PostTaxRequest', 'PostTaxResult'=>'PostTaxResult', 'ReconcileTaxHistoryRequest'=>'ReconcileTaxHistoryRequest', 'ReconcileTaxHistoryResult'=>'ReconcileTaxHistoryResult', 'TaxLine'=>'TaxLine', 'TaxDetail' => 'TaxDetail', 'ApplyPaymentRequest'=>'ApplyPaymentRequest', 'ApplyPaymentResult'=>'ApplyPaymentResult', 'BaseResult'=>'BaseResult', 'TaxOverride'=>'TaxOverride' ); public function __construct($configurationName = 'Default') { $config = new ATConfig($configurationName); if(!class_exists('DynamicSoapClient')) require (VMAVALARA_CLASS_PATH.DS.'DynamicSoapClient.class.php'); $this->client = new DynamicSoapClient ( $config->taxWSDL, array ( 'location' => $config->url.$config->taxService, 'trace' => $config->trace, 'classmap' => TaxServiceSoap::$classmap ), $config ); } /** * Calculates taxes on a document such as a sales order, sales invoice, purchase order, purchase invoice, or credit memo. *
The tax data is saved Sales Invoice and Purchase Invoice document types {@link GetTaxRequest#getDocType}. * * @param getTaxRequest -- Tax calculation request * * @return GetTaxResult * @throws SoapFault */ public function getTax(&$getTaxRequest) { $getTaxRequest->prepare(); return $this->client->GetTax(array('GetTaxRequest' => $getTaxRequest))->GetTaxResult; } /** * Retrieves a previously calculated tax document. *

* This is only available for saved tax documents (Sales Invoices, Purchase Invoices). *

*

* A document can be indicated solely by the {@link PostTaxRequest#getDocId} if it is known. * Otherwise the request must specify all of {@link PostTaxRequest#getCompanyCode}, see {@link PostTaxRequest#getDocCode} * and {@link PostTaxRequest#getDocType} in order to uniquely identify the document. *

* * @param getTaxHistoryRequest a {@link GetTaxHistoryRequest} object indicating the document for which history should be retrieved. * @return a {@link GetTaxHistoryResult} object * @throws SoapFault */ /*public com.avalara.avatax.services.tax.GetTaxHistoryResult getTaxHistory(com.avalara.avatax.services.tax.GetTaxHistoryRequest getTaxHistoryRequest) throws SoapFault; */ public function getTaxHistory(&$getTaxHistoryRequest) { $result = $this->client->GetTaxHistory(array('GetTaxHistoryRequest'=>$getTaxHistoryRequest))->GetTaxHistoryResult; $result->getGetTaxRequest()->postFetch(); return $result; } /** * Posts a previously calculated tax *

* This is only available for saved tax documents (Sales Invoices, Purchase Invoices). *

*

* A document can be indicated solely by the {@link PostTaxRequest#getDocId} if it is known. * Otherwise the request must specify all of {@link PostTaxRequest#getCompanyCode}, {@link PostTaxRequest#getDocCode}, and * {@link PostTaxRequest#getDocType} in order to uniquely identify the document. *

* * @param postTaxRequest a {@link PostTaxRequest} object indicating the document that should be posted. * @return a {@link PostTaxResult} object * @throws SoapFault */ /*public com.avalara.avatax.services.tax.PostTaxResult postTax(com.avalara.avatax.services.tax.PostTaxRequest postTaxRequest) throws SoapFault; */ public function postTax(&$postTaxRequest) { return $this->client->PostTax(array('PostTaxRequest'=>$postTaxRequest))->PostTaxResult; } /** * Commits a previously posted tax. *

* This is only available for posted tax documents (Sales Invoices, Purchase Invoices). Committed documents cannot * be changed or deleted. *

*

* A document can be indicated solely by the {@link CommitTaxRequest#getDocId} if it is known. Otherwise the * request must specify all of {@link CommitTaxRequest#getCompanyCode}, {@link CommitTaxRequest#getDocCode}, and * {@link CommitTaxRequest#getDocType} in order to uniquely identify the document. *

* * @param commitTaxRequest a {@link CommitTaxRequest} object indicating the document that should be committed. * @return a {@link CommitTaxResult} object * @throws SoapFault */ /*public com.avalara.avatax.services.tax.CommitTaxResult commitTax(com.avalara.avatax.services.tax.CommitTaxRequest commitTaxRequest) throws SoapFault; */ public function commitTax(&$commitTaxRequest) { return $this->client->CommitTax(array('CommitTaxRequest'=>$commitTaxRequest))->CommitTaxResult; } /** * Cancels a previously calculated tax; This is for use as a * compensating action when posting on the client fails to complete. *

* This is only available for saved tax document types (Sales Invoices, Purchase Invoices). A document that is saved * but not posted will be deleted if canceled. A document that has been posted will revert to a saved state if canceled * (in this case CancelTax should be called with a {@link CancelTaxRequest#getCancelCode} of * PostFailed). A document that has been committed cannot be reverted to a posted state or deleted. In the case * that a document on the client side no longer exists, a committed document can be virtually removed by calling * CancelTax with a CancelCode of DocDeleted. The record will be retained in history but removed * from all reports. *

*

* A document can be indicated solely by the {@link CancelTaxRequest#getDocId} if it is known. Otherwise the request * must specify all of {@link CancelTaxRequest#getCompanyCode}, {@link CancelTaxRequest#getDocCode}, and * {@link CancelTaxRequest#getDocType} in order to uniquely identify the document. * * @param cancelTaxRequest a {@link CancelTaxRequest} object indicating the document that should be canceled. * @return a {@link CancelTaxResult} object * @throws SoapFault */ /* public com.avalara.avatax.services.tax.CancelTaxResult cancelTax(com.avalara.avatax.services.tax.CancelTaxRequest cancelTaxRequest) throws SoapFault; */ public function cancelTax(&$cancelTaxRequest) { return $this->client->CancelTax(array('CancelTaxRequest'=>$cancelTaxRequest))->CancelTaxResult; } /** * Reconciles tax history to ensure the client data matches the * AvaTax history. *

The Reconcile operation allows reconciliation of the AvaTax history with the client accounting system. * It must be used periodically according to your service contract. *

*

* Because there may be a large number of documents to reconcile, it is designed to be called repetitively * until all documents have been reconciled. It should be called until no more documents are returned. * Each subsequent call should pass the previous results {@link ReconcileTaxHistoryRequest#getLastDocId}. *

*

* When all results have been reconciled, Reconcile should be called once more with * {@link ReconcileTaxHistoryRequest#getLastDocId} * equal to the last document code processed and {@link ReconcileTaxHistoryRequest#isReconciled} set to true to indicate * that all items have been reconciled. If desired, this may be done incrementally with each result set. Just send * Reconciled as true when requesting the next result set and the prior results will be marked as reconciled. *

*

* The {@link #postTax}, {@link #commitTax}, and {@link #cancelTax} operations can be used to correct any differences. * {@link #getTax} should be called if any committed documents are out of balance * ({@link GetTaxResult#getTotalAmount} or {@link GetTaxResult#getTotalTax} * don't match the accounting system records). This is to make sure the correct tax is reported. *

* * @param reconcileTaxHistoryRequest a Reconciliation request * @return A collection of documents that have been posted or committed since the last reconciliation. * @throws SoapFault */ /*public com.avalara.avatax.services.tax.ReconcileTaxHistoryResult reconcileTaxHistory(com.avalara.avatax.services.tax.ReconcileTaxHistoryRequest reconcileTaxHistoryRequest) throws SoapFault; */ public function reconcileTaxHistory(&$reconcileTaxHistoryRequest) { return $this->client->ReconcileTaxHistory(array('ReconcileTaxHistoryRequest'=>$reconcileTaxHistoryRequest))->ReconcileTaxHistoryResult; } /** * Adjusts a previously calculated tax. *

* This is only available for unlocked tax documents (Sales Invoices, Purchase Invoices). *

*

*

* * @param adjustTaxRequest a {@link AdjustTaxRequest} object indicating the document that should be edited. * @return a {@link AdjustTaxResult} object * @throws SoapFault */ /*public com.avalara.avatax.services.tax.CommitTaxResult commitTax(com.avalara.avatax.services.tax.CommitTaxRequest commitTaxRequest) throws SoapFault; */ public function adjustTax(&$adjustTaxRequest) { $adjustTaxRequest->getGetTaxRequest()->prepare(); return $this->client->AdjustTax(array('AdjustTaxRequest'=>$adjustTaxRequest))->AdjustTaxResult; } /** * Checks authentication of and authorization to one or more * operations on the service. * * This operation allows pre-authorization checking of any * or all operations. It will return a comma delimited set of * operation names which will be all or a subset of the requested * operation names. For security, it will never return operation * names other than those requested (no phishing allowed). * * Example:
* isAuthorized("GetTax,PostTax") * * @param string $operations a comma-delimited list of operation names * * @return IsAuthorizedResult * @throws SoapFault */ public function isAuthorized($operations) { return $this->client->IsAuthorized(array('Operations' => $operations))->IsAuthorizedResult; } /** * Verifies connectivity to the web service and returns version * information about the service. * * NOTE:This replaces TestConnection and is available on * every service. * * @param string $message for future use * @return PingResult * @throws SoapFault */ public function ping($message = '') { return $this->client->Ping(array('Message' => $message))->PingResult; } /** * This method is used to apply a payment to a document for cash basis accounting. Applies a payment date to an existing invoice * It sets the document PaymentDate and changes the reporting date from the DocDate default. It may be called before or after a document is committed. It should not be used for accrual basis accounting * * @param ApplyPaymentRequest $applyPaymentRequest * @return ApplyPaymentResult */ public function applyPayment(&$applyPaymentRequest) { return $this->client->ApplyPayment(array('ApplyPaymentRequest' => $applyPaymentRequest))->ApplyPaymentResult; } } ?> PK!?\9Hmmclasses/ATObject.class.phpnuW+A_ivars[$n])) { return $this->_ivars[$n]; } else { return null; } } public function __set($n,$v) { if($v == null) { unset($this->_ivars[$n]); } else { $this->_ivars[$n] = $v; } } public function __isset($n) { return isset($ivars[$n]); } public function __unset($n) { unset($this->_ivars[$n]); } public function __call($n,$args) { if(sizeof($args) == 1) { $this->__set($n,$args[0]); return null; } else if(sizeof($args) == 0) { return $this->__get($n); } } public function ivars() { return $this->_ivars; } } ?>PK!?\l}=2=2classes/ValidAddress.class.phpnuW+A * Example: * $address = new Address(); * $address->setLine1("900 Winslow Way"); * $address->setLine2("Suite 130"); * $address->setCity("Bainbridge Is"); * $address->setRegion("WA"); * $address->setPostalCode("98110-2450"); * * $result = svc->validate($address,TextCase::$Upper); * * if ($result->getResultCode() == SeverityLevel::$Success) * { * $addresses = result->validAddresses(); * if (sizeof($addresses) > 0) * { * $validAddress = $addresses[0]; * print($validAddress->getLine1()); // "900 WINSLOW WAY E STE 130", * print($validAddress->getLine4()); // "BAINBRIDGE IS WA 98110-2450" * print($validAddress->getFipsCode()); // "5303500000" * print($validAddress->getCounty()); // "KITSAP" * } * } * * * @see Address * * @author Avalara * @copyright � 2004 - 2011 Avalara, Inc. All rights reserved. * @package Address */ class ValidAddress //extends Address - or it should - SoapClient has issues mapping attributes in superclasses { /**#@+ * @access private * @var string */ private $AddressCode; private $Line1; private $Line2; private $Line3; private $City; private $Region; private $PostalCode; private $Country = 'USA'; private $Line4; private $County; private $FipsCode; private $CarrierRoute; private $PostNet; private $AddressType; private $Latitude; private $Longitude; /**#@-*/ /** * @access private * @var integer */ private $TaxRegionId = 0; /**#@+ * Accessor * @access public * @return string */ public function getAddressCode() { return $this->AddressCode; } public function getLine1() { return $this->Line1; } public function getLine2() { return $this->Line2; } public function getLine3() { return $this->Line3; } public function getCity() { return $this->City; } public function getRegion() { return $this->Region; } public function getPostalCode() { return $this->PostalCode; } public function getCountry() { return $this->Country; } /**#@-*/ /** * Accessor * @access public * @return integer */ public function getTaxRegionId() { return $this->TaxRegionId; } /** * Compare Addresses * @access public * @param Address * @return boolean */ public function equals(&$other) { if(!is_object($other)){ return FALSE; } return $this === $other || ( strcmp($this->AddressCode , $other->getAddressCode()) == 0 && strcmp($this->Line1 , $other->Line1) == 0 && strcmp($this->Line2 , $other->Line2) == 0 && strcmp($this->Line3 , $other->Line3) == 0 && strcmp($this->City , $other->City) == 0 && strcmp($this->Region , $other->Region) == 0 && strcmp($this->PostalCode , $other->PostalCode) == 0 && strcmp($this->Country , $other->Country) == 0 && $this->TaxRegionId === $other->TaxRegionId ); } /** * Address line 4. * * @return line4 - Address line 4 */ public function getLine4() { return $this->Line4; } /** * County Name. * * @return county - County Name */ public function getCounty() { return $this->County; } /** * Federal Information Processing Standards Code (USA). *

This is a unique code representing each geographic combination of state, county, and city. * The code is made up of the Federal Information Processing Code (FIPS) that uniquely identifies each state, county, and city in the U.S. * See Federal Information Processing Standards (FIPS) Codes for more details. * * * * * * * * * * * * * * * *
DigitsDescription
1-2State code
3-5County code
6-10City code
* * @return fipsCode */ public function getFipsCode() { return $this->FipsCode; } /** * The carrier route associated with the input address (USA). *

The CarrierRoute Property is a 4 character string set * after a successful return from the VerifyAddress Method. *

The first character of this property is always alphabetic, * and the last three characters are numeric. For example, * "R001" or "C027" would be typical carrier routes. The * alphabetic letter indicates the type of delivery associated * with this address. * * * * * * * * * * * * * * * * * * * * * * * * * * *
TermDescription
BPO Box
CCity Delivery
GGeneral Delivery
HHighway Contract
RRural Route
* * @return carrierRoute */ public function getCarrierRoute() { return $this->CarrierRoute; } /** * A 12-digit POSTNet barcode (USA). * * * * * * * * * * * * * * * * * *
DigitsDescription
1-5ZIP Code
6-9Plus4 code
10-11Delivery point
12Check digit
* * @return postNet */ public function getPostNet() { return $this->PostNet; } /** * Address Type - The type of address that was coded * (PO Box, Rural Route, and so on), using the input address. * * * * * * * * * * * * * * * * * * * * * * * * *
CodeType
FFirm or company address
GGeneral Delivery address
HHigh-rise or business complexs
PPO Box address
RRural route address
SStreet or residential address
* * @see AddressType * @return string */ public function getAddressType() { return $this->AddressType; } /** * Gets the latitude value for this ValidAddress. * * @return latitude */ public function getLatitude() { return $this->Latitude; } /** * Gets the longitude value for this ValidAddress. * * @return longitude */ public function getLongitude() { return $this->Longitude; } // mutators /**#@+ * Mutator * @access public * @var string * @return Address */ public function setAddressCode($value) { $this->AddressCode = $value; return $this; } public function setLine1($value) { $this->Line1 = $value; return $this; } public function setLine2($value) { $this->Line2 = $value; return $this; } public function setLine3($value) { $this->Line3 = $value; return $this; } public function setCity($value) { $this->City = $value; return $this; } public function setRegion($value) { $this->Region = $value; return $this; } public function setPostalCode($value) { $this->PostalCode = $value; return $this; } public function setCountry($value) { $this->Country = $value; return $this; } /**#@-*/ /** * Mutator * @access public * @param integer * @return Address */ public function setTaxRegionId($value) { $this->TaxRegionId = $value; return $this; } /** * Address line 4. * * @param line4 - Address line 4 * @var string */ public function setLine4($value) { $this->Line4 = $value; return $this; } /** * County Name. * * @param county - County Name * @var string */ public function setCounty($value) { $this->County= $value; return $this; } /** * Federal Information Processing Standards Code (USA). *

This is a unique code representing each geographic combination of state, county, and city. * The code is made up of the Federal Information Processing Code (FIPS) that uniquely identifies each state, county, and city in the U.S. * See Federal Information Processing Standards (FIPS) Codes for more details. * * * * * * * * * * * * * * * *
DigitsDescription
1-2State code
3-5County code
6-10City code
* * @param fipsCode * @var string */ public function setFipsCode($value) { $this->FipsCode= $value; return $this; } /** * The carrier route associated with the input address (USA). *

The CarrierRoute Property is a 4 character string set * after a successful return from the VerifyAddress Method. *

The first character of this property is always alphabetic, * and the last three characters are numeric. For example, * "R001" or "C027" would be typical carrier routes. The * alphabetic letter indicates the type of delivery associated * with this address. * * * * * * * * * * * * * * * * * * * * * * * * * * *
TermDescription
BPO Box
CCity Delivery
GGeneral Delivery
HHighway Contract
RRural Route
* * @param carrierRoute * @var string */ public function setCarrierRoute($value) { $this->CarrierRoute= $value; return $this; } /** * A 12-digit POSTNet barcode (USA). * * * * * * * * * * * * * * * * * *
DigitsDescription
1-5ZIP Code
6-9Plus4 code
10-11Delivery point
12Check digit
* * @param postNet * @var string */ public function setPostNet($value) { $this->PostNet= $value; return $this; } /** * Address Type - The type of address that was coded * (PO Box, Rural Route, and so on), using the input address. * * * * * * * * * * * * * * * * * * * * * * * * *
CodeType
FFirm or company address
GGeneral Delivery address
HHigh-rise or business complexs
PPO Box address
RRural route address
SStreet or residential address
* * @see AddressType * @param addressType * @var string */ public function setAddressType($value) { $this->AddressType= $value; return $this; } /** * Sets the latitude value for this ValidAddress. * * @param latitude */ public function setLatitude($value) { $this->Latitude= $value; return $this;} /** * Sets the longitude value for this ValidAddress. * * @param longitude */ public function setLongitude($value) { $this->Longitude= $value; return $this; } } ?>PK!?\V="classes/AdjustTaxRequest.class.phpnuW+AAdjustmentDescription = $value; } /** * Reason for Adjusting document. *

     * Sets a valid reason for the given AdjustTax call. Adjustment Reason is a high level classification of why an Original Document is being modified.
     * 0 Not Adjusted 
	 * 1 Sourcing Issue 
	 * 2 Reconciled with General Ledger 
	 * 3 Exemption Certificate Applied 
	 * 4 Price or Quantity Adjusted 
	 * 5 Item Returned 
	 * 6 Item Exchanged 
	 * 7 Bad Debt 
	 * 8 Other (Explain) 
		Must provide AdjustmentDescription
 		
     * 
     * Please visit Avalara's Administrative Console's transaction adjustment section for latest AdjustmentReasonList. 
	 *
	 * @param int $value	 
	 */		
    public function setAdjustmentReason($value) { $this->AdjustmentReason = $value;}
    
    
	/**
	 * Holds the data for Adjust Tax call. It takes the information needed for GetTax call. 
	 *
	 * @param GetTaxRequest $value
	 */
    public function setGetTaxRequest($value) { $this->GetTaxRequest = $value;}
	 
 	public function getAdjustmentReason() { return $this->AdjustmentReason;}	//int

    public function getAdjustmentDescription() { return $this->AdjustmentDescription;}	
        

    public function getGetTaxRequest() { return $this->GetTaxRequest;}	//string   invoice number
 

	

	
}

?>PK!?\>pܭclasses/AddCustomer.class.phpnuW+AAddCustomerRequest=$value;} // AddCustomerRequest
  public function getAddCustomerRequest(){return $this->AddCustomerRequest;} // AddCustomerRequest

}

?>
PK!?\jNN&classes/GetTaxHistoryRequest.class.phpnuW+A
 * The request must specify all of CompanyCode, DocCode, and DocType in order to uniquely identify the document. 
 * 

* * @see GetTaxHistoryResult * * @author Avalara * @copyright � 2004 - 2011 Avalara, Inc. All rights reserved. * @package Tax */ class GetTaxHistoryRequest extends TaxRequest { private $DetailLevel; public function __construct() { parent::__construct(); $this->DetailLevel = DetailLevel::$Document; // this is right Document $this->DocType = DocumentType::$SalesOrder; // this is right Document } /** * Specifies the level of detail to return. * * @return detailLevel * @var string * @see DetailLevel */ public function getDetailLevel() { return $this->DetailLevel; } /** * Specifies the level of detail to return. * * @see DetailLevel * @return string */ public function setDetailLevel($value) { DetailLevel::Validate($value); $this->DetailLevel = $value; return $this; } //Summary or Document or Line or Tax or Diagnostic - enum } ?>PK!?\"~WWclasses/Address.class.phpnuW+AExample: *
 *  $port = new AddressServiceSoap();
 *
 *  $address = new Address();
 *  $address->setLine1("900 Winslow Way");
 *  $address->setLine2("Suite 130");
 *  $address->setCity("Bainbridge Is");
 *  $address->setRegion("WA");
 *  $address->setPostalCode("98110-2450");
 *
 *  $result = $port->validate($address,TextCase::$Upper);
 *  $addresses = $result->ValidAddresses;
 *  print("Number of addresses returned is ". sizseof($addresses));
 *
 * 
* @author Avalara * @copyright � 2004 - 2011 Avalara, Inc. All rights reserved. * @package Address */ class Address { private $AddressCode; private $Line1; private $Line2; private $Line3; private $City; private $Region; private $PostalCode; private $Country = 'USA'; private $TaxRegionId = 0; /** * Construct a new Address. * * Constructs a new instance of Address. *
     * $address = new Address();
     * 
* * @param string $line1 * @param string $line2 * @param string $line3 * @param string $city * @param string $region * @param string $postalCode * @param string $country * @param integer $taxRegionId */ public function __construct($line1=null,$line2=null,$line3=null,$city=null,$region=null,$postalCode=null,$country='USA',$taxRegionId=0) { $this->Line1 = $line1; $this->Line2 = $line2; $this->Line3 = $line3; $this->City = $city; $this->Region = $region; $this->PostalCode = $postalCode; $this->Country = $country; $this->TaxRegionId = $taxRegionId; } /** * Programmatically determined value used internally by the adapter. * * @param string $value * */ public function setAddressCode($value) { $this->AddressCode = $value; } /** * Address line 1 * * @param string $value */ public function setLine1($value) { $this->Line1 = $value; } /** * Address line 2 * * @param string $value */ public function setLine2($value) { $this->Line2 = $value; } /** * Address line 3 * * @param string $value */ public function setLine3($value) { $this->Line3 = $value; } /** * City name * * @param string $value */ public function setCity($value) { $this->City = $value; } /** * State or province name or abbreviation * * @param string $value */ public function setRegion($value) { $this->Region = $value; } /** * Postal or ZIP code * * @param string $value */ public function setPostalCode($value) { $this->PostalCode = $value; } /** * Country name * * @param string $value */ public function setCountry($value) { $this->Country = $value; } /** * TaxRegionId provides the ability to override the tax region assignment for an address. * * @param string $value */ public function setTaxRegionId($value) { $this->TaxRegionId = $value; } /** * Programmatically determined value used internally by the adapter. * * @return string $value */ public function getAddressCode() { return $this->AddressCode; } /** * Address line 1 * * @return string $value */ public function getLine1() { return $this->Line1; } /** * Address line 2 * * @return string $value */ public function getLine2() { return $this->Line2; } /** * Address line 3 * * @return string $value */ public function getLine3() { return $this->Line3; } /** * City name * * @return string $value */ public function getCity() { return $this->City; } /** * State or province name or abbreviation * * @return string $value */ public function getRegion() { return $this->Region; } /** * Postal or ZIP code * * @return string $value */ public function getPostalCode() { return $this->PostalCode; } /** * Country name * * @return string $value */ public function getCountry() { return $this->AddressCode; } /** * TaxRegionId provides the ability to override the tax region assignment for an address. * * @return string $value */ public function getTaxRegionId() { return $this->TaxRegionId; } /** * Compares Addresses * @access public * @param Address * @return boolean */ public function equals(&$other) // fix me after replace { return $this === $other || ( strcmp($this->AddressCode , $other->AddressCode) == 0 && strcmp($this->Line1 , $other->Line1) == 0 && strcmp($this->Line2 , $other->Line2) == 0 && strcmp($this->Line3 , $other->Line3) == 0 && strcmp($this->City , $other->City) == 0 && strcmp($this->Region , $other->Region) == 0 && strcmp($this->PostalCode , $other->PostalCode) == 0 && strcmp($this->Country , $other->Country) == 0 && $this->TaxRegionId === $other->TaxRegionId ); } } ?>PK!?\vz classes/PostTaxRequest.class.phpnuW+A * The request must specify all of CompanyCode, DocCode, and DocType in order to uniquely identify the document. *

* * @see PostTaxResult * * @author Avalara * @copyright � 2004 - 2011 Avalara, Inc. All rights reserved. * @package Tax */ class PostTaxRequest extends TaxRequest { private $DocDate; //date private $TotalAmount; // decimal private $TotalTax; // decimal private $Commit=false; // boolean private $NewDocCode; //string public function __construct() { parent::__construct(); } public function getDocDate() { return $this->DocDate; } public function getTotalAmount() { return $this->TotalAmount; } public function getTotalTax() { return $this->TotalTax; } public function getCommit() { return $this->Commit; } public function getNewDocCode() { return $this->NewDocCode; } /** * DocDate should be in the format yyyy-mm-dd * * @param date $value */ public function setDocDate($value) { $this->DocDate = $value; return $this; } /** *The total amount (not including tax) for the document. * * @param decimal $value */ public function setTotalAmount($value) { $this->TotalAmount = $value; return $this; } /** * The total tax for the document. * * @param decimal $value */ public function setTotalTax($value) { $this->TotalTax = $value; return $this; } /** * If this is set to True, AvaTax will Post and Commit the document in one call. * A very useful feature if you want to Post/Commit the document in one call this avoides one round trip to AvaTax server. * * @param string $value */ public function setCommit($value) { $this->Commit = ($value ? true : false); return $this; } /** * New Document Code for the document. * As on this version of SDK DocCode can be changed during post using NewDocCode. * @param string $value */ public function setNewDocCode($value) { $this->NewDocCode = $value; } } ?>PK!?\!=r#classes/CertificateStatus.class.phpnuW+APK!?\)classes/.htaccessnuW+A Order allow,deny Deny from all PK!?\xBډclasses/BoundaryLevel.class.phpnuW+APK!?\R|eclasses/AVObject.class.phpnuW+A￿PK!?\QAclasses/Line.class.phpnuW+ANo=$no; $this->Qty=$qty; $this->Amount=$amount; $this->Discounted=false; } /* * Mutator * @access public * @param integer */ /** * Line Number. * * @param string $value */ public function setNo($value) { $this->No = $value; return $this; } //string // line Number of invoice /** * Item Code (SKU) * * @param string $value */ public function setItemCode($value) { $this->ItemCode = $value; return $this; } //string /** * Sets the description which defines the description for the product or item. * * @param string $value */ public function setDescription($value) { $this->Description = $value; return $this; } //string /** * System or Custom Tax Code. * * @param string $value */ public function setTaxCode($value) { $this->TaxCode = $value; return $this; } //string /** * Revenue Account. * * @param string $value */ public function setRevAcct($value) { $this->RevAcct = $value; return $this; } //string /** * Client specific reference field. * * @param string $value */ public function setRef1($value) { $this->Ref1 = $value; return $this; } //string /** * Client specific reference field. * * @param string $value */ public function setRef2($value) { $this->Ref2 = $value; return $this; } //string /** * Exemption number for this line * * @param string $value */ public function setExemptionNo($value) { $this->ExemptionNo = $value; return $this; } //string //zero tax will result if filled in /** * The client application customer or usage type. *

* This is used to determine the exempt status of the transaction based on the exemption tax rules for the * jurisdictions involved. This may also be set at the line level. *

*

* The standard values for the CustomerUsageType (A-L).
A � Federal Government
B � State/Local Govt.
C � Tribal Government
D � Foreign Diplomat
E � Charitable Organization
F � Religious/Education
G � Resale
H � Agricultural Production
I � Industrial Prod/Mfg.
J � Direct Pay Permit
K � Direct Mail
L - Other
*

* @param string $value */ public function setCustomerUsageType($value) { $this->CustomerUsageType = $value; return $this; } //string /** * Enter description here... * * @param string $value */ public function setBatchCode($value) { $this->BatchCode = $value; return $this; } //string /** * The quantity represented by this line. * * @param string $value */ public function setQty($value) { $this->Qty = $value; return $this; } //decimal /** * The total amount for this line item (Qty * UnitPrice). * * @param string $value */ public function setAmount($value) { $this->Amount = $value; return $this; } //decimal // TotalAmmount /** * TaxOverride for the document at line level. * * @param string $value */ public function setTaxOverride($value) { $this->TaxOverride = $value; return $this; } //decimal /** * True if the document discount should be applied to this line * * @param string $value */ public function setDiscounted( $value) { $this->Discounted = ($value ? true : false); return $this; } //boolean is discount applied to this item /** * Sets the Address used as the "Ship From" location for a specific line item. * * @param string $value */ public function setOriginAddress(&$value) { $this->OriginAddress = $value; return $this; } //Address /** * Sets the Address used as the "Ship To" location for a specific line item. * * @param string $value */ public function setDestinationAddress(&$value) { $this->DestinationAddress = $value; return $this; } //Address /** * True if tax is included in the line. * @param boolean */ public function setTaxIncluded($value) { $this->TaxIncluded=$value; } /** * True if tax is included in the line. * @return boolean */ public function getTaxIncluded($value) { return $this->TaxIncluded; } public function registerAddressesIn(&$getTaxRequest) { if(is_null($this->OriginAddress)) { $this->OriginAddress = $getTaxRequest->getOriginAddress(); } if(is_null($this->DestinationAddress)) { $this->DestinationAddress = $getTaxRequest->getDestinationAddress(); } $this->OriginCode = $getTaxRequest->registerAddress($this->OriginAddress); $this->DestinationCode = $getTaxRequest->registerAddress($this->DestinationAddress); } public function postFetchWithAddresses($addresses) { $this->OriginAddress = $addresses[$this->OriginCode]; $this->DestinationAddress = $addresses[$this->DestinationCode]; } //accessors /**#@+ * Accessor * @access public * @return string */ public function getNo () { return $this->No; } //string // line Number of invoice public function getItemCode() { return $this->ItemCode; } //string public function getDescription() { return $this->Description; } //string public function getTaxCode() { return $this->TaxCode; } //string public function getRevAcct() { return $this->RevAcct; } //string public function getRef1() { return $this->Ref1; } //string public function getRef2() { return $this->Ref2; } //string public function getExemptionNo() { return $this->ExemptionNo; } //string //zero tax will result if filled in public function getCustomerUsageType() { return $this->CustomerUsageType; } //string public function getBatchCode() { return $this->BatchCode; } //string public function getQty() { return $this->Qty; } //decimal public function getAmount() { return $this->Amount; } //decimal // TotalAmmount public function getTaxOverride() { return $this->TaxOverride; } //decimal public function getDiscounted() { return $this->Discounted; } //boolean is discount applied to this item public function getOriginAddress() { return $this->OriginAddress; } //Address public function getDestinationAddress() { return $this->DestinationAddress; } //Address /**#@-*/ } ?>PK!?\`Zp441classes/GetExemptionCertificatesRequest.class.phpnuW+AsetDate(0001,01,01); $this->FromDate=$dateTime->format("Y-m-d"); $dateTime->setDate(0001,01,01); $this->ToDate=$dateTime->format("Y-m-d"); } public function setCustomerCode($value){$this->CustomerCode=$value;} // string public function getCustomerCode(){return $this->CustomerCode;} // string public function setFromDate($value){$this->FromDate=$value;} // dateTime public function getFromDate(){return $this->FromDate;} // dateTime public function setToDate($value){$this->ToDate=$value;} // dateTime public function getToDate(){return $this->ToDate;} // dateTime public function setRegion($value){$this->Region=$value;} // string public function getRegion(){return $this->Region;} // string public function setCompanyCode($value){$this->CompanyCode=$value;} // string public function getCompanyCode(){return $this->CompanyCode;} // string } ?> PK!?\Bmm$classes/AddressServiceSoap.class.phpnuW+A * Example: *
 *  $addressService = new AddressServiceSoap();
 * 
* * @author Avalara * @copyright � 2004 - 2011 Avalara, Inc. All rights reserved. * @package Address * */ if(!class_exists('AvalaraSoapClient')) require (VMAVALARA_CLASS_PATH.DS.'AvalaraSoapClient.class.php'); class AddressServiceSoap extends AvalaraSoapClient { static private $servicePath = '/Address/AddressSvc.asmx'; static protected $classmap = array( 'Validate' => 'Validate', 'BaseRequest' => 'BaseRequest', 'ValidateRequest' => 'ValidateRequest', 'BaseAddress' => 'BaseAddress', 'ValidAddress' => 'ValidAddress', 'TextCase' => 'TextCase', 'ValidateResult' => 'ValidateResult', 'BaseResult' => 'BaseResult', 'SeverityLevel' => 'SeverityLevel', 'Message' => 'Message', 'Profile' => 'Profile', 'Ping' => 'Ping', 'PingResult' => 'PingResult', 'IsAuthorized' => 'IsAuthorized', 'IsAuthorizedResult' => 'IsAuthorizedResult'); /** * Construct a proxy for Avalara's Address Web Service using the default URL as coded in the class or programatically set. * * Example: *
     *  $port = new AddressServiceSoap();
     *  $port->ping();
     * 
* * @see AvalaraSoapClient * @see TaxServiceSoap */ public function __construct($configurationName = 'Default',$config=0) { if(empty($config)){ vmdebug('AddressServiceSoap '.$configurationName); $config = new ATConfig($configurationName); } if(!class_exists('DynamicSoapClient')) require (VMAVALARA_CLASS_PATH.DS.'DynamicSoapClient.class.php'); $this->client = new DynamicSoapClient ( $config->addressWSDL, array ( 'location' => $config->url.$config->addressService, 'trace' => $config->trace, 'classmap' => AddressServiceSoap::$classmap ), $config ); //$this->client->__getTypes(); } /** * Checks authentication of and authorization to one or more * operations on the service. * * This operation allows pre-authorization checking of any * or all operations. It will return a comma delimited set of * operation names which will be all or a subset of the requested * operation names. For security, it will never return operation * names other than those requested (no phishing allowed). * * Example:
* isAuthorized("GetTax,PostTax") * * @param string $operations a comma-delimited list of operation names * * @return IsAuthorizedResult * @throws SoapFault */ public function isAuthorized($operations) { return $this->client->IsAuthorized(array('Operations' => $operations))->IsAuthorizedResult; } /** * Verifies connectivity to the web service and returns version * information about the service. * * NOTE:This replaces TestConnection and is available on * every service. * * @param string $message for future use * @return PingResult * @throws SoapFault */ public function ping($message = '') { return $this->client->Ping(array('Message' => $message))->PingResult; } /** * Validates an address and returns a collection of possible * {@link ValidAddress} objects in a {@link ValidateResult} object. * * Takes an {@link Address}, an optional {@link TextCase} * property that determines the casing applied to a validated * address. It defaults to TextCase::$Default. * Example:
*
     *  $port = new AddressServiceSoap();
     *
     *  $address = new Address();
     *  $address->setLine1("900 Winslow Way");
     *  $address->setLine2("Suite 130");
     *  $address->setCity("Bainbridge Is");
     *  $address->setRegion("WA");
     *  $address->setPostalCode("98110-2450");
     *
     *  $result = $port->validate(new ValidateRequest($address,TextCase::$Upper));
     *  $addresses = $result->validAddresses();
     *  print('Number of addresses returned is: '.sizeof($addresses)); 
     * 
* * @param ValidateRequest * @return ValidateResult * * @throws SoapFault */ public function validate($validateRequest) { return $this->client->Validate( array('ValidateRequest' => $validateRequest) )->ValidateResult; //return $result->ValidateResult(); } } ?> PK!?\P;_ _ ,classes/ReconcileTaxHistoryRequest.class.phpnuW+AEndDate = date("Y-m-d"); $this->DocStatus =DocStatus::$Any; } public function getCompanyCode() { return $this->CompanyCode;} public function getstartDate() { return $this->StartDate; } public function getEndDate() { return $this->EndDate; } public function getDocStatus() { return $this->DocStatus; } /** * Sets the client application company reference code. * * @param string $value */ public function setCompanyCode($value) { $this->CompanyCode = $value; return $this; } /** * Set this to retrieve data FROM a specific date. * * @param date $value */ public function setStartDate($value) { $this->StartDate = $value; return $this; } /** * Set this to retrieve data TO a specific date. * * @param date $value */ public function setEndDate($value) { $this->EndDate = $value; return $this; } /** * Set this to retrieve data with a specific DocStatus. * * @param string $value */ public function setDocStatus($value) { DocStatus::Validate($value); $this->DocStatus = $value; return $this; } public function setDocType($value){$this->DocType=$value;} // DocType public function getDocType(){return $this->DocType;} // DocType public function setLastDocCode($value){$this->LastDocCode=$value;} // string public function getLastDocCode(){return $this->LastDocCode;} // string public function setPageSize($value){$this->PageSize=$value;} // int public function getPageSize(){return $this->PageSize;} // int } ?>PK!?\<~classes/TaxDetail.class.phpnuW+AStateAssignedNo; } /** * Gets the JurisdictionType. *

* *

* @see JurisdictionType @see GetTaxResults * @return JurisdictionType */ public function getJurisType() {return $this->JurisType; } /** * Gets the JurisCode. *

*

* @see JurisCode @see GetTaxResults * @return string */ public function getJurisCode() {return $this->JurisCode; } /** * Gets the TaxType. *

*

@see GetTaxResults * @return TaxType */ public function getTaxType() {return $this->TaxType; } /** * Gets the Taxable amount. *

*

@see GetTaxResults * @return decimal */ public function getTaxable() {return $this->Taxable; } /** * Gets the Taxable amount. *

*

@see GetTaxResults * @return decimal */ public function getBase() {return $this->Base; } /** * Gets the Rate amount. *

*

@see GetTaxResults * @return decimal */ public function getRate() {return $this->Rate; } /** * Gets the Tax amount. *

The tax amount, i.e. the calculated tax (base() * rate()) *

@see GetTaxResults * @return decimal */ public function getTax() {return $this->Tax; } /** * Gets the non-taxable amount.. *

The non-taxable amount. *

@see GetTaxResults * @return decimal */ public function getNonTaxable() {return $this->NonTaxable; } /** * Gets theExemption amount.. *

The exempt amount for this TaxDetail. *

@see GetTaxResults * @return decimal */ public function getExemption() {return $this->Exemption; } /** * Gets the jurisdiction name for this TaxDetail. *

Gets the jurisdiction name for this TaxDetail. *

@see GetTaxResults * @return decimal */ public function getJurisName() {return $this->JurisName; } /** * *

Gets the taxName value. It further defines tax and jurisdiction. *

@see GetTaxResults * @return decimal */ public function getTaxName() {return $this->TaxName; } /** * Gets the taxAuthorityType value for this TaxDetail. *

Gets the taxAuthorityType value for this TaxDetail. *

@see GetTaxResults * @return decimal */ public function getTaxAuthorityType() {return $this->TaxAuthorityType; } //@author:swetal public function getCountry(){ return $this->Country;} public function getRegion(){ return $this->Region;} public function getTaxCalculated(){ return $this->TaxCalculated;} public function getTaxGroup(){ return $this->TaxGroup;} } ?>PK!?\- AvaTax.phpnuW+APK!?\  avalara.phpnuW+APK!?\nll ̿avalara.xmlnuW+APK!?\V sindex.htmlnuW+APK!?\) .htaccessnuW+APK!?\R classes/DetailLevel.class.phpnuW+APK!?\%eeclasses/DocStatus.class.phpnuW+APK!?\xJclasses/BaseResult.class.phpnuW+APK!?\ Y #classes/DynamicSoapClient.class.phpnuW+APK!?\&classes/ExemptionCertificate.class.phpnuW+APK!?\*SJJ%5classes/GetTaxHistoryResult.class.phpnuW+APK!?\$uH<<classes/PostTaxResult.class.phpnuW+APK!?\\%_classes/ApplyPaymentRequest.class.phpnuW+APK!?\jV[[!Zclasses/ValidateRequest.class.phpnuW+APK!?\8`? ? 'classes/Customer.class.phpnuW+APK!?\4classes/AddressType.class.phpnuW+APK!?\ڇ!9classes/TaxOverrideType.class.phpnuW+APK!?\R R <classes/Message.class.phpnuW+APK!?\릵B"Eclasses/JurisdictionType.class.phpnuW+APK!?\}Lclasses/DocumentType.class.phpnuW+APK!?\NH$Uclasses/AddCustomerRequest.class.phpnuW+APK!?\x"ii$4Yclasses/ApplyPaymentResult.class.phpnuW+APK!?\ĩKZclasses/TaxRequest.class.phpnuW+APK!?\"Xlclasses/GetTaxResult.class.phpnuW+APK!?\  *classes/GetExemptionCertificates.class.phpnuW+APK!?\Xׯuclasses/ATConfig.class.phpnuW+APK!?\  "nclasses/CancelTaxRequest.class.phpnuW+APK!?\ !$!$classes/AvaCertSvc.class.phpnuW+APK!?\zmP  classes/TaxType.class.phpnuW+APK!?\JZclasses/SeverityLevel.class.phpnuW+APK!?\cxH66classes/PingResult.class.phpnuW+APK!?\| > >@classes/GetTaxRequest.class.phpnuW+APK!?\*-.y y (classes/SearchTaxHistoryResult.class.phpnuW+APK!?\`3::lclasses/Jurisdiction.class.phpnuW+APK!?\$E#!classes/AvalaraSoapClient.class.phpnuW+APK!?\m"%classes/CertificateUsage.class.phpnuW+APK!?\IC C *classes/CancelCode.class.phpnuW+APK!?\ "_4classes/CommitTaxRequest.class.phpnuW+APK!?\VA9classes/index.htmlnuW+APK!?\!9classes/AdjustTaxResult.class.phpnuW+APK!?\]eDD$Xclasses/InitiateExemptCert.class.phpnuW+APK!?\ M0[classes/GetExemptionCertificatesResult.class.phpnuW+APK!?\$^classes/IsAuthorizedResult.class.phpnuW+APK!?\g#fclasses/CommunicationMode.class.phpnuW+APK!?\i844jclasses/wsdl/Tax.wsdlnuW+APK!?\H5H5^classes/wsdl/Address.wsdlnuW+APK!?\)classes/wsdl/.htaccessnuW+APK!?\V֔classes/wsdl/index.htmlnuW+APK!?\5=uu<classes/wsdl/BatchSvc.wsdlnuW+APK!?\v$$ classes/wsdl/AvaCertSvc.wsdlnuW+APK!?\\PiXXvclasses/RequestType.class.phpnuW+APK!?\{\BB!classes/CommitTaxResult.class.phpnuW+APK!?\=ͮclasses/Enum.class.phpnuW+APK!?\%mclasses/TaxOverride.class.phpnuW+APK!?\ izclasses/TextCase.class.phpnuW+APK!?\DI Gclasses/ValidateResult.class.phpnuW+APK!?\;*Kclasses/InitiateExemptCertResult.class.phpnuW+APK!?\c\\aclasses/ServiceMode.class.phpnuW+APK!?\Ql l  classes/TaxLine.class.phpnuW+APK!?\tѝclasses/ReviewStatus.class.phpnuW+APK!?\l00+classes/InitiateExemptCertRequest.class.phpnuW+APK!?\'5classes/BatchSvc/AuditMessage.class.phpnuW+APK!?\)fclasses/BatchSvc/.htaccessnuW+APK!?\HC#/classes/BatchSvc/AvaTaxBatchSvc.phpnuW+APK!?\WE  &classes/BatchSvc/BatchDelete.class.phpnuW+APK!?\#w$gclasses/BatchSvc/BatchSave.class.phpnuW+APK!?\m::#classes/BatchSvc/BatchSvc.class.phpnuW+APK!?\<֩(classes/BatchSvc/SeverityLevel.class.phpnuW+APK!?\EE/classes/BatchSvc/IsAuthorizedResponse.class.phpnuW+APK!?\ŠY Y classes/BatchSvc/Batch.class.phpnuW+APK!?\NN-] classes/BatchSvc/BatchProcessResult.class.phpnuW+APK!?\G$classes/BatchSvc/BatchFile.class.phpnuW+APK!?\]  )classes/BatchSvc/BatchFileFetch.class.phpnuW+APK!?\.g/Oclasses/BatchSvc/BatchFileFetchResult.class.phpnuW+APK!?\@z.classes/BatchSvc/BatchFileSaveResult.class.phpnuW+APK!?\1<(classes/BatchSvc/BatchFileSave.class.phpnuW+APK!?\X.9!classes/BatchSvc/BatchProcessRequest.class.phpnuW+APK!?\r!"$classes/BatchSvc/Message.class.phpnuW+APK!?\/*classes/BatchSvc/Ping.class.phpnuW+APK!?\&;HYY1,classes/BatchSvc/BatchFileFetchResponse.class.phpnuW+APK!?\OEE//classes/BatchSvc/BatchProcessResponse.class.phpnuW+APK!?\W*'.2classes/BatchSvc/PingResponse.class.phpnuW+APK!?\pUOO0z4classes/BatchSvc/BatchFileSaveResponse.class.phpnuW+APK!?\h()7classes/BatchSvc/FilterRequest.class.phpnuW+APK!?\Lu'',H:classes/BatchSvc/BatchSaveResponse.class.phpnuW+APK!?\;-BB'<classes/BatchSvc/DeleteResult.class.phpnuW+APK!?\*d>classes/BatchSvc/BatchFileDelete.class.phpnuW+APK!?\]Q*@classes/BatchSvc/BatchSaveResult.class.phpnuW+APK!?\ɣ,((%Dclasses/BatchSvc/PingResult.class.phpnuW+APK!?\%Gclasses/BatchSvc/BatchFetch.class.phpnuW+APK!?\f]11-Iclasses/BatchSvc/BatchFetchResponse.class.phpnuW+APK!?\{'cLclasses/BatchSvc/IsAuthorized.class.phpnuW+APK!?\ Ok+Nclasses/BatchSvc/BatchFetchResult.class.phpnuW+APK!?\4fHH2Qclasses/BatchSvc/BatchFileDeleteResponse.class.phpnuW+APK!?\pTT'gTclasses/BatchSvc/FetchRequest.class.phpnuW+APK!?\-*'[classes/BatchSvc/FilterResult.class.phpnuW+APK!?\ח=='0]classes/BatchSvc/BatchProcess.class.phpnuW+APK!?\Z-_classes/BatchSvc/IsAuthorizedResult.class.phpnuW+APK!?\\(bclasses/BatchSvc/DeleteRequest.class.phpnuW+APK!?\ ޽"fclasses/BatchSvc/Profile.class.phpnuW+APK!?\Vjclasses/BatchSvc/index.htmlnuW+APK!?\#%yjclasses/BatchSvc/BaseResult.class.phpnuW+APK!?\wj_**.Ynclasses/BatchSvc/BatchDeleteResponse.class.phpnuW+APK!?\(u CC!pclasses/CancelTaxResult.class.phpnuW+APK!?\3\#uuclasses/AddCustomerResult.class.phpnuW+APK!?\| +wwclasses/ReconcileTaxHistoryResult.class.phpnuW+APK!?\j44 qclasses/TaxServiceSoap.class.phpnuW+APK!?\9HmmUclasses/ATObject.class.phpnuW+APK!?\l}=2=2 classes/ValidAddress.class.phpnuW+APK!?\V="classes/AdjustTaxRequest.class.phpnuW+APK!?\>pܭclasses/AddCustomer.class.phpnuW+APK!?\jNN&classes/GetTaxHistoryRequest.class.phpnuW+APK!?\"~WWclasses/Address.class.phpnuW+APK!?\vz @classes/PostTaxRequest.class.phpnuW+APK!?\!=r#\ classes/CertificateStatus.class.phpnuW+APK!?\)%classes/.htaccessnuW+APK!?\xBډD&classes/BoundaryLevel.class.phpnuW+APK!?\R|eG+classes/AVObject.class.phpnuW+APK!?\QA+classes/Line.class.phpnuW+APK!?\`Zp441Kclasses/GetExemptionCertificatesRequest.class.phpnuW+APK!?\Bmm$SRclasses/AddressServiceSoap.class.phpnuW+APK!?\P;_ _ ,iclasses/ReconcileTaxHistoryRequest.class.phpnuW+APK!?\<~rclasses/TaxDetail.class.phpnuW+APK{{.7