ecg matrix as output
This commit is contained in:
@@ -10,6 +10,7 @@ type Ecalc struct {
|
|||||||
Type string `json:"type"`
|
Type string `json:"type"`
|
||||||
Version string `json:"version"`
|
Version string `json:"version"`
|
||||||
CompanyFacts CompanyFacts `json:"companyFacts"`
|
CompanyFacts CompanyFacts `json:"companyFacts"`
|
||||||
|
Matrix Matrix `json:"matrix"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// EncodeJSON writes the JSON of the conf into the Writer
|
// EncodeJSON writes the JSON of the conf into the Writer
|
||||||
@@ -87,3 +88,16 @@ type Aspect struct {
|
|||||||
IsWeightSelectedByUser bool `json:"isWeightSelectedByUser"`
|
IsWeightSelectedByUser bool `json:"isWeightSelectedByUser"`
|
||||||
IsPositive bool `json:"isPositive"`
|
IsPositive bool `json:"isPositive"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Matrix struct {
|
||||||
|
Topics []MatrixTopic `json:"topics"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type MatrixTopic struct {
|
||||||
|
ShortName string `json:"shortName"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
Points int `json:"points"`
|
||||||
|
MaxPoints int `json:"maxPoints"`
|
||||||
|
PercentageReached int `json:"percentageReached"`
|
||||||
|
NotApplicable bool `json:"notApplicable"`
|
||||||
|
}
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ type Conf struct {
|
|||||||
Values []Value `json:"values"`
|
Values []Value `json:"values"`
|
||||||
Areas []Area `json:"areas"`
|
Areas []Area `json:"areas"`
|
||||||
Rating Rating `json:"rating"`
|
Rating Rating `json:"rating"`
|
||||||
|
Matrix Matrix `json:"matrix"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// EncodeJSON writes the JSON of the conf into the Writer
|
// EncodeJSON writes the JSON of the conf into the Writer
|
||||||
@@ -103,3 +104,22 @@ type RatingCol struct {
|
|||||||
Type string `json:"type"`
|
Type string `json:"type"`
|
||||||
Default string `json:"default"`
|
Default string `json:"default"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Matrix struct {
|
||||||
|
Sheet int `json:"sheet"`
|
||||||
|
Stakeholders []Stakeholder `json:"stakeholders"`
|
||||||
|
Values []MatrixValue `json:"values"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Stakeholder struct {
|
||||||
|
Row int `json:"row"`
|
||||||
|
ShortName string `json:"short_name"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type MatrixValue struct {
|
||||||
|
ShortName string `json:"short_name"`
|
||||||
|
PointsCol string `json:"points_col"`
|
||||||
|
PercentageReachedCol string `json:"percentage_reached_col"`
|
||||||
|
MaxPointsCol string `json:"max_points_col"`
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,234 +1,294 @@
|
|||||||
{
|
{
|
||||||
"title": "Good Balance Calculator",
|
"title": "Good Balance Calculator",
|
||||||
"version": "5.04",
|
"version": "5.04",
|
||||||
"type": "Full",
|
"type": "Full",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"sheet": 2,
|
||||||
|
"cell": "C7",
|
||||||
|
"type": "int",
|
||||||
|
"struct": "CompanyFacts",
|
||||||
|
"field": "TotalPurchaseFromSuppliers",
|
||||||
|
"default": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sheet": 2,
|
||||||
|
"cell": "C27",
|
||||||
|
"type": "int",
|
||||||
|
"struct": "CompanyFacts",
|
||||||
|
"field": "TotalStaffCosts",
|
||||||
|
"default": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sheet": 2,
|
||||||
|
"cell": "C18",
|
||||||
|
"type": "int",
|
||||||
|
"struct": "CompanyFacts",
|
||||||
|
"field": "Profit",
|
||||||
|
"default": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sheet": 2,
|
||||||
|
"cell": "C19",
|
||||||
|
"type": "int",
|
||||||
|
"struct": "CompanyFacts",
|
||||||
|
"field": "FinancialCosts",
|
||||||
|
"default": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sheet": 2,
|
||||||
|
"cell": "C20",
|
||||||
|
"type": "int",
|
||||||
|
"struct": "CompanyFacts",
|
||||||
|
"field": "IncomeFromFinancialInvestments",
|
||||||
|
"default": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sheet": 2,
|
||||||
|
"cell": "C22",
|
||||||
|
"type": "int",
|
||||||
|
"struct": "CompanyFacts",
|
||||||
|
"field": "AdditionsToFixedAssets",
|
||||||
|
"default": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sheet": 2,
|
||||||
|
"cell": "C37",
|
||||||
|
"type": "int",
|
||||||
|
"struct": "CompanyFacts",
|
||||||
|
"field": "Turnover",
|
||||||
|
"default": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sheet": 2,
|
||||||
|
"cell": "C21",
|
||||||
|
"type": "int",
|
||||||
|
"struct": "CompanyFacts",
|
||||||
|
"field": "TotalAssets",
|
||||||
|
"default": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sheet": 2,
|
||||||
|
"cell": "C23",
|
||||||
|
"type": "int",
|
||||||
|
"struct": "CompanyFacts",
|
||||||
|
"field": "FinancialAssetsAndCashBalance",
|
||||||
|
"default": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sheet": 2,
|
||||||
|
"cell": "C26",
|
||||||
|
"type": "int",
|
||||||
|
"struct": "CompanyFacts",
|
||||||
|
"field": "NumberOfEmployees",
|
||||||
|
"default": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sheet": 2,
|
||||||
|
"cell": "C24",
|
||||||
|
"type": "bool",
|
||||||
|
"struct": "CompanyFacts",
|
||||||
|
"field": "HasCanteen",
|
||||||
|
"default": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sheet": 2,
|
||||||
|
"cell": "C38",
|
||||||
|
"type": "bool",
|
||||||
|
"struct": "CompanyFacts",
|
||||||
|
"field": "IsB2B",
|
||||||
|
"default": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sheet": 2,
|
||||||
|
"cell": "C33",
|
||||||
|
"type": "int",
|
||||||
|
"struct": "CompanyFacts",
|
||||||
|
"field": "AverageJourneyToWorkForStaffInKm",
|
||||||
|
"default": ""
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"areas": [
|
||||||
|
{
|
||||||
|
"sheet": 2,
|
||||||
|
"start_row": 10,
|
||||||
|
"end_row": 14,
|
||||||
|
"struct": "SupplyFraction",
|
||||||
|
"cols": [
|
||||||
|
{
|
||||||
|
"col": "B",
|
||||||
|
"field": "IndustryCode",
|
||||||
|
"type": "string",
|
||||||
|
"split": " ",
|
||||||
|
"default": "Please choose"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"col": "D",
|
||||||
|
"field": "CountryCode",
|
||||||
|
"type": "string",
|
||||||
|
"split": " ",
|
||||||
|
"default": "Please choose"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"col": "F",
|
||||||
|
"field": "Costs",
|
||||||
|
"type": "string",
|
||||||
|
"default": "0"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sheet": 2,
|
||||||
|
"start_row": 30,
|
||||||
|
"end_row": 32,
|
||||||
|
"struct": "EmployeesFraction",
|
||||||
|
"cols": [
|
||||||
|
{
|
||||||
|
"col": "B",
|
||||||
|
"field": "CountryCode",
|
||||||
|
"type": "string",
|
||||||
|
"split": " ",
|
||||||
|
"default": "Please choose"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"col": "D",
|
||||||
|
"field": "Percentage",
|
||||||
|
"type": "float64",
|
||||||
|
"default": "0"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sheet": 2,
|
||||||
|
"start_row": 41,
|
||||||
|
"end_row": 43,
|
||||||
|
"struct": "IndustrySector",
|
||||||
|
"cols": [
|
||||||
|
{
|
||||||
|
"col": "B",
|
||||||
|
"field": "IndustryCode",
|
||||||
|
"type": "string",
|
||||||
|
"split": " ",
|
||||||
|
"default": "Please choose"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"col": "C",
|
||||||
|
"field": "Description",
|
||||||
|
"type": "string",
|
||||||
|
"default": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"col": "D",
|
||||||
|
"field": "AmountOfTotalTurnover",
|
||||||
|
"type": "int",
|
||||||
|
"default": "0"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"rating": {
|
||||||
|
"sheet": 3,
|
||||||
|
"start_row": 9,
|
||||||
|
"end_row": 93,
|
||||||
|
"short_name_col": "B",
|
||||||
|
"cols": [
|
||||||
|
{
|
||||||
|
"col": "I",
|
||||||
|
"field": "Points",
|
||||||
|
"type": "int",
|
||||||
|
"default": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"col": "J",
|
||||||
|
"field": "MaxPoints",
|
||||||
|
"type": "float64",
|
||||||
|
"default": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"col": "C",
|
||||||
|
"field": "Name",
|
||||||
|
"type": "int",
|
||||||
|
"default": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"col": "H",
|
||||||
|
"field": "Estimations",
|
||||||
|
"type": "int",
|
||||||
|
"default": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"col": "D",
|
||||||
|
"field": "Weight",
|
||||||
|
"type": "float64",
|
||||||
|
"default": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"col": "N",
|
||||||
|
"field": "IsWeightSelectedByUser",
|
||||||
|
"type": "bool",
|
||||||
|
"default": ""
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"matrix": {
|
||||||
|
"sheet": 5,
|
||||||
|
"stakeholders": [
|
||||||
|
{
|
||||||
|
"row": 9,
|
||||||
|
"short_name": "A",
|
||||||
|
"name": "Suppliers"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"row": 11,
|
||||||
|
"short_name": "B",
|
||||||
|
"name": "Owners"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"row": 13,
|
||||||
|
"short_name": "C",
|
||||||
|
"name": "Employees"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"row": 15,
|
||||||
|
"short_name": "D",
|
||||||
|
"name": "Customers"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"row": 17,
|
||||||
|
"short_name": "E",
|
||||||
|
"name": "Social environment"
|
||||||
|
}
|
||||||
|
],
|
||||||
"values": [
|
"values": [
|
||||||
{
|
{
|
||||||
"sheet": 2,
|
"short_name": "1",
|
||||||
"cell": "C7",
|
"name": "Human dignity",
|
||||||
"type": "int",
|
"points_col": "C",
|
||||||
"struct": "CompanyFacts",
|
"percentage_reached_col": "F",
|
||||||
"field": "TotalPurchaseFromSuppliers",
|
"max_points_col": "E"
|
||||||
"default": ""
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"sheet": 2,
|
"short_name": "2",
|
||||||
"cell": "C27",
|
"name": "Solidarity",
|
||||||
"type": "int",
|
"points_col": "G",
|
||||||
"struct": "CompanyFacts",
|
"percentage_reached_col": "I",
|
||||||
"field": "TotalStaffCosts",
|
"max_points_col": "J"
|
||||||
"default": ""
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"sheet": 2,
|
"short_name": "3",
|
||||||
"cell": "C18",
|
"name": "Environment sustainability",
|
||||||
"type": "int",
|
"points_col": "K",
|
||||||
"struct": "CompanyFacts",
|
"percentage_reached_col": "M",
|
||||||
"field": "Profit",
|
"max_points_col": "N"
|
||||||
"default": ""
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"sheet": 2,
|
"short_name": "4",
|
||||||
"cell": "C19",
|
"name": "Transparency",
|
||||||
"type": "int",
|
"points_col": "O",
|
||||||
"struct": "CompanyFacts",
|
"percentage_reached_col": "Q",
|
||||||
"field": "FinancialCosts",
|
"max_points_col": "R"
|
||||||
"default": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"sheet": 2,
|
|
||||||
"cell": "C20",
|
|
||||||
"type": "int",
|
|
||||||
"struct": "CompanyFacts",
|
|
||||||
"field": "IncomeFromFinancialInvestments",
|
|
||||||
"default": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"sheet": 2,
|
|
||||||
"cell": "C22",
|
|
||||||
"type": "int",
|
|
||||||
"struct": "CompanyFacts",
|
|
||||||
"field": "AdditionsToFixedAssets",
|
|
||||||
"default": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"sheet": 2,
|
|
||||||
"cell": "C37",
|
|
||||||
"type": "int",
|
|
||||||
"struct": "CompanyFacts",
|
|
||||||
"field": "Turnover",
|
|
||||||
"default": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"sheet": 2,
|
|
||||||
"cell": "C21",
|
|
||||||
"type": "int",
|
|
||||||
"struct": "CompanyFacts",
|
|
||||||
"field": "TotalAssets",
|
|
||||||
"default": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"sheet": 2,
|
|
||||||
"cell": "C23",
|
|
||||||
"type": "int",
|
|
||||||
"struct": "CompanyFacts",
|
|
||||||
"field": "FinancialAssetsAndCashBalance",
|
|
||||||
"default": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"sheet": 2,
|
|
||||||
"cell": "C26",
|
|
||||||
"type": "int",
|
|
||||||
"struct": "CompanyFacts",
|
|
||||||
"field": "NumberOfEmployees",
|
|
||||||
"default": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"sheet": 2,
|
|
||||||
"cell": "C24",
|
|
||||||
"type": "bool",
|
|
||||||
"struct": "CompanyFacts",
|
|
||||||
"field": "HasCanteen",
|
|
||||||
"default": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"sheet": 2,
|
|
||||||
"cell": "C38",
|
|
||||||
"type": "bool",
|
|
||||||
"struct": "CompanyFacts",
|
|
||||||
"field": "IsB2B",
|
|
||||||
"default": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"sheet": 2,
|
|
||||||
"cell": "C33",
|
|
||||||
"type": "int",
|
|
||||||
"struct": "CompanyFacts",
|
|
||||||
"field": "AverageJourneyToWorkForStaffInKm",
|
|
||||||
"default": ""
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"areas": [
|
|
||||||
{
|
|
||||||
"sheet": 2,
|
|
||||||
"start_row": 10,
|
|
||||||
"end_row": 14,
|
|
||||||
"struct": "SupplyFraction",
|
|
||||||
"cols": [
|
|
||||||
{
|
|
||||||
"col": "B",
|
|
||||||
"field": "IndustryCode",
|
|
||||||
"type": "string",
|
|
||||||
"split": " ",
|
|
||||||
"default": "Please choose"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"col": "D",
|
|
||||||
"field": "CountryCode",
|
|
||||||
"type": "string",
|
|
||||||
"split": " ",
|
|
||||||
"default": "Please choose"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"col": "F",
|
|
||||||
"field": "Costs",
|
|
||||||
"type": "string",
|
|
||||||
"default": "0"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"sheet": 2,
|
|
||||||
"start_row": 30,
|
|
||||||
"end_row": 32,
|
|
||||||
"struct": "EmployeesFraction",
|
|
||||||
"cols": [
|
|
||||||
{
|
|
||||||
"col": "B",
|
|
||||||
"field": "CountryCode",
|
|
||||||
"type": "string",
|
|
||||||
"split": " ",
|
|
||||||
"default": "Please choose"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"col": "D",
|
|
||||||
"field": "Percentage",
|
|
||||||
"type": "float64",
|
|
||||||
"default": "0"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"sheet": 2,
|
|
||||||
"start_row": 41,
|
|
||||||
"end_row": 43,
|
|
||||||
"struct": "IndustrySector",
|
|
||||||
"cols": [
|
|
||||||
{
|
|
||||||
"col": "B",
|
|
||||||
"field": "IndustryCode",
|
|
||||||
"type": "string",
|
|
||||||
"split": " ",
|
|
||||||
"default": "Please choose"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"col": "C",
|
|
||||||
"field": "Description",
|
|
||||||
"type": "string",
|
|
||||||
"default": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"col": "D",
|
|
||||||
"field": "AmountOfTotalTurnover",
|
|
||||||
"type": "int",
|
|
||||||
"default": "0"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"rating": {
|
|
||||||
"sheet": 3,
|
|
||||||
"start_row": 9,
|
|
||||||
"end_row": 93,
|
|
||||||
"short_name_col": "B",
|
|
||||||
"cols": [
|
|
||||||
{
|
|
||||||
"col": "I",
|
|
||||||
"field": "Points",
|
|
||||||
"type": "int",
|
|
||||||
"default": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"col": "J",
|
|
||||||
"field": "MaxPoints",
|
|
||||||
"type": "float64",
|
|
||||||
"default": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"col": "C",
|
|
||||||
"field": "Name",
|
|
||||||
"type": "int",
|
|
||||||
"default": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"col": "H",
|
|
||||||
"field": "Estimations",
|
|
||||||
"type": "int",
|
|
||||||
"default": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"col": "D",
|
|
||||||
"field": "Weight",
|
|
||||||
"type": "float64",
|
|
||||||
"default": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"col": "N",
|
|
||||||
"field": "IsWeightSelectedByUser",
|
|
||||||
"type": "bool",
|
|
||||||
"default": ""
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@@ -3,6 +3,8 @@ package loader
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"math"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"git.ecogood.org/andreas.schroepfer/excelConverter/pkg/ecalc"
|
"git.ecogood.org/andreas.schroepfer/excelConverter/pkg/ecalc"
|
||||||
@@ -185,6 +187,39 @@ func XLSX(r io.Reader, conf *Conf) (*ecalc.Ecalc, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
eBalance.CompanyFacts.Rating.Topics = append(eBalance.CompanyFacts.Rating.Topics, topic)
|
eBalance.CompanyFacts.Rating.Topics = append(eBalance.CompanyFacts.Rating.Topics, topic)
|
||||||
|
|
||||||
|
for _, stakeh := range conf.Matrix.Stakeholders {
|
||||||
|
for _, val := range conf.Matrix.Values {
|
||||||
|
mTopic := ecalc.MatrixTopic{
|
||||||
|
ShortName: fmt.Sprintf("%s%s", stakeh.ShortName, val.ShortName),
|
||||||
|
}
|
||||||
|
readCell := func(col, field string) {
|
||||||
|
axis := fmt.Sprintf("%s%d", col, stakeh.Row)
|
||||||
|
cellValue, err := xFile.GetCellValue(
|
||||||
|
xFile.GetSheetName(conf.Matrix.Sheet),
|
||||||
|
axis,
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
errs = append(errs, err)
|
||||||
|
}
|
||||||
|
f, err := strconv.ParseFloat(cellValue, 64)
|
||||||
|
switch field {
|
||||||
|
case "Points":
|
||||||
|
f = math.Round(f)
|
||||||
|
mTopic.Points = int(f)
|
||||||
|
case "MaxPoints":
|
||||||
|
f = math.Round(f)
|
||||||
|
mTopic.MaxPoints = int(f)
|
||||||
|
case "PercentageReached":
|
||||||
|
mTopic.PercentageReached = int(f * 100)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
readCell(val.PointsCol, "Points")
|
||||||
|
readCell(val.MaxPointsCol, "MaxPoints")
|
||||||
|
readCell(val.PercentageReachedCol, "PercentageReached")
|
||||||
|
eBalance.Matrix.Topics = append(eBalance.Matrix.Topics, mTopic)
|
||||||
|
}
|
||||||
|
}
|
||||||
// TODO: error handling of errs
|
// TODO: error handling of errs
|
||||||
return eBalance, nil
|
return eBalance, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,4 +20,14 @@ func TestXLSX(t *testing.T) {
|
|||||||
is.Equal(got.CompanyFacts.TotalPurchaseFromSuppliers, 10000)
|
is.Equal(got.CompanyFacts.TotalPurchaseFromSuppliers, 10000)
|
||||||
is.Equal(got.CompanyFacts.SupplyFractions[0].Costs, 500)
|
is.Equal(got.CompanyFacts.SupplyFractions[0].Costs, 500)
|
||||||
is.Equal(got.CompanyFacts.SupplyFractions[0].CountryCode, "ALB")
|
is.Equal(got.CompanyFacts.SupplyFractions[0].CountryCode, "ALB")
|
||||||
|
is.Equal(got.CompanyFacts.FinancialCosts, 12)
|
||||||
|
is.Equal(got.CompanyFacts.EmployeesFractions[1].CountryCode, "AUT")
|
||||||
|
|
||||||
|
is.Equal(got.Matrix.Topics[0].ShortName, "A1")
|
||||||
|
is.Equal(got.Matrix.Topics[0].MaxPoints, 44)
|
||||||
|
is.Equal(got.Matrix.Topics[4].ShortName, "B1")
|
||||||
|
is.Equal(got.Matrix.Topics[4].Points, 27)
|
||||||
|
is.Equal(got.Matrix.Topics[4].MaxPoints, 33)
|
||||||
|
is.Equal(got.Matrix.Topics[4].PercentageReached, 80)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user