Skip to content

Commit 4ee959a

Browse files
authored
Merge pull request #6 from Prims47/fix/issue-siret
fix(pdf): fix issue inside pdf siret
2 parents c720c92 + 2d2b161 commit 4ee959a

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

internal/pdf/generate_pdf.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,9 @@ func (b *BillingPDF) CreatePDF() {
149149
pdf.Cell(30, 0, b.Customer.Address.ZipCode+" "+b.Customer.Address.City+", "+b.Customer.Address.Country)
150150
pdf.Ln(6)
151151
pdf.Cell(110, 10, b.Account.Address.ZipCode+" "+b.Account.Address.City+", "+b.Account.Address.Country)
152-
pdf.Cell(30, 0, tr("N° SIRET: "+b.Account.Company.Siret))
152+
pdf.Cell(30, 0, tr("N° SIRET: "+b.Customer.Company.Siret))
153153
pdf.Ln(6)
154-
pdf.Cell(110, 10, tr("N° SIRET: "+b.Customer.Company.Siret))
154+
pdf.Cell(110, 10, tr("N° SIRET: "+b.Account.Company.Siret))
155155
pdf.Cell(20, 0, tr("N° TVA Intracommunautaire : "+b.Customer.Company.Tva))
156156
pdf.Ln(6)
157157
pdf.Cell(110, 10, tr("N° TVA Intracommunautaire : "+b.Account.Company.Tva))

internal/pdf/generate_pdf_test.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package pdf
33
import (
44
"bytes"
55
"io/ioutil"
6-
"os"
76
"testing"
87
"time"
98

@@ -73,8 +72,8 @@ func TestGeneratePDF(t *testing.T) {
7372
Country: "France",
7473
},
7574
Company: model.Company{
76-
Siret: "11212",
77-
Tva: "21212",
75+
Siret: "112127",
76+
Tva: "212127",
7877
Capital: 0,
7978
RCS: "",
8079
NAF: "",
@@ -146,8 +145,6 @@ func TestGeneratePDF(t *testing.T) {
146145
sut.CreatePDF()
147146

148147
if tc.expectedOutput != "" {
149-
os.Chtimes(tc.expectedOutput, datePDF, datePDF)
150-
151148
data, err := ioutil.ReadFile(tc.expectedOutput)
152149

153150
if err != nil {

tests/pdf/test_generated_billing.pdf

6 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)