Closed se7en-x230 closed 1 year ago
Some changes you made make it impossible to compile.
go version go1.20.5 linux/amd64 arch linux
Hey @se7en-x230, I'm not able to reproduce. Can you try the following:
go clean -modcache -cache
go install .
Thanks go clean -modcache -cache Did work
I use dmenu to collect the infos like --to --date --item ...
Fast, easy and the result looks good.
Thanks
Thanks, I will eventually add support for multiline From and To fields it will likely look something along the lines of:
invoice generate --from "Name<br>Address<br>Zip Code<br>City, State"
or
invoice generate --from "Name\nAddress\nZip Code\nCity, State"
You might also like gum
for collecting the infos:
I am trying to add common options to json. How do I add multiple items with different quantity/prices to the json?
@se7en-x230 you can do something like this in pdf.go
func writeNotes(pdf *gopdf.GoPdf, notes string) {
pdf.SetY(650)
_ = pdf.SetFont("Inter", "", 10)
pdf.SetTextColor(55, 55, 55)
_ = pdf.Cell(nil, "Notes")
pdf.Br(18)
_ = pdf.SetFont("Inter", "", 8)
pdf.SetTextColor(0, 0, 0)
notesArr := strings.Split(notes, "\\n")
for i := 0; i < len(notesArr); i++ {
_ = pdf.Cell(nil, notesArr[i])
pdf.Br(15)
}
pdf.Br(48)
}
SOLVED!
./pdf.go:103:14: undefined: strings
works fine
--from --to and --notes should have the possibility for multiple lines
I am trying to add common options to json. How do I add multiple items with different quantity/prices to the json?
@akyag You can do something like the following:
{
"items": ["Item 1", "Item 2", "Item 3"],
"rates": [1, 2, 3],
"quantities": [1, 2, 3]
}
invoice generate --import <file>.json
can the notes
section be multiline?
I'm trying to add wire info toit, and it gets all on a single line instead of multi-line.
I tried adding both <br/>
and \\n
and \n
but nothing seems to do the job
@piotryordanov I just made a PR to fix it, it's an issue with an extra escape character
@dvrd awesome! Please let me know when this gets merged
How would I include a address with several lines?
How could I add a currency? DONE I see the file and would add the currency + symbol but how would I compile it with the additional currency? Recompiled it with my currency added and set as default. All good.
Also --date "June 10, 2023" does not print the date on the invoice. Would it be possible to add the current date without typing it on the invoice? Something like --date current or similar even better set it in env?