started sales order print format (new style)
diff --git a/erpnext/selling/doctype/sales_order/sales_order.json b/erpnext/selling/doctype/sales_order/sales_order.json
index bb52113..6cc7b83 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.json
+++ b/erpnext/selling/doctype/sales_order/sales_order.json
@@ -223,7 +223,8 @@
"fieldtype": "Section Break",
"label": "Currency and Price List",
"options": "icon-tag",
- "permlevel": 0
+ "permlevel": 0,
+ "print_hide": 1
},
{
"fieldname": "currency",
@@ -342,6 +343,16 @@
"permlevel": 0
},
{
+ "fieldname": "column_break_33a",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break_33",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
"fieldname": "net_total_export",
"fieldtype": "Currency",
"label": "Net Total",
@@ -350,11 +361,6 @@
"read_only": 1
},
{
- "fieldname": "column_break_33",
- "fieldtype": "Column Break",
- "permlevel": 0
- },
- {
"fieldname": "net_total",
"fieldtype": "Currency",
"label": "Net Total (Company Currency)",
@@ -470,50 +476,6 @@
"print_hide": 1
},
{
- "fieldname": "grand_total_export",
- "fieldtype": "Currency",
- "label": "Grand Total",
- "oldfieldname": "grand_total_export",
- "oldfieldtype": "Currency",
- "options": "currency",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
- "reqd": 0,
- "width": "150px"
- },
- {
- "fieldname": "rounded_total_export",
- "fieldtype": "Currency",
- "label": "Rounded Total",
- "oldfieldname": "rounded_total_export",
- "oldfieldtype": "Currency",
- "options": "currency",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
- "width": "150px"
- },
- {
- "fieldname": "in_words_export",
- "fieldtype": "Data",
- "label": "In Words",
- "oldfieldname": "in_words_export",
- "oldfieldtype": "Data",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
- "width": "200px"
- },
- {
- "fieldname": "column_break3",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "permlevel": 0,
- "print_hide": 1,
- "width": "50%"
- },
- {
"fieldname": "grand_total",
"fieldtype": "Currency",
"label": "Grand Total (Company Currency)",
@@ -551,6 +513,50 @@
"width": "200px"
},
{
+ "fieldname": "column_break3",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 1,
+ "width": "50%"
+ },
+ {
+ "fieldname": "grand_total_export",
+ "fieldtype": "Currency",
+ "label": "Grand Total",
+ "oldfieldname": "grand_total_export",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1,
+ "reqd": 0,
+ "width": "150px"
+ },
+ {
+ "fieldname": "rounded_total_export",
+ "fieldtype": "Currency",
+ "label": "Rounded Total",
+ "oldfieldname": "rounded_total_export",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "in_words_export",
+ "fieldtype": "Data",
+ "label": "In Words",
+ "oldfieldname": "in_words_export",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1,
+ "width": "200px"
+ },
+ {
"fieldname": "terms_section_break",
"fieldtype": "Section Break",
"label": "Terms and Conditions",
@@ -883,7 +889,7 @@
"idx": 1,
"is_submittable": 1,
"issingle": 0,
- "modified": "2014-07-10 02:43:45.504009",
+ "modified": "2014-07-16 16:32:16.459587",
"modified_by": "Administrator",
"module": "Selling",
"name": "Sales Order",
diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py
index e0a7a1d..9a26404 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.py
+++ b/erpnext/selling/doctype/sales_order/sales_order.py
@@ -18,6 +18,10 @@
person_tname = 'Target Detail'
partner_tname = 'Partner Target Detail'
territory_tname = 'Territory Target Detail'
+ table_print_templates = {
+ "sales_order_details": "templates/print_formats/includes/item_grid.html",
+ "other_charges": "templates/print_formats/includes/taxes.html",
+ }
def validate_mandatory(self):
# validate transaction date v/s delivery date
diff --git a/erpnext/templates/print_formats/includes/item_grid.html b/erpnext/templates/print_formats/includes/item_grid.html
new file mode 100644
index 0000000..2ca4289
--- /dev/null
+++ b/erpnext/templates/print_formats/includes/item_grid.html
@@ -0,0 +1,31 @@
+<table class="table table-bordered">
+ <tbody>
+ <tr>
+ <th>Sr</th>
+ <th>Item Name</th>
+ <th>Description</th>
+ <th>Qty</th>
+ <th>UoM</th>
+ <th>Basic Rate</th>
+ <th>Amount</th>
+ </tr>
+ {%- for row in data -%}
+ <tr>
+ <td style="width: 3%;">{{ row.idx }}</td>
+ <td style="width: 20%;">
+ {{ row.item_name }}
+ {% if row.item_code != row.item_name -%}
+ <br>Item Code: {{ row.item_code}}
+ {%- endif %}
+ </td>
+ <td style="width: 37%;">
+ <div style="border: 0px;">{{ row.description }}</div></td>
+ <td style="width: 5%; text-align: right;">{{ row.qty }}</td>
+ <td style="width: 5%;">{{ row.stock_uom }}</td>
+ <td style="width: 15%; text-align: right;">{{
+ format(row.rate, table_meta.get_field("rate"), doc) }}</td>
+ <td style="width: 15%; text-align: right;">{{ format(row.amount, table_meta.get_field("amount"), doc) }}</td>
+ </tr>
+ {%- endfor -%}
+ </tbody>
+</table>
diff --git a/erpnext/templates/print_formats/includes/taxes.html b/erpnext/templates/print_formats/includes/taxes.html
new file mode 100644
index 0000000..e23b49c
--- /dev/null
+++ b/erpnext/templates/print_formats/includes/taxes.html
@@ -0,0 +1,17 @@
+<div class="row">
+ <div class="col-md-6"></div>
+ <div class="col-md-6">
+ {%- for charge in data -%}
+ {%- if not charge.included_in_print_rate -%}
+ <div class="row">
+ <div class="col-md-4 text-right">
+ <label>{{ charge.description }}</label></div>
+ <div class="col-md-8">
+ {{ format(charge.tax_amount / doc.conversion_rate,
+ table_meta.get_field("tax_amount"), doc) }}
+ </div>
+ </div>
+ {%- endif -%}
+ {%- endfor -%}
+ </div>
+</div>