VAT fixes

This commit is contained in:
Albert Santoni 2014-06-26 17:44:53 -04:00
parent 18c828defd
commit d785d92953
2 changed files with 8 additions and 6 deletions

View file

@ -40,7 +40,11 @@ class BillingController extends Zend_Controller_Action {
if ($form->isValid($formData)) {
$credentials = self::getAPICredentials();
$apply_vat = BillingController::checkIfVatShouldBeApplied($formData["customfields"]["7"], $formData["country"]);
if (in_array("7", $formData["customfields"])) {
$apply_vat = BillingController::checkIfVatShouldBeApplied($formData["customfields"]["7"], $formData["country"]);
} else {
$apply_vat = false;
}
$postfields = array();
$postfields["username"] = $credentials["username"];
@ -251,7 +255,7 @@ class BillingController extends Zend_Controller_Action {
$postfields["action"] = "updateinvoice";
$postfields["invoiceid"] = $invoice_id;
$postfields["tax"] = "$vat_amount";
$postfields["taxrate"] = "$vat_rate";
$postfields["taxrate"] = strval(VAT_RATE);
$postfields["total"] = "$invoice_total";
$postfields["responsetype"] = "json";