Merge branch 'develop' into payment_reconciliation_enhancements_for_dr_or_cr_and_gain_or_loss
This commit is contained in:
commit
af4f7b4ea1
@ -5,6 +5,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
|
from frappe import _
|
||||||
|
|
||||||
class AccountingPeriod(Document):
|
class AccountingPeriod(Document):
|
||||||
def validate(self):
|
def validate(self):
|
||||||
@ -33,7 +34,7 @@ class AccountingPeriod(Document):
|
|||||||
}, as_dict=True)
|
}, as_dict=True)
|
||||||
|
|
||||||
if len(existing_accounting_period) > 0:
|
if len(existing_accounting_period) > 0:
|
||||||
frappe.throw("Accounting Period overlaps with {0}".format(existing_accounting_period[0].get("name")))
|
frappe.throw(_("Accounting Period overlaps with {0}".format(existing_accounting_period[0].get("name"))))
|
||||||
|
|
||||||
def get_doctypes_for_closing(self):
|
def get_doctypes_for_closing(self):
|
||||||
docs_for_closing = []
|
docs_for_closing = []
|
||||||
|
@ -48,7 +48,7 @@ class BankStatementTransactionEntry(Document):
|
|||||||
|
|
||||||
def get_statement_headers(self):
|
def get_statement_headers(self):
|
||||||
if not self.bank_settings:
|
if not self.bank_settings:
|
||||||
frappe.throw("Bank Data mapper doesn't exist")
|
frappe.throw(_("Bank Data mapper doesn't exist"))
|
||||||
mapper_doc = frappe.get_doc("Bank Statement Settings", self.bank_settings)
|
mapper_doc = frappe.get_doc("Bank Statement Settings", self.bank_settings)
|
||||||
headers = {entry.mapped_header:entry.stmt_header for entry in mapper_doc.header_items}
|
headers = {entry.mapped_header:entry.stmt_header for entry in mapper_doc.header_items}
|
||||||
return headers
|
return headers
|
||||||
@ -57,7 +57,7 @@ class BankStatementTransactionEntry(Document):
|
|||||||
if self.bank_statement is None: return
|
if self.bank_statement is None: return
|
||||||
filename = self.bank_statement.split("/")[-1]
|
filename = self.bank_statement.split("/")[-1]
|
||||||
if (len(self.new_transaction_items + self.reconciled_transaction_items) > 0):
|
if (len(self.new_transaction_items + self.reconciled_transaction_items) > 0):
|
||||||
frappe.throw("Transactions already retreived from the statement")
|
frappe.throw(_("Transactions already retreived from the statement"))
|
||||||
|
|
||||||
date_format = frappe.get_value("Bank Statement Settings", self.bank_settings, "date_format")
|
date_format = frappe.get_value("Bank Statement Settings", self.bank_settings, "date_format")
|
||||||
if (date_format is None):
|
if (date_format is None):
|
||||||
@ -314,7 +314,7 @@ class BankStatementTransactionEntry(Document):
|
|||||||
try:
|
try:
|
||||||
reconcile_against_document(lst)
|
reconcile_against_document(lst)
|
||||||
except:
|
except:
|
||||||
frappe.throw("Exception occurred while reconciling {0}".format(payment.reference_name))
|
frappe.throw(_("Exception occurred while reconciling {0}".format(payment.reference_name)))
|
||||||
|
|
||||||
def submit_payment_entries(self):
|
def submit_payment_entries(self):
|
||||||
for payment in self.new_transaction_items:
|
for payment in self.new_transaction_items:
|
||||||
@ -414,7 +414,7 @@ def get_transaction_entries(filename, headers):
|
|||||||
elif (filename.lower().endswith("xls")):
|
elif (filename.lower().endswith("xls")):
|
||||||
rows = get_rows_from_xls_file(filename)
|
rows = get_rows_from_xls_file(filename)
|
||||||
else:
|
else:
|
||||||
frappe.throw("Only .csv and .xlsx files are supported currently")
|
frappe.throw(_("Only .csv and .xlsx files are supported currently"))
|
||||||
|
|
||||||
stmt_headers = headers.values()
|
stmt_headers = headers.values()
|
||||||
for row in rows:
|
for row in rows:
|
||||||
|
@ -157,7 +157,7 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
|
|||||||
can_change_release_date: function(date) {
|
can_change_release_date: function(date) {
|
||||||
const diff = frappe.datetime.get_diff(date, frappe.datetime.nowdate());
|
const diff = frappe.datetime.get_diff(date, frappe.datetime.nowdate());
|
||||||
if (diff < 0) {
|
if (diff < 0) {
|
||||||
frappe.throw('New release date should be in the future');
|
frappe.throw(__('New release date should be in the future'));
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return true;
|
return true;
|
||||||
|
@ -105,7 +105,7 @@ class PurchaseInvoice(BuyingController):
|
|||||||
|
|
||||||
def validate_release_date(self):
|
def validate_release_date(self):
|
||||||
if self.release_date and getdate(nowdate()) >= getdate(self.release_date):
|
if self.release_date and getdate(nowdate()) >= getdate(self.release_date):
|
||||||
frappe.msgprint('Release date must be in the future', raise_exception=True)
|
frappe.throw(_('Release date must be in the future'))
|
||||||
|
|
||||||
def validate_cash(self):
|
def validate_cash(self):
|
||||||
if not self.cash_bank_account and flt(self.paid_amount):
|
if not self.cash_bank_account and flt(self.paid_amount):
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
|
from frappe import _
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
from erpnext.utilities.product import get_price
|
from erpnext.utilities.product import get_price
|
||||||
|
|
||||||
@ -13,7 +14,7 @@ class SubscriptionPlan(Document):
|
|||||||
|
|
||||||
def validate_interval_count(self):
|
def validate_interval_count(self):
|
||||||
if self.billing_interval_count < 1:
|
if self.billing_interval_count < 1:
|
||||||
frappe.throw('Billing Interval Count cannot be less than 1')
|
frappe.throw(_('Billing Interval Count cannot be less than 1'))
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_plan_rate(plan, quantity=1, customer=None):
|
def get_plan_rate(plan, quantity=1, customer=None):
|
||||||
|
@ -176,7 +176,7 @@ def enqueue_multiple_variant_creation(item, args):
|
|||||||
for key in variants:
|
for key in variants:
|
||||||
total_variants *= len(variants[key])
|
total_variants *= len(variants[key])
|
||||||
if total_variants >= 600:
|
if total_variants >= 600:
|
||||||
frappe.msgprint("Please do not create more than 500 items at a time", raise_exception=1)
|
frappe.throw(_("Please do not create more than 500 items at a time"))
|
||||||
return
|
return
|
||||||
if total_variants < 10:
|
if total_variants < 10:
|
||||||
return create_multiple_variants(item, args)
|
return create_multiple_variants(item, args)
|
||||||
|
@ -38,7 +38,7 @@ class Question(Document):
|
|||||||
options = self.options
|
options = self.options
|
||||||
answers = [item.name for item in options if item.is_correct == True]
|
answers = [item.name for item in options if item.is_correct == True]
|
||||||
if len(answers) == 0:
|
if len(answers) == 0:
|
||||||
frappe.throw("No correct answer is set for {0}".format(self.name))
|
frappe.throw(_("No correct answer is set for {0}".format(self.name)))
|
||||||
return None
|
return None
|
||||||
elif len(answers) == 1:
|
elif len(answers) == 1:
|
||||||
return answers[0]
|
return answers[0]
|
||||||
|
@ -4,12 +4,13 @@
|
|||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
|
from frappe import _
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
|
|
||||||
class Quiz(Document):
|
class Quiz(Document):
|
||||||
def validate(self):
|
def validate(self):
|
||||||
if self.passing_score > 100:
|
if self.passing_score > 100:
|
||||||
frappe.throw("Passing Score value should be between 0 and 100")
|
frappe.throw(_("Passing Score value should be between 0 and 100"))
|
||||||
|
|
||||||
def allowed_attempt(self, enrollment, quiz_name):
|
def allowed_attempt(self, enrollment, quiz_name):
|
||||||
if self.max_attempts == 0:
|
if self.max_attempts == 0:
|
||||||
@ -17,7 +18,7 @@ class Quiz(Document):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
if len(frappe.get_all("Quiz Activity", {'enrollment': enrollment.name, 'quiz': quiz_name})) >= self.max_attempts:
|
if len(frappe.get_all("Quiz Activity", {'enrollment': enrollment.name, 'quiz': quiz_name})) >= self.max_attempts:
|
||||||
frappe.msgprint("Maximum attempts for this quiz reached!")
|
frappe.msgprint(_("Maximum attempts for this quiz reached!"))
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
return True
|
return True
|
||||||
@ -56,5 +57,5 @@ def compare_list_elementwise(*args):
|
|||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
except TypeError:
|
except TypeError:
|
||||||
frappe.throw("Compare List function takes on list arguments")
|
frappe.throw(_("Compare List function takes on list arguments"))
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe, json
|
import frappe, json
|
||||||
|
from frappe import _
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
from erpnext.education.api import get_grade
|
from erpnext.education.api import get_grade
|
||||||
from frappe.utils.pdf import get_pdf
|
from frappe.utils.pdf import get_pdf
|
||||||
@ -88,4 +89,4 @@ def get_attendance_count(student, academic_year, academic_term=None):
|
|||||||
attendance["Present"] = 0
|
attendance["Present"] = 0
|
||||||
return attendance
|
return attendance
|
||||||
else:
|
else:
|
||||||
frappe.throw("Provide the academic year and set the starting and ending date.")
|
frappe.throw(_("Provide the academic year and set the starting and ending date."))
|
@ -148,7 +148,7 @@ def enroll_in_program(program_name, student=None):
|
|||||||
# Check if self enrollment in allowed
|
# Check if self enrollment in allowed
|
||||||
program = frappe.get_doc('Program', program_name)
|
program = frappe.get_doc('Program', program_name)
|
||||||
if not program.allow_self_enroll:
|
if not program.allow_self_enroll:
|
||||||
return frappe.throw("You are not allowed to enroll for this course")
|
return frappe.throw(_("You are not allowed to enroll for this course"))
|
||||||
|
|
||||||
student = get_current_student()
|
student = get_current_student()
|
||||||
if not student:
|
if not student:
|
||||||
@ -162,7 +162,7 @@ def enroll_in_program(program_name, student=None):
|
|||||||
# Check if self enrollment in allowed
|
# Check if self enrollment in allowed
|
||||||
program = frappe.get_doc('Program', program_name)
|
program = frappe.get_doc('Program', program_name)
|
||||||
if not program.allow_self_enroll:
|
if not program.allow_self_enroll:
|
||||||
return frappe.throw("You are not allowed to enroll for this course")
|
return frappe.throw(_("You are not allowed to enroll for this course"))
|
||||||
|
|
||||||
# Enroll in program
|
# Enroll in program
|
||||||
program_enrollment = student.enroll_in_program(program_name)
|
program_enrollment = student.enroll_in_program(program_name)
|
||||||
@ -185,7 +185,7 @@ def add_activity(course, content_type, content, program):
|
|||||||
|
|
||||||
student = get_current_student()
|
student = get_current_student()
|
||||||
if not student:
|
if not student:
|
||||||
return frappe.throw("Student with email {0} does not exist".format(frappe.session.user), frappe.DoesNotExistError)
|
return frappe.throw(_("Student with email {0} does not exist".format(frappe.session.user)), frappe.DoesNotExistError)
|
||||||
|
|
||||||
enrollment = get_or_create_course_enrollment(course, program)
|
enrollment = get_or_create_course_enrollment(course, program)
|
||||||
if content_type == 'Quiz':
|
if content_type == 'Quiz':
|
||||||
@ -220,7 +220,7 @@ def get_quiz(quiz_name, course):
|
|||||||
quiz = frappe.get_doc("Quiz", quiz_name)
|
quiz = frappe.get_doc("Quiz", quiz_name)
|
||||||
questions = quiz.get_questions()
|
questions = quiz.get_questions()
|
||||||
except:
|
except:
|
||||||
frappe.throw("Quiz {0} does not exist".format(quiz_name))
|
frappe.throw(_("Quiz {0} does not exist".format(quiz_name)))
|
||||||
return None
|
return None
|
||||||
|
|
||||||
questions = [{
|
questions = [{
|
||||||
@ -347,7 +347,7 @@ def get_or_create_course_enrollment(course, program):
|
|||||||
if not course_enrollment:
|
if not course_enrollment:
|
||||||
program_enrollment = get_enrollment('program', program, student.name)
|
program_enrollment = get_enrollment('program', program, student.name)
|
||||||
if not program_enrollment:
|
if not program_enrollment:
|
||||||
frappe.throw("You are not enrolled in program {0}".format(program))
|
frappe.throw(_("You are not enrolled in program {0}".format(program)))
|
||||||
return
|
return
|
||||||
return student.enroll_in_course(course_name=course, program_enrollment=get_enrollment('program', program, student.name))
|
return student.enroll_in_course(course_name=course, program_enrollment=get_enrollment('program', program, student.name))
|
||||||
else:
|
else:
|
||||||
|
@ -252,6 +252,6 @@ def get_tax_account_head(tax):
|
|||||||
{"parent": "Shopify Settings", "shopify_tax": tax_title}, "tax_account")
|
{"parent": "Shopify Settings", "shopify_tax": tax_title}, "tax_account")
|
||||||
|
|
||||||
if not tax_account:
|
if not tax_account:
|
||||||
frappe.throw("Tax Account not specified for Shopify Tax {0}".format(tax.get("title")))
|
frappe.throw(_("Tax Account not specified for Shopify Tax {0}".format(tax.get("title"))))
|
||||||
|
|
||||||
return tax_account
|
return tax_account
|
||||||
|
@ -30,7 +30,7 @@ class ClinicalProcedureTemplate(Document):
|
|||||||
try:
|
try:
|
||||||
frappe.delete_doc("Item",self.item)
|
frappe.delete_doc("Item",self.item)
|
||||||
except Exception:
|
except Exception:
|
||||||
frappe.throw("""Not permitted. Please disable the Procedure Template""")
|
frappe.throw(_("""Not permitted. Please disable the Procedure Template"""))
|
||||||
|
|
||||||
def get_item_details(self, args=None):
|
def get_item_details(self, args=None):
|
||||||
item = frappe.db.sql("""select stock_uom, item_name
|
item = frappe.db.sql("""select stock_uom, item_name
|
||||||
|
@ -298,7 +298,7 @@ var get_procedure_prescribed = function(frm){
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
frappe.msgprint("Please select Patient to get prescribed procedure");
|
frappe.msgprint(__("Please select Patient to get prescribed procedure"));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -160,7 +160,7 @@ var btn_create_vital_signs = function (frm) {
|
|||||||
|
|
||||||
var btn_create_procedure = function (frm) {
|
var btn_create_procedure = function (frm) {
|
||||||
if(!frm.doc.patient){
|
if(!frm.doc.patient){
|
||||||
frappe.throw("Please select patient");
|
frappe.throw(__("Please select patient"));
|
||||||
}
|
}
|
||||||
frappe.route_options = {
|
frappe.route_options = {
|
||||||
"patient": frm.doc.patient,
|
"patient": frm.doc.patient,
|
||||||
|
@ -84,7 +84,7 @@ def get_benefit_pro_rata_ratio_amount(employee, on_date, sal_struct):
|
|||||||
pay_against_benefit_claim, max_benefit_amount = frappe.db.get_value("Salary Component", sal_struct_row.salary_component, ["pay_against_benefit_claim", "max_benefit_amount"])
|
pay_against_benefit_claim, max_benefit_amount = frappe.db.get_value("Salary Component", sal_struct_row.salary_component, ["pay_against_benefit_claim", "max_benefit_amount"])
|
||||||
except TypeError:
|
except TypeError:
|
||||||
# show the error in tests?
|
# show the error in tests?
|
||||||
frappe.throw("Unable to find Salary Component {0}".format(sal_struct_row.salary_component))
|
frappe.throw(_("Unable to find Salary Component {0}".format(sal_struct_row.salary_component)))
|
||||||
if sal_struct_row.is_flexible_benefit == 1 and pay_against_benefit_claim != 1:
|
if sal_struct_row.is_flexible_benefit == 1 and pay_against_benefit_claim != 1:
|
||||||
total_pro_rata_max += max_benefit_amount
|
total_pro_rata_max += max_benefit_amount
|
||||||
if total_pro_rata_max > 0:
|
if total_pro_rata_max > 0:
|
||||||
|
@ -15,7 +15,7 @@ frappe.ui.form.on('HR Settings', {
|
|||||||
let policy = frm.doc.password_policy;
|
let policy = frm.doc.password_policy;
|
||||||
if (policy) {
|
if (policy) {
|
||||||
if (policy.includes(' ') || policy.includes('--')) {
|
if (policy.includes(' ') || policy.includes('--')) {
|
||||||
frappe.msgprint("Password policy cannot contain spaces or simultaneous hyphens. The format will be restructured automatically");
|
frappe.msgprint(_("Password policy cannot contain spaces or simultaneous hyphens. The format will be restructured automatically"));
|
||||||
}
|
}
|
||||||
frm.set_value('password_policy', policy.split(new RegExp(" |-", 'g')).filter((token) => token).join('-'));
|
frm.set_value('password_policy', policy.split(new RegExp(" |-", 'g')).filter((token) => token).join('-'));
|
||||||
}
|
}
|
||||||
|
@ -120,7 +120,7 @@ def get_valid_items(search_value=''):
|
|||||||
def publish_selected_items(items_to_publish):
|
def publish_selected_items(items_to_publish):
|
||||||
items_to_publish = json.loads(items_to_publish)
|
items_to_publish = json.loads(items_to_publish)
|
||||||
if not len(items_to_publish):
|
if not len(items_to_publish):
|
||||||
frappe.throw('No items to publish')
|
frappe.throw(_('No items to publish'))
|
||||||
|
|
||||||
for item in items_to_publish:
|
for item in items_to_publish:
|
||||||
item_code = item.get('item_code')
|
item_code = item.get('item_code')
|
||||||
@ -165,7 +165,7 @@ def item_sync_preprocess(intended_item_publish_count):
|
|||||||
frappe.db.set_value("Marketplace Settings", "Marketplace Settings", "sync_in_progress", 1)
|
frappe.db.set_value("Marketplace Settings", "Marketplace Settings", "sync_in_progress", 1)
|
||||||
return response
|
return response
|
||||||
else:
|
else:
|
||||||
frappe.throw('Unable to update remote activity')
|
frappe.throw(_('Unable to update remote activity'))
|
||||||
|
|
||||||
|
|
||||||
def item_sync_postprocess():
|
def item_sync_postprocess():
|
||||||
@ -173,7 +173,7 @@ def item_sync_postprocess():
|
|||||||
if response:
|
if response:
|
||||||
frappe.db.set_value('Marketplace Settings', 'Marketplace Settings', 'last_sync_datetime', frappe.utils.now())
|
frappe.db.set_value('Marketplace Settings', 'Marketplace Settings', 'last_sync_datetime', frappe.utils.now())
|
||||||
else:
|
else:
|
||||||
frappe.throw('Unable to update remote activity')
|
frappe.throw(_('Unable to update remote activity'))
|
||||||
|
|
||||||
frappe.db.set_value('Marketplace Settings', 'Marketplace Settings', 'sync_in_progress', 0)
|
frappe.db.set_value('Marketplace Settings', 'Marketplace Settings', 'sync_in_progress', 0)
|
||||||
|
|
||||||
|
@ -645,7 +645,7 @@ def set_project_status(project, status):
|
|||||||
set status for project and all related tasks
|
set status for project and all related tasks
|
||||||
'''
|
'''
|
||||||
if not status in ('Completed', 'Cancelled'):
|
if not status in ('Completed', 'Cancelled'):
|
||||||
frappe.throw('Status must be Cancelled or Completed')
|
frappe.throw(_('Status must be Cancelled or Completed'))
|
||||||
|
|
||||||
project = frappe.get_doc('Project', project)
|
project = frappe.get_doc('Project', project)
|
||||||
frappe.has_permission(doc = project, throw = True)
|
frappe.has_permission(doc = project, throw = True)
|
||||||
|
@ -68,7 +68,7 @@ class Quiz {
|
|||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.submit_btn.remove()
|
this.submit_btn.remove()
|
||||||
if (!res.message) {
|
if (!res.message) {
|
||||||
frappe.throw("Something went wrong while evaluating the quiz.")
|
frappe.throw(__("Something went wrong while evaluating the quiz."))
|
||||||
}
|
}
|
||||||
|
|
||||||
let indicator = 'red'
|
let indicator = 'red'
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
|
from frappe import _
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
import json
|
import json
|
||||||
from six import iteritems
|
from six import iteritems
|
||||||
@ -414,7 +415,7 @@ class GSTR3BReport(Document):
|
|||||||
if gst_details:
|
if gst_details:
|
||||||
return gst_details[0]
|
return gst_details[0]
|
||||||
else:
|
else:
|
||||||
frappe.throw("Please enter GSTIN and state for the Company Address {0}".format(self.company_address))
|
frappe.throw(_("Please enter GSTIN and state for the Company Address {0}".format(self.company_address)))
|
||||||
|
|
||||||
def get_account_heads(self):
|
def get_account_heads(self):
|
||||||
|
|
||||||
@ -427,7 +428,7 @@ class GSTR3BReport(Document):
|
|||||||
if account_heads:
|
if account_heads:
|
||||||
return account_heads
|
return account_heads
|
||||||
else:
|
else:
|
||||||
frappe.throw("Please set account heads in GST Settings for Compnay {0}".format(self.company))
|
frappe.throw(_("Please set account heads in GST Settings for Compnay {0}".format(self.company)))
|
||||||
|
|
||||||
def get_missing_field_invoices(self):
|
def get_missing_field_invoices(self):
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user