Merge branch 'develop'

This commit is contained in:
Nabin Hait 2016-08-18 16:13:15 +05:30
commit e30fadc661
9 changed files with 35 additions and 17 deletions

View File

@ -2,7 +2,7 @@
from __future__ import unicode_literals
import frappe
__version__ = '7.0.29'
__version__ = '7.0.30'
def get_default_company(user=None):
'''Get default company for user'''

View File

@ -5,7 +5,7 @@
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import flt, getdate, add_months, get_last_day
from frappe.utils import flt, getdate, add_months, get_last_day, fmt_money
from frappe.model.naming import make_autoname
from frappe.model.document import Document
@ -85,13 +85,17 @@ def compare_expense_with_budget(args, cost_center, budget_amount, action_for, ac
actual_expense = get_actual_expense(args, cost_center)
if actual_expense > budget_amount:
diff = actual_expense - budget_amount
currency = frappe.db.get_value('Company', frappe.db.get_value('Cost Center',
cost_center, 'company'), 'default_currency')
msg = _("{0} Budget for Account {1} against Cost Center {2} is {3}. It will exceed by {4}").format(_(action_for), args.account, cost_center, budget_amount, diff)
msg = _("{0} Budget for Account {1} against Cost Center {2} is {3}. It will exceed by {4}").format(_(action_for),
frappe.bold(args.account), frappe.bold(cost_center),
frappe.bold(fmt_money(budget_amount, currency=currency)), frappe.bold(fmt_money(diff, currency=currency)))
if action=="Stop":
frappe.throw(msg, BudgetError)
else:
frappe.msgprint(msg)
frappe.msgprint(msg, indicator='orange')
def get_accumulated_monthly_budget(monthly_distribution, posting_date, fiscal_year, annual_budget):
distribution = {}

View File

@ -32,8 +32,13 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
cur_frm.toggle_display('sb1', doc.is_group==0)
cur_frm.set_intro(intro_txt);
cur_frm.add_custom_button(__('Chart of Cost Centers'),
function() { frappe.set_route("Tree", "Cost Center"); }, __("View"))
if(!cur_frm.doc.__islocal) {
cur_frm.add_custom_button(__('Chart of Cost Centers'),
function() { frappe.set_route("Tree", "Cost Center"); });
cur_frm.add_custom_button(__('Budget'),
function() { frappe.set_route("List", "Budget", {'cost_center': cur_frm.doc.name}); });
}
}
cur_frm.cscript.parent_cost_center = function(doc, cdt, cdn) {

View File

@ -13,9 +13,9 @@ from erpnext.controllers.accounts_controller import get_taxes_and_charges
@frappe.whitelist()
def get_pos_data():
doc = frappe.new_doc('Sales Invoice')
doc.update_stock = 1;
doc.is_pos = 1;
pos_profile = get_pos_profile(doc.company) or {}
doc.update_stock = pos_profile.get('update_stock')
if pos_profile.get('name'):
pos_profile = frappe.get_doc('POS Profile', pos_profile.get('name'))
@ -105,7 +105,7 @@ def update_tax_table(doc):
def get_items(doc, pos_profile):
item_list = []
for item in frappe.get_all("Item", fields=["*"], filters={'disabled': 0, 'has_variants': 0}):
for item in frappe.get_all("Item", fields=["*"], filters={'disabled': 0, 'has_variants': 0, 'is_sales_item': 1}):
item_doc = frappe.get_doc('Item', item.name)
if item_doc.taxes:
item.taxes = json.dumps(dict(([d.tax_type, d.tax_rate] for d in

View File

@ -1,5 +1,5 @@
frappe.listview_settings['Employee'] = {
add_fields: ["status", "branch", "department", "designation"],
add_fields: ["status", "branch", "department", "designation","image"],
filters: [["status","=", "Active"]],
get_indicator: function(doc) {
var indicator = [__(doc.status), frappe.utils.guess_colour(doc.status), "status,=," + doc.status];

View File

@ -13,4 +13,5 @@ def execute():
ts.flags.ignore_validate = True
ts.flags.ignore_mandatory = True
ts.flags.ignore_validate_update_after_submit = True
ts.flags.ignore_links = True
ts.save()

View File

@ -191,6 +191,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"depends_on": "eval:doc.get_students_from==\"Program Enrollments\"",
"fieldname": "new_program",
"fieldtype": "Link",
"hidden": 0,
@ -217,6 +218,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"depends_on": "eval:doc.get_students_from==\"Program Enrollments\"",
"fieldname": "new_academic_year",
"fieldtype": "Link",
"hidden": 0,
@ -275,7 +277,7 @@
"issingle": 1,
"istable": 0,
"max_attachments": 0,
"modified": "2016-07-25 01:24:05.632746",
"modified": "2016-08-17 07:50:40.399492",
"modified_by": "Administrator",
"module": "Schools",
"name": "Program Enrollment Tool",

View File

@ -6,6 +6,7 @@ from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
from erpnext.schools.api import enroll_student
class ProgramEnrollmentTool(Document):
def get_students(self):
@ -29,11 +30,16 @@ class ProgramEnrollmentTool(Document):
def enroll_students(self):
for stud in self.students:
prog_enrollment = frappe.new_doc("Program Enrollment")
prog_enrollment.student = stud.student
prog_enrollment.student_name = stud.student_name
prog_enrollment.program = self.new_program
prog_enrollment.academic_year = self.new_academic_year
prog_enrollment.save()
if stud.student:
prog_enrollment = frappe.new_doc("Program Enrollment")
prog_enrollment.student = stud.student
prog_enrollment.student_name = stud.student_name
prog_enrollment.program = self.new_program
prog_enrollment.academic_year = self.new_academic_year
prog_enrollment.save()
elif stud.student_applicant:
prog_enrollment = enroll_student(stud.student_applicant)
prog_enrollment.academic_year = self.academic_year
prog_enrollment.save()
frappe.msgprint("Students have been enrolled.")

View File

@ -80,7 +80,7 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({
} else {
filters = {
'item_code': item.item_code,
'posting_date': me.frm.doc.posting_date || nowdate(),
'posting_date': me.frm.doc.posting_date || frappe.datetime.nowdate(),
}
if(item.warehouse) filters["warehouse"] = item.warehouse