Work on end-of-month

This commit is contained in:
Rick Falkvinge
2018-12-03 14:02:12 +01:00
parent 5e74f792fb
commit c387290bc4
10 changed files with 96 additions and 18 deletions
+5
View File
@@ -264,6 +264,11 @@ namespace Swarmops.Common.Enums
/// </summary>
OrgVanityDomain,
/// <summary>
/// Organization's maintenance donation level, in parts-per-million; typically 1000 or 100
/// </summary>
OrgMaintenanceDonationLevel,
/// <summary>
/// Free-text description of an inbound invoice (what's it for?)
/// </summary>
@@ -167,6 +167,11 @@
/// </summary>
CostsLocalDonationTransfers,
/// <summary>
/// Voluntary donations toward maintenance of this very code base
/// </summary>
CostsMaintenanceDonations,
/// <summary>
/// No description
/// </summary>
@@ -402,6 +402,15 @@ namespace Swarmops.Logic.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Maintenance Donations.
/// </summary>
internal static string Cost_MaintenanceDonations {
get {
return ResourceManager.GetString("Cost_MaintenanceDonations", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Marketing and Campaigns.
/// </summary>
@@ -368,4 +368,8 @@
<value>Business Services</value>
<comment>Like paperwork services, fruit delivery, travel booking, anything that isn't strictly office maintenance</comment>
</data>
<data name="Cost_MaintenanceDonations" xml:space="preserve">
<value>Maintenance Donations</value>
<comment>This is donations toward maintenance of the Swarmops / Backoffice.Cash codebase and data.</comment>
</data>
</root>
+23
View File
@@ -607,6 +607,15 @@ namespace Swarmops.Logic.Structure
}
}
public void EnsureMaintenanceDonationAccountExists()
{
if (FinancialAccounts[OrganizationFinancialAccountType.CostsBitcoinFees] == null)
{
FinancialAccounts[OrganizationFinancialAccountType.CostsBitcoinFees] =
FinancialAccount.Create(this, "[LOC]Cost_MaintenanceDonations", FinancialAccountType.Cost, FinancialAccounts.CostsBankFees);
}
}
#endregion
#region Public properties
@@ -705,6 +714,20 @@ namespace Swarmops.Logic.Structure
get { return !String.IsNullOrEmpty(OpenLedgersDomain); }
}
public Int64 MaintenanceDonationLevelPpm
{
get
{
return
ObjectOptionalData.ForObject(this)
.GetOptionalDataInt64(ObjectOptionalDataType.OrgMaintenanceDonationLevel);
}
set
{
ObjectOptionalData.ForObject(this).SetOptionalDataInt64(ObjectOptionalDataType.OrgMaintenanceDonationLevel, value);
}
}
#endregion
#region UptakeGeographies
+18
View File
@@ -1131,6 +1131,15 @@ namespace Resources.Pages {
}
}
/// <summary>
/// Looks up a localized string similar to This is a checklist of things to do to close the previous month and begin the new one with respect to accounting..
/// </summary>
internal static string EndOfMonth_Info {
get {
return ResourceManager.GetString("EndOfMonth_Info", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Resolve all unmatched accounts.
/// </summary>
@@ -1140,6 +1149,15 @@ namespace Resources.Pages {
}
}
/// <summary>
/// Looks up a localized string similar to End-of-Month Routine.
/// </summary>
internal static string EndOfMonth_Title {
get {
return ResourceManager.GetString("EndOfMonth_Title", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Upload Bank Statement ({1}) for {0} for {2}.
/// </summary>
@@ -1006,10 +1006,16 @@
<value>Send Reports to Accountants, Shareholders, etc.</value>
<comment>This is the header for all items that send reports to external people at the end-of-month routine.</comment>
</data>
<data name="EndOfMonth_Info" xml:space="preserve">
<value>This is a checklist of things to do to close the previous month and begin the new one with respect to accounting.</value>
</data>
<data name="EndOfMonth_MatchAccounts" xml:space="preserve">
<value>Resolve all unmatched accounts</value>
<comment>This means to match bank transactions with incoming/outgoing expected payments (invoices, expense reports, etc) where it couldn't be done automatically</comment>
</data>
<data name="EndOfMonth_Title" xml:space="preserve">
<value>End-of-Month Routine</value>
</data>
<data name="EndOfMonth_UploadBankStatementFor" xml:space="preserve">
<value>Upload Bank Statement ({1}) for {0} for {2}</value>
<comment>Parameter zero is the account name, parameter one the format (e.g. PDF), parameter two is the month (e.g. October 2018)</comment>
+8 -13
View File
@@ -29,20 +29,17 @@
$('#TableEomItems').datagrid('appendRow', {
itemName: 'Upload/Fetch bank transaction data (FORMAT) up until [lastdatelastmonth]',
docs: "<img src='/Images/Icons/iconshock-red-cross-sphere-128x96px.png' data-test-id='Sockets-Browser' class='test-failed' style='display:none' height='20px' />",
actions: "<img src='/Images/Icons/iconshock-yellow-sphere-30pct-128x96px.png' data-test-id='Sockets-Browser' class='test-running' style='display:inline' height='20px' />"
action: "<img src='/Images/Icons/iconshock-yellow-sphere-30pct-128x96px.png' data-test-id='Sockets-Browser' class='test-running' style='display:inline' height='20px' />"
});
$('#TableEomItems').datagrid('appendRow', {
itemName: 'Upload bank statement (PDF) for [lastmonth]',
docs: "<img src='/Images/Icons/iconshock-red-cross-sphere-128x96px.png' data-test-id='Sockets-Browser' class='test-failed' style='display:none' height='20px' />",
actions: "<img src='/Images/Icons/iconshock-yellow-sphere-30pct-128x96px.png' data-test-id='Sockets-Browser' class='test-running' style='display:inline' height='20px' />"
action: "<img src='/Images/Icons/iconshock-yellow-sphere-30pct-128x96px.png' data-test-id='Sockets-Browser' class='test-running' style='display:inline' height='20px' />"
});
$('#TableEomItems').datagrid('appendRow', {
itemName: 'Resolve unmatched ledger transactions',
docs: "<img src='/Images/Icons/iconshock-red-cross-sphere-128x96px.png' data-test-id='Sockets-Browser' class='test-failed' style='display:none' height='20px' />",
actions: "<img src='/Images/Icons/iconshock-yellow-sphere-30pct-128x96px.png' data-test-id='Sockets-Browser' class='test-running' style='display:inline' height='20px' />"
action: "<img src='/Images/Icons/iconshock-yellow-sphere-30pct-128x96px.png' data-test-id='Sockets-Browser' class='test-running' style='display:inline' height='20px' />"
});
$('#TableEomItems').datagrid('appendRow', {
@@ -61,8 +58,7 @@
$('#TableEomItems').datagrid('appendRow', {
itemName: 'VAT Report for [lastmonth]',
docs: "<img src='/Images/Icons/iconshock-red-cross-sphere-128x96px.png' data-test-id='Sockets-Browser' class='test-failed' style='display:none' height='20px' />",
actions: "<img src='/Images/Icons/iconshock-yellow-sphere-30pct-128x96px.png' data-test-id='Sockets-Browser' class='test-running' style='display:inline' height='20px' />"
action: "<img src='/Images/Icons/iconshock-yellow-sphere-30pct-128x96px.png' data-test-id='Sockets-Browser' class='test-running' style='display:inline' height='20px' />"
});
/*
@@ -98,7 +94,7 @@
$('#TableEomItems').datagrid('appendRow', {
itemName: 'Close ledgers for [year]',
docs: "<img src='/Images/Icons/iconshock-red-cross-sphere-128x96px.png' data-test-id='Sockets-Browser' class='test-failed' style='display:none' height='20px' />",
actions: "<img src='/Images/Icons/iconshock-yellow-sphere-30pct-128x96px.png' data-test-id='Sockets-Browser' class='test-running' style='display:inline' height='20px' />"
action: "<img src='/Images/Icons/iconshock-yellow-sphere-30pct-128x96px.png' data-test-id='Sockets-Browser' class='test-running' style='display:inline' height='20px' />"
});
@@ -119,7 +115,7 @@
$('#TableEomItems').datagrid('appendRow', {
itemName: 'Send all reports as required',
docs: "<img src='/Images/Icons/iconshock-red-cross-sphere-128x96px.png' data-test-id='Sockets-Browser' class='test-failed' style='display:none' height='20px' />",
actions: "<img src='/Images/Icons/iconshock-yellow-sphere-30pct-128x96px.png' data-test-id='Sockets-Browser' class='test-running' style='display:inline' height='20px' />"
action: "<img src='/Images/Icons/iconshock-yellow-sphere-30pct-128x96px.png' data-test-id='Sockets-Browser' class='test-running' style='display:inline' height='20px' />"
});
@@ -177,9 +173,8 @@
<thead>
<tr>
<th data-options="field:'itemGroupName',width:42">&nbsp;</th>
<th data-options="field:'itemName',width:500">Todo</th>
<th data-options="field:'docs',width:42,align:'center'">Docs</th>
<th data-options="field:'actions',width:75,align:'center'">Actions</th>
<th data-options="field:'itemName',width:562">Todo</th>
<th data-options="field:'action',width:55,align:'center'">Action</th>
</tr>
</thead>
</table>
+16 -5
View File
@@ -17,6 +17,9 @@ namespace Swarmops.Frontend.Pages.Ledgers
{
this.PageAccessRequired = new Access(this.CurrentOrganization, AccessAspect.BookkeepingDetails);
this.Title = Resources.Pages.Ledgers.EndOfMonth_Title;
this.InfoBoxLiteral = Resources.Pages.Ledgers.EndOfMonth_Info;
// Check which reports are required
ItemGroups = new List<EomItemGroup>();
@@ -43,6 +46,7 @@ namespace Swarmops.Frontend.Pages.Ledgers
vatReport.Callback = "CreateVatReport";
vatReport.Name = String.Format(Resources.Pages.Ledgers.EndOfMonth_CreateVatReport, VatReport.NextReportDescription (this.CurrentOrganization));
vatReport.Completed = (vatRequired == ReportRequirement.Completed ? true : false);
vatReport.Icon = "document";
group2.Items.Add(vatReport);
}
@@ -69,10 +73,10 @@ namespace Swarmops.Frontend.Pages.Ledgers
builder.AppendFormat(@"
$('#TableEomItems').datagrid('appendRow', {
itemGroupName: '<span class=\x22itemGroupHeader\x22>{0}</span>',
$('#TableEomItems').datagrid('appendRow', " + '{' + @"
itemGroupName: '<span class=" + '"' + "itemGroupHeader" + '"' + @">{0}</span>',
itemId: '{1}'
});
" + '}' + @");
rowCount = $('#TableEomItems').datagrid('getRows').length;
@@ -83,11 +87,17 @@ namespace Swarmops.Frontend.Pages.Ledgers
field: 'itemGroupName'
});
", group.Header.Replace(" ", "&nbsp;"), group.Id);
", group.Header.Replace(" ", "&nbsp;").Replace("'", "''"), group.Id);
foreach (EomItem item in group.Items)
{
builder.AppendFormat(@"
$('#TableEomItems').datagrid('appendRow', " + '{' + @"
itemName: '{0}',
docs: ""<img src = '/Images/Icons/iconshock-red-cross-sphere-128x96px.png' data - test - id = 'Sockets-Browser' class='test-failed' style='display:none' height='20px' />"",
actions: ""<img src='/Images/Icons/iconshock-yellow-sphere-30pct-128x96px.png' class='eomitem-document' style='display:inline' height='20px' />""
});
", item.Name);
}
}
}
@@ -101,6 +111,7 @@ namespace Swarmops.Frontend.Pages.Ledgers
{
public string Id { get; set; }
public string Name { get; set; }
public string Icon { get; set; }
public string Callback { get; set; }
public bool Completed { get; set; }
}
+2
View File
@@ -1349,6 +1349,8 @@
<Content Include="Images\Flags\tr-24px.png" />
<Content Include="Images\Flags\tr-64px.png" />
<Content Include="Images\Icons\expensify-icon-official.png" />
<Content Include="Images\Icons\iconshock-balloon-invoice-128x96px-hot.png" />
<Content Include="Images\Icons\iconshock-balloon-invoice-128x96px.png" />
<Content Include="Images\Icons\iconshock-download-240px.png" />
<Content Include="Images\Icons\iconshock-download-96px.png" />
<Content Include="Images\Icons\iconshock-download-hot-240px.png" />