Dmitriy Shesterkin 9 years ago
parent a93a2a4e7a
commit a7d2afc48c
  1. 30
      src/commons/templatetags/my_tags.py
  2. 4
      templates/docs/nakladn/as_pdf.html

@ -85,22 +85,20 @@ def rub_in_parts(string, part):
result = string[:rub - 1] result = string[:rub - 1]
else: else:
result = string result = string
if len(result) >= 50:
words = result.split(' ') words = result.split(' ')
len_string = 0 len_string = 0
for word in words: for word in words:
if len_string >= 50: if len_string >= 50:
break break
len_string += len(word) + 1 len_string += len(word) + 1
first_part = result[:len_string] first_part = result[:len_string]
second_part = result[len_string:] second_part = result[len_string:]
if part == 1: if part == 1:
s = first_part s = first_part
elif part == 2: elif part == 2:
s = second_part s = second_part
else:
s = result
else: else:
s = result s = result
return s return s

@ -539,9 +539,9 @@
<td colspan="9" class="center font_7 top">(кем, кому (организация, должность, фамилия, и., о.))</td> <td colspan="9" class="center font_7 top">(кем, кому (организация, должность, фамилия, и., о.))</td>
</tr> </tr>
<tr> <tr>
<td colspan="5" class="bottom_border center"> {{ obj.sum_full_total_price|to_float|rubles|rub_in_parts:2 }} </td> <td colspan="5" class="bottom_border"> {{ obj.sum_full_total_price|to_float|rubles|rub_in_parts:2 }} </td>
<td>руб.</td> <td>руб.</td>
<td colspan="3" class="bottom_border">{{ obj.sum_full_total_price|to_float|only_kopeck }}</td> <td colspan="3" class="center bottom_border">{{ obj.sum_full_total_price|to_float|only_kopeck }}</td>
<td width="4%" class="right_border">коп.</td> <td width="4%" class="right_border">коп.</td>
{# правая половина #} {# правая половина #}
<td width="1%"></td> <td width="1%"></td>

Loading…
Cancel
Save