Sha256: 914977266b76b54881d523b1a035a3ff1c3d64340f28689a632b73d30a7bedcb

Contents?: true

Size: 1.89 KB

Versions: 9

Compression:

Stored size: 1.89 KB

Contents

I"ƒ(function() {
  $(document).on("ready page:load", function() {
    var sum_line, update_line_total, update_total;
    if ($('#quotation.edit').size() > 0) {
      sum_line = function(line) {
        var q, total, up;
        q = line.find('input.line-quantity').val().replace(',', '.');
        up = line.find('input.line-unit_price').val().replace(',', '.');
        return total = q * up;
      };
      update_line_total = function(line) {
        var total;
        total = sum_line(line);
        return display_euros(total, line.find('.line-total'));
      };
      update_total = function() {
        var total_duty, vat_amount, vat_rate;
        total_duty = 0;
        vat_rate = $('#quotation_vat_rate').val().replace(',', '.');
        $('.quotation-line').each(function(index, element) {
          var remove_me;
          remove_me = $(element).find('.remove-line input[type="hidden"]').val();
          if (remove_me === 'false') {
            return total_duty += sum_line($(element));
          }
        });
        vat_amount = vat_rate * total_duty / 100.0;
        display_euros(total_duty, $('#quotation-total_duty'));
        display_euros(vat_amount, $('#quotation-vat_amount'));
        return display_euros(vat_amount + total_duty, $('#quotation-total_all_taxes'));
      };
      $('#quotation-lines').on('input', 'input.line-quantity, input.line-unit_price', function(event) {
        update_line_total($(event.currentTarget).parents('.quotation-line'));
        return update_total();
      });
      $('#quotation').on('input', 'input#quotation_vat_rate', function(event) {
        return update_total();
      });
      $('#quotation').on('cocoon:after-remove', function(event) {
        return update_total();
      });
      $('.quotation-line').each(function(index, element) {
        return update_line_total($(element));
      });
      return update_total();
    }
  });

}).call(this);
:ET

Version data entries

9 entries across 7 versions & 1 rubygems

Version Path
dorsale-2.2.15 spec/dummy/tmp/cache/assets/test/sprockets/v3.0/NPavQ3CZgKvAF-7ax_JRTpgtcvxdx9ozGKu6jjoW4F4.cache
dorsale-2.2.15 spec/dummy/tmp/cache/assets/production/sprockets/v3.0/NPavQ3CZgKvAF-7ax_JRTpgtcvxdx9ozGKu6jjoW4F4.cache
dorsale-2.2.15 spec/dummy/tmp/cache/assets/development/sprockets/v3.0/NPavQ3CZgKvAF-7ax_JRTpgtcvxdx9ozGKu6jjoW4F4.cache
dorsale-2.1.5 spec/dummy/tmp/cache/assets/test/sprockets/v3.0/NPavQ3CZgKvAF-7ax_JRTpgtcvxdx9ozGKu6jjoW4F4.cache
dorsale-2.1.4 spec/dummy/tmp/cache/assets/test/sprockets/v3.0/NPavQ3CZgKvAF-7ax_JRTpgtcvxdx9ozGKu6jjoW4F4.cache
dorsale-2.1.3 spec/dummy/tmp/cache/assets/test/sprockets/v3.0/NPavQ3CZgKvAF-7ax_JRTpgtcvxdx9ozGKu6jjoW4F4.cache
dorsale-2.1.2 spec/dummy/tmp/cache/assets/test/sprockets/v3.0/NPavQ3CZgKvAF-7ax_JRTpgtcvxdx9ozGKu6jjoW4F4.cache
dorsale-2.1.1 spec/dummy/tmp/cache/assets/test/sprockets/v3.0/NPavQ3CZgKvAF-7ax_JRTpgtcvxdx9ozGKu6jjoW4F4.cache
dorsale-2.1.0 spec/dummy/tmp/cache/assets/test/sprockets/v3.0/NPavQ3CZgKvAF-7ax_JRTpgtcvxdx9ozGKu6jjoW4F4.cache