This commit is contained in:
Rick Falkvinge
2014-10-04 22:33:06 +02:00
10 changed files with 58 additions and 54 deletions
+2 -4
View File
@@ -1,7 +1,5 @@
using System;
using System.Configuration;
using System.Collections.Generic;
using System.Text;
namespace Swarmops.Basic
{
@@ -11,7 +9,7 @@ namespace Swarmops.Basic
{
get
{
string portString = ConfigurationSettings.AppSettings["SmtpPort"];
string portString = ConfigurationManager.AppSettings["SmtpPort"];
if (String.IsNullOrEmpty(portString))
{
@@ -26,7 +24,7 @@ namespace Swarmops.Basic
{
get
{
string smtpHost = ConfigurationSettings.AppSettings["SmtpHost"];
string smtpHost = ConfigurationManager.AppSettings["SmtpHost"];
if (String.IsNullOrEmpty(smtpHost))
{
+2 -1
View File
@@ -131,7 +131,8 @@ namespace Swarmops.Database
// Dev console process
return "database.config"; // Each dev needs to set the working directory to the Console directory when debugging
// Each dev needs to set the working directory to the Console directory when debugging
// return "database.config";
}
}
}
@@ -246,8 +246,10 @@ namespace Swarmops.Logic.Communications
// buffer för inläsning
var buf = new byte[8092];
#pragma warning disable 618
// ServicePointManager.CertificatePolicy is obsoleted, but is the only thing that works on both windows and mono.
//Needed to avoid errors from homegrown SSL cert.
ICertificatePolicy oldPolicy = ServicePointManager.CertificatePolicy;
ServicePointManager.CertificatePolicy = new HTTPSender();
@@ -263,6 +265,7 @@ namespace Swarmops.Logic.Communications
var response = (HttpWebResponse)request.GetResponse();
responseOut = response;
ServicePointManager.CertificatePolicy = oldPolicy;
#pragma warning restore 618
// läs in dataströmmen via responsmetoden
Stream resStream = response.GetResponseStream();
+1 -1
View File
@@ -80,7 +80,7 @@ namespace Swarmops.Logic.Financial
public Int64 GetBudgetCents (int year)
{
return (Int64) (GetBudget(year)*100);
return (Int64) (SwarmDb.GetDatabaseForReading().GetFinancialAccountBudget(this.Identity, year)*100);
}
public Int64[] GetBudgetMonthly (int year)
+1 -1
View File
@@ -35,7 +35,7 @@ namespace Swarmops.Logic.Financial
// TODO: Create in database
return payout;
// return payout;
}
private Payout (BasicPayout basic):
-2
View File
@@ -21,8 +21,6 @@ namespace Swarmops.Logic.Security
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
[assembly: System.Reflection.AssemblyVersion("0.1")]
/// <summary>BCrypt implements OpenBSD-style Blowfish password hashing
/// using the scheme described in "A Future-Adaptable Password Scheme"
/// by Niels Provos and David Mazieres.</summary>
@@ -1019,7 +1019,11 @@ namespace Swarmops.Logic.Special.Sweden
try
{
#pragma warning disable 618
// ServicePointManager.CertificatePolicy is obsoleted, but is the only thing that works on both windows and mono.
//Needed to avoid errors from homegrown SSL cert.
ServicePointManager.CertificatePolicy = new ErrorIgnorerPolicy();
#pragma warning restore 618
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
//string proxy = null;
Encoding recieverEncoding = Encoding.GetEncoding("iso-8859-1");
+1 -1
View File
@@ -11,7 +11,7 @@ namespace Swarmops.Logic.Swarm
}
public static OfficerChain FromOrganizationAndGeography (Organization org, Geography geo)
public new static OfficerChain FromOrganizationAndGeography (Organization org, Geography geo)
{
int[] concernedPeopleId = Roles.GetAllUpwardRoles(org.Identity, geo.Identity);
People concernedPeople = People.FromIdentities(concernedPeopleId);
+13 -13
View File
@@ -133,20 +133,20 @@ namespace Swarmops.Frontend.Automation
throw new NotImplementedException (
"We should never get to partial upload. If we do, something is very very unexpected and this needs to be implemented.");
using (var fs = new FileStream (fullName, FileMode.Append, FileAccess.Write))
{
var buffer = new byte[1024];
//using (var fs = new FileStream(fullName, FileMode.Append, FileAccess.Write))
//{
// var buffer = new byte[1024];
int l = inputStream.Read (buffer, 0, 1024);
while (l > 0)
{
fs.Write (buffer, 0, l);
l = inputStream.Read (buffer, 0, 1024);
}
fs.Flush();
fs.Close();
}
statuses.Add (new FilesStatus (new FileInfo (fullName)));
// int l = inputStream.Read(buffer, 0, 1024);
// while (l > 0)
// {
// fs.Write(buffer, 0, l);
// l = inputStream.Read(buffer, 0, 1024);
// }
// fs.Flush();
// fs.Close();
//}
//statuses.Add(new FilesStatus(new FileInfo(fullName)));
}
// Upload entire file
+31 -31
View File
@@ -55,43 +55,43 @@ public partial class Pages_v5_Ledgers_CloseLedgers : PageV5Base
// First, roll over virtual balances.
if (false) // if this.CurrentOrganization.Parameters.VirtualBankingEnabled
{
FinancialAccount rootAccount = FinancialAccount.FromIdentity(29); // HACK: Hardcoded account; should be _organization.FinancialAccount.CostsVirtualBankingRoot
FinancialAccount tempAccount = FinancialAccount.FromIdentity(98); // HACK: Hardcoded account; should be _organization.FinancialAccount.AssetsVirtualRollover
//if (false) // if this.CurrentOrganization.Parameters.VirtualBankingEnabled
//{
// FinancialAccount rootAccount = FinancialAccount.FromIdentity(29); // HACK: Hardcoded account; should be _organization.FinancialAccount.CostsVirtualBankingRoot
// FinancialAccount tempAccount = FinancialAccount.FromIdentity(98); // HACK: Hardcoded account; should be _organization.FinancialAccount.AssetsVirtualRollover
FinancialAccounts localAccounts = rootAccount.GetTree();
// FinancialAccounts localAccounts = rootAccount.GetTree();
foreach (FinancialAccount account in localAccounts)
{
Int64 currentBalanceCents = account.GetDeltaCents(new DateTime(closingYear, 1, 1), new DateTime(closingYear+1, 1, 1));
Int64 budgetCents = -account.GetBudgetCents(closingYear);
Int64 carryOverCents = budgetCents - currentBalanceCents;
// foreach (FinancialAccount account in localAccounts)
// {
// Int64 currentBalanceCents = account.GetDeltaCents(new DateTime(closingYear, 1, 1), new DateTime(closingYear+1, 1, 1));
// Int64 budgetCents = -account.GetBudgetCents(closingYear);
// Int64 carryOverCents = budgetCents - currentBalanceCents;
if (carryOverCents != 0)
{
FinancialTransaction transactionOldYear = FinancialTransaction.Create(1,
new DateTime(closingYear, 12,
31, 23, 50,
00),
"Budgetrest " + account.Name);
// HACK: Localize rollover label
// if (carryOverCents != 0)
// {
// FinancialTransaction transactionOldYear = FinancialTransaction.Create(1,
// new DateTime(closingYear, 12,
// 31, 23, 50,
// 00),
// "Budgetrest " + account.Name);
// // HACK: Localize rollover label
transactionOldYear.AddRow(account, carryOverCents, null);
transactionOldYear.AddRow(tempAccount, -carryOverCents, null);
// transactionOldYear.AddRow(account, carryOverCents, null);
// transactionOldYear.AddRow(tempAccount, -carryOverCents, null);
FinancialTransaction transactionNewYear = FinancialTransaction.Create(1,
new DateTime(closingYear + 1,
1, 1, 0, 10, 0),
"Budgetrest " +
closingYear.ToString() + " " +
account.Name);
// FinancialTransaction transactionNewYear = FinancialTransaction.Create(1,
// new DateTime(closingYear + 1,
// 1, 1, 0, 10, 0),
// "Budgetrest " +
// closingYear.ToString() + " " +
// account.Name);
transactionNewYear.AddRow(account, -carryOverCents, null);
transactionNewYear.AddRow(tempAccount, carryOverCents, null);
}
}
}
// transactionNewYear.AddRow(account, -carryOverCents, null);
// transactionNewYear.AddRow(tempAccount, carryOverCents, null);
// }
// }
//}
// Then, actually close the ledgers.