mirror of
https://github.com/fspc/Yellow-Bike-Database.git
synced 2025-02-23 01:03:23 -05:00
Two minor fixes.
* If sum is really large it is fixed(2) so that difference in transaction_log is correct and it turns green, etc. * typeof amount.val() is check for undefined to avoid unneccesary error output.
This commit is contained in:
parent
98965c8b19
commit
69b9c5e433
@ -468,7 +468,7 @@ $(function() {
|
|||||||
var deposit_amount = $('input[name="' + k + '"]').parent().prev().prev().text().replace(/\$(\d*(?:,\d{3})*\.\d*)\s+/, "$1" );
|
var deposit_amount = $('input[name="' + k + '"]').parent().prev().prev().text().replace(/\$(\d*(?:,\d{3})*\.\d*)\s+/, "$1" );
|
||||||
deposit_amount = deposit_amount.replace(/,/, "");
|
deposit_amount = deposit_amount.replace(/,/, "");
|
||||||
if (deposit_amount != 0) {
|
if (deposit_amount != 0) {
|
||||||
var diff = deposit_amount - sum;
|
var diff = deposit_amount - sum.toFixed(2);
|
||||||
$("#" + k + "_difference span").text("$"+ diff.toFixed(2));
|
$("#" + k + "_difference span").text("$"+ diff.toFixed(2));
|
||||||
if ( diff == 0 ) {
|
if ( diff == 0 ) {
|
||||||
$("#" + k + "_difference").css("color","green");
|
$("#" + k + "_difference").css("color","green");
|
||||||
@ -992,10 +992,12 @@ $(function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// prexisting price without input, e.g. pre-filled Stand Time, needs to be taken into account
|
// prexisting price without input, e.g. pre-filled Stand Time, needs to be taken into account
|
||||||
if ( amount.cleanVal() >= 100 ) {
|
if ( typeof amount.val() !== 'undefined') {
|
||||||
price = (amount.cleanVal() / 100).toFixed(2);
|
if ( amount.cleanVal() >= 100 ) {
|
||||||
} else {
|
price = (amount.cleanVal() / 100).toFixed(2);
|
||||||
price = amount.cleanVal();
|
} else {
|
||||||
|
price = amount.cleanVal();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//console.log("original " + price);
|
//console.log("original " + price);
|
||||||
$("#original_price").text(price);
|
$("#original_price").text(price);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user