/** * Adds tax status * * @param string $passkey * @param int $intRowid * @param string $strStatus * @param int $blnTax1Exempt * @param int $blnTax2Exempt * @param int $blnTax3Exempt * @param int $blnTax4Exempt * @param int $blnTax5Exempt * @return string */ function add_tax_status($passkey, $intRowid, $strStatus, $blnTax1Exempt, $blnTax2Exempt, $blnTax3Exempt, $blnTax4Exempt, $blnTax5Exempt) { if (!$this->check_passkey($passkey)) { return self::FAIL_AUTH; } if ($strStatus == "") { //ignore blank tax statuses return self::OK; } // Loads tax $tax = TaxStatus::LoadByLS($intRowid); if (!$tax) { $tax = new TaxStatus(); } $tax->lsid = $intRowid; $tax->status = $strStatus; $tax->tax1_status = $blnTax1Exempt; $tax->tax2_status = $blnTax2Exempt; $tax->tax3_status = $blnTax3Exempt; $tax->tax4_status = $blnTax4Exempt; $tax->tax5_status = $blnTax5Exempt; if (!$tax->save()) { Yii::log("SOAP ERROR : Error saving category {$strStatus} " . print_r($tax->getErrors()), 'error', 'application.' . __CLASS__ . "." . __FUNCTION__); return self::UNKNOWN_ERROR . " Error saving category {$strStatus} " . print_r($tax->getErrors(), true); } return self::OK; }
/** * Adds tax status * * @param string $passkey * @param int $intRowid * @param string $strStatus * @param int $blnTax1Exempt * @param int $blnTax2Exempt * @param int $blnTax3Exempt * @param int $blnTax4Exempt * @param int $blnTax5Exempt * @return string * @throws SoapFault * @soap */ function add_tax_status($passkey, $intRowid, $strStatus, $blnTax1Exempt, $blnTax2Exempt, $blnTax3Exempt, $blnTax4Exempt, $blnTax5Exempt) { self::check_passkey($passkey); if ($strStatus == "") { //ignore blank tax statuses return self::OK; } // Loads tax $tax = TaxStatus::LoadByLS($intRowid); if (!$tax) { $tax = new TaxStatus(); } $tax->lsid = $intRowid; $tax->status = $strStatus; $tax->tax1_status = $blnTax1Exempt; $tax->tax2_status = $blnTax2Exempt; $tax->tax3_status = $blnTax3Exempt; $tax->tax4_status = $blnTax4Exempt; $tax->tax5_status = $blnTax5Exempt; if (!$tax->save()) { $strMsg = "Error saving category {$strStatus}"; Yii::log("SOAP ERROR : {$strMsg} " . print_r($tax->getErrors(), true), CLogger::LEVEL_ERROR, 'application.' . __CLASS__ . "." . __FUNCTION__); throw new SoapFault($strMsg, WsSoapException::ERROR_UNKNOWN); } return self::OK; }