]> git.plutz.net Git - invoices/commitdiff
change table width, accept manual line breaks
authorPaul Hänsch <paul@plutz.net>
Tue, 4 May 2021 18:22:12 +0000 (20:22 +0200)
committerPaul Hänsch <paul@plutz.net>
Tue, 4 May 2021 18:22:12 +0000 (20:22 +0200)
odtgen.sh

index 67232a9659cfcda9e465712ec51a9d6edde8634b..177065a9c9a0fd10f92cba31058aceacc51f1b98 100755 (executable)
--- a/odtgen.sh
+++ b/odtgen.sh
@@ -72,14 +72,17 @@ odt_content(){
              <style:table-properties style:width="6.7in" fo:margin-top="0in" fo:margin-bottom="0in" table:align="margins"/>
            </style:style>
            <style:style style:name="Table1.A" style:family="table-column">
-             <style:table-column-properties style:column-width="1.1in" style:rel-column-width="11000*"/>
+             <style:table-column-properties style:column-width="1.2in" style:rel-column-width="12000*"/>
            </style:style>
            <style:style style:name="Table1.B" style:family="table-column">
              <style:table-column-properties style:column-width="3.4in" style:rel-column-width="34000*"/>
            </style:style>
-           <style:style style:name="Table1.CD" style:family="table-column">
+           <style:style style:name="Table1.C" style:family="table-column">
              <style:table-column-properties style:column-width="1.1in" style:rel-column-width="11000*"/>
            </style:style>
+           <style:style style:name="Table1.D" style:family="table-column">
+             <style:table-column-properties style:column-width="1.0in" style:rel-column-width="10000*"/>
+           </style:style>
            <style:style style:name="Table1.1" style:family="table-cell">
              <style:table-cell-properties fo:padding="0.0201in" fo:border-left="none" fo:border-right="none" fo:border-top="none" fo:border-bottom="0.05pt solid #000000"/>
            </style:style>
@@ -92,6 +95,10 @@ odt_content(){
            <style:style style:name="P3" style:family="paragraph" style:parent-style-name="Standard">
              <style:text-properties style:font-name="DejaVu Sans" fo:font-size="10.5pt" style:font-size-asian="10.5pt" style:font-size-complex="10.5pt"/>
            </style:style>
+           <style:style style:name="P4" style:family="paragraph" style:parent-style-name="Standard">
+             <style:paragraph-properties fo:text-align="end" style:justify-single-word="false"/>
+             <style:text-properties style:font-name="DejaVu Sans" fo:font-size="10.5pt" style:font-size-asian="10.5pt" style:font-size-complex="10.5pt"/>
+           </style:style>
            <style:style style:name="P5" style:family="paragraph" style:parent-style-name="Standard">
              <style:paragraph-properties fo:text-align="end" style:justify-single-word="false"/>
              <style:text-properties fo:font-size="10.5pt" style:font-size-asian="10.5pt" style:font-size-complex="10.5pt"/>
@@ -152,8 +159,8 @@ odt_content(){
              <table:table table:name="Table1" table:style-name="Table1">
                <table:table-column table:style-name="Table1.A"/>
                <table:table-column table:style-name="Table1.B"/>
-               <table:table-column table:style-name="Table1.CD"/>
-               <table:table-column table:style-name="Table1.CD"/>
+               <table:table-column table:style-name="Table1.C"/>
+               <table:table-column table:style-name="Table1.D"/>
                <table:table-header-rows>
                  <table:table-row>
                    <table:table-cell table:style-name="Table1.1" office:value-type="string">
@@ -171,13 +178,13 @@ odt_content(){
                  </table:table-row>
                </table:table-header-rows>
                $(sed 1d "invoices/$id" |while read -r time work hours; do
-                   time="$(UNSTRING "${time#time=}")"
-                   work="$(UNSTRING "${work#work=}")"
+                   time="$(UNSTRING "${time#time=}" |sed 's;\r;<text:line-break/>;g')"
+                   work="$(UNSTRING "${work#work=}" |sed 's;\r;<text:line-break/>;g')"
                   hours="$(UNSTRING "${hours#hours=}")"
                  cat <<-TROW
                        <table:table-row>
                          <table:table-cell table:style-name="Table1.2" office:value-type="string">
-                           <text:p text:style-name="P3">${time}</text:p>
+                           <text:p text:style-name="P4">${time} </text:p>
                          </table:table-cell>
                          <table:table-cell table:style-name="Table1.2" office:value-type="string">
                            <text:p text:style-name="P3">${work}</text:p>