Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var tax={}; var number;
- number = $("#customerTax").val().replace(/[^0-9]+/g, '');
- if(type === "PJ"){
- tax.type = "CNPJ";
- tax.value = number;
- // tax = JSON.stringify(tax);
- console.log("PJ tax: ",tax);
- console.log("old: ", old.tax);
- if ((old.tax.type !== tax.type)||(old.tax.value !== tax.value)){
- console.log("Tax different: ",old.tax, tax);
- data.append("tax", JSON.stringify(tax));
- }
- }
- if(type === "PF"){
- tax.type = "CPF";
- tax.value = number;
- // tax = JSON.stringify(tax);
- console.log("PF tax: ",tax);
- console.log("old: ", old.tax);
- if ((old.tax.type !== tax.type)||(old.tax.value !== tax.value)){
- console.log("are different: ", old.tax, tax);
- data.append("tax", JSON.stringify(tax));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment