Completed Bank File Upload up until processing
This commit is contained in:
@@ -292,9 +292,8 @@ namespace Activizr.Database
|
||||
return GetFinancialAccountRows(new int[] {financialAccountId}, startDateTime, endDateTime);
|
||||
}
|
||||
|
||||
|
||||
public BasicFinancialAccountRow[] GetFinancialAccountRows (int[] financialAccountIds, DateTime startDateTime,
|
||||
DateTime endDateTime)
|
||||
public BasicFinancialAccountRow[] GetFinancialAccountRows(int[] financialAccountIds, DateTime startDateTime,
|
||||
DateTime endDateTime)
|
||||
{
|
||||
var result = new List<BasicFinancialAccountRow>();
|
||||
|
||||
@@ -323,6 +322,38 @@ namespace Activizr.Database
|
||||
}
|
||||
|
||||
|
||||
public BasicFinancialAccountRow[] GetLastFinancialAccountRows (int financialAccountId, int rowCount)
|
||||
{
|
||||
return GetLastFinancialAccountRows(new int[] {financialAccountId}, rowCount);
|
||||
}
|
||||
|
||||
public BasicFinancialAccountRow[] GetLastFinancialAccountRows (int[] financialAccountIds, int rowCount)
|
||||
{
|
||||
var result = new List<BasicFinancialAccountRow>();
|
||||
|
||||
using (DbConnection connection = GetMySqlDbConnection())
|
||||
{
|
||||
connection.Open();
|
||||
|
||||
DbCommand command =
|
||||
GetDbCommand(
|
||||
"select FinancialTransactionRows.FinancialAccountId,FinancialTransactionRows.FinancialTransactionId,FinancialTransactions.DateTime,FinancialTransactions.Comment,FinancialTransactionRows.AmountCents,FinancialTransactionRows.CreatedDateTime,FinancialTransactionRows.CreatedByPersonId FROM FinancialTransactions,FinancialTransactionRows WHERE FinancialTransactionRows.Deleted=0 AND FinancialTransactions.FinancialTransactionId=FinancialTransactionRows.FinancialTransactionId AND FinancialTransactionRows.FinancialAccountId IN (" +
|
||||
JoinIds(financialAccountIds) + ") ORDER BY DateTime DESC,FinancialTransactions.FinancialTransactionId,FinancialTransactionRows.CreatedDateTime LIMIT " + rowCount.ToString() + ";",
|
||||
connection);
|
||||
|
||||
using (DbDataReader reader = command.ExecuteReader())
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
result.Add(ReadFinancialAccountRowFromDataReader(reader));
|
||||
}
|
||||
|
||||
return result.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public BasicFinancialTransactionRow[] GetFinancialTransactionRows(int financialTransactionId)
|
||||
{
|
||||
var result = new List<BasicFinancialTransactionRow>();
|
||||
|
||||
@@ -41,6 +41,12 @@ namespace Activizr.Logic.Financial
|
||||
return PirateDb.GetDatabase().GetFinancialAccountBalanceDeltaCents(Identity, start, end);
|
||||
}
|
||||
|
||||
public FinancialAccountRows GetLastRows(int rowCount)
|
||||
{
|
||||
BasicFinancialAccountRow[] basicRows = PirateDb.GetDatabase().GetLastFinancialAccountRows(Identity, rowCount);
|
||||
return FinancialAccountRows.FromArray(basicRows);
|
||||
}
|
||||
|
||||
public FinancialAccountRows GetRows(DateTime start, DateTime end)
|
||||
{
|
||||
BasicFinancialAccountRow[] basicRows = PirateDb.GetDatabase().GetFinancialAccountRows(Identity, start, end);
|
||||
|
||||
@@ -1023,7 +1023,7 @@ namespace Activizr.Logic.Pirates
|
||||
|
||||
// For now, return true if Anna, Janne, or Rick. Bad hack, bad, really bad.
|
||||
|
||||
if (this.Identity == 2)
|
||||
if (this.Identity == 1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -157,6 +157,18 @@
|
||||
<value>Go there...</value>
|
||||
<comment>Link after describing something.</comment>
|
||||
</data>
|
||||
<data name="Global_UploadFile" xml:space="preserve">
|
||||
<value>Upload File</value>
|
||||
<comment>Displayed on "Submit" button next to file upload controls.</comment>
|
||||
</data>
|
||||
<data name="Global_UploadFileToActivizr" xml:space="preserve">
|
||||
<value>Upload File To Activizr</value>
|
||||
<comment>Used as header above upload sections.</comment>
|
||||
</data>
|
||||
<data name="Global_Upload_ErrorSelectFile" xml:space="preserve">
|
||||
<value>Please select a file to upload.</value>
|
||||
<comment>Error message. Displayed when the used has clicked "Upload" without selecting a file to upload.</comment>
|
||||
</data>
|
||||
<data name="Sidebar_Actions" xml:space="preserve">
|
||||
<value>Actions</value>
|
||||
<comment>List of shortcuts to likely actions</comment>
|
||||
|
||||
@@ -117,14 +117,19 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="UploadBankFiles_DownloadAtLeastSince" xml:space="preserve">
|
||||
<value>You should include all records from at least <strong>{0:yyyy-MMM-dd}.</strong></value>
|
||||
<data name="UploadBankFiles_DownloadDataSince" xml:space="preserve">
|
||||
<value></p><p>(The most recent data in Activizr is from {0:yyyy-MMM-dd}. You should download bank data from at least <strong>{1:yyyy-MMM-dd}.</strong>)</value>
|
||||
<comment>Displayed to help user determine scope of bank download</comment>
|
||||
</data>
|
||||
<data name="UploadBankFiles_DownloadDataSince_Paypal" xml:space="preserve">
|
||||
<value></p><p>(Paypal will tell you the time of the last transaction download. Download all transactions from that point in time, adding some three days of overlap.)</value>
|
||||
<comment>Displayed instead of date of last transaction in the case of Paypal.</comment>
|
||||
</data>
|
||||
<data name="UploadBankFiles_DownloadInstructions" xml:space="preserve">
|
||||
<value>Bank Download Instructions</value>
|
||||
<comment>Header above instructions for generation of the bank file type selected.</comment>
|
||||
</data>
|
||||
<data name="UploadBankFiles_DownloadInstructionsSebAccountFile" xml:space="preserve">
|
||||
<data name="UploadBankFiles_DownloadInstructions_SebAccountFile" xml:space="preserve">
|
||||
<value>Open SEB's internet bank. Go to <strong>your account</strong>, and enter the date span you wish to download in the search box. Press <strong>filter</strong>. After that, click the link to <strong>save the account history</strong>. A popup will appear. Choose <strong>csv</strong> and <strong>tab separated</strong>, then <strong>save</strong>. The downloaded file will be named <em>kontohandelser.csv</em>.</value>
|
||||
<comment>Only translate to languages where SEB is active.</comment>
|
||||
</data>
|
||||
@@ -140,8 +145,15 @@
|
||||
<value>Select Bookkeeping Account</value>
|
||||
<comment>Select prompt for the financial account in the organization's bookkeeping.</comment>
|
||||
</data>
|
||||
<data name="UploadBankFiles_SelectBankAndAccount" xml:space="preserve">
|
||||
<value>Select File Type And Account For Upload</value>
|
||||
</data>
|
||||
<data name="UploadBankFiles_SelectBankFileType" xml:space="preserve">
|
||||
<value>Select Bank File Type For Upload</value>
|
||||
<value>Select Bank File Type</value>
|
||||
<comment>Header above several bank logos, prompting a selection of bank.</comment>
|
||||
</data>
|
||||
<data name="UploadBankFiles_UploadBankFile" xml:space="preserve">
|
||||
<value>Upload Bank File</value>
|
||||
<comment>Displayed as header above download instructions / upload form</comment>
|
||||
</data>
|
||||
</root>
|
||||
@@ -127,6 +127,6 @@
|
||||
<value>Access Denied</value>
|
||||
</data>
|
||||
<data name="AccessDenied_Rant" xml:space="preserve">
|
||||
<value><p>The Activizr security framework has denied you access to the page you were trying to go to. This usually means that its functions were above the access levels granted to you for the currently selected organization ({0}). This has not been logged nor reported anywhere.</p><p>There are several reasons why this may have happened:</p></value>
|
||||
<value><p>The Activizr security framework has denied you access to the page you were trying to go to. This usually means that its functions were above the access levels granted to you for the currently selected organization (<em>{0}</em>). This has not been logged nor reported anywhere.</p><p>There are several reasons why this may have happened:</p></value>
|
||||
</data>
|
||||
</root>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 16 KiB |
@@ -116,8 +116,8 @@ div.BankUploadInstructionsImage
|
||||
|
||||
<asp:UpdatePanel ID="PanelFileTypeAccount" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<h2><asp:Label ID="LabelSelectBankUploadFilter" Text="Select Bank And Bookkeeping LOC" runat="server"/></h2>
|
||||
<h3><asp:Label ID="LabelBank" Text="Bank LOC" runat="server" /></h3>
|
||||
<h2><asp:Label ID="LabelSelectBankAndAccount" Text="Select Bank And Bookkeeping LOC" runat="server"/></h2>
|
||||
<h3><asp:Label ID="LabelSelectFileType" Text="Bank LOC" runat="server" /></h3>
|
||||
<asp:ImageButton OnClick="ButtonSebAccountFile_Click" CssClass="FileTypeImage" ID="ButtonSebAccountFile" runat="server" ImageUrl="~/Images/Ledgers/uploadbankfiles-type-seb-kontoutdrag.png"/>
|
||||
<asp:ImageButton CssClass="FileTypeImage" ID="ButtonSebPaymentFile" runat="server" ImageUrl="~/Images/Ledgers/uploadbankfiles-type-seb-bankgirofil.png"/>
|
||||
<asp:HiddenField ID="HiddenFileType" runat="server"/>
|
||||
@@ -153,6 +153,7 @@ div.BankUploadInstructionsImage
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:AsyncPostBackTrigger ControlID="ButtonSebAccountFile" EventName="Click" />
|
||||
<asp:AsyncPostbackTrigger ControlID="DropAccounts" EventName="SelectedIndexChanged" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
@@ -31,7 +31,12 @@ namespace Activizr.Site.Pages.Ledgers
|
||||
this.LabelUploadBankFilesInfo.Text = Resources.Pages.Ledgers.UploadBankFiles_Info;
|
||||
this.LabelActionItemsHere.Text = Resources.Pages.Global.Sidebar_Todo_Placeholder;
|
||||
|
||||
this.LabelSelectBankUploadFilter.Text = Resources.Pages.Ledgers.UploadBankFiles_SelectBankFileType;
|
||||
this.LabelSelectBankAndAccount.Text = Resources.Pages.Ledgers.UploadBankFiles_SelectBankAndAccount;
|
||||
this.LabelSelectFileType.Text = Resources.Pages.Ledgers.UploadBankFiles_SelectBankFileType;
|
||||
this.LabelSelectAccount.Text = Resources.Pages.Ledgers.UploadBankFiles_SelectAccount;
|
||||
this.LabelUploadH2Header.Text = Resources.Pages.Ledgers.UploadBankFiles_UploadBankFile;
|
||||
this.LabelUploadH3Header.Text = Resources.Pages.Global.Global_UploadFileToActivizr;
|
||||
this.Upload.Text = Resources.Pages.Global.Global_UploadFile;
|
||||
|
||||
if (!IsPostBack)
|
||||
{
|
||||
@@ -68,7 +73,7 @@ namespace Activizr.Site.Pages.Ledgers
|
||||
|
||||
this.LiteralDownloadInstructions.Text =
|
||||
this.LiteralDownloadInstructionsModal.Text =
|
||||
Resources.Pages.Ledgers.UploadBankFiles_DownloadInstructionsSebAccountFile;
|
||||
Resources.Pages.Ledgers.UploadBankFiles_DownloadInstructions_SebAccountFile;
|
||||
|
||||
}
|
||||
|
||||
@@ -91,7 +96,7 @@ namespace Activizr.Site.Pages.Ledgers
|
||||
{
|
||||
this.LiteralSelectAccountDivStyle.Text = @"style=""opacity:1;display:inline""";
|
||||
|
||||
if (this.DropAccounts.SelectedIndex > -2)
|
||||
if (this.DropAccounts.SelectedIndex > 0)
|
||||
{
|
||||
ScriptManager.RegisterClientScriptBlock(this.PanelFileTypeAccount, this.PanelFileTypeAccount.GetType(), "FadeDownload2",
|
||||
"$(\"#DivInstructions\").fadeTo('slow',1.0);", true);
|
||||
@@ -101,8 +106,17 @@ namespace Activizr.Site.Pages.Ledgers
|
||||
"$(function () { $(\"a[rel*=leanModal]\").leanModal();});", true);
|
||||
|
||||
|
||||
|
||||
FinancialAccount account = FinancialAccount.FromIdentity(Int32.Parse(this.DropAccounts.SelectedValue));
|
||||
|
||||
FinancialAccountRows rows = account.GetLastRows(1);
|
||||
DateTime lastTransactionDateTime = new DateTime(1801, 1, 1);
|
||||
|
||||
if (rows != null && rows.Count > 0)
|
||||
{
|
||||
lastTransactionDateTime = rows[0].RowDateTime;
|
||||
}
|
||||
|
||||
this.LiteralLastAccountRecord.Text = String.Format(Resources.Pages.Ledgers.UploadBankFiles_DownloadDataSince, lastTransactionDateTime, lastTransactionDateTime.AddDays(-5));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,6 +129,7 @@ namespace Activizr.Site.Pages.Ledgers
|
||||
UploadedFile file = UploadedFile.FromHttpPostedFile(Request.Files[fileInputID]);
|
||||
if (file.ContentLength > 0)
|
||||
{
|
||||
|
||||
// TODO: PROCESS
|
||||
// file.SaveAs("c:\\temp\\" + file.GetName());
|
||||
RadProgressContext progress = RadProgressContext.Current;
|
||||
@@ -155,13 +170,13 @@ namespace Activizr.Site.Pages.Ledgers
|
||||
{
|
||||
// If no file was uploaded, re-show the instructions div
|
||||
|
||||
this.LabelNoFileUploaded.Text = "Please upload a file LOC";
|
||||
this.LiteralDivInstructionsStyle.Text = "style='display:inline'";
|
||||
this.LabelNoFileUploaded.Text = Resources.Pages.Global.Global_Upload_ErrorSelectFile;
|
||||
this.LiteralDivInstructionsStyle.Text = @"style='display:inline'";
|
||||
}
|
||||
else
|
||||
{
|
||||
this.LabelNoFileUploaded.Text = string.Empty;
|
||||
this.LiteralDivInstructionsStyle.Text = "style='display:none'";
|
||||
this.LiteralDivInstructionsStyle.Text = @"style='display:none'";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user