X-Git-Url: http://git.plutz.net/?a=blobdiff_plain;f=odtgen.sh;h=abed2db2028e43f153aee28ec1d4f2701e8000f0;hb=HEAD;hp=e4c800a73e15f0c2d640b17570d887416ebedf0e;hpb=bcc010f29b2cb34783f30c068584e14647b5f813;p=invoices diff --git a/odtgen.sh b/odtgen.sh index e4c800a..abed2db 100755 --- a/odtgen.sh +++ b/odtgen.sh @@ -69,16 +69,19 @@ odt_content(){ - + - + - + - - + + + + + @@ -92,6 +95,10 @@ odt_content(){ + + + + @@ -127,16 +134,16 @@ odt_content(){ $(HTML "$sender" |sed -r 's;( \;)? \;;;g')$(HTML "$sender" |sed -r 's;( \;)? \;|(�?[Dd]\;)?�?[aA]\;|\r?$;;g') $(HTML "$client" |sed -r 's;( \;)? \;;;g')$(HTML "$client" |sed -r 's;( \;)? \;|(�?[Dd]\;)?�?[aA]\;|\r?$;;g') - Rechnung ${issuance} + Rechnung ${number} @@ -152,8 +159,8 @@ odt_content(){ - - + + @@ -171,22 +178,28 @@ odt_content(){ $(sed 1d "invoices/$id" |while read -r time work hours; do - time="$(UNSTRING "${time#time=}")" - work="$(UNSTRING "${work#work=}")" + time="$(UNSTRING "${time#time=}" |sed -r 's;( \;)? \;|(�?[Dd]\;)?�?[aA]\;|\r?$;;g')" + work="$(UNSTRING "${work#work=}" |sed -r 's;( \;)? \;|(�?[Dd]\;)?�?[aA]\;|\r?$;;g')" hours="$(UNSTRING "${hours#hours=}")" cat <<-TROW - ${time} + ${time} - ${item} + ${work} - ${hours} + $( awk "BEGIN { + if ( int(${hours}) == ${hours} ) + printf \"%i\", ${hours}; + else + printf \"%i:%i\", int(${hours}), int((${hours} - int(${hours})) * 60); + }" + ) - $((${hourly} * ${hours})) € + $(awk "BEGIN { printf \"%.2f\", ${hourly} * ${hours}; }" ) € TROW