Work on several items

This commit is contained in:
Falkvinge
2017-06-18 16:04:09 +02:00
parent 3f36e400dd
commit 425cdffe5d
9 changed files with 265 additions and 5 deletions
+2 -1
View File
@@ -33,4 +33,5 @@
0033 - Added transaction row identity return, necessary for 0032 [RF]
0034 - Fix for SetFinancialTransactionRowNativeCurrency
0035 - Added OrganizationSequenceId on FinancialTransactions, VatCents setter on invoices [RF]
0036 - Added support for VatCents on ExpenseClaims [RF]
0036 - Added support for VatCents on ExpenseClaims [RF]
0037 - Added Suppliers, ExternalContacts tables; no procs for them yet [RF]
+46
View File
@@ -0,0 +1,46 @@
ALTER TABLE `InboundInvoices`
ADD COLUMN `PayToBitcoinAddress` VARCHAR(128) NOT NULL DEFAULT '' AFTER `SupplierId`,
ADD COLUMN `PayToEthereumAddress` VARCHAR(128) NOT NULL DEFAULT '' AFTER `PayToBitcoinAddress`
#
CREATE TABLE `ExternalContacts` (
`ExternalContactId` INT NOT NULL AUTO_INCREMENT,
`OrganizationId` INT NOT NULL DEFAULT 0,
`Name` VARCHAR(128) NOT NULL,
`Phone` VARCHAR(128) NOT NULL,
`Email` VARCHAR(128) NOT NULL,
`CultureId` VARCHAR(64) NOT NULL DEFAULT 'en-US',
`ExternalContactTypeId` INT NOT NULL DEFAULT 0,
PRIMARY KEY (`ExternalContactId`),
INDEX `Ix_OrganizationId` (`OrganizationId` ASC),
INDEX `Ix_TypeId` (`ExternalContactTypeId` ASC),
INDEX `Ix_Name` (`Name` ASC))
#
CREATE TABLE `ExternalContactTypes` (
`ExternalContactTypeId` INT NOT NULL AUTO_INCREMENT,
`Name` VARCHAR(128) NOT NULL,
PRIMARY KEY (`ExternalContactTypeId`),
INDEX `Ix_Name` (`Name` ASC))
#
CREATE TABLE `Suppliers` (
`SupplierId` INT NOT NULL AUTO_INCREMENT,
`OrganizationId` INT NOT NULL,
`Name` VARCHAR(128) NOT NULL DEFAULT '',
`ExternalContactId` INT NOT NULL DEFAULT 0,
`Street` VARCHAR(128) NOT NULL DEFAULT '',
`PostalCode` VARCHAR(45) NOT NULL DEFAULT '',
`City` VARCHAR(45) NOT NULL DEFAULT '',
`CountryId` INT NOT NULL DEFAULT '',
`Bank` VARCHAR(128) NOT NULL DEFAULT '',
`Account` VARCHAR(128) NOT NULL DEFAULT '',
`BitcoinAddress` VARCHAR(128) NOT NULL DEFAULT '',
`EthereumAddress` VARCHAR(128) NOT NULL DEFAULT '',
`VatId` VARCHAR(128) NOT NULL DEFAULT '',
PRIMARY KEY (`SupplierId`),
INDEX `Ix_Name` (`Name` ASC),
INDEX `Ix_Organization` (`OrganizationId` ASC))
+71
View File
@@ -0,0 +1,71 @@
CREATE TABLE `VatReports` (
`VatReportId` INT NOT NULL AUTO_INCREMENT,
`OrganizationId` INT NOT NULL,
`CreatedDateTime` DATETIME NOT NULL,
`DateTimeStart` DATETIME NOT NULL,
`MonthCount` INT NOT NULL,
`Open` TINYINT NOT NULL,
`VatOutboundCents` BIGINT NOT NULL,
`VatInboundCents` BIGINT NOT NULL,
`UnderConstruction` TINYINT NOT NULL COMMENT 'This is 1 when rows are being populated and the report is not yet ready to display.',
PRIMARY KEY (`VatReportId`),
INDEX `Ix_Organization` (`OrganizationId` ASC),
INDEX `Ix_DateTimeStart` (`DateTimeStart` ASC),
INDEX `Ix_Open` (`Open` ASC),
INDEX `Ix_Construction` (`UnderConstruction` ASC))
#
CREATE TABLE `VatReportItems` (
`VatReportItemId` INT NOT NULL AUTO_INCREMENT,
`VatReportId` INT NOT NULL,
`FinancialTransactionRowId` INT NOT NULL,
`ForeignObjectId` INT NOT NULL,
`FinancialDependencyTypeId` INT NOT NULL,
`VatInboundCents` BIGINT NOT NULL,
`VatOutboundCents` BIGINT NOT NULL,
PRIMARY KEY (`VatReportItemId`),
INDEX `Ix_ReportId` (`VatReportId` ASC),
INDEX `Ix_TxRowId` (`FinancialTransactionRowId` ASC))
#
DROP PROCEDURE IF EXISTS `CreateVatReport`
#
DROP PROCEDURE IF EXISTS `SetVatReportComplete`
#
DROP PROCEDURE IF EXISTS `SetVatReportOpen`
#
DROP PROCEDURE IF EXISTS `CreateVatReportItem`
#
CREATE PROCEDURE `CreateVatReport` (
organizationId INT,
createdDateTime DATETIME,
dateTimeStart DATETIME,
monthCount INT
)
BEGIN
INSERT INTO VatReports
(OrganizationId,CreatedDateTime,DateTimeStart,MonthCount,Open,VatInboundCents,VatOutboundCents,UnderConstruction)
VALUES
(organizationId,createdDateTime,dateTimeStart,monthCount,1,0,0,1);
SELECT LAST_INSERT_ID() AS Identity;
END
Continue with procs to create Vat report, to set open and under construction, to calculate inbound/outbound cents
procs to create vat report item, including copying tx's foreign object and dependency
@@ -0,0 +1 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Json-MasterPersonEditPaymentHistory.aspx.cs" Inherits="Swarmops.Frontend.Automation.Json_MasterPersonEditPaymentHistory" %>
@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Swarmops.Logic.Swarm;
namespace Swarmops.Frontend.Automation
{
public partial class Json_MasterPersonEditPaymentHistory : DataV5Base
{
private AuthenticationData _authenticationData;
private Person _person;
protected void Page_Load(object sender, EventArgs e)
{
this._authenticationData = GetAuthenticationDataAndCulture();
int personId = Int32.Parse(Request.QueryString["PersonId"]); // may throw and that's okay
this._person = Person.FromIdentity(personId);
/*
THIS ENTIRE STUFF IS TODO
Response.ContentType = "application/json";
Response.Output.WriteLine("{\"rows\": " + RecurseReport(report.ReportLines) + ", \"footer\": [" +
WriteFooter() + "]}");
Response.End();*/
}
}
}
@@ -0,0 +1,15 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Swarmops.Frontend.Automation {
public partial class Json_MasterPersonEditPaymentHistory {
}
}
+23 -4
View File
@@ -361,6 +361,28 @@
<asp:Label runat="server" ID="MasterLabelEditPerson2FAProvisioning" />
</div>
</div>
<div title="<img src='/Images/PageIcons/iconshock-money-calculator-128px.png' height='64' width='64' />">
<h2><span class="spanModalEditingPersonName">PERSONNAME</span>: Payment History</h2>
<table id="masterPersonEditTablePaymentHistory" title="" class="easyui-treegrid" style="width: 100%; height: 400px"
rownumbers="false"
animate="true"
fitColumns="true"
idField="id"
footer="true">
<thead>
<tr>
<th field="name" width="178"><asp:Literal ID="MasterPersonEditLiteralHeaderItemName" Text="Item Type XYZ" runat="server"/></th>
<th field="description" width="180"><asp:Literal ID="MasterPersonEditLiteralHeaderItemDescription" Text="Description XYZ" runat="server"/></th>
<th field="opened" width="120"><asp:Literal ID="Literal1" Text="Opened date XYZ" runat="server"/></th>
<th field="owedorg" width="120" align="right"><asp:Literal ID="Literal2" Text="You owe XYZ" runat="server"/></th>
<th field="oweduser" width="120" align="right"><asp:Literal ID="Literal3" Text="Owed to you XYZ" runat="server"/></th>
<th field="closed" width="120"><asp:Literal ID="Literal4" Text="Closed date XYZ" runat="server"/></th>
<th field="notes" width="80"><asp:Literal ID="Literal5" Text="Notes XYZ" runat="server"/></th>
</tr>
</thead>
</table>
</div>
<!--
<div title="<img src='/Images/Icons/iconshock-foreman-128px.png' height='64' width='64' />">
<h2><span class="spanModalEditingPersonName">PERSONNAME</span>: Role and Responsibility</h2>
@@ -425,10 +447,7 @@
Prefer bitcoin for salaries
</div>
</div>
<div title="<img src='/Images/PageIcons/iconshock-money-calculator-128px.png' height='64' width='64' />">
<h2><span class="spanModalEditingPersonName">PERSONNAME</span>: Payment History</h2>
TABLE
</div>
<div title="<img src='/Images/PageIcons/iconshock-award-96px.png' height='64' width='64' />">
<h2><span class="spanModalEditingPersonName">PERSONNAME</span>: Achievements</h2>
TABLE
+63
View File
@@ -516,6 +516,69 @@ namespace Swarmops.Frontend {
/// </remarks>
protected global::System.Web.UI.WebControls.Label MasterLabelEditPerson2FAProvisioning;
/// <summary>
/// MasterPersonEditLiteralHeaderItemName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal MasterPersonEditLiteralHeaderItemName;
/// <summary>
/// MasterPersonEditLiteralHeaderItemDescription control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal MasterPersonEditLiteralHeaderItemDescription;
/// <summary>
/// Literal1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal Literal1;
/// <summary>
/// Literal2 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal Literal2;
/// <summary>
/// Literal3 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal Literal3;
/// <summary>
/// Literal4 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal Literal4;
/// <summary>
/// Literal5 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal Literal5;
/// <summary>
/// MasterEditPersonOrgMail control.
/// </summary>
+8
View File
@@ -89,6 +89,13 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Automation\Json-MasterPersonEditPaymentHistory.aspx.cs">
<DependentUpon>Json-MasterPersonEditPaymentHistory.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Automation\Json-MasterPersonEditPaymentHistory.aspx.designer.cs">
<DependentUpon>Json-MasterPersonEditPaymentHistory.aspx</DependentUpon>
</Compile>
<Compile Include="Controls\v5\Base\AjaxToggleSlider.ascx.cs">
<DependentUpon>AjaxToggleSlider.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@@ -637,6 +644,7 @@
<Content Include="Automation\Json-ByGuid.aspx" />
<Content Include="Automation\Json-FinancialAccountsTree.aspx" />
<Content Include="Automation\Json-GeographiesTree.aspx" />
<Content Include="Automation\Json-MasterPersonEditPaymentHistory.aspx" />
<Content Include="Automation\Json-PositionsTree.aspx" />
<Content Include="Automation\Json-SearchPeoplePattern.aspx" />
<Content Include="Automation\Json-TransactionTagsTree.aspx" />