-2

I uses OpenTBS to produce IT invoices.

I have a problem on a block with a 'bmagnet' on 2 levels table: table + table: table. The problem is on '101' block.

When the 'lib' field is missing, the deleted block goes too far and it corruptes the file. You can not even open it in libreoffice.

the example is here: http://www.autocross-france.net/tmp/test_opentbs.zip

The php script 'test_opentbs.php' initializes the variables and processes the template 'test_template.odt'. The result is in 'test_result.odt'

O.Hot
  • 1
  • 1
  • 1
    Please include a [mcve]. Linking to a .zip file is not a good way to ensure that your example will be read. Read [ask] for more information on asking a good, answerable question. – JoSSte Feb 05 '19 at 08:36
  • OK, Explain me how I can put an ODT exemple file here. There are 3 files: The php script, the odt file template and the odt result. The problem is in the odt file template. – O.Hot Feb 05 '19 at 10:26
  • I admit that the .odt file will be a bit big. – JoSSte Feb 06 '19 at 13:50

2 Answers2

0

The problem is the table with block [101] is itself embedded into a parent table. The parent table is the one with text « VOTRE SOLDE ». So the frame of your template is like below :

|----------------|
| VOTRE SOLDE... |
|----------------|
|                |
| (1)|--------|  |
|    |[101...]|  |
|    |--------|  |
|                |
|----------------|

|--------|
|[SOM...]|
|--------| (2)

Point (1) is the begening of magnet table:table+table:table.

Point (2) is the end of magnet table:table+table:table.

So you can see than when TBS do the delete from (1) to (2) then the XML becomes unvalid.

The solution, of course, is to put table [101...] out of the parent table. Like this:

|----------------|
| VOTRE SOLDE... |
|----------------|
|                |
|----------------|

(1)|--------|
   |[101...]|
   |--------|

|--------|
|[SOM...]|
|--------| (2)
Skrol29
  • 5,402
  • 1
  • 20
  • 25
0

In fact, when I dont have any data in 101, I want to delete all the block between 1 and 2 (1) |----------------| | VOTRE SOLDE... | |----------------| | | | |--------| | | |[101...]| | | |--------| | | | |----------------| (2)

I want to delete the lib before the bloc 101.

I have tried with a bmagnet=text:p+text:p+(table:table) with this canvas: (1) <P>VOTRE SOLDE...</P> |--------| |[101...]| |--------| (2) and it runs correctly.

But in an other place in the template I have to use an extention of the first exemple with included tables at 4 levels: (1) |-------------------------------------------------------------------------------------| | Le detail par abonnements... | |-------------------------------------------------------------------------------------| | | | |-----------------------------------------------------------------------------| | | | Ligne 0606060606 Bloc 250 - bmagnet=table:table+table:table | | | |-----------------------------------------------------------------------------| | | | | | | | |---------------------------------------------------------------------| | | | | | Dans le forfait Bloc 250_sub1 | | | | | |---------------------------------------------------------------------| | | | | | | | | | | | |-------------------------------------------------------------| | | | | | | | Appels France Metropolitaine Bloc 250_sub1_sub1 | | | | | | | |-------------------------------------------------------------| | | | | | | | | | | | | | | | |-------------------------------------------------------| | | | | | | | | | 12/12/2019 | 10:10:10 | ... Bloc 250_sub1_sub1_sub1 | | | | | | | | | | 13/12/2019 | 02:10:10 | ... | | | | | | | | | |-------------------------------------------------------| | | | | | | | | | | | | | | | |-------------------------------------------------------------| | | | | | | | | | | | |---------------------------------------------------------------------| | | | | | | | |-----------------------------------------------------------------------------| | | | |-------------------------------------------------------------------------------------| (2) I want that all the tables between (1) and (2) are deleted if the data in bloc 250 is empty

It doesn't run correctly... or I haven't understood how it realy runs.

Do you have some other explanations?

O.Hot
  • 1
  • 1