VAT fixes
This commit is contained in:
parent
18c828defd
commit
d785d92953
|
@ -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";
|
||||
|
||||
|
|
|
@ -149,10 +149,8 @@ $(document).ready(function() {
|
|||
return;
|
||||
}
|
||||
vatFieldChangeTimer = setTimeout(function() {
|
||||
//TODO: validate VAT number
|
||||
validateVATNumber();
|
||||
recalculateTotals();
|
||||
}, 2000);
|
||||
validateVATNumber(); //Validate and recalculate the totals
|
||||
}, 1500); //Wait 1.5 seconds before validating the VAT number
|
||||
});
|
||||
|
||||
$("#hobbyist_grid_price").text("$" + products[0].pricing["USD"]["monthly"] + " / month");
|
||||
|
|
Loading…
Reference in New Issue