</table:table-row>
</table:table-header-rows>
$(sed 1d "invoices/$id" |while read -r time work hours; do
- time="$(UNSTRING "${time#time=}" |sed 's;\r;<text:line-break/>;g')"
- work="$(UNSTRING "${work#work=}" |sed 's;\r;<text:line-break/>;g')"
+ time="$(UNSTRING "${time#time=}" |sed -r 's;(
\;)?
\;|(�?[Dd]\;)?�?[aA]\;|\r?$;<text:line-break/>;g')"
+ work="$(UNSTRING "${work#work=}" |sed -r 's;(
\;)?
\;|(�?[Dd]\;)?�?[aA]\;|\r?$;<text:line-break/>;g')"
hours="$(UNSTRING "${hours#hours=}")"
cat <<-TROW
<table:table-row>
<text:p text:style-name="P3">${work}</text:p>
</table:table-cell>
<table:table-cell table:style-name="Table1.2" office:value-type="string">
- <text:p text:style-name="P5">${hours}</text:p>
+ <text:p text:style-name="P5">$( awk "BEGIN {
+ if ( int(${hours}) == ${hours} )
+ printf \"%i\", ${hours};
+ else
+ printf \"%i:%i\", int(${hours}), int((${hours} - int(${hours})) * 60);
+ }"
+ )</text:p>
</table:table-cell>
<table:table-cell table:style-name="Table1.2" office:value-type="string">
- <text:p text:style-name="P5">$((${hourly} * ${hours})) €</text:p>
+ <text:p text:style-name="P5">$(awk "BEGIN { printf \"%.2f\", ${hourly} * ${hours}; }" ) €</text:p>
</table:table-cell>
</table:table-row>
TROW