Checkpoint commit on balancing tx
This commit is contained in:
@@ -35,6 +35,18 @@
|
||||
$('input:radio[name="TxOptions"]').prop('checked', false);
|
||||
$('div.radioOption').hide();
|
||||
<%= this.DialogTx.ClientID %>_open();
|
||||
|
||||
$('#spanTransactionUnbalancedBy').text('[...]');
|
||||
$('#<%=this.DropOpenPayouts.ClientID%>')
|
||||
|
||||
SwarmopsJS.ajaxCall(
|
||||
"/Pages/v5/Ledgers/BalanceTransactions.aspx/GetTransactionMatchability",
|
||||
{ transactionId: transactionId },
|
||||
function(data) {
|
||||
console.log(data);
|
||||
$('#spanTransactionUnbalancedBy').text(data.DifferingAmount);
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -72,7 +84,7 @@
|
||||
<th field="checkTx" checkbox="true"></th>
|
||||
<th data-options="field:'id',width:60,align:'right'"><asp:Label ID="LabelGridHeaderId" runat="server" Text="ID#"/></th>
|
||||
<th data-options="field:'dateTime',width:170,sortable:true"><asp:Label ID="LabelGridHeaderDateTime" runat="server" Text="XYZ DateTime" /></th>
|
||||
<th data-options="field:'accountName',width:170,align:'right'"><asp:Label ID="LabelGridHeaderAccountName" runat="server" Text="XYZ Debit" /></th>
|
||||
<th data-options="field:'accountName',width:170"><asp:Label ID="LabelGridHeaderAccountName" runat="server" Text="XYZ Debit" /></th>
|
||||
<th data-options="field:'description',width:210"><asp:Label ID="LabelGridHeaderDescription" runat="server" Text="XYZ Description" /></th>
|
||||
<th data-options="field:'delta',width:100,align:'right'"><asp:Label ID="LabelGridHeaderDelta" runat="server" Text="XYZ Delta" /></th>
|
||||
<th data-options="field:'action',width:43,align:'center'"><asp:Label ID="LabelGridHeaderAction" runat="server" Text="XYZAct" /></th>
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Services;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using Swarmops.Logic.Financial;
|
||||
using Swarmops.Logic.Security;
|
||||
|
||||
namespace Swarmops.Frontend.Pages.v5.Ledgers
|
||||
@@ -44,5 +46,39 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
|
||||
this.LabelRadioPayout.Text = Resources.Pages.Ledgers.BalanceTransactions_ModalDialog_RadioPayout;
|
||||
this.LiteralButtonPayout.Text = Resources.Pages.Ledgers.BalanceTransactions_ModalDialog_ButtonPayout;
|
||||
}
|
||||
|
||||
|
||||
public class TransactionMatchabilityData
|
||||
{
|
||||
public string DifferingAmount { get; set; }
|
||||
public string OpenPayoutDropDownJsonData { get; set; }
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public static TransactionMatchabilityData GetTransactionMatchability (int transactionId)
|
||||
{
|
||||
AuthenticationData authData = GetAuthenticationDataAndCulture();
|
||||
|
||||
if (
|
||||
!authData.CurrentUser.HasAccess (new Access (authData.CurrentOrganization,
|
||||
AccessAspect.BookkeepingDetails)))
|
||||
{
|
||||
throw new UnauthorizedAccessException();
|
||||
}
|
||||
|
||||
FinancialTransaction transaction = FinancialTransaction.FromIdentity (transactionId);
|
||||
if (transaction.OrganizationId != authData.CurrentOrganization.Identity)
|
||||
{
|
||||
throw new UnauthorizedAccessException();
|
||||
}
|
||||
|
||||
TransactionMatchabilityData result = new TransactionMatchabilityData();
|
||||
|
||||
result.DifferingAmount = String.Format ("{0} {1:+#,#.00;−#,#.00;0}",
|
||||
// this is a UNICODE MINUS (U+2212), not the hyphen on the keyboard
|
||||
authData.CurrentOrganization.Currency.DisplayCode, transaction.Rows.AmountCentsTotal/100.0);
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -34,7 +34,7 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
|
||||
|
||||
string row =
|
||||
String.Format (
|
||||
"\"id\":\"{0:N0}\",\"description\":\"{1}\",\"accountName\":\"{2}\",\"delta\":\"{3:+#,#.00;-#,#.00}\",\"dateTime\":\"{4:yyyy-MMM-dd HH:mm}\"",
|
||||
"\"id\":\"{0:N0}\",\"description\":\"{1}\",\"accountName\":\"{2}\",\"delta\":\"{3:+#,#.00;−#,#.00}\",\"dateTime\":\"{4:yyyy-MMM-dd HH:mm}\"",
|
||||
transaction.Identity, JsonSanitize (transaction.Description), JsonSanitize (accountName), txRows.AmountCentsTotal / 100.0, transaction.DateTime);
|
||||
|
||||
row +=
|
||||
|
||||
Reference in New Issue
Block a user