Skip to content

Commit

Permalink
add items
Browse files Browse the repository at this point in the history
  • Loading branch information
banana committed Oct 29, 2021
1 parent ead0437 commit 286abc6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
1 change: 1 addition & 0 deletions web/staff/op_tools/add_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
else:
print('''<p>Not all required fields were filled out </p>''')


print('''<form name="newitem" action="add_items.py" method="get">''')
print('''item name*: <input type="text" name="name" />''')
print('''item size*: <input type="text" name="itemsize" size="5" /> size unit*: <select name="size_unit">''')
Expand Down
25 changes: 14 additions & 11 deletions web/staff/op_tools/add_items_js.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
newrow += '<td rowspan="1" width="80"><div onClick="split('+item_id+')">split</div></td>';
newrow += '</tr>';
table = $('#' + price_id + '_table', window.parent.main.document);
table = $('#' + price_id + '_table', document);
if(table.length != 0){
table.append(newrow);
}
Expand All @@ -103,16 +103,18 @@
newpricerow += '</select></td>';
newpricerow += '<td colspan="13" class="td"> <table id="'+price_id+'_table" cellspacing=0 cellpadding=0></table></td></tr>';
$('#main', window.parent.main.document).append(newpricerow);
$('#'+price_id+'_table',window.parent.main.document).append(newrow);
$('#main', document).append(newpricerow);
$('#'+price_id+'_table',document).append(newrow);
}
$('.price',window.parent.main.document).keypress(parent.main.handlePriceChange);
$('.ditemid', window.parent.main.document).keypress(parent.main.handleDItemChange);
$('.casesize', window.parent.main.document).keypress(parent.main.handleCaseSizeChange);
$('.casecost', window.parent.main.document).keypress(parent.main.handleCaseCostChange);
$('.group', window.parent.main.document).keypress(parent.main.handleGroupChange);
$('.amt', window.parent.main.document).keypress(parent.main.handleAmtChange);
// $('.price',document).keypress(parent.main.handlePriceChange);
// $('.ditemid', document).keypress(parent.main.handleDItemChange);
// $('.casesize', document).keypress(parent.main.handleCaseSizeChange);
// $('.casecost', document).keypress(parent.main.handleCaseCostChange);
// $('.group', document).keypress(parent.main.handleGroupChange);
// $('.amt', document).keypress(parent.main.handleAmtChange);
// commented out bc idk what is happening -CR 10/29/21
$('#msg').text('Item ' + item_id + ' added.');
$('#name').val('');
$('#itemsize').val('');
Expand All @@ -125,7 +127,8 @@
$('#case_size').val('');
$('#price').val('');
parent.main.updateMargins(price_id);
// parent.main.updateMargins(price_id);
}
else{
alert(data);
Expand All @@ -138,7 +141,7 @@




print('''<div id="msg"></div>''')
print('''item name*: <input type="text" id="name" />''')
print('''item size*: <input type="text" id="itemsize" size="5" /> size unit*: <select id="size_unit">''')
for unit in db.get_units():
Expand Down

0 comments on commit 286abc6

Please sign in to comment.