Work on VAT reports
This commit is contained in:
@@ -165,22 +165,23 @@ namespace Swarmops.Database
|
||||
|
||||
#region Creation and manipulation - stored procedures
|
||||
|
||||
public int CreateVatReport (int payrollItemId, DateTime payoutDate, Int64 baseSalaryCents, Int64 netSalaryCents,
|
||||
Int64 subtractiveTaxCents, Int64 additiveTaxCents)
|
||||
public int CreateVatReport (int organizationId, string guid, int yearMonthStart, int monthCount)
|
||||
{
|
||||
guid = guid.Replace("-", ""); // remove noise before committing
|
||||
DateTime nowUtc = DateTime.UtcNow;
|
||||
|
||||
using (DbConnection connection = GetMySqlDbConnection())
|
||||
{
|
||||
connection.Open();
|
||||
|
||||
DbCommand command = GetDbCommand ("CreateSalaryPrecise", connection);
|
||||
DbCommand command = GetDbCommand ("CreateVatReport", connection);
|
||||
command.CommandType = CommandType.StoredProcedure;
|
||||
|
||||
AddParameterWithName (command, "payrollItemId", payrollItemId);
|
||||
AddParameterWithName (command, "payoutDate", payoutDate);
|
||||
AddParameterWithName (command, "baseSalaryCents", baseSalaryCents);
|
||||
AddParameterWithName (command, "netSalaryCents", netSalaryCents);
|
||||
AddParameterWithName (command, "subtractiveTaxCents", subtractiveTaxCents);
|
||||
AddParameterWithName (command, "additiveTaxCents", additiveTaxCents);
|
||||
AddParameterWithName (command, "organizationId", organizationId);
|
||||
AddParameterWithName (command, "guid", guid);
|
||||
AddParameterWithName (command, "createdDateTime", nowUtc);
|
||||
AddParameterWithName (command, "yearMonthStart", yearMonthStart);
|
||||
AddParameterWithName (command, "monthCount", monthCount);
|
||||
|
||||
return Convert.ToInt32 (command.ExecuteScalar());
|
||||
}
|
||||
@@ -211,7 +212,7 @@ namespace Swarmops.Database
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void SetVatReportReleased (int vatReportId)
|
||||
{
|
||||
using (DbConnection connection = GetMySqlDbConnection())
|
||||
@@ -251,4 +252,5 @@ namespace Swarmops.Database
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Threading.Tasks;
|
||||
using Swarmops.Basic.Types.Financial;
|
||||
using Swarmops.Common.Interfaces;
|
||||
using Swarmops.Database;
|
||||
using Swarmops.Logic.Structure;
|
||||
|
||||
namespace Swarmops.Logic.Financial
|
||||
{
|
||||
@@ -37,6 +38,15 @@ namespace Swarmops.Logic.Financial
|
||||
return FromBasic(SwarmDb.GetDatabaseForWriting().GetVatReport(vatReportId));
|
||||
}
|
||||
|
||||
public static VatReport Create(Organization organization, int year, int startMonth, int monthCount)
|
||||
{
|
||||
System.Guid guid = System.Guid.NewGuid();
|
||||
|
||||
int vatReportId = SwarmDb.GetDatabaseForWriting()
|
||||
.CreateVatReport(organization.Identity, guid.ToString(), year*100 + startMonth, monthCount);
|
||||
return FromIdentityAggressive(vatReportId);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public void AddItem(FinancialTransaction transaction, Int64 turnoverCents,
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Swarmops.Basic.Types.Financial;
|
||||
using Swarmops.Logic.Support;
|
||||
|
||||
namespace Swarmops.Logic.Financial
|
||||
{
|
||||
public class VatReports: PluralBase<VatReports, VatReport, BasicVatReport>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -129,6 +129,7 @@
|
||||
<Compile Include="Financial\VatReport.cs" />
|
||||
<Compile Include="Financial\VatReportItem.cs" />
|
||||
<Compile Include="Financial\VatReportItems.cs" />
|
||||
<Compile Include="Financial\VatReports.cs" />
|
||||
<Compile Include="Resources\Logic.Financial.FinancialAccount.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
|
||||
Reference in New Issue
Block a user