1b.app
Link copied -

Variable suborder in document, reading from array

Необходима консультация специалиста по работе системы?
У нас есть партнеры-интеграторы которые с радостью вам помогут! Посмотреть список партнеров
To create a shipping list, there are Customer Orders and their parent Shipment process.
In Shipments, in the document template Shipping list, the variable suborder needs to read the data on orders with a list of goods.
Previously, they answered the question https://crm-onebox.com/ru/support/documents/10051-remennaya-suborder-v-dokumente... and offered the following table creation code, here it is:
For example, I will provide a short example by which you can try to figure it out:
<table>
<head>
<tr>
<td>Order</td>
<td>Products</td>
</tr>
</thing>
<body>
{|foreach from=$subOrderArray item="suborder"|}
<tr>
<td>{|$suborder.name|}</td>
<td>
<table>
{|foreach from=$suborder.productArray item="product"|}
<tr>
<td>{|$product.name|} - {|$product.count|} - {|$product.price|}</td>
</tr>
{|/foreach|}
</table>
</td>
</tr>
{|/foreach|}
</tbody>
Original question is available on version: ru

Answers:

Now, how do you need https://more-moto.crm-onebox.com/admin/document/580/control/ ?
Tweaked the template a bit
27.08.2021, 16:20
Original comment available on version: ru

Thanks It works!
The last thing left is how to output only the first level subprocesses in an array through suborder? I tried what I could.
Now the second-level sub-processes Lead and Order to the supplier are included in the shipping list
Our process structure:
Shipment (assigned to parent)
Sales order (main process)
Lead (sub-process) Order to the supplier (sub-process)
Shipment process for verification: https://more-moto.crm-onebox.com/admin/customorder/dostavka/5600/edit/
27.08.2021, 23:30
Original comment available on version: ru

Try to set it up in the same way, only through the $subOrderArray1 array
31.08.2021, 16:24
Original comment available on version: ru

Thank you Now everything worked out for sure!
I'll leave the working template code here for posterity :)
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<table style="border-collapse: collapse; width: 100%; height: 46px;" border="1">
<head>
<tr style="height: 18px;">
<td style="height: 18px;">Order</td>
<td style="height: 18px;">Products</td>
</tr>
</thing>
<tbody>{|foreach from=$subOrderArray1 item="suborder"|}
<tr style="height: 28px;">
<td style="height: 28px;">{|$suborder.name|}</td>
<td style="height: 28px;">
<table>
<tbody>{|foreach from=$suborder.productArray item="product"|}
<tr>
<td>{|$product.name|} - {|$product.count|} - {|$product.price|}</td>
</tr>
{|/foreach|}</tbody>
</table>
</td>
</tr>
{|/foreach|}</tbody>
</table>
</body>
</html>
31.08.2021, 19:01
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