-
Notifications
You must be signed in to change notification settings - Fork 1
/
print_doc.html
107 lines (106 loc) · 3.73 KB
/
print_doc.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<h3>{{ doc.select_print_heading or _("Sales Order") }}</h3>
<div class="row">
<div class="col-md-3 text-right">{{ _("Customer Name") }}</div>
<div class="col-md-9">{{ doc.customer_name }}</div>
</div>
<div class="row">
<div class="col-md-3 text-right">Date</div>
<div class="col-md-9">{{ doc.get_formatted("invoice_date") }}</div>
</div>
<table class="table table-bordered">
<tbody>
<tr>
<!--<th>{{_("Sr")}}</th>-->
<th>{{_("Description")}}</th>
<th class="text-right">{{_("Quantity")}}</th>
{% if doc.print_prices %}
<th class="text-right">{{_("Rate")}}</th>
<th class="text-right">{{_("Amount")}}</th>
{% endif %}
</tr>
{%- for row in doc.items -%}
<tr>
<!--<td style="width: 3%;">{{ row.idx }}</td>-->
<td class="print-col-description">
{% if doc.print_items_images -%}
{% if not row.image -%}
{% set image = "https://www.syncros.com/_ui/responsive/common/images/no-product-image-available.png" %}
{% else %}
{% set image = row.image %}
{% endif %}
{% set base = "" %}
{% if(image[:4] != "http") %}
{% set base = frappe.utils.get_url() %}
{% endif %}
<img class="img-responsive print-item-image" src="{{ base }}{{ image }}" />
{%- endif %}
{% if row.item_code != row.item_name -%}
<b>{{ row.item_code}}</b>
{%- endif %}
{{ _(row.item_name) }}
<!--<div class="print-item-description">{{ _(row.description) }}</div>-->
<div class="print_item-discount">{{ _("Rate") }}: {{ row.get_formatted("price_list_rate", doc) }}</div>
{% if row.discount_percentage -%}
<div class="print_item-discount">{{ _("Discount") }}: {{ row.get_formatted("discount_percentage", doc) }}</div>
{%- endif %}
</td>
<td class="{% if doc.print_prices %}print-col-quantity{% else %}print-col-quantity-only{% endif %}">
{{ row.get_formatted("qty", doc) }}
<spam class="small">
{{ _(row.uom) or _(row.stock_uom) }}
{% if row.stock_uom != row.uom -%}
<br>{{ row.conversion_factor * row.qty }} {{ _(row.stock_uom) }}
{%- endif %}
</spam>
</td>
{% if doc.print_prices -%}
<td class="print-col-rate">{{
row.get_formatted("rate", doc) }}</td>
<td class="print-col-amount">{{
row.get_formatted("amount", doc) }}</td>
{%- endif %}
</tr>
{%- endfor -%}
</tbody>
</table>
<style>
.print-item-description{
font-size: 60%;
color:gray;
height: 2rem;
overflow: hidden;
text-overflow: ellipsis;
}
.print-item-image{
max-width:9rem !important;
max-height:10rem !important;
float:left;
margin-right: 1rem;
}
.print-col-description{
width: 50%;
}
.print-col-quantity{
width: 15%;
text-align: right;
}
.print-col-quantity-only{
width: 50%;
text-align: right;
}
.print-col-rate{
width: 12.5%;
text-align: right;
}
.print-col-discount{
width: 10%;
text-align: right;
}
.print-col-amount{
width: 12.5%;
text-align: right;
}
.small{
color:gray;
}
</style>