Finished Inspect Ledgers for Red

This commit is contained in:
Rick Falkvinge
2014-10-25 15:03:36 +02:00
parent 3504043a81
commit b96bf0a011
3 changed files with 34 additions and 3 deletions
+24 -1
View File
@@ -35,6 +35,15 @@
// Footer cells could not be merged in datagrid :(
}
// Enable various actions on icon
$('img.LocalIconFlag').click(function () {
onFlagTransaction("Add Tx Id here");
});
$('img.LocalIconInspect').click(function () {
onInspectTransaction("Add Tx Id here");
});
}
});
@@ -69,6 +78,15 @@
$('#gridOutstandingAccounts').datagrid('reload');
}
function onInspectTransaction(transactionId) {
alertify.log ('<asp:Label ID="LabelInspectNotAvailable" runat="server" />');
}
function onFlagTransaction(transactionId) {
alertify.log('<asp:Label ID="LabelFlagNotAvailable" runat="server" />');
}
</script>
@@ -80,6 +98,11 @@
font-weight: 500;
}
.LocalIconInspect, .LocalIconFlag {
cursor:pointer;
position: relative;
top: 4px;
}
</style>
</asp:Content>
@@ -94,7 +117,7 @@
idField="id">
<thead>
<tr>
<th data-options="field:'id',width:50"><asp:Label ID="LabelGridHeaderId" runat="server" Text="ID#"/></th>
<th data-options="field:'id',width:50,align:'right'"><asp:Label ID="LabelGridHeaderId" runat="server" Text="ID#"/></th>
<th data-options="field:'datetime',width:90,sortable:true"><asp:Label ID="LabelGridHeaderDateTime" runat="server" Text="XYZ DateTime" /></th>
<th data-options="field:'description',width:270"><asp:Label ID="LabelGridHeaderDescription" runat="server" Text="XYZ Description" /></th>
<th data-options="field:'deltaPos',width:70,align:'right'"><asp:Label ID="LabelGridHeaderDeltaPositive" runat="server" Text="XYZ Debit" /></th>
@@ -66,6 +66,9 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
this.LabelGridHeaderDeltaPositive.Text = Resources.Global.Ledgers_Debit;
this.LabelGridHeaderDescription.Text = Resources.Global.Global_Description;
this.LabelGridHeaderId.Text = Resources.Pages.Ledgers.InspectLedgers_TransactionId;
this.LabelFlagNotAvailable.Text = Resources.Pages.Ledgers.InspectLedgers_FlaggingNotAvailable;
this.LabelInspectNotAvailable.Text = Resources.Pages.Ledgers.InspectLedgers_InspectNotAvailable;
}
}
}
@@ -156,15 +156,20 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
runningBalance += row.AmountCents;
string actionHtml = String.Format(
"<img src=\"/Images/Icons/iconshock-magnifyingglass-16px.png\" class=\"LocalIconInspect\" baseid=\"\" />&nbsp;<img src=\"/Images/Icons/iconshock-flag-white-16px.png\" class=\"LocalIconFlag\" baseid=\"{0}\" />",
row.FinancialTransactionId.ToString(CultureInfo.InvariantCulture));
result.Append("{" + String.Format(
"\"id\":\"{0}\",\"datetime\":\"{1:MMM-dd HH:mm}\",\"description\":\"{2}\"," +
"\"deltaPos\":\"{3}\",\"deltaNeg\":\"{4}\",\"balance\":\"{5:N0}\"",
"\"deltaPos\":\"{3}\",\"deltaNeg\":\"{4}\",\"balance\":\"{5:N0}\",\"action\":\"{6}\"",
row.FinancialTransactionId,
row.TransactionDateTime,
JsonSanitize(row.Description),
debitString,
creditString,
runningBalance / 100.0) + "},");
runningBalance / 100.0,
JsonSanitize(actionHtml)) + "},");
}
if (rows.Count == 0)