Create invoice retrieving data from a CSV file
I'm trying to assemble invoices based on CSV data.
I found this example: Combining invoice and datatool to create serial invoices
This is the code:
documentclass{letter}
usepackage{invoice}
usepackage{datatool}
address{ABC AG \
Nonamestreet 4 \
1100 Vienna \
bill@example.com}
date{16. September 2013}
begin{document}
DTLloaddb{bills}{billdata.csv}
DTLforeach{bills}
{firstname=firstname,
lastname=lastname,
caddress=customeraddress,
tariffname=tariffname,
service=service,
rateperunit=rateperunit,
unitcount=unitcount}
{
begin{letter}{firstname~ lastname \ caddress}
opening{Invoice} Dear customer lastname! This is your current bill.
begin{invoice}{Euro}{20}
ProjectTitle{tariffname}
Fee{Regular charge} {rateperunit} {unitcount}
end{invoice}
closing{Best regards, ABC AG}
end{letter}
clearpage
}
end{document}
And this is my CSV file:
firstname,lastname,customeraddress,tariffname,service,rateperunit,unitcount
John,Doe,Musterstraße 4,Tariff 1,Call,0.04,4
Andy,Ball,Molenstraat 178B,Tariff 2,Extra,56.78,5
However, looks like it cannot retrieve more data than just the first line of the CVS file.
What I'm trying to achieve is the following:
- have a database with all the entries (services, quantity, price, etc...) for a single invoice
What I'm doing wrong?
datatool invoice
New contributor
add a comment |
I'm trying to assemble invoices based on CSV data.
I found this example: Combining invoice and datatool to create serial invoices
This is the code:
documentclass{letter}
usepackage{invoice}
usepackage{datatool}
address{ABC AG \
Nonamestreet 4 \
1100 Vienna \
bill@example.com}
date{16. September 2013}
begin{document}
DTLloaddb{bills}{billdata.csv}
DTLforeach{bills}
{firstname=firstname,
lastname=lastname,
caddress=customeraddress,
tariffname=tariffname,
service=service,
rateperunit=rateperunit,
unitcount=unitcount}
{
begin{letter}{firstname~ lastname \ caddress}
opening{Invoice} Dear customer lastname! This is your current bill.
begin{invoice}{Euro}{20}
ProjectTitle{tariffname}
Fee{Regular charge} {rateperunit} {unitcount}
end{invoice}
closing{Best regards, ABC AG}
end{letter}
clearpage
}
end{document}
And this is my CSV file:
firstname,lastname,customeraddress,tariffname,service,rateperunit,unitcount
John,Doe,Musterstraße 4,Tariff 1,Call,0.04,4
Andy,Ball,Molenstraat 178B,Tariff 2,Extra,56.78,5
However, looks like it cannot retrieve more data than just the first line of the CVS file.
What I'm trying to achieve is the following:
- have a database with all the entries (services, quantity, price, etc...) for a single invoice
What I'm doing wrong?
datatool invoice
New contributor
Welcome to TeX.SX! Unfortunately we cannot answer what you are doing wrong without seeing a minimal compilable code example illustrating your issue. The answer in the linked post works for me (even for more rows).
– TeXnician
yesterday
I added the code both from the example I found and the CSV file I created
– teo-gamba
yesterday
This creates as expected two letters, one for John Doe and one for Andy Ball. If you want more entries for each customer you will need a different structure both in the csv and in the code.
– Ulrike Fischer
yesterday
Do you perhaps have a suggestion on how to change the CSV and the code? Thank you very much.
– teo-gamba
yesterday
add a comment |
I'm trying to assemble invoices based on CSV data.
I found this example: Combining invoice and datatool to create serial invoices
This is the code:
documentclass{letter}
usepackage{invoice}
usepackage{datatool}
address{ABC AG \
Nonamestreet 4 \
1100 Vienna \
bill@example.com}
date{16. September 2013}
begin{document}
DTLloaddb{bills}{billdata.csv}
DTLforeach{bills}
{firstname=firstname,
lastname=lastname,
caddress=customeraddress,
tariffname=tariffname,
service=service,
rateperunit=rateperunit,
unitcount=unitcount}
{
begin{letter}{firstname~ lastname \ caddress}
opening{Invoice} Dear customer lastname! This is your current bill.
begin{invoice}{Euro}{20}
ProjectTitle{tariffname}
Fee{Regular charge} {rateperunit} {unitcount}
end{invoice}
closing{Best regards, ABC AG}
end{letter}
clearpage
}
end{document}
And this is my CSV file:
firstname,lastname,customeraddress,tariffname,service,rateperunit,unitcount
John,Doe,Musterstraße 4,Tariff 1,Call,0.04,4
Andy,Ball,Molenstraat 178B,Tariff 2,Extra,56.78,5
However, looks like it cannot retrieve more data than just the first line of the CVS file.
What I'm trying to achieve is the following:
- have a database with all the entries (services, quantity, price, etc...) for a single invoice
What I'm doing wrong?
datatool invoice
New contributor
I'm trying to assemble invoices based on CSV data.
I found this example: Combining invoice and datatool to create serial invoices
This is the code:
documentclass{letter}
usepackage{invoice}
usepackage{datatool}
address{ABC AG \
Nonamestreet 4 \
1100 Vienna \
bill@example.com}
date{16. September 2013}
begin{document}
DTLloaddb{bills}{billdata.csv}
DTLforeach{bills}
{firstname=firstname,
lastname=lastname,
caddress=customeraddress,
tariffname=tariffname,
service=service,
rateperunit=rateperunit,
unitcount=unitcount}
{
begin{letter}{firstname~ lastname \ caddress}
opening{Invoice} Dear customer lastname! This is your current bill.
begin{invoice}{Euro}{20}
ProjectTitle{tariffname}
Fee{Regular charge} {rateperunit} {unitcount}
end{invoice}
closing{Best regards, ABC AG}
end{letter}
clearpage
}
end{document}
And this is my CSV file:
firstname,lastname,customeraddress,tariffname,service,rateperunit,unitcount
John,Doe,Musterstraße 4,Tariff 1,Call,0.04,4
Andy,Ball,Molenstraat 178B,Tariff 2,Extra,56.78,5
However, looks like it cannot retrieve more data than just the first line of the CVS file.
What I'm trying to achieve is the following:
- have a database with all the entries (services, quantity, price, etc...) for a single invoice
What I'm doing wrong?
datatool invoice
datatool invoice
New contributor
New contributor
edited 9 mins ago
barbara beeton
69.1k9157367
69.1k9157367
New contributor
asked yesterday
teo-gamba
63
63
New contributor
New contributor
Welcome to TeX.SX! Unfortunately we cannot answer what you are doing wrong without seeing a minimal compilable code example illustrating your issue. The answer in the linked post works for me (even for more rows).
– TeXnician
yesterday
I added the code both from the example I found and the CSV file I created
– teo-gamba
yesterday
This creates as expected two letters, one for John Doe and one for Andy Ball. If you want more entries for each customer you will need a different structure both in the csv and in the code.
– Ulrike Fischer
yesterday
Do you perhaps have a suggestion on how to change the CSV and the code? Thank you very much.
– teo-gamba
yesterday
add a comment |
Welcome to TeX.SX! Unfortunately we cannot answer what you are doing wrong without seeing a minimal compilable code example illustrating your issue. The answer in the linked post works for me (even for more rows).
– TeXnician
yesterday
I added the code both from the example I found and the CSV file I created
– teo-gamba
yesterday
This creates as expected two letters, one for John Doe and one for Andy Ball. If you want more entries for each customer you will need a different structure both in the csv and in the code.
– Ulrike Fischer
yesterday
Do you perhaps have a suggestion on how to change the CSV and the code? Thank you very much.
– teo-gamba
yesterday
Welcome to TeX.SX! Unfortunately we cannot answer what you are doing wrong without seeing a minimal compilable code example illustrating your issue. The answer in the linked post works for me (even for more rows).
– TeXnician
yesterday
Welcome to TeX.SX! Unfortunately we cannot answer what you are doing wrong without seeing a minimal compilable code example illustrating your issue. The answer in the linked post works for me (even for more rows).
– TeXnician
yesterday
I added the code both from the example I found and the CSV file I created
– teo-gamba
yesterday
I added the code both from the example I found and the CSV file I created
– teo-gamba
yesterday
This creates as expected two letters, one for John Doe and one for Andy Ball. If you want more entries for each customer you will need a different structure both in the csv and in the code.
– Ulrike Fischer
yesterday
This creates as expected two letters, one for John Doe and one for Andy Ball. If you want more entries for each customer you will need a different structure both in the csv and in the code.
– Ulrike Fischer
yesterday
Do you perhaps have a suggestion on how to change the CSV and the code? Thank you very much.
– teo-gamba
yesterday
Do you perhaps have a suggestion on how to change the CSV and the code? Thank you very much.
– teo-gamba
yesterday
add a comment |
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
teo-gamba is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f466899%2fcreate-invoice-retrieving-data-from-a-csv-file%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
teo-gamba is a new contributor. Be nice, and check out our Code of Conduct.
teo-gamba is a new contributor. Be nice, and check out our Code of Conduct.
teo-gamba is a new contributor. Be nice, and check out our Code of Conduct.
teo-gamba is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f466899%2fcreate-invoice-retrieving-data-from-a-csv-file%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Welcome to TeX.SX! Unfortunately we cannot answer what you are doing wrong without seeing a minimal compilable code example illustrating your issue. The answer in the linked post works for me (even for more rows).
– TeXnician
yesterday
I added the code both from the example I found and the CSV file I created
– teo-gamba
yesterday
This creates as expected two letters, one for John Doe and one for Andy Ball. If you want more entries for each customer you will need a different structure both in the csv and in the code.
– Ulrike Fischer
yesterday
Do you perhaps have a suggestion on how to change the CSV and the code? Thank you very much.
– teo-gamba
yesterday