Create invoice retrieving data from a CSV file












1














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?










share|improve this question









New contributor




teo-gamba is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • 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
















1














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?










share|improve this question









New contributor




teo-gamba is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • 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














1












1








1


1





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?










share|improve this question









New contributor




teo-gamba is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











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






share|improve this question









New contributor




teo-gamba is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




teo-gamba is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 9 mins ago









barbara beeton

69.1k9157367




69.1k9157367






New contributor




teo-gamba is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked yesterday









teo-gamba

63




63




New contributor




teo-gamba is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





teo-gamba is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






teo-gamba is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • 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










  • 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















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.










draft saved

draft discarded


















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.










draft saved

draft discarded


















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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

サソリ

広島県道265号伴広島線

Setup Asymptote in Texstudio