Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. function findTaxForProcess(argPrc, argPrcAmount, argPrcDiscount) {
  2. if (argPrc == '') { return 0; };
  3. var _valToReturn;
  4.  
  5. if ($('#hdnTaxBefore').val() == "true") {
  6. // if tax is calculated before discount
  7. $.ajax({
  8. url: '/AutoComplete.asmx/FindProcessTax',
  9. type: 'POST',
  10. timeout: 5000,
  11. datatype: 'xml',
  12. cache: false,
  13. data: 'argProcess=' + argPrc + '&argAmt=' + argPrcAmount,
  14. success: function (response) {
  15. _valToReturn = $(response).find('double').text();
  16. alert(_valToReturn);
  17. }
  18. });
  19. }
  20.  
  21. else {
  22. // the tax is calculated after discount
  23. $.ajax({
  24. url: '/AutoComplete.asmx/FindProcessTaxAter',
  25. type: 'POST',
  26. timeout: 5000,
  27. datatype: 'xml',
  28. cache: false,
  29. data: 'argProcess=' + argPrc + '&argAmt=' + argPrcAmount + '&argDiscount=' + argPrcDiscount,
  30. success: function (response) {
  31. _valToReturn = $(response).find('double').text();
  32. alert(_valToReturn);
  33. }
  34. });
  35. }
  36. alert('came here ' + _valToReturn);
  37. return _valToReturn;
  38. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement