cleanup for print format

This commit is contained in:
Rushabh Mehta 2014-07-18 16:39:31 +05:30 committed by Anand Doshi
parent 28804bfb62
commit f84c240d1c
6 changed files with 37 additions and 29 deletions

View File

@ -10,6 +10,12 @@ from frappe import _, throw
from erpnext.controllers.stock_controller import StockController from erpnext.controllers.stock_controller import StockController
class SellingController(StockController): class SellingController(StockController):
def __setup__(self):
self.table_print_templates = {
self.fname: "templates/print_formats/includes/item_grid.html",
"other_charges": "templates/print_formats/includes/taxes.html",
}
def validate(self): def validate(self):
super(SellingController, self).validate() super(SellingController, self).validate()
self.validate_max_discount() self.validate_max_discount()

View File

@ -18,10 +18,6 @@ class SalesOrder(SellingController):
person_tname = 'Target Detail' person_tname = 'Target Detail'
partner_tname = 'Partner Target Detail' partner_tname = 'Partner Target Detail'
territory_tname = 'Territory 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): def validate_mandatory(self):
# validate transaction date v/s delivery date # validate transaction date v/s delivery date

View File

@ -1,6 +1,6 @@
{ {
"autoname": "MREQD-.#####", "autoname": "MREQD-.#####",
"creation": "2013-02-22 01:28:02.000000", "creation": "2013-02-22 01:28:02",
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"fields": [ "fields": [
@ -28,6 +28,7 @@
"oldfieldname": "item_name", "oldfieldname": "item_name",
"oldfieldtype": "Data", "oldfieldtype": "Data",
"permlevel": 0, "permlevel": 0,
"print_hide": 1,
"print_width": "100px", "print_width": "100px",
"reqd": 0, "reqd": 0,
"search_index": 1, "search_index": 1,
@ -70,6 +71,21 @@
"reqd": 1, "reqd": 1,
"width": "80px" "width": "80px"
}, },
{
"fieldname": "uom",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Stock UOM",
"no_copy": 0,
"oldfieldname": "uom",
"oldfieldtype": "Link",
"options": "UOM",
"permlevel": 0,
"print_width": "70px",
"read_only": 1,
"reqd": 1,
"width": "70px"
},
{ {
"fieldname": "warehouse", "fieldname": "warehouse",
"fieldtype": "Link", "fieldtype": "Link",
@ -89,21 +105,6 @@
"fieldtype": "Column Break", "fieldtype": "Column Break",
"permlevel": 0 "permlevel": 0
}, },
{
"fieldname": "uom",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Stock UOM",
"no_copy": 0,
"oldfieldname": "uom",
"oldfieldtype": "Link",
"options": "UOM",
"permlevel": 0,
"print_width": "70px",
"read_only": 1,
"reqd": 1,
"width": "70px"
},
{ {
"allow_on_submit": 0, "allow_on_submit": 0,
"fieldname": "schedule_date", "fieldname": "schedule_date",
@ -216,6 +217,7 @@
"oldfieldname": "ordered_qty", "oldfieldname": "ordered_qty",
"oldfieldtype": "Currency", "oldfieldtype": "Currency",
"permlevel": 0, "permlevel": 0,
"print_hide": 1,
"read_only": 1 "read_only": 1
}, },
{ {
@ -232,9 +234,10 @@
], ],
"idx": 1, "idx": 1,
"istable": 1, "istable": 1,
"modified": "2014-02-03 11:35:26.000000", "modified": "2014-07-18 01:04:18.470761",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Stock", "module": "Stock",
"name": "Material Request Item", "name": "Material Request Item",
"owner": "Administrator" "owner": "Administrator",
"permissions": []
} }

View File

@ -4,10 +4,9 @@
<th>Sr</th> <th>Sr</th>
<th>Item Name</th> <th>Item Name</th>
<th>Description</th> <th>Description</th>
<th>Qty</th> <th class="text-right">Qty</th>
<th>UoM</th> <th class="text-right">Rate</th>
<th>Basic Rate</th> <th class="text-right">Amount</th>
<th>Amount</th>
</tr> </tr>
{%- for row in data -%} {%- for row in data -%}
<tr> <tr>
@ -20,8 +19,7 @@
</td> </td>
<td style="width: 37%;"> <td style="width: 37%;">
<div style="border: 0px;">{{ row.description }}</div></td> <div style="border: 0px;">{{ row.description }}</div></td>
<td style="width: 5%; text-align: right;">{{ row.qty }}</td> <td style="width: 10%; text-align: right;">{{ row.qty }} {{ row.stock_uom }}</td>
<td style="width: 5%;">{{ row.stock_uom }}</td>
<td style="width: 15%; text-align: right;">{{ <td style="width: 15%; text-align: right;">{{
format(row.rate, table_meta.get_field("rate"), doc) }}</td> 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> <td style="width: 15%; text-align: right;">{{ format(row.amount, table_meta.get_field("amount"), doc) }}</td>

View File

@ -14,6 +14,10 @@ class Note(Document):
import re import re
self.name = re.sub("[%'\"#*?`]", "", self.title.strip()) self.name = re.sub("[%'\"#*?`]", "", self.title.strip())
def before_print(self):
self.print_heading = self.name
self.sub_heading = ""
def get_permission_query_conditions(user): def get_permission_query_conditions(user):
if not user: user = frappe.session.user if not user: user = frappe.session.user

View File

@ -1,5 +1,6 @@
{ {
"db_name": "test_frappe", "db_name": "test_frappe",
"db_password": "test_frappe", "db_password": "test_frappe",
"mute_emails": 1 "mute_emails": 1,
"developer_mode": 1
} }