diff --git a/tailbone/templates/purchases/batches/receive_form.mako b/tailbone/templates/purchases/batches/receive_form.mako index 13312490..3a3ed888 100644 --- a/tailbone/templates/purchases/batches/receive_form.mako +++ b/tailbone/templates/purchases/batches/receive_form.mako @@ -154,7 +154,28 @@ } $(this).button('disable').button('option', 'label', "Working..."); $('#mode').val('damaged'); - $('#receiving-form').submit(); + $('#damaged-dialog').dialog({ + title: "Damaged Product", + modal: true, + width: '500px', + buttons: [ + { + text: "OK", + click: function() { + $('#damaged-dialog').dialog('close'); + $('#receiving-form #trash').val($('#damaged-dialog #trash').is(':checked') ? '1' : ''); + $('#receiving-form').submit(); + } + }, + { + text: "Cancel", + click: function() { + $('#damaged').button('option', 'label', "Damaged").button('enable'); + $('#damaged-dialog').dialog('close'); + } + } + ] + }); }); $('#expiration input[type="date"]').datepicker(); @@ -166,8 +187,9 @@ $(this).button('disable').button('option', 'label', "Working..."); $('#mode').val('expired'); $('#expiration').dialog({ - title: "Expiration Date", + title: "Expired / Short Date", modal: true, + width: '500px', buttons: [ { text: "OK", @@ -175,6 +197,7 @@ $('#expiration').dialog('close'); $('#receiving-form #expiration_date').val( $('#expiration input[type="date"]').val()); + $('#receiving-form #trash').val($('#expiration #trash').is(':checked') ? '1' : ''); $('#receiving-form').submit(); } }, @@ -280,6 +303,10 @@ }); + + +<%def name="extra_styles()"> + ${parent.extra_styles()}