1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-10 07:38:13 -05:00

org tax information

This commit is contained in:
Kyle Spearrin 2017-10-25 12:41:07 -04:00
parent 8ba3e27a7d
commit e41461f8fc
10 changed files with 61 additions and 13 deletions

View File

@ -14,12 +14,11 @@ namespace Bit.Api.Models
OurAddress3 = apiSettings.OurAddress3; OurAddress3 = apiSettings.OurAddress3;
CustomerName = organization.BusinessName ?? "--"; CustomerName = organization.BusinessName ?? "--";
// TODO: address and vat CustomerAddress1 = organization.BusinessAddress1;
CustomerAddress1 = "123 Any St"; CustomerAddress2 = organization.BusinessAddress2;
CustomerAddress2 = "New York, NY 10001"; CustomerAddress3 = organization.BusinessAddress3;
CustomerAddress3 = "United States"; CustomerCountry = organization.BusinessCountry;
CustomerAddress4 = null; CustomerVatNumber = organization.BusinessTaxNumber;
CustomerVatNumber = "PT123456789";
InvoiceDate = invoice.Date?.ToLongDateString(); InvoiceDate = invoice.Date?.ToLongDateString();
InvoiceDueDate = invoice.DueDate?.ToLongDateString(); InvoiceDueDate = invoice.DueDate?.ToLongDateString();
@ -43,7 +42,7 @@ namespace Bit.Api.Models
public string CustomerAddress1 { get; set; } public string CustomerAddress1 { get; set; }
public string CustomerAddress2 { get; set; } public string CustomerAddress2 { get; set; }
public string CustomerAddress3 { get; set; } public string CustomerAddress3 { get; set; }
public string CustomerAddress4 { get; set; } public string CustomerCountry { get; set; }
public IEnumerable<Item> Items { get; set; } public IEnumerable<Item> Items { get; set; }
public string SubtotalAmount { get; set; } public string SubtotalAmount { get; set; }
public string VatTotalAmount { get; set; } public string VatTotalAmount { get; set; }

View File

@ -3,12 +3,12 @@
<head> <head>
<style> <style>
body { body {
font-family: Arial, Helvetica, sans-serif; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 18px; font-size: 18px;
} }
h1, h2, h3, h4 { h1, h2, h3, h4, h5 {
font-family: Arial, Helvetica, sans-serif; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
} }
table { table {
@ -45,7 +45,7 @@
.number { .number {
float: right; float: right;
text-align: right; text-align: right;
font-family: Courier New, Courier, monospace; font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
} }
</style> </style>
</head> </head>
@ -90,9 +90,9 @@
{ {
@Model.CustomerAddress3<br /> @Model.CustomerAddress3<br />
} }
@if(!string.IsNullOrWhiteSpace(Model.CustomerAddress4)) @if(!string.IsNullOrWhiteSpace(Model.CustomerCountry))
{ {
@Model.CustomerAddress4 @Model.CustomerCountry
} }
</p> </p>
@if(Model.UsesVat) @if(Model.UsesVat)

View File

@ -29,6 +29,7 @@ namespace Bit.Core.Models.Api
[EncryptedString] [EncryptedString]
[StringLength(1000)] [StringLength(1000)]
public string CollectionName { get; set; } public string CollectionName { get; set; }
public string Country { get; set; }
public virtual OrganizationSignup ToOrganizationSignup(User user) public virtual OrganizationSignup ToOrganizationSignup(User user)
{ {
@ -43,6 +44,7 @@ namespace Bit.Core.Models.Api
AdditionalStorageGb = AdditionalStorageGb.GetValueOrDefault(0), AdditionalStorageGb = AdditionalStorageGb.GetValueOrDefault(0),
BillingEmail = BillingEmail, BillingEmail = BillingEmail,
BusinessName = BusinessName, BusinessName = BusinessName,
BusinessCountry = Country,
CollectionName = CollectionName CollectionName = CollectionName
}; };
} }

View File

@ -19,6 +19,11 @@ namespace Bit.Core.Models.Api
Id = organization.Id.ToString(); Id = organization.Id.ToString();
Name = organization.Name; Name = organization.Name;
BusinessName = organization.BusinessName; BusinessName = organization.BusinessName;
BusinessAddress1 = organization.BusinessAddress1;
BusinessAddress2 = organization.BusinessAddress2;
BusinessAddress3 = organization.BusinessAddress3;
BusinessCountry = organization.BusinessCountry;
BusinessTaxNumber = organization.BusinessTaxNumber;
BillingEmail = organization.BillingEmail; BillingEmail = organization.BillingEmail;
Plan = organization.Plan; Plan = organization.Plan;
PlanType = organization.PlanType; PlanType = organization.PlanType;
@ -32,6 +37,11 @@ namespace Bit.Core.Models.Api
public string Id { get; set; } public string Id { get; set; }
public string Name { get; set; } public string Name { get; set; }
public string BusinessName { get; set; } public string BusinessName { get; set; }
public string BusinessAddress1 { get; set; }
public string BusinessAddress2 { get; set; }
public string BusinessAddress3 { get; set; }
public string BusinessCountry { get; set; }
public string BusinessTaxNumber { get; set; }
public string BillingEmail { get; set; } public string BillingEmail { get; set; }
public string Plan { get; set; } public string Plan { get; set; }
public Enums.PlanType PlanType { get; set; } public Enums.PlanType PlanType { get; set; }

View File

