From 232309de7068c308ca591d7cf2c04b7b12cba086 Mon Sep 17 00:00:00 2001 From: Jonathan Rosenbaum Date: Wed, 28 Jan 2015 19:47:16 +0000 Subject: [PATCH] More validation for storage transaction in regards to save. --- js/transaction.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/js/transaction.js b/js/transaction.js index 2439f2b..b1e7219 100644 --- a/js/transaction.js +++ b/js/transaction.js @@ -690,9 +690,16 @@ $(function() { // If storage date is NULL, update to 0000-00-00 on save $("#save_transaction").click(function(e) { + + var span_or_select = $("[name='sold_to']").is("span"), err0; + if(span_or_select) { + err0 = error_handler(span_or_select, date_error, true, "*Patron must be signed in to complete this transaction.",e); + } if ( !$("#date").val().length ) { - $("#date").val("0000-00-00"); + if (err0 != 1) { + $("#date").val("0000-00-00"); + } } });