[cleanup] payment entry form view

This commit is contained in:
Rushabh Mehta 2016-07-11 16:07:06 +05:30
parent f366f4d915
commit 3ce24d64c2
11 changed files with 263 additions and 283 deletions

View File

@ -79,6 +79,7 @@ frappe.ui.form.on('Payment Entry', {
},
refresh: function(frm) {
erpnext.hide_company();
frm.events.hide_unhide_fields(frm);
frm.events.set_dynamic_labels(frm);
frm.events.show_general_ledger(frm);

View File

@ -9,7 +9,33 @@
"docstatus": 0,
"doctype": "DocType",
"document_type": "",
"editable_grid": 0,
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "type_of_payment",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Type of Payment",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 1,
@ -62,6 +88,60 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"depends_on": "eval:in_list([\"Receive\", \"Pay\"], doc.payment_type)",
"fieldname": "party_type",
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Party Type",
"length": 0,
"no_copy": 0,
"options": "Customer\nSupplier",
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"depends_on": "eval:in_list([\"Receive\", \"Pay\"], doc.payment_type) && doc.party_type",
"fieldname": "party",
"fieldtype": "Dynamic Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Party",
"length": 0,
"no_copy": 0,
"options": "party_type",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
@ -167,16 +247,15 @@
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"depends_on": "eval:in_list([\"Receive\", \"Pay\"], doc.payment_type)",
"fieldname": "party_section",
"collapsible": 1,
"fieldname": "payment_accounts_section",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "",
"label": "Accounts",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@ -190,84 +269,6 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"depends_on": "eval:in_list([\"Receive\", \"Pay\"], doc.payment_type)",
"fieldname": "party_type",
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Party Type",
"length": 0,
"no_copy": 0,
"options": "Customer\nSupplier",
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "column_break_10",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 1,
"collapsible": 0,
"depends_on": "eval:in_list([\"Receive\", \"Pay\"], doc.payment_type) && doc.party_type",
"fieldname": "party",
"fieldtype": "Dynamic Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Party",
"length": 0,
"no_copy": 0,
"options": "party_type",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
@ -294,31 +295,6 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "payment_accounts_section",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 1,
@ -518,7 +494,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "",
"label": "Amount",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@ -729,7 +705,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Reference Documents",
"label": "Reference",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@ -782,6 +758,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Writeoff",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@ -1040,7 +1017,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Transaction References",
"label": "Transaction ID",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@ -1372,7 +1349,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-07-04 15:00:53.731584",
"modified": "2016-07-11 06:25:00.248907",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Entry",

View File

@ -10,6 +10,10 @@ frappe.ui.form.on("Purchase Order", {
erpnext.queries.setup_queries(frm, "Warehouse", function() {
return erpnext.queries.warehouse(frm.doc);
});
frm.set_indicator_formatter('item_code',
function(doc) { return (doc.qty<=doc.received_qty) ? "green" : "orange" })
}
});

View File

@ -5,7 +5,7 @@ data = {
'fieldname': 'purchase_order',
'transactions': [
{
'label': _('Related Documents'),
'label': _('Related'),
'items': ['Purchase Receipt', 'Purchase Invoice', 'Stock Entry']
},
]

View File

@ -5,7 +5,7 @@ data = {
'fieldname': 'request_for_quotation',
'transactions': [
{
'label': _('Related Documents'),
'label': _('Related'),
'items': ['Supplier Quotation']
},
]

View File

@ -4,7 +4,7 @@ data = {
'fieldname': 'prevdoc_docname',
'transactions': [
{
'label': _('Related Documents'),
'label': _('Related'),
'items': ['Quotation']
},
]

View File

@ -147,6 +147,7 @@ def setup_item():
for i in items:
item = frappe.new_doc('Item')
item.update(i)
item.min_order_qty = random.randint(10, 30)
item.default_warehouse = frappe.get_all('Warehouse', filters={'warehouse_name': item.default_warehouse}, limit=1)[0].name
item.insert()

View File

@ -29,11 +29,8 @@ def make_purchase_receipt():
pr.posting_date = frappe.flags.current_date
pr.insert()
try:
pr.submit()
frappe.db.commit()
except (NegativeStockError):
frappe.db.rollback()
pr.submit()
frappe.db.commit()
def make_delivery_note():
# make purchase requests

View File

@ -14,8 +14,8 @@ $.extend(frappe.document_flow, {
"Purchase Invoice", "Payment Entry"]
},
"Buying": {
"Purchase Order": ["Supplier Quotation", "Purchase Order", "Purchase Receipt",
"Purchase Invoice", "Payment Entry"],
// "Purchase Order": ["Supplier Quotation", "Purchase Order", "Purchase Receipt",
// "Purchase Invoice", "Payment Entry"],
"Supplier Quotation": ["Supplier Quotation", "Purchase Order", "Purchase Receipt",
"Purchase Invoice", "Payment Entry"]
},

View File

@ -21,8 +21,8 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Warehouse Group",
"in_list_view": 1,
"label": "Check in (group)",
"length": 0,
"no_copy": 0,
"options": "Warehouse",
@ -48,7 +48,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Warehouse",
"label": "Request for",
"length": 0,
"no_copy": 0,
"options": "Warehouse",
@ -146,7 +146,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2016-07-11 03:19:14.851011",
"modified": "2016-07-11 03:59:06.870780",
"modified_by": "Administrator",
"module": "Stock",
"name": "Item Reorder",

View File

@ -5,7 +5,7 @@ data = {
'fieldname': 'material_request',
'transactions': [
{
'label': _('Related Documents'),
'label': _('Related'),
'items': ['Request for Quotation', 'Supplier Quotation', 'Purchase Order']
},
]