@ -6,6 +6,7 @@ namespace Bit.Core.Models.Business
{ {
public string Name { get; set; } public string Name { get; set; }
public string BusinessName { get; set; } public string BusinessName { get; set; }
public string BusinessCountry { get; set; }
public string BillingEmail { get; set; } public string BillingEmail { get; set; }
public User Owner { get; set; } public User Owner { get; set; }
public string OwnerKey { get; set; } public string OwnerKey { get; set; }

View File

@ -11,6 +11,11 @@ namespace Bit.Core.Models.Table
public Guid Id { get; set; } public Guid Id { get; set; }
public string Name { get; set; } public string Name { get; set; }
public string BusinessName { get; set; } public string BusinessName { get; set; }
public string BusinessAddress1 { get; set; }
public string BusinessAddress2 { get; set; }
public string BusinessAddress3 { get; set; }
public string BusinessCountry { get; set; }
public string BusinessTaxNumber { get; set; }
public string BillingEmail { get; set; } public string BillingEmail { get; set; }
public string Plan { get; set; } public string Plan { get; set; }
public PlanType PlanType { get; set; } public PlanType PlanType { get; set; }

View File

@ -517,6 +517,7 @@ namespace Bit.Core.Services
Name = signup.Name, Name = signup.Name,
BillingEmail = signup.BillingEmail, BillingEmail = signup.BillingEmail,
BusinessName = signup.BusinessName, BusinessName = signup.BusinessName,
BusinessCountry = signup.BusinessCountry,
PlanType = plan.Type, PlanType = plan.Type,
Seats = (short)(plan.BaseSeats + signup.AdditionalSeats), Seats = (short)(plan.BaseSeats + signup.AdditionalSeats),
MaxCollections = plan.MaxCollections, MaxCollections = plan.MaxCollections,

View File

@ -2,6 +2,11 @@
@Id UNIQUEIDENTIFIER, @Id UNIQUEIDENTIFIER,
@Name NVARCHAR(50), @Name NVARCHAR(50),
@BusinessName NVARCHAR(50), @BusinessName NVARCHAR(50),
@BusinessAddress1 NVARCHAR(50),
@BusinessAddress2 NVARCHAR(50),
@BusinessAddress3 NVARCHAR(50),
@BusinessCountry VARCHAR(2),
@BusinessTaxNumber NVARCHAR(30),
@BillingEmail NVARCHAR(50), @BillingEmail NVARCHAR(50),
@Plan NVARCHAR(50), @Plan NVARCHAR(50),
@PlanType TINYINT, @PlanType TINYINT,
@ -30,6 +35,11 @@ BEGIN
[Id], [Id],
[Name], [Name],
[BusinessName], [BusinessName],
[BusinessAddress1],
[BusinessAddress2],
[BusinessAddress3],
[BusinessCountry],
[BusinessTaxNumber],
[BillingEmail], [BillingEmail],
[Plan], [Plan],
[PlanType], [PlanType],
@ -55,6 +65,11 @@ BEGIN
@Id, @Id,
@Name, @Name,
@BusinessName, @BusinessName,
@BusinessAddress1,
@BusinessAddress2,
@BusinessAddress3,
@BusinessCountry,
@BusinessTaxNumber,
@BillingEmail, @BillingEmail,
@Plan, @Plan,
@PlanType, @PlanType,

View File

@ -2,6 +2,11 @@
@Id UNIQUEIDENTIFIER, @Id UNIQUEIDENTIFIER,
@Name NVARCHAR(50), @Name NVARCHAR(50),
@BusinessName NVARCHAR(50), @BusinessName NVARCHAR(50),
@BusinessAddress1 NVARCHAR(50),
@BusinessAddress2 NVARCHAR(50),
@BusinessAddress3 NVARCHAR(50),
@BusinessCountry VARCHAR(2),
@BusinessTaxNumber NVARCHAR(30),
@BillingEmail NVARCHAR(50), @BillingEmail NVARCHAR(50),
@Plan NVARCHAR(50), @Plan NVARCHAR(50),
@PlanType TINYINT, @PlanType TINYINT,
@ -31,6 +36,11 @@ BEGIN
SET SET
[Name] = @Name, [Name] = @Name,
[BusinessName] = @BusinessName, [BusinessName] = @BusinessName,
[BusinessAddress1] = @BusinessAddress1,
[BusinessAddress2] = @BusinessAddress2,
[BusinessAddress3] = @BusinessAddress3,
[BusinessCountry] = @BusinessCountry,
[BusinessTaxNumber] = @BusinessTaxNumber,
[BillingEmail] = @BillingEmail, [BillingEmail] = @BillingEmail,
[Plan] = @Plan, [Plan] = @Plan,
[PlanType] = @PlanType, [PlanType] = @PlanType,

View File

@ -2,6 +2,11 @@
[Id] UNIQUEIDENTIFIER NOT NULL, [Id] UNIQUEIDENTIFIER NOT NULL,
[Name] NVARCHAR (50) NOT NULL, [Name] NVARCHAR (50) NOT NULL,
[BusinessName] NVARCHAR (50) NULL, [BusinessName] NVARCHAR (50) NULL,
[BusinessAddress1] NVARCHAR (50) NULL,
[BusinessAddress2] NVARCHAR (50) NULL,
[BusinessAddress3] NVARCHAR (50) NULL,
[BusinessCountry] VARCHAR (2) NULL,
[BusinessTaxNumber] NVARCHAR (30) NULL,
[BillingEmail] NVARCHAR (50) NOT NULL, [BillingEmail] NVARCHAR (50) NOT NULL,
[Plan] NVARCHAR (50) NOT NULL, [Plan] NVARCHAR (50) NOT NULL,
[PlanType] TINYINT NOT NULL, [PlanType] TINYINT NOT NULL,