Заменить в печатной форме Накладной символ # на № Есть решение

Добрый день. Как в плагине Накладная Торг-12 заменить символ # на № в номере накладной ?

И можно ли дату накладной автоматически выставлять текущей датой, а не датой заказа?

 

5 ответов

  • 1
    Михаил Волков 2 августа 2022 11:29 #

  • 1
    replicant 2 августа 2022 11:41 # Решение

    В плагине на вкладке шаблон заменить можно что угодно. Например в номере заказа заменить # на № можно так {$order.id_str|replace:'#':'№'}

    Для вывода текущей даты в формате ДД-ММ-ГГГГ используйте {$smarty.now|date_format:"%d-%m-%Y"}

  • 1
    Михаил Волков 2 августа 2022 11:47 #

    В каком месте поменять данные значения?

    Накладная от Вебасиста

    {*
    @param waOrder $order
    *}
    {$_section_id = uniqid("s-incoice-form-section")}
    <div class="s-form-section" id="{$_section_id}">
    <style type="text/css">{include file="./css/printform.css" inline}</style>
    <table cellpadding="0" cellspacing="0" border="0" width="100%">
    <tr>
    <td class=reportSmallFont align=right>Унифицированная форма №
    Торг-12<br>Утверждена Постановлением Госкомстата России
    <br>от 25.12.1998 г. за №132
    </td>
    </tr>
    <tr>
    <td> </td>
    </tr>
    </table>
    <table cellpadding="0" cellspacing="0" border="0" width="100%">
    <tr>
    <td valign=top width="90%">
    <table cellpadding="0" cellspacing="0" border="0" width="100%" class="mainTable">
    <tr>
    <td class=underlined align=center><b>
    {$settings.COMPANYNAME|default:"Продавец"|escape}, {if !empty($settings.INN)}{"ИНН `$settings.INN`"|escape}, {/if}{$settings.COMPANYADDRESS|default:"город, улица, дом"|escape}, (тел.:{$settings.COMPANYPHONE|default:"+7 495 1234567"|escape})</b>
    </td>
    </tr>
    <tr>
    <td class=underlined align=center><b>
    {"р/счет №`$settings.BANK_ACCOUNT_NUMBER` в `$settings.BANKNAME`, кор/счет `$settings.BANK_KOR_NUMBER`, БИК `$settings.BIK`"|escape}
    </b></td>
    </tr>
    <tr>
    <td class="reportSmallFont underlined cellComment" align="center" style="padding-top: 1mm; padding-bottom: 5mm">
    грузоотправитель, адрес, номер телефона, банковские реквизиты</td>
    </tr>
    <tr>
    <td class="reportSmallFont cellComment" align="center" style="padding-top: 1mm; padding-bottom: 2mm">
    структурное подразделение
    </td>
    </tr>
    </table>
    <table cellpadding="0" cellspacing="0" border="0" width="100%">
    <tr>
    <td class="reportSmallFont name_cell">Грузополучатель</td>
    <td width="100%" class="reportSmallFont underlined"><b class="inline_edit js-editable">
    {$company = $order->contact_company}
    {$company = ifempty($company,$order.shipping_address.name)}
    {$company = ifempty($company,$order.contact_name)}
    {if !empty($company)}
    {$company|escape}, {/if}
    {if !empty($order.shipping_address.region_name)}{$order.shipping_address.region_name|escape}, {/if}
    {if !empty($order.shipping_address.city)}{$order.shipping_address.city|escape}, {/if}
    {if !empty($order.shipping_address.zip)}{$order.shipping_address.zip|escape}, {/if}
    {if !empty($order.shipping_address.street)}{$order.shipping_address.street|escape}, {/if}
    {if $order->contact_phone}тел.: {$order->contact_phone|escape}{/if}
    </b></td>
    </tr>
    <tr>
    <td class="reportSmallFont name_cell">Поставщик</td>
    <td width="100%" class="reportSmallFont underlined"><b>
    {$settings.COMPANYNAME|default:"Продавец"|escape}, {if !empty($settings.INN)}{"ИНН `$settings.INN`"|escape}, {/if}
    {$settings.COMPANYADDRESS|default:"город, улица, дом"|escape}, (тел.:{$settings.COMPANYPHONE|default:"-"|escape})
    {", р/счет №`$settings.BANK_ACCOUNT_NUMBER` в `$settings.BANKNAME`, кор/счет №`$settings.BANK_KOR_NUMBER`, БИК `$settings.BIK`"|escape}</b></td>
    </tr>
    <tr>
    <td class="reportSmallFont name_cell">Плательщик</td>
    <td width="100%" class="reportSmallFont underlined">
    <b class="inline_edit js-editable">
    {$company = $order->contact_company}
    {$company = ifempty($company,$order.billing_address.name)}
    {$company = ifempty($company,$order.contact_name)}
    {if !empty($company)}
    {$company|escape}, {/if}
    {if !empty($order.billing_address.address)}
    {if !empty($order.billing_address.region_name)}{$order.billing_address.region_name|escape}, {/if}
    {if !empty($order.billing_address.city)}{$order.billing_address.city|escape}, {/if}
    {if !empty($order.billing_address.zip)}{$order.billing_address.zip|escape}, {/if}
    {if !empty($order.billing_address.street)}{$order.billing_address.street|escape}, {/if}
    {else}
    {$company = ifempty($company,$order.shipping_address.name)}
    {if !empty($order.shipping_address.region_name)}{$order.shipping_address.region_name|escape}, {/if}
    {if !empty($order.shipping_address.city)}{$order.shipping_address.city|escape}, {/if}
    {if !empty($order.shipping_address.zip)}{$order.shipping_address.zip|escape}, {/if}
    {if !empty($order.shipping_address.street)}{$order.shipping_address.street|escape}, {/if}
    {/if}
    {if $order->contact_phone}тел.: {$order->contact_phone|escape}{/if}
    </b></td>
    </tr>
    <tr>
    <td class="reportSmallFont name_cell">Основание</td>
    <td width="100%" class="reportSmallFont underlined"><b class="inline_edit js-editable">По заказу {$order.id_str|default:'№№№'} от {if $order.datetime}{$order.datetime|date_format:'d.m.Y'}{else}'%datetime%{/if} г.</b></td>
    </tr>
    <tr>
    <td colspan=2> </td>
    </table>
    <table cellpadding="0" cellspacing="0" border="0" width="100%">
    <tr>
    <td align=center>
    <table cellpadding="0" cellspacing="0" border="0">
    <tr>
    <td rowspan=2 class="reportSmallFont docNameLabels" valign=bottom>
    <b>ТОВАРНАЯ НАКЛАДНАЯ </b>
    </td>
    <td class="reportSmallFont docNameLabels b_top b_left b_right" align="center">
    Номер<br>документа
    </td>
    <td class="reportSmallFont docNameLabels b_top b_right" align="center">
    Дата<br>составления
    </td>
    </tr>
    <tr>
    <td
    class="reportSmallFont docNameLabels b_top b_left b_bottom b_right docNameValues"
    align=center>
    <b class="inline_edit js-editable">{$order.id_str|default:"№№№"}</b>
    </td>
    <td
    class="reportSmallFont docNameLabels b_top b_right b_bottom docNameValues"
    align=center>
    <b class="inline_edit js-editable">{$order.datetime|default:time()|date_format:'d.m.Y'}</b>
    </td>
    </tr>
    <tr>
    <td colspan=3 class=separatorCell> </td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    </td>
    <td valign=top align=right>
    <table cellpadding="0" cellspacing="0" border="0">
    <tr>
    <td colspan=2 class=reportSmallFont> </td>
    <td style="width: 20mm"
    class="item_cell b_left b_bottom b_top b_right reportSmallFont"
    align=center>Код</td>
    </tr>
    <tr>
    <td class="reportSmallFont name_cell nobr" colspan=2 align=right>Форма
    по ОКУД</td>
    <td style="width: 20mm"
    class="item_cell b_left b_bottom b_right reportSmallFont"
    align=center>0330212</td>
    </tr>
    <tr>
    <td class="reportSmallFont name_cell nobr" colspan=2 align=right>по
    ОКПО</td>
    <td style="width: 20mm"
    class="item_cell b_left b_bottom b_right reportSmallFont"
    align=center> </td>
    </tr>
    <tr>
    <td class="reportSmallFont name_cell nobr" colspan=2 align=right>Вид
    деятельности по ОКДП</td>
    <td style="width: 20mm"
    class="item_cell b_left b_bottom b_right reportSmallFont"
    align=center> </td>
    </tr>
    <tr>
    <td class="reportSmallFont name_cell nobr" colspan=2 align=right>по
    ОКПО</td>
    <td style="width: 20mm"
    class="item_cell b_left b_bottom b_right reportSmallFont"
    align=center> </td>
    </tr>
    <tr>
    <td class="reportSmallFont name_cell nobr" colspan=2 align=right>по
    ОКПО</td>
    <td style="width: 20mm"
    class="item_cell b_left b_bottom b_right reportSmallFont"
    align=center> </td>
    </tr>
    <tr>
    <td class="reportSmallFont"> </td>
    <td class="reportSmallFont name_cell b_bottom nobr" align=right>по
    ОКПО</td>
    <td style="width: 20mm"
    class="item_cell b_left b_bottom b_right reportSmallFont"
    align=center> </td>
    </tr>
    <tr>
    <td rowspan="2"> </td>
    <td style="width: 20mm"
    class="name_cell item_cell b_left b_bottom reportSmallFont"
    align=right>номер</td>
    <td style="width: 20mm"
    class="item_cell b_left b_bottom b_right reportSmallFont inline_edit js-editable"
    align=center>{$order.id_str|default:" "}</td>
    </tr>
    <tr>
    <td style="width: 20mm"
    class="name_cell item_cell b_left b_bottom reportSmallFont"
    align=right>дата</td>
    <td style="width: 20mm"
    class="item_cell b_left b_bottom b_right reportSmallFont inline_edit js-editable"
    align=center>{$order.datetime|default:time()|date_format:'d.m.Y'}</td>
    </tr>
    <tr>
    <td class="reportSmallFont name_cell nobr" rowspan="2" valign="top">Транспортная
    накладная</td>
    <td style="width: 20mm"
    class="name_cell item_cell b_left b_bottom reportSmallFont"
    align=right>номер</td>
    <td style="width: 20mm"
    class="item_cell b_left b_bottom b_right reportSmallFont"
    align=center> </td>
    </tr>
    <tr>
    <td style="width: 20mm"
    class="name_cell item_cell b_left b_bottom reportSmallFont"
    align=right>дата</td>
    <td style="width: 20mm"
    class="item_cell b_left b_bottom b_right reportSmallFont"
    align=center> </td>
    </tr>
    <tr>
    <td class="reportSmallFont name_cell nobr" colspan=2 align=right>Вид
    операции</td>
    <td style="width: 20mm"
    class="item_cell b_left b_bottom b_right reportSmallFont"
    align=center> </td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    <table width="100%" border="0" cellpadding=0 cellspacing=0
    class="mainTable">
    <tr>
    <td rowspan="2" class="b_top b_left"><b>№<br>
    п/п</b></td>
    <td colspan="2" class="b_top b_left b_bottom"><b>Товар</b></td>
    <td colspan="2" class="b_top b_left b_bottom"><b>Ед. изм.</b></td>
    <td rowspan="2" class="b_top b_left"><b>Вид<br>упа-<br>ков-<br>ки</b></td>
    <td colspan="2" class="b_top b_left b_bottom"><b>Количество</b></td>
    <td rowspan="2" class="b_top b_left"><b>Масса<br>брутто</b></td>
    <td rowspan="2" class="b_top b_left"><b>Количество<br>(масса<br>нетто)</b></td>
    <td rowspan="2" class="b_top b_left"><b>Цена, руб.<br>коп.</b></td>
    <td rowspan="2" class="b_top b_left"><b>Сумма без<br>учета НДС<br>руб. коп.</b></td>
    <td colspan="2" class="b_top b_left b_bottom"><b>НДС</b></td>
    <td rowspan="2" class="b_top b_left b_right"><b>Сумма с<br>учетом НДС<br>руб. коп.</b></td>
    </tr>
    <tr>
    <td class="b_left">наименование, характеристика,<br>сорт, артикул товара</td>
    <td class="b_left">Код</td>
    <td class="b_left">Наиме-<br>нование</td>
    <td class="b_left">код<br>по<br>ОКЕИ</td>
    <td class="b_left">в од-<br>ном<br>месте</td>
    <td class="b_left">мест,<br>штук</td>
    <td class="b_left">ставка, %</td>
    <td class="b_left">сумма руб.<br>коп.</td>
    </tr>
    <tr class=boldborders>
    <td class="b_left b_top b_bottom">1</td>
    <td class="b_left b_top b_bottom">2</td>
    <td class="b_left b_top b_bottom">3</td>
    <td class="b_left b_top b_bottom">4</td>
    <td class="b_left b_top b_bottom">5</td>
    <td class="b_left b_top b_bottom">6</td>
    <td class="b_left b_top b_bottom">7</td>
    <td class="b_left b_top b_bottom">8</td>
    <td class="b_left b_top b_bottom">9</td>
    <td class="b_left b_top b_bottom">10</td>
    <td class="b_left b_top b_bottom">11</td>
    <td class="b_left b_top b_bottom">12</td>
    <td class="b_left b_top b_bottom">13</td>
    <td class="b_left b_top b_bottom">14</td>
    <td class="b_left b_top b_bottom b_right">15</td>
    </tr>
    {$total_total = 0}
    {$total_tax = null}
    {$total_amount = 0}
    {foreach $items as $id => $item}
    {* For rate 0 there must be a total tax price *}
    {if !is_null($item.tax_percent) && is_null($total_tax)}
    {$total_tax = 0}
    {/if}
    {if !empty($item.tax_included) && !empty($item.tax)}
    {$total_tax=$total_tax + round($item.tax, 2)}
    {$item.total_without_tax = $item.total - round($item.tax, 2)}
    {$item.price_without_tax = $item.price - round($item.tax/$item.quantity, 2)}
    {else}
    {$item.total_without_tax = round($item.total, 2)}
    {$item.price_without_tax = round($item.price, 2)}
    {/if}
    {$total_amount = $total_amount + round($item.total, 2)}
    {$total_total = $total_total + round($item.total_without_tax, 2)}
    <tr class="js-product-line">
    <td class="b_left b_bottom">{$id+1}</td>
    <td class="b_left b_bottom leftAlign inline_edit js-editable">{$item.name|default:" "}{if $item.sku} ({$item.sku}){/if}</td>
    <td class="b_left b_bottom"> </td>
    <td class="b_left b_bottom">{$item.stock_unit|default:'шт.'|escape}</td>
    <td class="b_left b_bottom">{if !empty($item.stock_unit_code)}{$item.stock_unit_code}{else}796{/if}</td>
    <td class="b_left b_bottom"> </td>
    <td class="b_left b_bottom"> </td>
    <td class="b_left b_bottom rightAlign"> </td>
    <td class="b_left b_bottom"> </td>
    <td class="js-column-10 b_left b_bottom rightAlign">{$item.quantity}</td>
    <td class="js-column-11 b_left b_bottom rightAlign nobr">{$item.price_without_tax|wa_format_amount:$order.currency:'%2'}</td>
    <td class="js-column-12 b_left b_bottom rightAlign nobr">{$item.total_without_tax|default:0|wa_format_amount:$order.currency:'%2'}</td>
    <td class="js-column-13 b_left b_bottom">
    {if is_null($item.tax_percent)}
    Без НДС
    {else}
    {$item.tax_percent|string_format:"%d"}
    {/if}
    </td>
    <td class="js-column-14 b_left b_bottom rightAlign">
    {strip}
    <div class="inline_edit js-editable">
    {$_tax = 0}
    {if !is_null($item.tax_percent) && !empty($item.tax)}
    {$_tax = $item.tax}
    {/if}
    {$_tax|wa_format_amount:$order.currency:'%2'}
    </div>
    {/strip}
    </td>
    <td class="js-column-15 b_left b_bottom b_right rightAlign nobr">{$item.total|wa_format_amount:$order.currency:'%2'}</td>
    </tr>
    {/foreach}
    {$total_quantity = $order.total_quantity}
    <tr class="js-subtotal-line">
    <td colspan="7" align="right" class="rightAlign">Итого</td>
    <td class="b_left b_bottom">X</td>
    <td class="b_left b_bottom">X</td>
    <td class="js-column-10 b_left b_bottom rightAlign nobr">{$total_quantity|string_format:"%0.3f"}</td>
    <td class="js-column-11 b_left b_bottom">X</td>
    <td class="js-column-12 b_left b_bottom rightAlign nobr">{$total_total|wa_format_amount:$order.currency:'%2'}</td>
    <td class="js-column-13 b_left b_bottom">X</td>
    <td class="js-column-14 b_left b_bottom rightAlign nobr">
    {$_tax = 0}
    {if !empty($total_tax)}
    {$_tax = $total_tax}
    {/if}
    {$_tax|wa_format_amount:$order.currency:'%2'}
    </td>
    <td class="js-column-15 b_left b_bottom b_right rightAlign nobr">{$total_amount|wa_format_amount:$order.currency:'%2'}</td>
    </tr>
    <tr class="js-total-line totals">
    <td colspan="7" align="right" class="rightAlign normalFont ">Всего
    по накладной</td>
    <td class="b_left b_bottom"> </td>
    <td class="b_left b_bottom"> </td>
    <td class="js-column-10 b_left b_bottom rightAlign">{$total_quantity|string_format:"%0.3f"}</td>
    <td class="js-column-11 b_left b_bottom normalFont">X</td>
    <td class="js-column-12 b_left b_bottom rightAlign nobr">{$total_total|wa_format_amount:$order.currency:'%2'}</td>
    <td class="js-column-13 b_left b_bottom normalFont">X</td>
    <td class="js-column-14 b_left b_bottom rightAlign">
    {$_tax = 0}
    {if !empty($total_tax)}
    {$_tax = $total_tax}
    {/if}
    {$_tax|wa_format_amount:$order.currency:'%2'}
    </td>
    <td class="js-column-15 b_left b_bottom b_right rightAlign nobr">{$total_amount|wa_format_amount:$order.currency:'%2'}</td>
    </tr>
    </table>
    <table width="100%" border="0" cellpadding=0 cellspacing=0
    class="mainTable">
    <tr>
    <td class=separatorCell> </td>
    </tr>
    </table>
    <table width="100%" border="0" cellpadding=0 cellspacing=0
    class="mainTable">
    <tr>
    <td class="nobr">Товарная накладная имеет приложение на</td>
    <td style="width: 40%" class="underlined"> </td>
    <td class="nobr">и содержит</td>
    <td style="width: 40%" class=underlined title="{count($order.items)}"><b>{waCurrency::getIntInWords(count($order.items))}</b></td>
    <td class="nobr">порядковых номеров записей</td>
    </tr>
    <tr>
    <td> </td>
    <td> </td>
    <td> </td>
    <td class="reportSmallFont cellComment">прописью</td>
    <td> </td>
    </tr>
    </table>
    <table width="100%" border="0" cellpadding=0 cellspacing=0
    class="mainTable">
    <tr>
    <td class=separatorCell> </td>
    </tr>
    </table>
    <table width="100%" border="0" cellpadding=0 cellspacing=0
    class="mainTable">
    <tr>
    <td> </td>
    <td> </td>
    <td class="rightAlign">Масса груза (нетто)</td>
    <td class=underlined><b> </b></td>
    <td class="b_top b_left b_bottom b_right" style="width: 30mm"> </td>
    <td class="leftAlign" style="width: 20mm">кг</td>
    </tr>
    <tr>
    <td> </td>
    <td> </td>
    <td> </td>
    <td class=cellComment>прописью</td>
    <td> </td>
    <td> </td>
    </tr>
    <tr>
    <td style="width: 20mm" class="leftAlign nobr">Всего мест</td>
    <td style="width: 50%" class=underlined><b> </b></td>
    <td class="rightAlign">Масса груза (брутто)</td>
    <td class=underlined><b> </b></td>
    <td class="b_top b_left b_bottom b_right" style="width: 30mm"> </td>
    <td class="leftAlign" style="width: 20mm">кг</td>
    </tr>
    <tr>
    <td> </td>
    <td class=cellComment>прописью</td>
    <td> </td>
    <td class=cellComment>прописью</td>
    <td> </td>
    <td> </td>
    </tr>
    </table>
    <table width="100%" border="0" cellpadding=0 cellspacing=0
    class="mainTable">
    <tr>
    <td class=separatorCell> </td>
    </tr>
    </table>
    <table border=0 cellpadding=0 cellspacing=0 width="100%">
    <tr>
    <td width="50%">
    <table width="100%" border="0" cellpadding=0 cellspacing=0
    class="mainTable">
    <tr>
    <td class="nobr">Приложение (паспорта, сертификаты, и т.п.)</td>
    <td width="80%" class=underlined> </td>
    <td>листах</td>
    </tr>
    </table>
    <table width="100%" border="0" cellpadding=0 cellspacing=0
    class="mainTable">
    <tr>
    <td class=leftAlign>Всего отпущено на сумму</td>
    </tr>
    <tr>
    <td class="underlined leftAlign"><b>{waCurrency::format('%.W{n0} %.2{f0}', $total_amount, $order.currency, 'ru_RU')}, {if !empty($total_tax)}в т.ч. НДС{else}без налога (НДС){/if}</b></td>
    </tr>
    <tr>
    <td class=separatorCell> </td>
    </tr>
    </table>
    <table width="100%" border="0" cellpadding=0 cellspacing=0
    class="mainTable">
    <tr>
    <td class="leftAlign nobr">Отпуск разрешил</td>
    <td class=underlined style="width: 30%">Директор</td>
    <td> </td>
    <td class=underlined style="width: 30%"> </td>
    <td> </td>
    <td class=underlined><b>{$settings.CEO_NAME|escape|default:" "}</b></td>
    </tr>
    <tr>
    <td> </td>
    <td class=cellComment>должность</td>
    <td> </td>
    <td class=cellComment>подпись</td>
    <td> </td>
    <td class="cellComment nobr">расшифровка подписи</td>
    </tr>
    <tr>
    <td class=leftAlign> </td>
    <td class=underlined>Гл. Бухгалтер</td>
    <td> </td>
    <td class=underlined> </td>
    <td> </td>
    <td class=underlined><b>{$settings.BUH_NAME|escape|default:" "}</b></td>
    </tr>
    <tr>
    <td> </td>
    <td class=cellComment>должность</td>
    <td> </td>
    <td class=cellComment>подпись</td>
    <td> </td>
    <td class="cellComment nobr">расшифровка подписи</td>
    </tr>
    </table>
    <table border="0" cellpadding=0 cellspacing=0
    class="mainTable">
    <tr>
    <td width="90">М.П.</td>
    <td style="padding-left:100px;" class="inline_edit js-editable">{$order.datetime|default:time()|date_format:'d.m.Y'}</td>
    </tr>
    </table>
    </td>
    <td style="padding-left: 5px"> </td>
    <td width="50%" valign=top>
    <table width="100%" border="0" cellpadding=0 cellspacing=0
    class="mainTable">
    <tr>
    <td class="leftAlign nobr">По доверенности №</td>
    <td class=underlined style="width: 85%"> </td>
    </tr>
    <tr>
    <td class=separatorCell> </td>
    <td class=separatorCell> </td>
    </tr>
    </table>
    <table width="100%" border="0" cellpadding=0 cellspacing=0
    class="mainTable">
    <tr>
    <td class=leftAlign>Выданной</td>
    <td class=underlined style="width: 90%"> </td>
    </tr>
    <tr>
    <td> </td>
    <td class="cellComment nobr">кем, кому (организация,
    должность, фамилия, и.о.)</td>
    </tr>
    </table>
    <table width="100%" border="0" cellpadding=0 cellspacing=0
    class="mainTable">
    <tr>
    <td class="leftAlign nobr">Груз принял</td>
    <td class=underlined style="width: 90%"> </td>
    </tr>
    </table>
    <table width="100%" border="0" cellpadding=0 cellspacing=0
    class="mainTable">
    <tr>
    <td class=separatorCell> </td>
    <td class=separatorCell> </td>
    </tr>
    <tr>
    <td align=left class="nobr">Груз получил грузополучатель</td>
    <td class=underlined style="width: 90%"> </td>
    </tr>
    </table>
    <table border="0" cellpadding=0 cellspacing=0
    class="mainTable">
    <tr>
    <td colspan="2"> </td>
    </tr>
    <tr>
    <td width="90">М.П.</td>
    <td style="padding-left:100px;" class="inline_edit js-editable">{if !empty($order.paid_datetime)}{$order.paid_datetime|date_format:'d.m.Y'}{/if}</td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    <script>
    ( function($, printform) {
    var $wrapper = $("#{$_section_id}");
    $wrapper.on("edited", function(event, node) {
    calculate();
    });
    function calculate() {
    var col_12_sum = 0,
    col_14_sum = 0,
    col_15_sum = 0;
    $wrapper.find(".js-product-line").each( function() {
    var $line = $(this),
    $col_10 = $line.find(".js-column-10"),
    $col_11 = $line.find(".js-column-11"),
    $col_12 = $line.find(".js-column-12"),
    $col_13 = $line.find(".js-column-13"),
    $col_14 = $line.find(".js-column-14"),
    $col_15 = $line.find(".js-column-15");
    // static
    var col_10_value = printform.parseString($col_10.text()),
    col_15_value = printform.parseString($col_15.text());
    // editable
    var col_14_value = printform.parseString($col_14.text());
    // dependent
    var col_12_value = col_15_value - col_14_value;
    var col_11_value = col_12_value/col_10_value;
    var $col_14_text_w = $col_14.find(".js-editable");
    if (!$col_14_text_w.length) { $col_14_text_w = $col_14; }
    $col_14_text_w.text( printform.formatPrice(col_14_value) );
    $col_11.text( printform.formatPrice(col_11_value) );
    $col_12.text( printform.formatPrice(col_12_value) );
    $col_15.text( printform.formatPrice(col_15_value) );
    col_12_sum += parseFloat(col_12_value.toFixed(2));
    col_14_sum += col_14_value;
    col_15_sum += col_15_value;
    });
    $wrapper.find(".js-total-line, .js-subtotal-line").each( function() {
    var $line = $(this),
    $total_col_12 = $line.find(".js-column-12"),
    $total_col_14 = $line.find(".js-column-14"),
    $total_col_15 = $line.find(".js-column-15");
    $total_col_12.text( printform.formatPrice(col_12_sum) );
    $total_col_14.text( printform.formatPrice(col_14_sum) );
    $total_col_15.text( printform.formatPrice(col_15_sum) );
    });
    }
    })(jQuery, window.Printform);
    </script>
    </div>
    • +1
      replicant replicant 2 августа 2022 13:39 #

      Используйте для этого поиск в браузере (обычно клавиши Ctrl+F)

      И меняйте там, где это нужно или везде (3 места), на то, как было написано ранее.

Добавить ответ

Чтобы добавить комментарий, зарегистрируйтесь или войдите