/** * Init tax override object * * @param string $taxOverrideType * @param string $reason * @param float $taxAmount * @return TaxOverride */ protected function _getTaxOverrideObject($taxOverrideType, $reason, $taxAmount) { $taxOverride = new TaxOverride(); $taxOverride->setTaxOverrideType($taxOverrideType); $taxOverride->setReason($reason); $taxOverride->setTaxAmount($taxAmount); return $taxOverride; }
private function CreateTaxRequestForTaxOverrideType($docCode) { $request = new GetTaxRequest(); $request->setCompanyCode("DEFAULT"); $request->setDocCode($docCode); $request->setDocType(DocumentType::$PurchaseOrder); $dateTime = new DateTime(); $docDate = date_format($dateTime, "Y-m-d"); $request->setDocDate($docDate); $request->setCustomerCode("TaxSvcTest"); $request->setSalespersonCode(""); $request->setDetailLevel(DetailLevel::$Tax); $origin = new Address(); $origin->setAddressCode("Origin"); $origin->setCity("Denver"); $origin->setRegion("CO"); $origin->setPostalCode("80216-1022"); $origin->setCountry("USA"); $request->setOriginAddress($origin); $destination = new Address(); $destination->setAddressCode("Dest"); $destination->setLine1("11051 S Parker Rd"); $destination->setCity("Parker"); $destination->setRegion("CO"); $destination->setPostalCode("80134-7441"); $destination->setCountry("USA"); $request->setDestinationAddress($destination); $line = new Line(); $line->setNo("1"); $line->setQty(1); $line->setAmount(0); $taxOverride = new TaxOverride(); $taxOverride->setTaxOverrideType(TaxOverrideType::$AccruedTaxAmount); $taxOverride->setTaxAmount(21.1); $taxOverride->setReason("Accrued"); $line->setTaxOverride($taxOverride); $request->setLines(array($line)); return $request; }