1b.app
Link copied -

2015614073 - Refinement of the variable quantity of goods in the order

In Changelog 31.08-06.09
Improvement indicated: The orderProductsCount variable has been improved - counts the number of product positions in the process, and depending on this variable, substitutes a page break in the document
What exactly is meant by "depending on this variable substitutes a page break in the document" and how to apply it.
Thanks
Original question is available on version: ru

Answers:

In the document template, you can write
{|if $orderProductsCount > 10|}
<p style="page-break-after: always; ">Table on next page if products > 10</p>
{|else|}
<p>Table on the same page</p>
{|/if|}
TABLE
those. depending on the number of process products, you can adjust the page breaks in the document. Previously, you could do it anyway, but there was simply no variable with the number of products in the process. Now there is.
10.09.2020, 11:41
Original comment available on version: ru


Bodyako Dmitry Employee wrote:
In the document template, you can write {|if $orderProductsCount > 10|}<p style="page-break-after: always; ">Table on the next page if the number of products > 10</p>{|else|}< p>Table on the same page</p>{|/if|}TABLEi.e. depending on the number of process products, you can adjust the page breaks in the document. Previously, you could do it anyway, but there was simply no variable with the number of products in the process. Now there is.

Thank you.
I'll clarify that for sure))
Previously, in the template, in the place where I suggested a page break, I wrote <p style="page-break-after: always;"></p>
then now I can specify the orderProductsCount change and if I have, for example, 11 products, and I specify {|if $orderProductsCount > 10|}<p style="page-break-after: always; ">Table on the next page if qty products > 10</p>{|else|}<p> then on one page I will have a table with 10 products, and the 11th position will go to the second page.
Did I understand correctly?
10.09.2020, 11:47
Original comment available on version: ru

No, not 1 product will be transferred, but the entire table. Those. anything written after <p style="page-break-after: always; ">XXX</p> will wrap to the next page
10.09.2020, 11:50
Original comment available on version: ru


Bodyako Dmitry Employee wrote:
No, not 1 product will be transferred, but the entire table. Those. anything written after <p style="page-break-after: always; ">XXX</p> will wrap to the next page

Thanks
10.09.2020, 11:53
Original comment available on version: ru


Bodyako Dmitry Employee wrote:
{|if $orderProductsCount > 10|}
<p style="page-break-after: always; ">Table on next page if products > 10</p>
{|else|}
<p>Table on the same page</p>
{|/if|}

is it possible to write a similar condition so that when the number of goods in a row is more than 1, the cell is painted black?
10.09.2020, 12:15
Original comment available on version: ru

The quantity of goods in the line is determined by the variable quantity of the product of the process.
You can write something like
<span {|if $variable from which to set color > 1|}style="background-color: black"{|/if|}>YYY</span>
and there already to prescribe different conditions to a variable. and change styles depending on that. There are a lot of opportunities out there.
10.09.2020, 12:22
Original comment available on version: ru

{|if $row:product_count > 1|}
<p style="font-size: 30px;">{row:product_count}</p>
{|/if|}
like this is possible?
Now there is an error while generating the document
10.09.2020, 12:26
Original comment available on version: ru

{| and |} try to change to just { }
10.09.2020, 12:32
Original comment available on version: ru

The problem is with the row:product_count variable, only it can display the number of products in the table. The condition does not work with it - HTTP ERROR 500
Variables {productsum}{countOrderProducts} works, but they display the total number of all products.
10.09.2020, 14:13
Original comment available on version: ru

means by row: you can’t prescribe such conditions or you need to contrive. Ask a separate question, I'll see what can be done there.
10.09.2020, 14:31
Original comment available on version: ru

Please join the conversation. If you have something to say - please write a comment. You will need a mobile phone and an SMS code for identification to enter. Log in and comment