Browse Source

Fixes an issue when Sum has ",", and a spelling mistake.

devel
Jonathan Rosenbaum 10 years ago
parent
commit
a44e5e93f2
  1. 3
      js/transaction.js
  2. 2
      sql/populate.sql

3
js/transaction.js

@ -133,7 +133,8 @@ $(function() {
$("#" + k + "_sum span").text("$" + sum.toFixed(2));
// Difference
var deposit_amount = $('input[name="' + k + '"]').parent().prev().prev().text().replace(/\$(\d*\.\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(/,/, "");
if (deposit_amount != 0) {
var diff = deposit_amount - sum;
$("#" + k + "_difference span").text("$"+ diff.toFixed(2));

2
sql/populate.sql

@ -151,7 +151,7 @@ INSERT INTO transaction_types
("Trade-ups/Ins", 4, 1, 1, 1, 1, 0, 1, 1, 1, 1, "Sale Date", "Sold By"," ", "Sold To", 1, "Description", "Sales", 1, 0),
("Helmets", 5, 1, 1, 1, 1, 0, 1, 1, 1, 1, "Sale Date", "Sold By"," ", "Sold To", 1, "Description", "Sales", 1, 0),
("Donations", 6, 1, 0, 1, 1, 0, 0, 1, 1, 1, "Sale Date", "Received by"," ", "Given by", 1, "Description", "Sales", 0, 1),
("Monentary Donations", 7, 1, 0, 1, 1, 0, 1, 1, 1, 1, "Sale Date", "Received by"," ", "Given by", 1, "Description", "Sales", 1, 1),
("Monetary Donations", 7, 1, 0, 1, 1, 0, 1, 1, 1, 1, "Sale Date", "Received by"," ", "Given by", 1, "Description", "Sales", 1, 1),
("Memberships", 8, 1, 1, 1, 1, 0, 1, 1, 1, 1, "Sale Date", "Sold By"," ", "Sold To", 1, "Description", "Sales", 1, 0),
("Inventory Parts", 9, 1, 1, 1, 1, 0, 1, 1, 1, 1, "Sale Date", "Sold By"," ", "Sold To", 1, "Description", "Sales", 1, 0),
("Cargo Related", 10, 1, 1, 1, 1, 0, 1, 1, 1, 1, "Sale Date", "Sold By"," ", "Sold To", 1, "Description", "Sales", 1, 0),

Loading…
Cancel
Save