This commit is contained in:
Rick Falkvinge
2018-12-31 14:28:13 +01:00
parent e2720b667c
commit 8e1bbb9f48
5 changed files with 30 additions and 9 deletions
+6 -1
View File
@@ -77,6 +77,11 @@ namespace Swarmops.Common.Enums
/// <summary>
/// Nor this
/// </summary>
Salary
Salary,
/// <summary>
/// Documentation related to a financial account, usually an external one
/// </summary>
FinancialAccountDocument
}
}
+4
View File
@@ -249,6 +249,10 @@ namespace Swarmops.Logic.Support
{
return DocumentType.Salary;
}
else if (foreignObject is FinancialAccountDocument)
{
return DocumentType.FinancialAccountDocument;
}
else
{
throw new ArgumentException ("Unrecognized foreign object type:" + foreignObject.GetType().ToString());
+13 -7
View File
@@ -277,15 +277,21 @@
}
var itemType = activeUpload.substring(0, activeUpload.indexOf('-'));
console.log(itemType);
console.log("Upload" + itemType);
/*
// Note that the function to call is selected dynamically!
SwarmopsJS.ajaxCall(
"EndOfMonth.aspx/Upload" + ,
{guid: uploadGuid, itemId: activeUpload},
)
// TODO: AJAX CALL TO STORE UPLOAD*/
"EndOfMonth.aspx/Upload" + itemType,
{ guid: uploadGuid, itemId: activeUpload },
function(result) {
if (result.Success) {
} else {
// Todo: add more error handling later, maybe
clientFailedUpload();
}
});
markItemCompleted(activeUpload);
+6
View File
@@ -277,6 +277,7 @@ namespace Swarmops.Frontend.Pages.Ledgers
string[] parts = itemId.Split('-');
FinancialAccount account = FinancialAccount.FromIdentity(Int32.Parse(parts[1]));
int yearMonth = Int32.Parse(parts[2]);
DateTime statementStart = new DateTime(yearMonth/100, yearMonth%100, 1);
if (account.OrganizationId != authData.CurrentOrganization.Identity)
{
@@ -285,6 +286,11 @@ namespace Swarmops.Frontend.Pages.Ledgers
Documents documents = Documents.RecentFromDescription(guid);
FinancialAccountDocument accountDoc = FinancialAccountDocument.Create(account, FinancialAccountDocumentType.BankStatement, authData.CurrentUser,
statementStart, statementStart.AddMonths(1), string.Empty);
documents.SetForeignObjectForAll(accountDoc);
return new AjaxCallResult {Success = true};
}
+1 -1
View File
@@ -5311,7 +5311,7 @@
</Content>
</ItemGroup>
<ItemGroup>
<Folder Include="Frames\" />
<Folder Include="Frames\v5\" />
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>