Lines 94-99
Link Here
|
94 |
<li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" value="[% barcode | html %]" /></li> |
94 |
<li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" value="[% barcode | html %]" /></li> |
95 |
<li><label for="desc">Description: </label><input type="text" name="desc" id="desc" size="50" value="[% desc | html %]" /></li> |
95 |
<li><label for="desc">Description: </label><input type="text" name="desc" id="desc" size="50" value="[% desc | html %]" /></li> |
96 |
<li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" value="[% note | html %]" /></li> |
96 |
<li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" value="[% note | html %]" /></li> |
|
|
97 |
<li class="additional_field"><label for="cost">Cost: </label><input type="text" inputmode="decimal" pattern="^\d+(\.\d{2})?$" name="cost" id="cost" min="0" value="[% amount | $Price on_editing => 1 %]" /></li> |
98 |
<li class="additional_field"><label for="quantity">Quantity: </label><input type="text" name="quantity" id="quantity" value="1" /></li> |
97 |
<li><label for="amount">Amount: </label><input type="text" inputmode="decimal" pattern="^\d+(\.\d{2})?$" name="amount" id="amount" required="required" min="0" value="[% amount | $Price on_editing => 1 %]" /> Example: 5.00</li> |
99 |
<li><label for="amount">Amount: </label><input type="text" inputmode="decimal" pattern="^\d+(\.\d{2})?$" name="amount" id="amount" required="required" min="0" value="[% amount | $Price on_editing => 1 %]" /> Example: 5.00</li> |
98 |
</ol> |
100 |
</ol> |
99 |
</fieldset> |
101 |
</fieldset> |
Lines 141-151
Link Here
|
141 |
[% UNLESS amount.defined %] |
143 |
[% UNLESS amount.defined %] |
142 |
$("#maninvoice #desc").val($("#maninvoice #type option:selected").text()); |
144 |
$("#maninvoice #desc").val($("#maninvoice #type option:selected").text()); |
143 |
$("#maninvoice #amount").val(type_fees[$("#maninvoice #type option:selected").val()]); |
145 |
$("#maninvoice #amount").val(type_fees[$("#maninvoice #type option:selected").val()]); |
|
|
146 |
$("#maninvoice #cost").val(type_fees[$("#maninvoice #type option:selected").val()]); |
147 |
if(!type_fees[$("#maninvoice #type option:selected").val()]){ |
148 |
$("#maninvoice li.additional_field").hide(); |
149 |
} |
144 |
[% END %] |
150 |
[% END %] |
145 |
$("#maninvoice #type").change(function(){ |
151 |
$("#maninvoice #type").change(function(){ |
146 |
$("#maninvoice #desc").val($(this).find("option:selected").text()); |
152 |
$("#maninvoice #desc").val($(this).find("option:selected").text()); |
147 |
$("#maninvoice #amount").val(type_fees[$(this).val()]); |
153 |
$("#maninvoice #amount").val(type_fees[$(this).val()]); |
|
|
154 |
$("#maninvoice #cost").val(type_fees[$(this).val()]); |
155 |
$("#maninvoice #quantity").val('1'); |
156 |
if(type_fees[$(this).val()]){ |
157 |
$("#maninvoice li.additional_field").show(); |
158 |
} |
159 |
else{ |
160 |
$("#maninvoice li.additional_field").hide(); |
161 |
} |
148 |
}); |
162 |
}); |
|
|
163 |
$("#maninvoice #quantity").blur(function(){ |
164 |
$("#maninvoice #amount").val(($("#maninvoice #cost").val() * $(this).val()).toFixed(2)); |
165 |
}) |
166 |
$("#maninvoice #cost").blur(function(){ |
167 |
$("#maninvoice #amount").val(($("#maninvoice #quantity").val() * $(this).val()).toFixed(2)); |
168 |
}) |
149 |
}); |
169 |
}); |
150 |
</script> |
170 |
</script> |
151 |
[% END %] |
171 |
[% END %] |
152 |
- |
|
|