json-object-editor 0.9.891 → 0.9.901
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/css/joe-styles.css +5 -1
- package/css/joe.css +5 -1
- package/package.json +1 -1
- package/server/schemas/ledger.js +52 -16
package/CHANGELOG.md
CHANGED
package/css/joe-styles.css
CHANGED
|
@@ -3375,7 +3375,7 @@ html.touch .small-size .joe-objectlist-table input[type=number]:focus{
|
|
|
3375
3375
|
cursor:pointer;
|
|
3376
3376
|
transition:.2s background-color;
|
|
3377
3377
|
padding:10px;
|
|
3378
|
-
line-height: 1em;
|
|
3378
|
+
line-height: 1.1em;
|
|
3379
3379
|
font-size:.8em;
|
|
3380
3380
|
}
|
|
3381
3381
|
html.no-touch .joe-objectlist-row.templated .row-template:hover{
|
|
@@ -3584,6 +3584,10 @@ joe-checkbox.checked joe-checkbox-percentage{
|
|
|
3584
3584
|
line-height: 18px;
|
|
3585
3585
|
}
|
|
3586
3586
|
|
|
3587
|
+
.joe-table.fixed {
|
|
3588
|
+
table-layout: fixed;
|
|
3589
|
+
}
|
|
3590
|
+
|
|
3587
3591
|
table.joe-table td,
|
|
3588
3592
|
table.joe-table th
|
|
3589
3593
|
{
|
package/css/joe.css
CHANGED
|
@@ -3861,7 +3861,7 @@ html.touch .small-size .joe-objectlist-table input[type=number]:focus{
|
|
|
3861
3861
|
cursor:pointer;
|
|
3862
3862
|
transition:.2s background-color;
|
|
3863
3863
|
padding:10px;
|
|
3864
|
-
line-height: 1em;
|
|
3864
|
+
line-height: 1.1em;
|
|
3865
3865
|
font-size:.8em;
|
|
3866
3866
|
}
|
|
3867
3867
|
html.no-touch .joe-objectlist-row.templated .row-template:hover{
|
|
@@ -4070,6 +4070,10 @@ joe-checkbox.checked joe-checkbox-percentage{
|
|
|
4070
4070
|
line-height: 18px;
|
|
4071
4071
|
}
|
|
4072
4072
|
|
|
4073
|
+
.joe-table.fixed {
|
|
4074
|
+
table-layout: fixed;
|
|
4075
|
+
}
|
|
4076
|
+
|
|
4073
4077
|
table.joe-table td,
|
|
4074
4078
|
table.joe-table th
|
|
4075
4079
|
{
|
package/package.json
CHANGED
package/server/schemas/ledger.js
CHANGED
|
@@ -181,15 +181,18 @@ var schema = {
|
|
|
181
181
|
var height = 32;
|
|
182
182
|
var balance = parseFloat(item.starting_balance);
|
|
183
183
|
var amount;
|
|
184
|
-
var html ='<table class="joe-table">'+
|
|
185
|
-
'<colgroup>'+
|
|
186
|
-
|
|
184
|
+
var html ='<table class="joe-table ledger-table fixed">'+
|
|
185
|
+
//'<colgroup>'+
|
|
186
|
+
//00ffbf
|
|
187
|
+
'<col span="1" style="width: 4px;">'+
|
|
188
|
+
'<col span="1" style="width: 50px;">'+
|
|
189
|
+
'<col span="1" >'+
|
|
187
190
|
//'<col span="1" style="width: 40px;">'+
|
|
188
|
-
'<col span="1" >\
|
|
189
|
-
<col span="1" >\
|
|
190
|
-
<col span="1" style="width:
|
|
191
|
-
|
|
192
|
-
</colgroup>'
|
|
191
|
+
'<col span="1" style="width:calc(100%-250px);">\
|
|
192
|
+
<col span="1" style="width:100px;">\
|
|
193
|
+
<col span="1" style="width:100px;">'
|
|
194
|
+
|
|
195
|
+
// +'</colgroup>'
|
|
193
196
|
+'<tr>'
|
|
194
197
|
//+'<th width=40></th><th width=40></th>'
|
|
195
198
|
+'<th colspan="4" align="left">Starting Balance</th><td style="width:75px;">'
|
|
@@ -275,6 +278,22 @@ var schema = {
|
|
|
275
278
|
transaction.tdate = tdate;
|
|
276
279
|
transactions.push($.extend({str_tdate:$c.format(new Date(tdate),'Y/m/d')},trans,pretrans,transaction));
|
|
277
280
|
|
|
281
|
+
}else if(tdate.isArray()){
|
|
282
|
+
tdate.map((ctd,i)=>{
|
|
283
|
+
let transaction = {};
|
|
284
|
+
//fix transations missing leading 0
|
|
285
|
+
if(ctd.indexOf('/') == 1){
|
|
286
|
+
ctd = '0'+ctd;
|
|
287
|
+
}
|
|
288
|
+
var pretrans = transactionPassthrough(trans,ctd);
|
|
289
|
+
transaction.amount = (trans.transaction_type == 'credit') ? pretrans.amount : -pretrans.amount;
|
|
290
|
+
// if(pretrans.status == 'paid' || pretrans.status == "autopay"){
|
|
291
|
+
// pending += transaction.amount;
|
|
292
|
+
// }
|
|
293
|
+
transaction.tdate = ctd;
|
|
294
|
+
transactions.push($.extend({str_tdate:$c.format(new Date(ctd),'Y/m/d')},trans,pretrans,transaction));
|
|
295
|
+
})
|
|
296
|
+
|
|
278
297
|
}
|
|
279
298
|
}
|
|
280
299
|
|
|
@@ -375,7 +394,7 @@ var schema = {
|
|
|
375
394
|
|
|
376
395
|
|
|
377
396
|
budget_html += '<tr data-budgetid="'+bud._id+'" class="row-divider">'
|
|
378
|
-
+ '<td colspan="
|
|
397
|
+
+ '<td colspan="5">'+bud.name+remaining_str+'</td>'
|
|
379
398
|
//+ '<td>$' + budget_amount + '</td>'
|
|
380
399
|
+'<td>' + budget_amount + '</td>'
|
|
381
400
|
+'<td align="right" class="left-border" style="font-weight:500;">' +('$'+balance).replace('$-','-$') + '</td>'
|
|
@@ -383,20 +402,23 @@ var schema = {
|
|
|
383
402
|
budget_html+= subhtml;
|
|
384
403
|
});
|
|
385
404
|
//_bmResponse(bm,'budget loop')
|
|
386
|
-
budget_html = '<tr><th colspan="
|
|
387
|
-
+'<th colspan="2" align="right">'+('$'+bst).replace('$-','-$')
|
|
405
|
+
budget_html = '<tr class="budget-header"><th colspan="4" align="left">Budgeted Spending <br/><small>total</small></th>'
|
|
406
|
+
+'<th colspan="2" align="right">'+('$'+bst).replace('$-','-$')
|
|
407
|
+
+'</th>'
|
|
408
|
+
//+'<td></td>'
|
|
409
|
+
+'</tr>'+budget_html;
|
|
388
410
|
|
|
389
411
|
//var ending = _joe.getField('transactions').getEndingTotals();
|
|
390
412
|
var ending = _joe.schemas.ledger.methods.getEndingTotals(ledger);
|
|
391
413
|
ledger.ending_balance = balance;
|
|
392
414
|
var remaining_withdrawals = _joe.Utils.toDollars(ending.pending+ending.unspent);
|
|
393
415
|
html+=budget_html+
|
|
394
|
-
'<tr><th colspan="
|
|
395
|
-
+'<tr><td colspan="
|
|
416
|
+
'<tr class="end-bal-header"><th colspan="6" align="left">Ending Balance</th><td align="right"><b>$'+balance+'</b></td></tr>'
|
|
417
|
+
+'<tr><td colspan="4"></td><th colspan="2" align="left">Unspent</th><td id="unspent">$'
|
|
396
418
|
+_joe.Utils.toDollars(ending.unspent)+'</td></tr>'
|
|
397
|
-
+'<tr><td colspan="
|
|
419
|
+
+'<tr><td colspan="4"></td><th colspan="2" align="left">Pending</th><td id="pending">$'
|
|
398
420
|
+_joe.Utils.toDollars(ending.pending)+'</td></tr>'
|
|
399
|
-
+'<tr><td colspan="
|
|
421
|
+
+'<tr><td colspan="4"></td><th colspan="2" align="left">Remaining Withdrawals</th><td id="total_spending">$'+remaining_withdrawals+'</td></tr>'
|
|
400
422
|
|
|
401
423
|
// +'<tr><td colspan="3"></td><th colspan="2" align="left">Total</th><td id="total_spending">$'+ending.total+'</td></tr>'
|
|
402
424
|
+'</tbody></table>';
|
|
@@ -577,6 +599,7 @@ var schema = {
|
|
|
577
599
|
}
|
|
578
600
|
case 'biweekly':
|
|
579
601
|
var next ='';
|
|
602
|
+
var timesInRange = [];
|
|
580
603
|
var tdate = new Date(t.transaction_date);
|
|
581
604
|
if(tdate >= startDate && tdate <= endDate){
|
|
582
605
|
return (tdate.getMonth()+1)+'/'+("0" + tdate.getDate()).slice(-2)+'/'+tdate.getFullYear();
|
|
@@ -585,10 +608,16 @@ var schema = {
|
|
|
585
608
|
|
|
586
609
|
while(tdate <= endDate) {
|
|
587
610
|
tdate.setHours(24 * 14);
|
|
611
|
+
// if(tdate >= startDate && tdate <= endDate){
|
|
612
|
+
// return (tdate.getMonth()+1)+'/'+("0" + tdate.getDate()).slice(-2)+'/'+tdate.getFullYear();
|
|
613
|
+
// }
|
|
588
614
|
if(tdate >= startDate && tdate <= endDate){
|
|
589
|
-
|
|
615
|
+
timesInRange.push( (tdate.getMonth()+1)+'/'+("0" + tdate.getDate()).slice(-2)+'/'+tdate.getFullYear());
|
|
590
616
|
}
|
|
591
617
|
}
|
|
618
|
+
if(timesInRange.length > 0){
|
|
619
|
+
return timesInRange;
|
|
620
|
+
}
|
|
592
621
|
return true;
|
|
593
622
|
}
|
|
594
623
|
case 'monthly':
|
|
@@ -646,6 +675,12 @@ var schema = {
|
|
|
646
675
|
var id = (t._id.contains('_'))?(t._id).substr(0,t._id.indexOf('_')):t._id;
|
|
647
676
|
var specs = specs || {};
|
|
648
677
|
var bgcolor = (index%2==0)?'#f4f4f4':'transparent';
|
|
678
|
+
var stripeColor = 'transparent';
|
|
679
|
+
if(t.paycheck){
|
|
680
|
+
stripeColor = "#00ffbf";
|
|
681
|
+
}else{
|
|
682
|
+
stripeColor = (t.transaction_type =="credit")?'#00cc0044':'#cc000044';
|
|
683
|
+
}
|
|
649
684
|
var action = '_joe.getField(\'transactions\').setStatus(\''+t._id+'\')';
|
|
650
685
|
var trans_action = 'goJoe(_joe.search(\''+id+'\')[0],{schema:\'transaction\'})';
|
|
651
686
|
var input_action='_joe.getField(\'transactions\').updateAmount(this.value,\''+t._id+'\')';
|
|
@@ -667,6 +702,7 @@ var schema = {
|
|
|
667
702
|
|
|
668
703
|
var html =
|
|
669
704
|
'<tr data-transid="'+t._id+'" class="'+(specs.trcss||'')+'" style="background-color:'+(t.color||'')+';">'
|
|
705
|
+
+`<td class="trans-stripe" style="background-color:${stripeColor};"></td>`
|
|
670
706
|
+'<td onclick="'+trans_action+'" class="joe-table-button joe-view-button" title="view"> </td>'
|
|
671
707
|
//+((t.paycheck)?'': '<td onclick="'+action+'" class="joe-table-button joe-submit-button" title="status"> </td>')
|
|
672
708
|
+tname
|