Browse Source

Improves the presentation.

devel
Jonathan Rosenbaum 7 years ago
parent
commit
a05575999c
  1. 17
      js/transaction.js
  2. 8
      json/transaction.php
  3. 6
      transaction_log.php

17
js/transaction.js

@ -652,6 +652,11 @@ $(function() {
var quantity_error = $("#quantity_error");
var check_number_error = $("#check_number_error");
//var check_number = $("#check_number").on("input");
// hardwire label for Stand Time
if ( $("#trans_type_info").text() === "Stand Time" ) {
$("#paid_label").text("Amount Owed:");
}
// Things to do before pressing the save / close button
@ -724,9 +729,15 @@ $(function() {
// Stand Time
if ( $("#trans_type_info").text() === "Stand Time" ) {
$.post("json/transaction.php", { stand_time: 1, contact_id: this.value, shop_id: shop_id }, function (data) {
amount.val(data + ".00");
$.post("json/transaction.php", { stand_time: 1, contact_id: this.value, shop_id: shop_id }, function (data) {
if (data) {
var obj = $.parseJSON(data);
amount.val(obj.total + ".00");
$("#stand_time_total").text(obj.hours + " hours " + obj.minutes + " minutes");
} else {
amount.val(data);
$("#stand_time_total").empty();
}
}); // stand time pos
}

8
json/transaction.php

@ -159,6 +159,8 @@ $timezone = TIMEZONE;
$sql = mysql_query($query, $YBDB) or die(mysql_error());
$result = mysql_fetch_assoc($sql);
// need to factor more than one login in same shop
if($result) {
// Give 15 minutes grace time, and round off to the next hour afterwards
@ -187,10 +189,10 @@ $timezone = TIMEZONE;
}
$total = $stand_time * $stand_time_hourly_rate;
echo "$total";
$stand_time_array = array("total" => $total, "hours" => $difference->h, "minutes" => $difference->i);
echo json_encode($stand_time_array);
}
//echo json_encode($result);
}
} // Stand Time

6
transaction_log.php

@ -501,10 +501,12 @@ if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "ChangeDate")) {
<?php if($row_Recordset3['transaction_type_id'] == "Deposit"){?>
<td><label>Deposited:</label></td>
<?php } else { ?>
<td><label>Paid:</label></td>
<td><label id="paid_label">Paid:</label></td>
<?php } ?>
<td><input name="amount" type="text" id="amount" value="<?php echo $row_Recordset2['format_amount']; ?>" size="6" />
<span id="payment_error"></span></td>
<span id="payment_error"></span>
<span id="stand_time_total"></span>
</td>
</tr>
<?php } // end show_amount ?>

Loading…
Cancel
Save