|
Lines 183-200
Link Here
|
| 183 |
[% INCLUDE 'datatables.inc' %] |
183 |
[% INCLUDE 'datatables.inc' %] |
| 184 |
[% Asset.js("lib/jquery/plugins/jquery.jeditable.mini.js") | $raw %] |
184 |
[% Asset.js("lib/jquery/plugins/jquery.jeditable.mini.js") | $raw %] |
| 185 |
<script> |
185 |
<script> |
| 186 |
function fnClickAddRow( table, invoiceCode, invoiceTitle, invoicePrice ) { |
|
|
| 187 |
table.fnAddData( [ |
| 188 |
invoiceTitle, |
| 189 |
invoicePrice, |
| 190 |
1, |
| 191 |
null, |
| 192 |
'<button class="drop"><i class="fa fa-trash"></i> Remove</button>', |
| 193 |
invoiceCode |
| 194 |
] |
| 195 |
); |
| 196 |
} |
| 197 |
|
| 198 |
function moneyFormat(textObj) { |
186 |
function moneyFormat(textObj) { |
| 199 |
var newValue = textObj.value; |
187 |
var newValue = textObj.value; |
| 200 |
var decAmount = ""; |
188 |
var decAmount = ""; |
|
Lines 244-249
Link Here
|
| 244 |
textObj.value = dolAmount + "." + decAmount; |
232 |
textObj.value = dolAmount + "." + decAmount; |
| 245 |
} |
233 |
} |
| 246 |
|
234 |
|
|
|
235 |
function fnClickAddRow( table, invoiceCode, invoiceTitle, invoicePrice ) { |
| 236 |
var defaultPrice = { value: invoicePrice }; |
| 237 |
moneyFormat(defaultPrice); |
| 238 |
table.fnAddData( [ |
| 239 |
invoiceTitle, |
| 240 |
defaultPrice.value, |
| 241 |
1, |
| 242 |
null, |
| 243 |
'<button class="drop"><i class="fa fa-trash"></i> Remove</button>', |
| 244 |
invoiceCode |
| 245 |
] |
| 246 |
); |
| 247 |
} |
| 248 |
|
| 247 |
function updateChangeValues() { |
249 |
function updateChangeValues() { |
| 248 |
var change = $('#change')[0]; |
250 |
var change = $('#change')[0]; |
| 249 |
change.innerHTML = Math.round(($('#collected')[0].value - $('#paid')[0].value) * 100) / 100; |
251 |
change.innerHTML = Math.round(($('#collected')[0].value - $('#paid')[0].value) * 100) / 100; |
| 250 |
- |
|
|