Sha256: 5643c97798fc19e4e0eb0e9bb0f1772b1e8cba8a0298a7c135cc73c6463aff3e

Contents?: true

Size: 951 Bytes

Versions: 8

Compression:

Stored size: 951 Bytes

Contents

$(document).ready(function() {
  if ($("#generate-invoice").attr("data-requires-check") == "1") {
    var taskCount = $("ul#invoicable-supplementary-tasks > li").length + $("ul#invoicable-tasks > li").length;
    var assetCount = $("ul#invoicable-photo-reports > li").length + $("ul#invoicable-documents > li").length;
    $("form").submit(function(){
      var checkTaskCount = $("ul#invoicable-supplementary-tasks > li > input:checked").length + $("ul#invoicable-tasks > li > input:checked").length;
      if (checkTaskCount == taskCount) {
        var checkAssetCount = $("ul#invoicable-photo-reports > li > input:checked").length + $("ul#invoicable-documents > li > input:checked").length;
        if (checkAssetCount != assetCount) {
          var answer = confirm("You still have documents that you should invoice, are you sure you want to continue?")
          if (!answer) {
            return false
          }
        }
      }
    })
  }
})

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
head_start-0.1.7 vendor/assets/javascripts/scorpion/invoices.js
head_start-0.1.6 vendor/assets/javascripts/scorpion/invoices.js
head_start-0.1.5 vendor/assets/javascripts/scorpion/invoices.js
head_start-0.1.4 vendor/assets/javascripts/scorpion/invoices.js
head_start-0.1.3 vendor/assets/javascripts/scorpion/invoices.js
head_start-0.1.2 vendor/assets/javascripts/scorpion/invoices.js
head_start-0.1.1 vendor/assets/javascripts/scorpion/invoices.js
head_start-0.1.0 vendor/assets/javascripts/scorpion/invoices.js