/**
  * Add a tax code into the WS
  *
  * @param string $passkey
  * @param int $intRowid
  * @param string $strCode
  * @param int $intListOrder
  * @param double $fltTax1Rate
  * @param double $fltTax2Rate
  * @param double $fltTax3Rate
  * @param double $fltTax4Rate
  * @param double $fltTax5Rate
  * @return string
  */
 public function add_tax_code($passkey, $intRowid, $strCode, $intListOrder, $fltTax1Rate, $fltTax2Rate, $fltTax3Rate, $fltTax4Rate, $fltTax5Rate)
 {
     if (!$this->check_passkey($passkey)) {
         return self::FAIL_AUTH;
     }
     if ($strCode == "") {
         //ignore blank tax codes
         return self::OK;
     }
     // Loads tax
     $tax = TaxCode::LoadByLS($intRowid);
     if (!$tax) {
         $tax = new TaxCode();
     }
     $tax->lsid = $intRowid;
     $tax->code = $strCode;
     $tax->list_order = $intListOrder;
     $tax->tax1_rate = $fltTax1Rate;
     $tax->tax2_rate = $fltTax2Rate;
     $tax->tax3_rate = $fltTax3Rate;
     $tax->tax4_rate = $fltTax4Rate;
     $tax->tax5_rate = $fltTax5Rate;
     if (!$tax->save()) {
         Yii::log("SOAP ERROR : Error saving tax {$strCode} " . print_r($tax->getErrors()), 'error', 'application.' . __CLASS__ . "." . __FUNCTION__);
         return self::UNKNOWN_ERROR . " Error saving category {$strCode} " . print_r($tax->getErrors(), true);
     }
     return self::OK;
 }
 /**
  * Add a tax code into the WS
  *
  * @param string $passkey
  * @param int $intRowid
  * @param string $strCode
  * @param int $intListOrder
  * @param double $fltTax1Rate
  * @param double $fltTax2Rate
  * @param double $fltTax3Rate
  * @param double $fltTax4Rate
  * @param double $fltTax5Rate
  * @return string
  * @throws SoapFault
  * @soap
  */
 public function add_tax_code($passkey, $intRowid, $strCode, $intListOrder, $fltTax1Rate, $fltTax2Rate, $fltTax3Rate, $fltTax4Rate, $fltTax5Rate)
 {
     self::check_passkey($passkey);
     if ($strCode == "") {
         //ignore blank tax codes
         return self::OK;
     }
     // Loads tax
     $tax = TaxCode::LoadByLS($intRowid);
     if (!$tax) {
         $tax = new TaxCode();
     }
     $tax->lsid = $intRowid;
     $tax->code = $strCode;
     $tax->list_order = $intListOrder;
     $tax->tax1_rate = $fltTax1Rate;
     $tax->tax2_rate = $fltTax2Rate;
     $tax->tax3_rate = $fltTax3Rate;
     $tax->tax4_rate = $fltTax4Rate;
     $tax->tax5_rate = $fltTax5Rate;
     if (!$tax->save()) {
         $strMsg = "Error saving tax {$strCode}";
         Yii::log("SOAP ERROR : {$strMsg} " . print_r($tax->getErrors(), true), CLogger::LEVEL_ERROR, 'application.' . __CLASS__ . "." . __FUNCTION__);
         throw new SoapFault($strMsg, WsSoapException::ERROR_UNKNOWN);
     }
     TaxCode::VerifyAnyDestination();
     return self::OK;
 }