Added VatReport.Guid field

This commit is contained in:
Rick Falkvinge
2017-10-04 20:24:42 +02:00
parent c5341f3fde
commit 4bde187096
5 changed files with 38 additions and 2 deletions
+2
View File
@@ -59,6 +59,8 @@
<ItemGroup>
<Compile Include="Types\Financial\BasicHotBitcoinAddress.cs" />
<Compile Include="Types\Financial\BasicHotBitcoinAddressUnspent.cs" />
<Compile Include="Types\Financial\BasicVatReport.cs" />
<Compile Include="Types\Financial\BasicVatReportItem.cs" />
<Compile Include="Types\Governance\BasicBallot.cs" />
<Compile Include="Types\Swarm\BasicPosition.cs" />
<Compile Include="Types\Swarm\BasicPositionAssignment.cs" />
+1 -1
View File
@@ -14,7 +14,7 @@ namespace Swarmops.Database
/// </summary>
public static int DbVersionExpected
{
get { return 38; }
get { return 39; }
}
+1
View File
@@ -124,6 +124,7 @@
<Compile Include="Database-Reporters.cs" />
<Compile Include="Database-Roles.cs" />
<Compile Include="Database-OutboundPhoneMessages.cs" />
<Compile Include="Database-VatReports.cs" />
<Compile Include="Database-Salaries.cs" />
<Compile Include="Database-SwarmopsLog.cs" />
<Compile Include="Database-TaxLevels.cs" />
+2 -1
View File
@@ -35,4 +35,5 @@
0035 - Added OrganizationSequenceId on FinancialTransactions, VatCents setter on invoices [RF]
0036 - Added support for VatCents on ExpenseClaims [RF]
0037 - Added Suppliers, ExternalContacts tables; no procs for them yet [RF]
0038 - VAT Report tables and functions [RF]
0038 - VAT Report tables and functions [RF]
0039 - VatReport.Guid added [RF]
+32
View File
@@ -0,0 +1,32 @@
ALTER TABLE `VatReports`
ADD COLUMN `Guid` VARCHAR(128) NOT NULL AFTER `OrganizationId`,
ADD INDEX `Ix_Guid` (`Guid` ASC)
#
DROP PROCEDURE IF EXISTS `CreateVatReport`
#
CREATE DEFINER=`swarmops-live-a`@`%` PROCEDURE `CreateVatReport`(
organizationId INT,
guid VARCHAR(128),
createdDateTime DATETIME,
yearMonthStart BIGINT,
monthCount INT
)
BEGIN
INSERT INTO VatReports
(OrganizationId,Guid,CreatedDateTime,YearMonthStart,MonthCount,Open,TurnoverCents,VatInboundCents,VatOutboundCents,UnderConstruction)
VALUES
(organizationId,guid,createdDateTime,yearMonthStart,monthCount,1,0,0,0,1);
SELECT LAST_INSERT_ID() AS Identity;
END