Merge branch 'develop'
This commit is contained in:
commit
f78ffd84b4
@ -1,2 +1,2 @@
|
||||
from __future__ import unicode_literals
|
||||
__version__ = '5.2.0'
|
||||
__version__ = '5.2.1'
|
||||
|
@ -173,7 +173,7 @@
|
||||
"icon": "icon-money",
|
||||
"idx": 1,
|
||||
"in_create": 0,
|
||||
"modified": "2015-06-14 20:57:55.471334",
|
||||
"modified": "2015-07-20 03:54:14.297995",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Account",
|
||||
@ -257,5 +257,5 @@
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"search_fields": "is_group"
|
||||
"search_fields": ""
|
||||
}
|
@ -109,7 +109,7 @@ erpnext.accounts.JournalEntry = frappe.ui.form.Controller.extend({
|
||||
|
||||
against_jv: function(doc, cdt, cdn) {
|
||||
var d = frappe.get_doc(cdt, cdn);
|
||||
if (d.against_jv && d.party && !flt(d.credit) && !flt(d.debit)) {
|
||||
if (d.against_jv && !flt(d.credit) && !flt(d.debit)) {
|
||||
this.get_outstanding('Journal Entry', d.against_jv, d);
|
||||
}
|
||||
},
|
||||
@ -119,7 +119,8 @@ erpnext.accounts.JournalEntry = frappe.ui.form.Controller.extend({
|
||||
var args = {
|
||||
"doctype": doctype,
|
||||
"docname": docname,
|
||||
"party": child.party
|
||||
"party": child.party,
|
||||
"account": child.account
|
||||
}
|
||||
|
||||
return this.frm.call({
|
||||
|
@ -545,12 +545,14 @@ def get_against_jv(doctype, txt, searchfield, start, page_len, filters):
|
||||
@frappe.whitelist()
|
||||
def get_outstanding(args):
|
||||
args = eval(args)
|
||||
if args.get("doctype") == "Journal Entry" and args.get("party"):
|
||||
if args.get("doctype") == "Journal Entry":
|
||||
condition = " and party=%(party)s" if args.get("party") else ""
|
||||
|
||||
against_jv_amount = frappe.db.sql("""
|
||||
select sum(ifnull(debit, 0)) - sum(ifnull(credit, 0))
|
||||
from `tabJournal Entry Account` where parent=%s and party=%s
|
||||
from `tabJournal Entry Account` where parent=%(docname)s and account=%(account)s {0}
|
||||
and ifnull(against_invoice, '')='' and ifnull(against_voucher, '')=''
|
||||
and ifnull(against_jv, '')=''""", (args['docname'], args['party']))
|
||||
and ifnull(against_jv, '')=''""".format(condition), args)
|
||||
|
||||
against_jv_amount = flt(against_jv_amount[0][0]) if against_jv_amount else 0
|
||||
if against_jv_amount > 0:
|
||||
|
@ -64,7 +64,7 @@ def get_data():
|
||||
"type": "module"
|
||||
},
|
||||
"Learn": {
|
||||
"color": "#7272FF",
|
||||
"color": "#FCB868",
|
||||
"force_show": True,
|
||||
"icon": "icon-facetime-video",
|
||||
"type": "module",
|
||||
|
@ -5,7 +5,7 @@ app_publisher = "Frappe Technologies Pvt. Ltd. and Contributors"
|
||||
app_description = "Open Source Enterprise Resource Planning for Small and Midsized Organizations"
|
||||
app_icon = "icon-th"
|
||||
app_color = "#e74c3c"
|
||||
app_version = "5.2.0"
|
||||
app_version = "5.2.1"
|
||||
|
||||
error_report_email = "support@erpnext.com"
|
||||
|
||||
|
@ -19,10 +19,13 @@ erpnext.hr.ExpenseClaimController = frappe.ui.form.Controller.extend({
|
||||
jv.company = cur_frm.doc.company;
|
||||
jv.remark = 'Payment against Expense Claim: ' + cur_frm.doc.name;
|
||||
jv.fiscal_year = cur_frm.doc.fiscal_year;
|
||||
|
||||
var d1 = frappe.model.add_child(jv, 'Journal Entry Account', 'accounts');
|
||||
d1.debit = cur_frm.doc.total_sanctioned_amount;
|
||||
d1.against_expense_claim = cur_frm.doc.name;
|
||||
var expense = cur_frm.doc.expenses || [];
|
||||
for(var i = 0; i < expense.length; i++){
|
||||
var d1 = frappe.model.add_child(jv, 'Journal Entry Account', 'accounts');
|
||||
d1.debit = expense[i].sanctioned_amount;
|
||||
d1.account = expense[i].default_account;
|
||||
d1.against_expense_claim = cur_frm.doc.name;
|
||||
}
|
||||
|
||||
// credit to bank
|
||||
var d1 = frappe.model.add_child(jv, 'Journal Entry Account', 'accounts');
|
||||
@ -43,6 +46,7 @@ $.extend(cur_frm.cscript, new erpnext.hr.ExpenseClaimController({frm: cur_frm}))
|
||||
|
||||
cur_frm.add_fetch('employee', 'company', 'company');
|
||||
cur_frm.add_fetch('employee','employee_name','employee_name');
|
||||
cur_frm.add_fetch('expense_type', 'default_account', 'default_account');
|
||||
|
||||
cur_frm.cscript.onload = function(doc,cdt,cdn) {
|
||||
if(!doc.approval_status)
|
||||
|
@ -34,6 +34,18 @@
|
||||
"reqd": 1,
|
||||
"width": "150px"
|
||||
},
|
||||
{
|
||||
"depends_on": "expense_type",
|
||||
"fieldname": "default_account",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 1,
|
||||
"label": "Default Account",
|
||||
"options": "Account",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"read_only": 1,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"fieldname": "section_break_4",
|
||||
"fieldtype": "Section Break",
|
||||
@ -93,7 +105,7 @@
|
||||
],
|
||||
"idx": 1,
|
||||
"istable": 1,
|
||||
"modified": "2015-04-08 06:18:47.539134",
|
||||
"modified": "2015-07-16 06:13:32.090048",
|
||||
"modified_by": "Administrator",
|
||||
"module": "HR",
|
||||
"name": "Expense Claim Detail",
|
||||
|
@ -17,6 +17,14 @@
|
||||
"reqd": 1,
|
||||
"search_index": 0
|
||||
},
|
||||
{
|
||||
"fieldname": "default_account",
|
||||
"fieldtype": "Link",
|
||||
"label": "Default Account",
|
||||
"options": "Account",
|
||||
"permlevel": 0,
|
||||
"precision": ""
|
||||
},
|
||||
{
|
||||
"fieldname": "description",
|
||||
"fieldtype": "Small Text",
|
||||
@ -29,7 +37,7 @@
|
||||
],
|
||||
"icon": "icon-flag",
|
||||
"idx": 1,
|
||||
"modified": "2015-07-13 04:46:38.897484",
|
||||
"modified": "2015-07-15 08:57:23.069980",
|
||||
"modified_by": "Administrator",
|
||||
"module": "HR",
|
||||
"name": "Expense Claim Type",
|
||||
@ -55,7 +63,7 @@
|
||||
"print": 0,
|
||||
"read": 1,
|
||||
"report": 0,
|
||||
"role": "Employee",
|
||||
"role": "All",
|
||||
"share": 0,
|
||||
"write": 0
|
||||
}
|
||||
|
@ -9,8 +9,13 @@ from frappe.desk.reportview import execute as runreport
|
||||
def execute(filters=None):
|
||||
if not filters: filters = {}
|
||||
|
||||
employee_filters = filters.get("company") and \
|
||||
[["Employee", "company", "=", filters.get("company")]] or None
|
||||
employee_filters = {
|
||||
"status": "Active"
|
||||
}
|
||||
|
||||
if filters.get("company"):
|
||||
filters["company"] = filters.company
|
||||
|
||||
employees = runreport(doctype="Employee", fields=["name", "employee_name", "department"],
|
||||
filters=employee_filters, limit_page_length=None)
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe.model import rename_field
|
||||
from frappe.model.utils.rename_field import rename_field
|
||||
from frappe.modules import scrub, get_doctype_module
|
||||
|
||||
rename_map = {
|
||||
|
@ -2,7 +2,7 @@
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
import frappe
|
||||
from frappe.model import rename_field
|
||||
from frappe.model.utils.rename_field import rename_field
|
||||
from frappe.modules import scrub, get_doctype_module
|
||||
|
||||
rename_map = {
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe.model import rename_field
|
||||
from frappe.model.utils.rename_field import rename_field
|
||||
from frappe.modules import scrub, get_doctype_module
|
||||
|
||||
selling_doctypes = ("Quotation", "Sales Order", "Delivery Note", "Sales Invoice")
|
||||
|
@ -5,42 +5,59 @@ frappe.provide("erpnext.projects");
|
||||
|
||||
cur_frm.add_fetch("project", "company", "company");
|
||||
|
||||
erpnext.projects.Task = frappe.ui.form.Controller.extend({
|
||||
setup: function() {
|
||||
this.frm.fields_dict.project.get_query = function() {
|
||||
frappe.ui.form.on("Task", {
|
||||
refresh: function(frm) {
|
||||
var doc = frm.doc;
|
||||
if(!doc.__islocal) {
|
||||
if(frappe.model.can_read("Time Log")) {
|
||||
frm.add_custom_button(__("Time Logs"), function() {
|
||||
frappe.route_options = {"project": doc.project, "task": doc.name}
|
||||
frappe.set_route("List", "Time Log");
|
||||
}, "icon-list", true);
|
||||
}
|
||||
if(frappe.model.can_read("Expense Claim")) {
|
||||
frm.add_custom_button(__("Expense Claims"), function() {
|
||||
frappe.route_options = {"project": doc.project, "task": doc.name}
|
||||
frappe.set_route("List", "Expense Claim");
|
||||
}, "icon-list", true);
|
||||
}
|
||||
|
||||
if(frm.perm[0].write) {
|
||||
if(frm.doc.status==="Open") {
|
||||
frm.add_custom_button("Close", function() {
|
||||
frm.set_value("status", "Closed");
|
||||
frm.save();
|
||||
});
|
||||
} else {
|
||||
frm.add_custom_button("Reopen", function() {
|
||||
frm.set_value("status", "Open");
|
||||
frm.save();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
setup: function(frm) {
|
||||
frm.fields_dict.project.get_query = function() {
|
||||
return {
|
||||
query: "erpnext.projects.doctype.task.task.get_project"
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
project: function() {
|
||||
if(this.frm.doc.project) {
|
||||
return get_server_fields('get_project_details', '','', this.frm.doc, this.frm.doc.doctype,
|
||||
this.frm.doc.name, 1);
|
||||
project: function(frm) {
|
||||
if(frm.doc.project) {
|
||||
return get_server_fields('get_project_details', '','', frm.doc, frm.doc.doctype,
|
||||
frm.doc.name, 1);
|
||||
}
|
||||
},
|
||||
|
||||
validate: function() {
|
||||
this.frm.doc.project && frappe.model.remove_from_locals("Project",
|
||||
this.frm.doc.project);
|
||||
validate: function(frm) {
|
||||
frm.doc.project && frappe.model.remove_from_locals("Project",
|
||||
frm.doc.project);
|
||||
},
|
||||
|
||||
refresh: function(doc) {
|
||||
if(!doc.__islocal) {
|
||||
cur_frm.add_custom_button(__("Time Logs"), function() {
|
||||
frappe.route_options = {"project": doc.project, "task": doc.name}
|
||||
frappe.set_route("List", "Time Log");
|
||||
}, "icon-list", true);
|
||||
cur_frm.add_custom_button(__("Expense Claims"), function() {
|
||||
frappe.route_options = {"project": doc.project, "task": doc.name}
|
||||
frappe.set_route("List", "Expense Claim");
|
||||
}, "icon-list", true);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
cur_frm.add_fetch('task', 'subject', 'subject');
|
||||
|
||||
cur_frm.cscript = new erpnext.projects.Task({frm: cur_frm});
|
||||
|
||||
|
@ -96,3 +96,8 @@
|
||||
.pos .tax-table {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.erpnext-icon {
|
||||
width: 24px;
|
||||
margin-right: 0px;
|
||||
margin-top: -3px;
|
||||
}
|
||||
|
46
erpnext/public/images/erp-icon.svg
Normal file
46
erpnext/public/images/erp-icon.svg
Normal file
@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 16.0.4, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="512px" height="512px" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve">
|
||||
<g>
|
||||
<path fill="#7574FF" d="M512,448c0,35.2-28.8,64-64,64H64c-35.2,0-64-28.8-64-64V64C0,28.8,28.8,0,64,0h384c35.2,0,64,28.8,64,64
|
||||
V448z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path fill="#FFFFFF" d="M150.483,371.684V141.15c0-15.167,9.534-25.133,23.833-25.133h162.5c13.866,0,20.8,6.933,20.8,18.633v2.6
|
||||
c0,12.133-6.934,18.633-20.8,18.633h-141.7v78.434h109.634c14.3,0,20.8,6.066,20.8,17.767v1.3c0,12.133-6.934,18.633-20.8,18.633
|
||||
H195.117v84.934h144.3c13.867,0,20.367,6.066,20.367,17.767v2.167c0,12.566-6.5,19.5-20.367,19.5h-165.1
|
||||
C160.017,396.384,150.483,386.851,150.483,371.684z"/>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.2 KiB |
@ -11,7 +11,7 @@ $(document).bind('toolbar_setup', function() {
|
||||
href="https://discuss.erpnext.com">Feedback</a></p>'
|
||||
|
||||
|
||||
$('.navbar-home').html('ERPNext');
|
||||
$('.navbar-home').html('<img class="erpnext-icon" src="/assets/erpnext/images/erp-icon.svg" />');
|
||||
|
||||
$('[data-link="docs"]').attr("href", "https://manual.erpnext.com")
|
||||
});
|
||||
|
@ -120,3 +120,8 @@
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.erpnext-icon {
|
||||
width: 24px;
|
||||
margin-right: 0px;
|
||||
margin-top: -3px;
|
||||
}
|
||||
|
@ -46,7 +46,6 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend(
|
||||
|
||||
} else {
|
||||
// un-stop
|
||||
cur_frm.dashboard.set_headline_alert(__("Stopped"), "alert-danger", "icon-stop");
|
||||
cur_frm.add_custom_button(__('Unstop'), cur_frm.cscript['Unstop Sales Order'], "icon-check");
|
||||
}
|
||||
}
|
||||
|
@ -57,7 +57,12 @@ class StockLedgerEntry(Document):
|
||||
def validate_item(self):
|
||||
item_det = frappe.db.sql("""select name, has_batch_no, docstatus,
|
||||
is_stock_item, has_variants, stock_uom
|
||||
from tabItem where name=%s""", self.item_code, as_dict=True)[0]
|
||||
from tabItem where name=%s""", self.item_code, as_dict=True)
|
||||
|
||||
if not item_det:
|
||||
frappe.throw(_("Item {0} not found").format(self.item_code))
|
||||
|
||||
item_det = item_det[0]
|
||||
|
||||
if item_det.is_stock_item != 'Yes':
|
||||
frappe.throw(_("Item {0} must be a stock Item").format(self.item_code))
|
||||
@ -97,7 +102,7 @@ class StockLedgerEntry(Document):
|
||||
def scrub_posting_time(self):
|
||||
if not self.posting_time or self.posting_time == '00:0':
|
||||
self.posting_time = '00:00'
|
||||
|
||||
|
||||
def validate_batch(self):
|
||||
if self.batch_no and self.voucher_type != "Stock Entry":
|
||||
expiry_date = frappe.db.get_value("Batch", self.batch_no, "expiry_date")
|
||||
|
Loading…
x
Reference in New Issue
Block a user