diff --git a/Intacct/BatchToJournal.ascx.cs b/Intacct/BatchToJournal.ascx.cs index 6fdc097..8bec8e7 100644 --- a/Intacct/BatchToJournal.ascx.cs +++ b/Intacct/BatchToJournal.ascx.cs @@ -75,6 +75,13 @@ namespace RockWeb.Plugins.rocks_kfs.Intacct Order = 3, Key = AttributeKey.LogResponse )] + [BooleanField( + "Log Request", + Description = "Flag indicating if the Intacct Request should be logged to the Exception Log", + DefaultBooleanValue = false, + Order = 4, + Key = AttributeKey.LogRequest )] + [LavaField( "Journal Memo Lava", Description = "Lava for the journal (or other receipt if configured) memo per line. Default: Batch.Id: Batch.Name", @@ -199,6 +206,7 @@ private static class AttributeKey public const string ExportMode = "ExportMode"; public const string UndepositedFundsAccount = "UndepositedFundsAccount"; public const string AccountGroupingMode = "AccountGroupingMode"; + public const string LogRequest = "LogRequest"; } #endregion Keys @@ -443,7 +451,8 @@ private List GetIntacctBankAccountIds() var postXml = checkingAccountList.GetBankAccountsXML( _intacctAuth, _financialBatch.Id, accountFields ); var endpoint = new IntacctEndpoint(); - var resultXml = endpoint.PostToIntacct( postXml ); + var logRequest = GetAttributeValue( AttributeKey.LogRequest ).AsBoolean(); + var resultXml = endpoint.PostToIntacct( postXml, logRequest ); return endpoint.ParseListCheckingAccountsResponse( resultXml, _financialBatch.Id ); } @@ -498,8 +507,9 @@ protected void btnExportToIntacct_Click( object sender, EventArgs e ) postXml = otherReceipt.CreateOtherReceiptXML( _intacctAuth, _financialBatch.Id, ref debugLava, ( PaymentMethod ) ddlPaymentMethods.SelectedValue.AsInteger(), groupingMode, bankAccountId, undepFundAccount, GetAttributeValue( AttributeKey.JournalMemoLava ) ); } - var resultXml = endpoint.PostToIntacct( postXml ); var logResponse = GetAttributeValue( AttributeKey.LogResponse ).AsBoolean(); + var logRequest = GetAttributeValue( AttributeKey.LogRequest ).AsBoolean(); + var resultXml = endpoint.PostToIntacct( postXml, logRequest ); var success = endpoint.ParseEndpointResponse( resultXml, _financialBatch.Id, logResponse ); if ( success ) diff --git a/Intacct/BatchesToJournal.ascx.cs b/Intacct/BatchesToJournal.ascx.cs index d3ec62c..82bdcfa 100644 --- a/Intacct/BatchesToJournal.ascx.cs +++ b/Intacct/BatchesToJournal.ascx.cs @@ -90,6 +90,13 @@ namespace RockWeb.Plugins.rocks_kfs.Intacct Order = 4, Key = AttributeKey.LogResponse )] + [BooleanField( + "Log Request", + Description = "Flag indicating if the Intacct Request should be logged to the Exception Log", + DefaultBooleanValue = false, + Order = 4, + Key = AttributeKey.LogRequest )] + [BooleanField( "Enable Debug", Description = "Outputs the object graph to help create your Lava syntax.", @@ -228,6 +235,7 @@ private static class AttributeKey public const string ExportMode = "ExportMode"; public const string UndepositedFundsAccount = "UndepositedFundsAccount"; public const string AccountGroupingMode = "AccountGroupingMode"; + public const string LogRequest = "LogRequest"; } #endregion Keys @@ -491,7 +499,8 @@ private List GetIntacctBankAccountIds() var postXml = checkingAccountList.GetBankAccountsXML( _intacctAuth, this.BlockId, accountFields ); var endpoint = new IntacctEndpoint(); - var resultXml = endpoint.PostToIntacct( postXml ); + var logRequest = GetAttributeValue( AttributeKey.LogRequest ).AsBoolean(); + var resultXml = endpoint.PostToIntacct( postXml, logRequest ); return endpoint.ParseListCheckingAccountsResponse( resultXml, this.BlockId ); } @@ -687,7 +696,8 @@ protected void btnExportToIntacct_Click( object sender, EventArgs e ) postXml = otherReceipt.CreateOtherReceiptXML( _intacctAuth, batch.Id, ref debugLava, ( PaymentMethod ) ddlPaymentMethods.SelectedValue.AsInteger(), groupingMode, bankAccountId, undepFundAccount, GetAttributeValue( AttributeKey.JournalMemoLava ) ); } - var resultXml = endpoint.PostToIntacct( postXml ); + var logRequest = GetAttributeValue( AttributeKey.LogRequest ).AsBoolean(); + var resultXml = endpoint.PostToIntacct( postXml, logRequest ); var logResponse = GetAttributeValue( AttributeKey.LogResponse ).AsBoolean(); var success = endpoint.ParseEndpointResponse( resultXml, batch.Id, logResponse );