Merge branch 'develop' into dev-job-offer-list-view
This commit is contained in:
commit
81af2235f4
@ -188,14 +188,15 @@ frappe.ui.form.on('Invoice Discounting', {
|
||||
},
|
||||
|
||||
show_general_ledger: (frm) => {
|
||||
if(frm.doc.docstatus===1) {
|
||||
if(frm.doc.docstatus > 0) {
|
||||
cur_frm.add_custom_button(__('Accounting Ledger'), function() {
|
||||
frappe.route_options = {
|
||||
voucher_no: frm.doc.name,
|
||||
from_date: frm.doc.posting_date,
|
||||
to_date: frm.doc.posting_date,
|
||||
to_date: moment(frm.doc.modified).format('YYYY-MM-DD'),
|
||||
company: frm.doc.company,
|
||||
group_by: "Group by Voucher (Consolidated)"
|
||||
group_by: "Group by Voucher (Consolidated)",
|
||||
show_cancelled_entries: frm.doc.docstatus === 2
|
||||
};
|
||||
frappe.set_route("query-report", "General Ledger");
|
||||
}, __("View"));
|
||||
|
@ -13,15 +13,16 @@ frappe.ui.form.on("Journal Entry", {
|
||||
refresh: function(frm) {
|
||||
erpnext.toggle_naming_series();
|
||||
|
||||
if(frm.doc.docstatus==1) {
|
||||
if(frm.doc.docstatus > 0) {
|
||||
frm.add_custom_button(__('Ledger'), function() {
|
||||
frappe.route_options = {
|
||||
"voucher_no": frm.doc.name,
|
||||
"from_date": frm.doc.posting_date,
|
||||
"to_date": frm.doc.posting_date,
|
||||
"to_date": moment(frm.doc.modified).format('YYYY-MM-DD'),
|
||||
"company": frm.doc.company,
|
||||
"finance_book": frm.doc.finance_book,
|
||||
"group_by_voucher": 0
|
||||
"group_by": '',
|
||||
"show_cancelled_entries": frm.doc.docstatus === 2
|
||||
};
|
||||
frappe.set_route("query-report", "General Ledger");
|
||||
}, __('View'));
|
||||
|
@ -280,7 +280,7 @@
|
||||
"idx": 1,
|
||||
"istable": 1,
|
||||
"links": [],
|
||||
"modified": "2020-06-18 14:06:54.833738",
|
||||
"modified": "2020-06-24 14:06:54.833738",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Journal Entry Account",
|
||||
|
@ -172,8 +172,8 @@ frappe.ui.form.on('Payment Entry', {
|
||||
frm.toggle_display("base_paid_amount", frm.doc.paid_from_account_currency != company_currency);
|
||||
|
||||
frm.toggle_display("base_received_amount", (
|
||||
frm.doc.paid_to_account_currency != company_currency
|
||||
&& frm.doc.paid_from_account_currency != frm.doc.paid_to_account_currency
|
||||
frm.doc.paid_to_account_currency != company_currency
|
||||
&& frm.doc.paid_from_account_currency != frm.doc.paid_to_account_currency
|
||||
&& frm.doc.base_paid_amount != frm.doc.base_received_amount
|
||||
));
|
||||
|
||||
@ -234,14 +234,15 @@ frappe.ui.form.on('Payment Entry', {
|
||||
},
|
||||
|
||||
show_general_ledger: function(frm) {
|
||||
if(frm.doc.docstatus==1) {
|
||||
if(frm.doc.docstatus > 0) {
|
||||
frm.add_custom_button(__('Ledger'), function() {
|
||||
frappe.route_options = {
|
||||
"voucher_no": frm.doc.name,
|
||||
"from_date": frm.doc.posting_date,
|
||||
"to_date": frm.doc.posting_date,
|
||||
"to_date": moment(frm.doc.modified).format('YYYY-MM-DD'),
|
||||
"company": frm.doc.company,
|
||||
group_by: ""
|
||||
"group_by": "",
|
||||
"show_cancelled_entries": frm.doc.docstatus === 2
|
||||
};
|
||||
frappe.set_route("query-report", "General Ledger");
|
||||
}, "fa fa-table");
|
||||
|
@ -25,9 +25,10 @@ frappe.ui.form.on('Period Closing Voucher', {
|
||||
frappe.route_options = {
|
||||
"voucher_no": frm.doc.name,
|
||||
"from_date": frm.doc.posting_date,
|
||||
"to_date": frm.doc.posting_date,
|
||||
"to_date": moment(frm.doc.modified).format('YYYY-MM-DD'),
|
||||
"company": frm.doc.company,
|
||||
group_by_voucher: 0
|
||||
"group_by": "",
|
||||
"show_cancelled_entries": frm.doc.docstatus === 2
|
||||
};
|
||||
frappe.set_route("query-report", "General Ledger");
|
||||
}, "fa fa-table");
|
||||
|
@ -408,6 +408,8 @@ class Asset(AccountsController):
|
||||
row.expected_value_after_useful_life = asset_value_after_full_schedule
|
||||
|
||||
def validate_cancellation(self):
|
||||
if self.status in ("In Maintenance", "Out of Order"):
|
||||
frappe.throw(_("There are active maintenance or repairs against the asset. You must complete all of them before cancelling the asset."))
|
||||
if self.status not in ("Submitted", "Partially Depreciated", "Fully Depreciated"):
|
||||
frappe.throw(_("Asset cannot be cancelled, as it is already {0}").format(self.status))
|
||||
|
||||
|
@ -51,7 +51,7 @@ class RequestforQuotation(BuyingController):
|
||||
|
||||
def validate_email_id(self, args):
|
||||
if not args.email_id:
|
||||
frappe.throw(_("Row {0}: For supplier {0} Email Address is required to send email").format(args.idx, args.supplier))
|
||||
frappe.throw(_("Row {0}: For Supplier {0}, Email Address is Required to Send Email").format(args.idx, args.supplier))
|
||||
|
||||
def on_submit(self):
|
||||
frappe.db.set(self, 'status', 'Submitted')
|
||||
@ -154,7 +154,7 @@ class RequestforQuotation(BuyingController):
|
||||
sender=sender,attachments = attachments, send_email=True,
|
||||
doctype=self.doctype, name=self.name)["name"]
|
||||
|
||||
frappe.msgprint(_("Email sent to supplier {0}").format(data.supplier))
|
||||
frappe.msgprint(_("Email Sent to Supplier {0}").format(data.supplier))
|
||||
|
||||
def get_attachments(self):
|
||||
attachments = [d.name for d in get_attachments(self.doctype, self.name)]
|
||||
@ -193,7 +193,7 @@ def send_supplier_emails(rfq_name):
|
||||
def check_portal_enabled(reference_doctype):
|
||||
if not frappe.db.get_value('Portal Menu Item',
|
||||
{'reference_doctype': reference_doctype}, 'enabled'):
|
||||
frappe.throw(_("Request for Quotation is disabled to access from portal, for more check portal settings."))
|
||||
frappe.throw(_("The Access to Request for Quotation From Portal is Disabled. To Allow Access, Enable it in Portal Settings."))
|
||||
|
||||
def get_list_context(context=None):
|
||||
from erpnext.controllers.website_list_for_contact import get_list_context
|
||||
@ -259,7 +259,7 @@ def create_supplier_quotation(doc):
|
||||
sq_doc.flags.ignore_permissions = True
|
||||
sq_doc.run_method("set_missing_values")
|
||||
sq_doc.save()
|
||||
frappe.msgprint(_("Supplier Quotation {0} created").format(sq_doc.name))
|
||||
frappe.msgprint(_("Supplier Quotation {0} Created").format(sq_doc.name))
|
||||
return sq_doc.name
|
||||
except Exception:
|
||||
return None
|
||||
|
@ -33,7 +33,7 @@ def validate_filters(filters):
|
||||
frappe.throw(_("{0} is mandatory").format(f))
|
||||
|
||||
if not frappe.db.exists("Fiscal Year", filters.get("fiscal_year")):
|
||||
frappe.throw(_("Fiscal Year: {0} does not exists").format(filters.get("fiscal_year")))
|
||||
frappe.throw(_("Fiscal Year {0} Does Not Exist").format(filters.get("fiscal_year")))
|
||||
|
||||
if filters.get("based_on") == filters.get("group_by"):
|
||||
frappe.throw(_("'Based On' and 'Group By' can not be same"))
|
||||
|
@ -55,14 +55,15 @@ frappe.ui.form.on("Fees", {
|
||||
frm.set_df_property('posting_date', 'read_only', 1);
|
||||
frm.set_df_property('posting_time', 'read_only', 1);
|
||||
}
|
||||
if(frm.doc.docstatus===1) {
|
||||
if(frm.doc.docstatus > 0) {
|
||||
frm.add_custom_button(__('Accounting Ledger'), function() {
|
||||
frappe.route_options = {
|
||||
voucher_no: frm.doc.name,
|
||||
from_date: frm.doc.posting_date,
|
||||
to_date: frm.doc.posting_date,
|
||||
to_date: moment(frm.doc.modified).format('YYYY-MM-DD'),
|
||||
company: frm.doc.company,
|
||||
group_by_voucher: false
|
||||
group_by: '',
|
||||
show_cancelled_entries: frm.doc.docstatus === 2
|
||||
};
|
||||
frappe.set_route("query-report", "General Ledger");
|
||||
}, __("View"));
|
||||
|
@ -1,20 +1,21 @@
|
||||
{
|
||||
"add_total_row": 0,
|
||||
"apply_user_permissions": 1,
|
||||
"creation": "2013-05-13 14:04:03",
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 3,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2017-11-10 19:42:36.457449",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Education",
|
||||
"name": "Absent Student Report",
|
||||
"owner": "Administrator",
|
||||
"ref_doctype": "Student Attendance",
|
||||
"report_name": "Absent Student Report",
|
||||
"report_type": "Script Report",
|
||||
"add_total_row": 0,
|
||||
"creation": "2013-05-13 14:04:03",
|
||||
"disable_prepared_report": 0,
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 3,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2020-06-24 17:16:40.251116",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Education",
|
||||
"name": "Absent Student Report",
|
||||
"owner": "Administrator",
|
||||
"prepared_report": 0,
|
||||
"ref_doctype": "Student Attendance",
|
||||
"report_name": "Absent Student Report",
|
||||
"report_type": "Script Report",
|
||||
"roles": [
|
||||
{
|
||||
"role": "Academics User"
|
||||
|
@ -1,20 +1,21 @@
|
||||
{
|
||||
"add_total_row": 0,
|
||||
"apply_user_permissions": 1,
|
||||
"creation": "2017-11-09 15:07:30.404428",
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 0,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2017-11-28 18:35:44.903665",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Education",
|
||||
"name": "Assessment Plan Status",
|
||||
"owner": "Administrator",
|
||||
"ref_doctype": "Assessment Plan",
|
||||
"report_name": "Assessment Plan Status",
|
||||
"report_type": "Script Report",
|
||||
"add_total_row": 0,
|
||||
"creation": "2017-11-09 15:07:30.404428",
|
||||
"disable_prepared_report": 0,
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 0,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2020-06-24 17:16:02.027410",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Education",
|
||||
"name": "Assessment Plan Status",
|
||||
"owner": "Administrator",
|
||||
"prepared_report": 0,
|
||||
"ref_doctype": "Assessment Plan",
|
||||
"report_name": "Assessment Plan Status",
|
||||
"report_type": "Script Report",
|
||||
"roles": [
|
||||
{
|
||||
"role": "Academics User"
|
||||
|
@ -1,24 +1,26 @@
|
||||
{
|
||||
"add_total_row": 0,
|
||||
"apply_user_permissions": 1,
|
||||
"creation": "2017-05-05 14:46:13.776133",
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 0,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2018-02-08 15:11:24.904628",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Education",
|
||||
"name": "Course wise Assessment Report",
|
||||
"owner": "Administrator",
|
||||
"ref_doctype": "Assessment Result",
|
||||
"report_name": "Course wise Assessment Report",
|
||||
"report_type": "Script Report",
|
||||
"add_total_row": 0,
|
||||
"creation": "2017-05-05 14:46:13.776133",
|
||||
"disable_prepared_report": 0,
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 0,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2020-06-24 17:15:15.477530",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Education",
|
||||
"name": "Course wise Assessment Report",
|
||||
"owner": "Administrator",
|
||||
"prepared_report": 0,
|
||||
"query": "",
|
||||
"ref_doctype": "Assessment Result",
|
||||
"report_name": "Course wise Assessment Report",
|
||||
"report_type": "Script Report",
|
||||
"roles": [
|
||||
{
|
||||
"role": "Instructor"
|
||||
},
|
||||
},
|
||||
{
|
||||
"role": "Education Manager"
|
||||
}
|
||||
|
@ -1,24 +1,25 @@
|
||||
{
|
||||
"add_total_row": 0,
|
||||
"apply_user_permissions": 1,
|
||||
"creation": "2018-01-22 17:04:43.412054",
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 0,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2019-02-08 15:11:35.339434",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Education",
|
||||
"name": "Final Assessment Grades",
|
||||
"owner": "Administrator",
|
||||
"ref_doctype": "Assessment Result",
|
||||
"report_name": "Final Assessment Grades",
|
||||
"report_type": "Script Report",
|
||||
"add_total_row": 0,
|
||||
"creation": "2018-01-22 17:04:43.412054",
|
||||
"disable_prepared_report": 0,
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 0,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2020-06-24 17:13:35.373756",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Education",
|
||||
"name": "Final Assessment Grades",
|
||||
"owner": "Administrator",
|
||||
"prepared_report": 0,
|
||||
"ref_doctype": "Assessment Result",
|
||||
"report_name": "Final Assessment Grades",
|
||||
"report_type": "Script Report",
|
||||
"roles": [
|
||||
{
|
||||
"role": "Instructor"
|
||||
},
|
||||
},
|
||||
{
|
||||
"role": "Education Manager"
|
||||
}
|
||||
|
@ -1,24 +1,25 @@
|
||||
{
|
||||
"add_total_row": 0,
|
||||
"apply_user_permissions": 1,
|
||||
"creation": "2017-03-27 17:47:16.831433",
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 0,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2017-11-10 19:42:30.300729",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Education",
|
||||
"name": "Student and Guardian Contact Details",
|
||||
"owner": "Administrator",
|
||||
"ref_doctype": "Program Enrollment",
|
||||
"report_name": "Student and Guardian Contact Details",
|
||||
"report_type": "Script Report",
|
||||
"add_total_row": 0,
|
||||
"creation": "2017-03-27 17:47:16.831433",
|
||||
"disable_prepared_report": 0,
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 0,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2020-06-24 17:16:50.639488",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Education",
|
||||
"name": "Student and Guardian Contact Details",
|
||||
"owner": "Administrator",
|
||||
"prepared_report": 0,
|
||||
"ref_doctype": "Program Enrollment",
|
||||
"report_name": "Student and Guardian Contact Details",
|
||||
"report_type": "Script Report",
|
||||
"roles": [
|
||||
{
|
||||
"role": "Instructor"
|
||||
},
|
||||
},
|
||||
{
|
||||
"role": "Academics User"
|
||||
}
|
||||
|
@ -1,20 +1,21 @@
|
||||
{
|
||||
"add_total_row": 0,
|
||||
"apply_user_permissions": 1,
|
||||
"creation": "2016-11-28 22:07:03.859124",
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 2,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2017-11-10 19:41:12.328346",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Education",
|
||||
"name": "Student Batch-Wise Attendance",
|
||||
"owner": "Administrator",
|
||||
"ref_doctype": "Student Attendance",
|
||||
"report_name": "Student Batch-Wise Attendance",
|
||||
"report_type": "Script Report",
|
||||
"add_total_row": 0,
|
||||
"creation": "2016-11-28 22:07:03.859124",
|
||||
"disable_prepared_report": 0,
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 2,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2020-06-24 17:16:59.823709",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Education",
|
||||
"name": "Student Batch-Wise Attendance",
|
||||
"owner": "Administrator",
|
||||
"prepared_report": 0,
|
||||
"ref_doctype": "Student Attendance",
|
||||
"report_name": "Student Batch-Wise Attendance",
|
||||
"report_type": "Script Report",
|
||||
"roles": [
|
||||
{
|
||||
"role": "Academics User"
|
||||
|
@ -1,21 +1,22 @@
|
||||
{
|
||||
"add_total_row": 0,
|
||||
"creation": "2016-06-22 02:58:41.024538",
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 3,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2018-12-17 16:46:46.176620",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Education",
|
||||
"name": "Student Fee Collection",
|
||||
"owner": "Administrator",
|
||||
"prepared_report": 0,
|
||||
"query": "SELECT\n student as \"Student:Link/Student:200\",\n student_name as \"Student Name::200\",\n sum(grand_total) - sum(outstanding_amount) as \"Paid Amount:Currency:150\",\n sum(outstanding_amount) as \"Outstanding Amount:Currency:150\",\n sum(grand_total) as \"Grand Total:Currency:150\"\nFROM\n `tabFees` \nGROUP BY\n student",
|
||||
"ref_doctype": "Fees",
|
||||
"report_name": "Student Fee Collection",
|
||||
"report_type": "Query Report",
|
||||
"add_total_row": 0,
|
||||
"creation": "2016-06-22 02:58:41.024538",
|
||||
"disable_prepared_report": 0,
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 3,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2020-06-24 17:14:39.452551",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Education",
|
||||
"name": "Student Fee Collection",
|
||||
"owner": "Administrator",
|
||||
"prepared_report": 0,
|
||||
"query": "SELECT\n student as \"Student:Link/Student:200\",\n student_name as \"Student Name::200\",\n sum(grand_total) - sum(outstanding_amount) as \"Paid Amount:Currency:150\",\n sum(outstanding_amount) as \"Outstanding Amount:Currency:150\",\n sum(grand_total) as \"Grand Total:Currency:150\"\nFROM\n `tabFees` \nGROUP BY\n student",
|
||||
"ref_doctype": "Fees",
|
||||
"report_name": "Student Fee Collection",
|
||||
"report_type": "Query Report",
|
||||
"roles": [
|
||||
{
|
||||
"role": "Academics User"
|
||||
|
@ -1,20 +1,21 @@
|
||||
{
|
||||
"add_total_row": 0,
|
||||
"apply_user_permissions": 1,
|
||||
"creation": "2013-05-13 14:04:03",
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 3,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2017-11-10 19:42:43.376658",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Education",
|
||||
"name": "Student Monthly Attendance Sheet",
|
||||
"owner": "Administrator",
|
||||
"ref_doctype": "Student Attendance",
|
||||
"report_name": "Student Monthly Attendance Sheet",
|
||||
"report_type": "Script Report",
|
||||
"add_total_row": 0,
|
||||
"creation": "2013-05-13 14:04:03",
|
||||
"disable_prepared_report": 0,
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 3,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2020-06-24 17:16:13.307053",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Education",
|
||||
"name": "Student Monthly Attendance Sheet",
|
||||
"owner": "Administrator",
|
||||
"prepared_report": 0,
|
||||
"ref_doctype": "Student Attendance",
|
||||
"report_name": "Student Monthly Attendance Sheet",
|
||||
"report_type": "Script Report",
|
||||
"roles": [
|
||||
{
|
||||
"role": "Academics User"
|
||||
|
@ -213,12 +213,15 @@ frappe.ui.form.on("Expense Claim", {
|
||||
refresh: function(frm) {
|
||||
frm.trigger("toggle_fields");
|
||||
|
||||
if(frm.doc.docstatus === 1 && frm.doc.approval_status !== "Rejected") {
|
||||
if(frm.doc.docstatus > 0 && frm.doc.approval_status !== "Rejected") {
|
||||
frm.add_custom_button(__('Accounting Ledger'), function() {
|
||||
frappe.route_options = {
|
||||
voucher_no: frm.doc.name,
|
||||
company: frm.doc.company,
|
||||
group_by_voucher: false
|
||||
from_date: frm.doc.posting_date,
|
||||
to_date: moment(frm.doc.modified).format('YYYY-MM-DD'),
|
||||
group_by: '',
|
||||
show_cancelled_entries: frm.doc.docstatus === 2
|
||||
};
|
||||
frappe.set_route("query-report", "General Ledger");
|
||||
}, __("View"));
|
||||
|
@ -235,8 +235,10 @@ def make_repayment_entry(loan, applicant_type, applicant, loan_type, company, as
|
||||
@frappe.whitelist()
|
||||
def create_loan_security_unpledge(loan, applicant_type, applicant, company, as_dict=1):
|
||||
loan_security_pledge_details = frappe.db.sql("""
|
||||
SELECT p.parent, p.loan_security, p.qty as qty FROM `tabLoan Security Pledge` lsp , `tabPledge` p
|
||||
SELECT p.loan_security, sum(p.qty) as qty
|
||||
FROM `tabLoan Security Pledge` lsp , `tabPledge` p
|
||||
WHERE p.parent = lsp.name AND lsp.loan = %s AND lsp.docstatus = 1
|
||||
GROUP BY p.loan_security
|
||||
""",(loan), as_dict=1)
|
||||
|
||||
unpledge_request = frappe.new_doc("Loan Security Unpledge")
|
||||
|
@ -116,7 +116,7 @@ class LoanRepayment(AccountsController):
|
||||
def allocate_amounts(self, paid_entries):
|
||||
self.set('repayment_details', [])
|
||||
self.principal_amount_paid = 0
|
||||
interest_paid = 0
|
||||
interest_paid = self.amount_paid - self.penalty_amount
|
||||
|
||||
if self.amount_paid - self.penalty_amount > 0 and paid_entries:
|
||||
interest_paid = self.amount_paid - self.penalty_amount
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"actions": [],
|
||||
"autoname": "LM-LSP-.####",
|
||||
"creation": "2019-09-03 18:20:31.382887",
|
||||
"doctype": "DocType",
|
||||
@ -46,6 +47,7 @@
|
||||
"fieldtype": "Currency",
|
||||
"in_list_view": 1,
|
||||
"label": "Loan Security Price",
|
||||
"options": "Company:company:default_currency",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
@ -79,7 +81,8 @@
|
||||
"read_only": 1
|
||||
}
|
||||
],
|
||||
"modified": "2019-10-26 09:46:46.069667",
|
||||
"links": [],
|
||||
"modified": "2020-06-11 03:41:33.900340",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Loan Management",
|
||||
"name": "Loan Security Price",
|
||||
|
@ -19,7 +19,9 @@ def update_shortfall_status(loan, security_value):
|
||||
return
|
||||
|
||||
if security_value >= loan_security_shortfall.shortfall_amount:
|
||||
frappe.db.set_value("Loan Security Shortfall", loan_security_shortfall.name, "status", "Completed")
|
||||
frappe.db.set_value("Loan Security Shortfall", loan_security_shortfall.name, {
|
||||
"status": "Completed",
|
||||
"shortfall_value": loan_security_shortfall.shortfall_amount})
|
||||
else:
|
||||
frappe.db.set_value("Loan Security Shortfall", loan_security_shortfall.name,
|
||||
"shortfall_amount", loan_security_shortfall.shortfall_amount - security_value)
|
||||
|
@ -9,12 +9,15 @@ frappe.ui.form.on(cur_frm.doctype, {
|
||||
}
|
||||
|
||||
if (['Loan Disbursement', 'Loan Repayment', 'Loan Interest Accrual'].includes(frm.doc.doctype)
|
||||
&& frm.doc.docstatus == 1) {
|
||||
&& frm.doc.docstatus > 0) {
|
||||
|
||||
frm.add_custom_button(__("Accounting Ledger"), function() {
|
||||
frappe.route_options = {
|
||||
voucher_no: frm.doc.name,
|
||||
company: frm.doc.company
|
||||
company: frm.doc.company,
|
||||
from_date: frm.doc.posting_date,
|
||||
to_date: moment(frm.doc.modified).format('YYYY-MM-DD'),
|
||||
show_cancelled_entries: frm.doc.docstatus === 2
|
||||
};
|
||||
|
||||
frappe.set_route("query-report", "General Ledger");
|
||||
|
@ -98,11 +98,17 @@ class ProductionPlan(Document):
|
||||
elif self.get_items_from == "Material Request":
|
||||
self.get_mr_items()
|
||||
|
||||
def get_so_mr_list(self, field, table):
|
||||
"""Returns a list of Sales Orders or Material Requests from the respective tables"""
|
||||
so_mr_list = [d.get(field) for d in self.get(table) if d.get(field)]
|
||||
return so_mr_list
|
||||
|
||||
def get_so_items(self):
|
||||
so_list = [d.sales_order for d in self.sales_orders if d.sales_order]
|
||||
if not so_list:
|
||||
msgprint(_("Please enter Sales Orders in the above table"))
|
||||
return []
|
||||
# Check for empty table or empty rows
|
||||
if not self.get("sales_orders") or not self.get_so_mr_list("sales_order", "sales_orders"):
|
||||
frappe.throw(_("Please fill the Sales Orders table"), title=_("Sales Orders Required"))
|
||||
|
||||
so_list = self.get_so_mr_list("sales_order", "sales_orders")
|
||||
|
||||
item_condition = ""
|
||||
if self.item_code:
|
||||
@ -134,10 +140,11 @@ class ProductionPlan(Document):
|
||||
self.calculate_total_planned_qty()
|
||||
|
||||
def get_mr_items(self):
|
||||
mr_list = [d.material_request for d in self.material_requests if d.material_request]
|
||||
if not mr_list:
|
||||
msgprint(_("Please enter Material Requests in the above table"))
|
||||
return []
|
||||
# Check for empty table or empty rows
|
||||
if not self.get("material_requests") or not self.get_so_mr_list("material_request", "material_requests"):
|
||||
frappe.throw(_("Please fill the Material Requests table"), title=_("Material Requests Required"))
|
||||
|
||||
mr_list = self.get_so_mr_list("material_request", "material_requests")
|
||||
|
||||
item_condition = ""
|
||||
if self.item_code:
|
||||
@ -628,16 +635,19 @@ def get_items_for_material_requests(doc, warehouses=None):
|
||||
|
||||
if warehouse_list:
|
||||
warehouses = list(set(warehouse_list))
|
||||
|
||||
|
||||
if doc.get("for_warehouse") and doc.get("for_warehouse") in warehouses:
|
||||
warehouses.remove(doc.get("for_warehouse"))
|
||||
|
||||
warehouse_list = None
|
||||
|
||||
doc['mr_items'] = []
|
||||
|
||||
po_items = doc.get('po_items') if doc.get('po_items') else doc.get('items')
|
||||
if not po_items:
|
||||
frappe.throw(_("Items are required to pull the raw materials which is associated with it."))
|
||||
# Check for empty table or empty rows
|
||||
if not po_items or not [row.get('item_code') for row in po_items if row.get('item_code')]:
|
||||
frappe.throw(_("Items to Manufacture are required to pull the Raw Materials associated with it."),
|
||||
title=_("Items Required"))
|
||||
|
||||
company = doc.get('company')
|
||||
ignore_existing_ordered_qty = doc.get('ignore_existing_ordered_qty')
|
||||
|
@ -381,7 +381,6 @@
|
||||
{
|
||||
"fieldname": "earning",
|
||||
"fieldtype": "Column Break",
|
||||
"label": "Earning",
|
||||
"oldfieldtype": "Column Break",
|
||||
"show_days": 1,
|
||||
"show_seconds": 1,
|
||||
@ -400,7 +399,6 @@
|
||||
{
|
||||
"fieldname": "deduction",
|
||||
"fieldtype": "Column Break",
|
||||
"label": "Deduction",
|
||||
"oldfieldtype": "Column Break",
|
||||
"show_days": 1,
|
||||
"show_seconds": 1,
|
||||
@ -616,7 +614,7 @@
|
||||
"idx": 9,
|
||||
"is_submittable": 1,
|
||||
"links": [],
|
||||
"modified": "2020-06-22 14:42:43.921828",
|
||||
"modified": "2020-06-25 14:42:43.921828",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Payroll",
|
||||
"name": "Salary Slip",
|
||||
|
@ -239,13 +239,12 @@ def get_next_attribute_and_values(item_code, selected_attributes):
|
||||
if exact_match:
|
||||
data = get_product_info_for_website(exact_match[0])
|
||||
product_info = data.product_info
|
||||
product_info["allow_items_not_in_stock"] = cint(data.cart_settings.allow_items_not_in_stock)
|
||||
if not data.cart_settings.show_price:
|
||||
product_info = None
|
||||
else:
|
||||
product_info = None
|
||||
|
||||
product_info["allow_items_not_in_stock"] = cint(data.cart_settings.allow_items_not_in_stock)
|
||||
|
||||
return {
|
||||
'next_attribute': next_attribute,
|
||||
'valid_options_for_attributes': valid_options_for_attributes,
|
||||
|
@ -140,52 +140,6 @@ class TestTimesheet(unittest.TestCase):
|
||||
settings.ignore_employee_time_overlap = initial_setting
|
||||
settings.save()
|
||||
|
||||
def test_timesheet_std_working_hours(self):
|
||||
emp = make_employee("test_employee_6@salary.com")
|
||||
|
||||
company = frappe.get_doc('Company', "_Test Company")
|
||||
company.standard_working_hours = 8
|
||||
company.save()
|
||||
|
||||
timesheet = frappe.new_doc("Timesheet")
|
||||
timesheet.employee = emp
|
||||
timesheet.company = '_Test Company'
|
||||
timesheet.append(
|
||||
'time_logs',
|
||||
{
|
||||
"activity_type": "_Test Activity Type",
|
||||
"from_time": now_datetime(),
|
||||
"to_time": now_datetime() + datetime.timedelta(days= 4)
|
||||
}
|
||||
)
|
||||
timesheet.save()
|
||||
|
||||
ts = frappe.get_doc('Timesheet', timesheet.name)
|
||||
self.assertEqual(ts.total_hours, 32)
|
||||
ts.submit()
|
||||
ts.cancel()
|
||||
|
||||
company = frappe.get_doc('Company', "_Test Company")
|
||||
company.standard_working_hours = 0
|
||||
company.save()
|
||||
|
||||
timesheet = frappe.new_doc("Timesheet")
|
||||
timesheet.employee = emp
|
||||
timesheet.company = '_Test Company'
|
||||
timesheet.append(
|
||||
'time_logs',
|
||||
{
|
||||
"activity_type": "_Test Activity Type",
|
||||
"from_time": now_datetime(),
|
||||
"to_time": now_datetime() + datetime.timedelta(days= 4)
|
||||
}
|
||||
)
|
||||
timesheet.save()
|
||||
|
||||
ts = frappe.get_doc('Timesheet', timesheet.name)
|
||||
self.assertEqual(ts.total_hours, 96)
|
||||
ts.submit()
|
||||
ts.cancel()
|
||||
|
||||
def make_salary_structure_for_timesheet(employee):
|
||||
salary_structure_name = "Timesheet Salary Structure Test"
|
||||
|
@ -162,19 +162,11 @@ frappe.ui.form.on("Timesheet Detail", {
|
||||
|
||||
to_time: function(frm, cdt, cdn) {
|
||||
var child = locals[cdt][cdn];
|
||||
var time_diff = (moment(child.to_time).diff(moment(child.from_time),"seconds")) / ( 60 * 60 * 24);
|
||||
var std_working_hours = 0;
|
||||
|
||||
if(frm._setting_hours) return;
|
||||
|
||||
var hours = moment(child.to_time).diff(moment(child.from_time), "seconds") / 3600;
|
||||
std_working_hours = time_diff * frappe.working_hours;
|
||||
|
||||
if (std_working_hours < hours && std_working_hours > 0) {
|
||||
frappe.model.set_value(cdt, cdn, "hours", std_working_hours);
|
||||
} else {
|
||||
frappe.model.set_value(cdt, cdn, "hours", hours);
|
||||
}
|
||||
frappe.model.set_value(cdt, cdn, "hours", hours);
|
||||
},
|
||||
|
||||
time_logs_add: function(frm) {
|
||||
@ -236,23 +228,12 @@ var calculate_end_time = function(frm, cdt, cdn) {
|
||||
|
||||
let d = moment(child.from_time);
|
||||
if(child.hours) {
|
||||
var time_diff = (moment(child.to_time).diff(moment(child.from_time),"seconds")) / (60 * 60 * 24);
|
||||
var std_working_hours = 0;
|
||||
var hours = moment(child.to_time).diff(moment(child.from_time), "seconds") / 3600;
|
||||
|
||||
std_working_hours = time_diff * frappe.working_hours;
|
||||
|
||||
if (std_working_hours < hours && std_working_hours > 0) {
|
||||
frappe.model.set_value(cdt, cdn, "hours", std_working_hours);
|
||||
frappe.model.set_value(cdt, cdn, "to_time", d.add(hours, "hours").format(frappe.defaultDatetimeFormat));
|
||||
} else {
|
||||
d.add(child.hours, "hours");
|
||||
frm._setting_hours = true;
|
||||
frappe.model.set_value(cdt, cdn, "to_time",
|
||||
d.format(frappe.defaultDatetimeFormat)).then(() => {
|
||||
frm._setting_hours = false;
|
||||
});
|
||||
}
|
||||
d.add(child.hours, "hours");
|
||||
frm._setting_hours = true;
|
||||
frappe.model.set_value(cdt, cdn, "to_time",
|
||||
d.format(frappe.defaultDatetimeFormat)).then(() => {
|
||||
frm._setting_hours = false;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -24,7 +24,6 @@ class Timesheet(Document):
|
||||
self.set_status()
|
||||
self.validate_dates()
|
||||
self.validate_time_logs()
|
||||
self.calculate_std_hours()
|
||||
self.update_cost()
|
||||
self.calculate_total_amounts()
|
||||
self.calculate_percentage_billed()
|
||||
@ -91,17 +90,6 @@ class Timesheet(Document):
|
||||
self.start_date = getdate(start_date)
|
||||
self.end_date = getdate(end_date)
|
||||
|
||||
def calculate_std_hours(self):
|
||||
std_working_hours = frappe.get_value("Company", self.company, 'standard_working_hours')
|
||||
|
||||
for time in self.time_logs:
|
||||
if time.from_time and time.to_time:
|
||||
if flt(std_working_hours) and date_diff(time.to_time, time.from_time):
|
||||
time.hours = flt(std_working_hours) * date_diff(time.to_time, time.from_time)
|
||||
else:
|
||||
if not time.hours:
|
||||
time.hours = time_diff_in_hours(time.to_time, time.from_time)
|
||||
|
||||
def before_cancel(self):
|
||||
self.set_status()
|
||||
|
||||
|
@ -55,8 +55,9 @@ erpnext.stock.StockController = frappe.ui.form.Controller.extend({
|
||||
frappe.route_options = {
|
||||
voucher_no: me.frm.doc.name,
|
||||
from_date: me.frm.doc.posting_date,
|
||||
to_date: me.frm.doc.posting_date,
|
||||
company: me.frm.doc.company
|
||||
to_date: moment(me.frm.doc.modified).format('YYYY-MM-DD'),
|
||||
company: me.frm.doc.company,
|
||||
show_cancelled_entries: me.frm.doc.docstatus === 2
|
||||
};
|
||||
frappe.set_route("query-report", "Stock Ledger");
|
||||
}, __("View"));
|
||||
@ -71,9 +72,10 @@ erpnext.stock.StockController = frappe.ui.form.Controller.extend({
|
||||
frappe.route_options = {
|
||||
voucher_no: me.frm.doc.name,
|
||||
from_date: me.frm.doc.posting_date,
|
||||
to_date: me.frm.doc.posting_date,
|
||||
to_date: moment(me.frm.doc.modified).format('YYYY-MM-DD'),
|
||||
company: me.frm.doc.company,
|
||||
group_by: "Group by Voucher (Consolidated)"
|
||||
group_by: "Group by Voucher (Consolidated)",
|
||||
show_cancelled_entries: me.frm.doc.docstatus === 2
|
||||
};
|
||||
frappe.set_route("query-report", "General Ledger");
|
||||
}, __("View"));
|
||||
|
@ -159,6 +159,26 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
||||
};
|
||||
});
|
||||
}
|
||||
if (this.frm.fields_dict["items"].grid.get_field("cost_center")) {
|
||||
this.frm.set_query("cost_center", "items", function(doc) {
|
||||
return {
|
||||
filters: {
|
||||
"company": doc.company,
|
||||
"is_group": 0
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
if (this.frm.fields_dict["items"].grid.get_field("expense_account")) {
|
||||
this.frm.set_query("expense_account", "items", function(doc) {
|
||||
return {
|
||||
filters: {
|
||||
"company": doc.company
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
if(frappe.meta.get_docfield(this.frm.doc.doctype, "pricing_rules")) {
|
||||
this.frm.set_indicator_formatter('pricing_rule', function(doc) {
|
||||
|
@ -388,8 +388,7 @@ def check_credit_limit(customer, company, ignore_outstanding_sales_order=False,
|
||||
credit_controller_users = get_users_with_role(credit_controller_role or "Sales Master Manager")
|
||||
|
||||
# form a list of emails and names to show to the user
|
||||
credit_controller_users_list = [user for user in credit_controller_users if frappe.db.exists("Employee", {"prefered_email": user})]
|
||||
credit_controller_users = [get_formatted_email(user).replace("<", "(").replace(">", ")") for user in credit_controller_users_list]
|
||||
credit_controller_users = [get_formatted_email(user).replace("<", "(").replace(">", ")") for user in credit_controller_users]
|
||||
|
||||
if not credit_controller_users:
|
||||
frappe.throw(_("Please contact your administrator to extend the credit limits for {0}.".format(customer)))
|
||||
@ -409,7 +408,7 @@ def check_credit_limit(customer, company, ignore_outstanding_sales_order=False,
|
||||
'customer': customer,
|
||||
'customer_outstanding': customer_outstanding,
|
||||
'credit_limit': credit_limit,
|
||||
'credit_controller_users_list': credit_controller_users_list
|
||||
'credit_controller_users_list': credit_controller_users
|
||||
}
|
||||
}
|
||||
)
|
||||
|
@ -22,7 +22,6 @@
|
||||
"default_letter_head",
|
||||
"default_holiday_list",
|
||||
"default_finance_book",
|
||||
"standard_working_hours",
|
||||
"default_selling_terms",
|
||||
"default_buying_terms",
|
||||
"default_warehouse_for_sales_return",
|
||||
@ -240,11 +239,6 @@
|
||||
"label": "Default Holiday List",
|
||||
"options": "Holiday List"
|
||||
},
|
||||
{
|
||||
"fieldname": "standard_working_hours",
|
||||
"fieldtype": "Float",
|
||||
"label": "Standard Working Hours"
|
||||
},
|
||||
{
|
||||
"fieldname": "default_warehouse_for_sales_return",
|
||||
"fieldtype": "Link",
|
||||
@ -746,7 +740,7 @@
|
||||
"image_field": "company_logo",
|
||||
"is_tree": 1,
|
||||
"links": [],
|
||||
"modified": "2020-06-20 11:38:43.178970",
|
||||
"modified": "2020-06-24 12:45:31.462195",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Setup",
|
||||
"name": "Company",
|
||||
|
@ -405,8 +405,8 @@ class EmailDigest(Document):
|
||||
|
||||
value, count = frappe.db.sql("""select ifnull((sum(grand_total)) - (sum(grand_total*per_billed/100)),0),
|
||||
count(*) from `tabSales Order`
|
||||
where (transaction_date <= %(to_date)s) and billing_status != "Fully Billed"
|
||||
and status not in ('Closed','Cancelled', 'Completed') """, {"to_date": self.future_to_date})[0]
|
||||
where (transaction_date <= %(to_date)s) and billing_status != "Fully Billed" and company = %(company)s
|
||||
and status not in ('Closed','Cancelled', 'Completed') """, {"to_date": self.future_to_date, "company": self.company})[0]
|
||||
|
||||
label = get_link_to_report('Sales Order', label=self.meta.get_label("sales_orders_to_bill"),
|
||||
report_type="Report Builder",
|
||||
@ -430,8 +430,8 @@ class EmailDigest(Document):
|
||||
|
||||
value, count = frappe.db.sql("""select ifnull((sum(grand_total)) - (sum(grand_total*per_delivered/100)),0),
|
||||
count(*) from `tabSales Order`
|
||||
where (transaction_date <= %(to_date)s) and delivery_status != "Fully Delivered"
|
||||
and status not in ('Closed','Cancelled', 'Completed') """, {"to_date": self.future_to_date})[0]
|
||||
where (transaction_date <= %(to_date)s) and delivery_status != "Fully Delivered" and company = %(company)s
|
||||
and status not in ('Closed','Cancelled', 'Completed') """, {"to_date": self.future_to_date, "company": self.company})[0]
|
||||
|
||||
label = get_link_to_report('Sales Order', label=self.meta.get_label("sales_orders_to_deliver"),
|
||||
report_type="Report Builder",
|
||||
@ -455,8 +455,8 @@ class EmailDigest(Document):
|
||||
|
||||
value, count = frappe.db.sql("""select ifnull((sum(grand_total))-(sum(grand_total*per_received/100)),0),
|
||||
count(*) from `tabPurchase Order`
|
||||
where (transaction_date <= %(to_date)s) and per_received < 100
|
||||
and status not in ('Closed','Cancelled', 'Completed') """, {"to_date": self.future_to_date})[0]
|
||||
where (transaction_date <= %(to_date)s) and per_received < 100 and company = %(company)s
|
||||
and status not in ('Closed','Cancelled', 'Completed') """, {"to_date": self.future_to_date, "company": self.company})[0]
|
||||
|
||||
label = get_link_to_report('Purchase Order', label=self.meta.get_label("purchase_orders_to_receive"),
|
||||
report_type="Report Builder",
|
||||
@ -480,8 +480,8 @@ class EmailDigest(Document):
|
||||
|
||||
value, count = frappe.db.sql("""select ifnull((sum(grand_total)) - (sum(grand_total*per_billed/100)),0),
|
||||
count(*) from `tabPurchase Order`
|
||||
where (transaction_date <= %(to_date)s) and per_billed < 100
|
||||
and status not in ('Closed','Cancelled', 'Completed') """, {"to_date": self.future_to_date})[0]
|
||||
where (transaction_date <= %(to_date)s) and per_billed < 100 and company = %(company)s
|
||||
and status not in ('Closed','Cancelled', 'Completed') """, {"to_date": self.future_to_date, "company": self.company})[0]
|
||||
|
||||
label = get_link_to_report('Purchase Order', label=self.meta.get_label("purchase_orders_to_bill"),
|
||||
report_type="Report Builder",
|
||||
|
@ -13,6 +13,12 @@ $.extend(cur_frm.cscript, {
|
||||
},
|
||||
enable_checkout: function(){
|
||||
toggle_mandatory(cur_frm)
|
||||
},
|
||||
enabled: function() {
|
||||
if (cur_frm.doc.enabled === 1) {
|
||||
cur_frm.doc.show_configure_button = 1;
|
||||
cur_frm.refresh_field('show_configure_button');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -55,7 +55,7 @@ def get_product_info_for_website(item_code, skip_quotation_creation=False):
|
||||
|
||||
def set_product_info_for_website(item):
|
||||
"""set product price uom for website"""
|
||||
product_info = get_product_info_for_website(item.item_code, skip_quotation_creation=True)
|
||||
product_info = get_product_info_for_website(item.item_code, skip_quotation_creation=True).get("product_info")
|
||||
|
||||
if product_info:
|
||||
item.update(product_info)
|
||||
|
@ -71,7 +71,7 @@
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
@ -88,7 +88,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2018-09-12 09:30:03.951743",
|
||||
"modified": "2020-06-26 09:30:03.951743",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Customs Tariff Number",
|
||||
@ -143,4 +143,4 @@
|
||||
"track_changes": 1,
|
||||
"track_seen": 0,
|
||||
"track_views": 0
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
{
|
||||
"actions": [],
|
||||
"allow_import": 1,
|
||||
"allow_rename": 1,
|
||||
"autoname": "field:serial_no",
|
||||
"creation": "2013-05-16 10:59:15",
|
||||
"description": "Distinct unit of an Item",
|
||||
@ -427,7 +426,7 @@
|
||||
"icon": "fa fa-barcode",
|
||||
"idx": 1,
|
||||
"links": [],
|
||||
"modified": "2020-05-21 19:29:58.517772",
|
||||
"modified": "2020-06-25 15:53:50.900855",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Serial No",
|
||||
|
@ -187,7 +187,7 @@ def get_fifo_queue(filters, sle=None):
|
||||
transferred_item_details[(d.voucher_no, d.name)].append(fifo_queue.pop(0))
|
||||
else:
|
||||
# all from current batch
|
||||
batch[0] -= qty_to_pop
|
||||
batch[0] = flt(batch[0]) - qty_to_pop
|
||||
transferred_item_details[(d.voucher_no, d.name)].append([qty_to_pop, batch[1]])
|
||||
qty_to_pop = 0
|
||||
|
||||
|
@ -79,7 +79,7 @@ frappe.ui.form.on("Issue", {
|
||||
method: "erpnext.support.doctype.issue.issue.make_task",
|
||||
frm: frm
|
||||
});
|
||||
}, __("Make"));
|
||||
}, __("Create"));
|
||||
|
||||
} else {
|
||||
if (frm.doc.service_level_agreement) {
|
||||
@ -232,4 +232,4 @@ function get_status(variance) {
|
||||
} else {
|
||||
return {"diff_display": "Failed", "indicator": "red"};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -79,47 +79,52 @@ class Issue(Document):
|
||||
|
||||
def handle_hold_time(self, status):
|
||||
if self.service_level_agreement:
|
||||
# set response and resolution variance as None as the issue is on Hold for status as Replied
|
||||
# set response and resolution variance as None as the issue is on Hold
|
||||
pause_sla_on = frappe.db.get_all("Pause SLA On Status", fields=["status"],
|
||||
filters={"parent": self.service_level_agreement})
|
||||
hold_statuses = [entry.status for entry in pause_sla_on]
|
||||
update_values = {}
|
||||
|
||||
if self.status in hold_statuses and status not in hold_statuses:
|
||||
update_values['on_hold_since'] = frappe.flags.current_time or now_datetime()
|
||||
if not self.first_responded_on:
|
||||
update_values['response_by'] = None
|
||||
update_values['response_by_variance'] = 0
|
||||
update_values['resolution_by'] = None
|
||||
update_values['resolution_by_variance'] = 0
|
||||
if hold_statuses:
|
||||
if self.status in hold_statuses and status not in hold_statuses:
|
||||
update_values['on_hold_since'] = frappe.flags.current_time or now_datetime()
|
||||
if not self.first_responded_on:
|
||||
update_values['response_by'] = None
|
||||
update_values['response_by_variance'] = 0
|
||||
update_values['resolution_by'] = None
|
||||
update_values['resolution_by_variance'] = 0
|
||||
|
||||
# calculate hold time when status is changed from Replied to any other status
|
||||
if self.status not in hold_statuses and status in hold_statuses:
|
||||
hold_time = self.total_hold_time if self.total_hold_time else 0
|
||||
now_time = frappe.flags.current_time or now_datetime()
|
||||
update_values['total_hold_time'] = hold_time + time_diff_in_seconds(now_time, self.on_hold_since)
|
||||
# calculate hold time when status is changed from any hold status to any non-hold status
|
||||
if self.status not in hold_statuses and status in hold_statuses:
|
||||
hold_time = self.total_hold_time if self.total_hold_time else 0
|
||||
now_time = frappe.flags.current_time or now_datetime()
|
||||
last_hold_time = 0
|
||||
if self.on_hold_since:
|
||||
# last_hold_time will be added to the sla variables
|
||||
last_hold_time = time_diff_in_seconds(now_time, self.on_hold_since)
|
||||
update_values['total_hold_time'] = hold_time + last_hold_time
|
||||
|
||||
# re-calculate SLA variables after issue changes from Replied to Open
|
||||
# add hold time to SLA variables
|
||||
if self.status == "Open" and status in hold_statuses:
|
||||
start_date_time = get_datetime(self.service_level_agreement_creation)
|
||||
priority = get_priority(self)
|
||||
now_time = frappe.flags.current_time or now_datetime()
|
||||
hold_time = time_diff_in_seconds(now_time, self.on_hold_since)
|
||||
# re-calculate SLA variables after issue changes from any hold status to any non-hold status
|
||||
# add hold time to SLA variables
|
||||
start_date_time = get_datetime(self.service_level_agreement_creation)
|
||||
priority = get_priority(self)
|
||||
now_time = frappe.flags.current_time or now_datetime()
|
||||
|
||||
if not self.first_responded_on:
|
||||
response_by = get_expected_time_for(parameter="response", service_level=priority, start_date_time=start_date_time)
|
||||
update_values['response_by'] = add_to_date(response_by, seconds=round(hold_time))
|
||||
response_by_variance = round(time_diff_in_hours(self.response_by, now_time))
|
||||
update_values['response_by_variance'] = response_by_variance + (hold_time // 3600)
|
||||
if not self.first_responded_on:
|
||||
response_by = get_expected_time_for(parameter="response", service_level=priority, start_date_time=start_date_time)
|
||||
response_by = add_to_date(response_by, seconds=round(last_hold_time))
|
||||
response_by_variance = round(time_diff_in_hours(response_by, now_time))
|
||||
update_values['response_by'] = response_by
|
||||
update_values['response_by_variance'] = response_by_variance + (last_hold_time // 3600)
|
||||
|
||||
resolution_by = get_expected_time_for(parameter="resolution", service_level=priority, start_date_time=start_date_time)
|
||||
update_values['resolution_by'] = add_to_date(resolution_by, seconds=round(hold_time))
|
||||
resolution_by_variance = round(time_diff_in_hours(self.resolution_by, now_time))
|
||||
update_values['resolution_by_variance'] = resolution_by_variance + (hold_time // 3600)
|
||||
update_values['on_hold_since'] = None
|
||||
resolution_by = get_expected_time_for(parameter="resolution", service_level=priority, start_date_time=start_date_time)
|
||||
resolution_by = add_to_date(resolution_by, seconds=round(last_hold_time))
|
||||
resolution_by_variance = round(time_diff_in_hours(resolution_by, now_time))
|
||||
update_values['resolution_by'] = resolution_by
|
||||
update_values['resolution_by_variance'] = resolution_by_variance + (last_hold_time // 3600)
|
||||
update_values['on_hold_since'] = None
|
||||
|
||||
self.db_set(update_values)
|
||||
self.db_set(update_values)
|
||||
|
||||
def update_agreement_status(self):
|
||||
if self.service_level_agreement and self.agreement_fulfilled == "Ongoing":
|
||||
|
Loading…
x
Reference in New Issue
Block a user