Browse Source

Removes a bug where Payment Type label became hidden.

1).  Relates an on load selector with hide() that has been preempted
     by the new error validation.  But will watch to make sure new
     bugs haven't been introduced.
devel
Jonathan Rosenbaum 10 years ago
parent
commit
2175ab18e4
  1. 11
      js/transaction.js
  2. 2
      transaction_log.php

11
js/transaction.js

@ -85,7 +85,7 @@ $(function() {
} );
// paid or not?
$(":checked").parent("td").prev().children().hide();
//$(":checked").parent("td").prev().children().hide(); // with validation testing this seems to be unnecessary
$(".paid").click(function() {
if (open_shop == "no_shop") { return false; }
@ -453,7 +453,7 @@ $(function() {
var transaction_id = $("input[name='transaction_id']").val();
var sold_to = $("[name='sold_to']");
var sold_by = $("[name='sold_by']");
var payment_type = $("input[name='payment_type']");
//var payment_type = $("input[name='payment_type']");
var amount = $("#amount");
var description = $("#description");
var quantity = $("#quantity");
@ -497,7 +497,8 @@ $(function() {
// sold_by error
err2 = error_handler(sold_by.val(), sold_by_error, "no_selection", "*Required",e);
// for storage transactions don't check for payment_type and payment until there is an actual date
// for storage transactions don't check for payment_type and payment until there is an actual date
var payment_type = $("input[name='payment_type']"); // payment_type variable needs to be kept within scope
var payment_type_result;
if ( date.val() != "0000-00-00" && date.val() != "") {
@ -548,7 +549,7 @@ $(function() {
transaction_error.text("Correct errors below");
} else {
transaction_error.hide();
}
}
});
// error handler for edited transactions
@ -601,7 +602,7 @@ $(function() {
});
// what type of payment? cash, credit or check?
payment_type.click(function() {
$("input[name='payment_type']").click(function() {
if ($(this).prop("checked")) {
$.post("json/transaction.php",{ payment_type: this.value, transaction_id: $("input[name='transaction_id']").val() } );

2
transaction_log.php

@ -476,7 +476,7 @@ if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "ChangeDate")) {
<?php if($row_Recordset3['show_payment']) { ?>
<tr id="payment_type">
<td></td>
<td><label>Payment Type:</label></td>
<td><label for="payment_type" id="payment_type_label">Payment Type:</label></td>
<td>
<input type="radio" name="payment_type" value="cash"
<?php if ($row_Recordset2['payment_type'] == "cash") { echo " checked"; } ?> >

Loading…
Cancel
Save