gicristhie

Untitled

Mar 6th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. var tax={}; var number;
  2. number = $("#customerTax").val().replace(/[^0-9]+/g, '');
  3. if(type === "PJ"){
  4. tax.type = "CNPJ";
  5. tax.value = number;
  6. // tax = JSON.stringify(tax);
  7. console.log("PJ tax: ",tax);
  8. console.log("old: ", old.tax);
  9. if ((old.tax.type !== tax.type)||(old.tax.value !== tax.value)){
  10. console.log("Tax different: ",old.tax, tax);
  11. data.append("tax", JSON.stringify(tax));
  12. }
  13. }
  14. if(type === "PF"){
  15. tax.type = "CPF";
  16. tax.value = number;
  17. // tax = JSON.stringify(tax);
  18. console.log("PF tax: ",tax);
  19. console.log("old: ", old.tax);
  20. if ((old.tax.type !== tax.type)||(old.tax.value !== tax.value)){
  21. console.log("are different: ", old.tax, tax);
  22. data.append("tax", JSON.stringify(tax));
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment