Merge branch 'develop' into call-summary-dialog
This commit is contained in:
commit
a367a85a78
@ -5,7 +5,7 @@
|
||||
<p>ERP made simple</p>
|
||||
</p>
|
||||
|
||||
[](https://travis-ci.com/frappe/erpnext)
|
||||
[](https://travis-ci.com/frappe/erpnext)
|
||||
[](https://www.codetriage.com/frappe/erpnext)
|
||||
[](https://coveralls.io/github/frappe/erpnext?branch=develop)
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe, json
|
||||
from frappe.utils import add_to_date, date_diff, getdate, nowdate, get_last_day
|
||||
from frappe.utils import add_to_date, date_diff, getdate, nowdate, get_last_day, formatdate
|
||||
from erpnext.accounts.report.general_ledger.general_ledger import execute
|
||||
from frappe.core.page.dashboard.dashboard import cache_source, get_from_date_from_timespan
|
||||
from frappe.desk.doctype.dashboard_chart.dashboard_chart import get_period_ending
|
||||
@ -37,7 +37,7 @@ def get(chart_name=None, from_date = None, to_date = None):
|
||||
result = build_result(account, dates, gl_entries)
|
||||
|
||||
return {
|
||||
"labels": [r[0].strftime('%Y-%m-%d') for r in result],
|
||||
"labels": [formatdate(r[0].strftime('%Y-%m-%d')) for r in result],
|
||||
"datasets": [{
|
||||
"name": account,
|
||||
"values": [r[1] for r in result]
|
||||
|
18
erpnext/accounts/doctype/bank/bank_dashboard.py
Normal file
18
erpnext/accounts/doctype/bank/bank_dashboard.py
Normal file
@ -0,0 +1,18 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'bank',
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Bank Deatils'),
|
||||
'items': ['Bank Account', 'Bank Guarantee']
|
||||
},
|
||||
{
|
||||
'items': ['Payment Order']
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'bank_account',
|
||||
'non_standard_fieldnames': {
|
||||
'Customer': 'default_bank_account',
|
||||
'Supplier': 'default_bank_account',
|
||||
'Journal Entry': 'bank_account_no'
|
||||
},
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Payments'),
|
||||
'items': ['Payment Entry', 'Payment Request', 'Payment Order']
|
||||
},
|
||||
{
|
||||
'label': _('Party'),
|
||||
'items': ['Customer', 'Supplier']
|
||||
},
|
||||
{
|
||||
'items': ['Bank Guarantee']
|
||||
},
|
||||
{
|
||||
'items': ['Journal Entry']
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'cost_center',
|
||||
'reports': [
|
||||
{
|
||||
'label': _('Reports'),
|
||||
'items': ['Budget Variance Report', 'General Ledger']
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'finance_book',
|
||||
'non_standard_fieldnames': {
|
||||
'Asset': 'default_finance_book',
|
||||
'Company': 'default_finance_book'
|
||||
},
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Assets'),
|
||||
'items': ['Asset', 'Asset Value Adjustment']
|
||||
},
|
||||
{
|
||||
'items': ['Company']
|
||||
},
|
||||
{
|
||||
'items': ['Journal Entry']
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'fiscal_year',
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Budgets'),
|
||||
'items': ['Budget']
|
||||
},
|
||||
{
|
||||
'label': _('References'),
|
||||
'items': ['Period Closing Voucher', 'Request for Quotation', 'Tax Withholding Category']
|
||||
},
|
||||
{
|
||||
'label': _('Target Details'),
|
||||
'items': ['Sales Person', 'Sales Partner', 'Territory', 'Monthly Distribution']
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'item_tax_template',
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Pre Sales'),
|
||||
'items': ['Quotation', 'Supplier Quotation']
|
||||
},
|
||||
{
|
||||
'label': _('Sales'),
|
||||
'items': ['Sales Invoice', 'Sales Order', 'Delivery Note']
|
||||
},
|
||||
{
|
||||
'label': _('Purchase'),
|
||||
'items': ['Purchase Invoice', 'Purchase Order', 'Purchase Receipt']
|
||||
},
|
||||
{
|
||||
'items': ['Item']
|
||||
}
|
||||
]
|
||||
}
|
@ -25,13 +25,13 @@ frappe.ui.form.on("Journal Entry", {
|
||||
"group_by_voucher": 0
|
||||
};
|
||||
frappe.set_route("query-report", "General Ledger");
|
||||
}, "fa fa-table");
|
||||
}, __('View'));
|
||||
}
|
||||
|
||||
if(frm.doc.docstatus==1) {
|
||||
frm.add_custom_button(__('Reverse Journal Entry'), function() {
|
||||
return erpnext.journal_entry.reverse_journal_entry(frm);
|
||||
});
|
||||
}, __('Make'));
|
||||
}
|
||||
|
||||
if (frm.doc.__islocal) {
|
||||
@ -47,8 +47,7 @@ frappe.ui.form.on("Journal Entry", {
|
||||
frm.add_custom_button(__("Create Inter Company Journal Entry"),
|
||||
function() {
|
||||
frm.trigger("make_inter_company_journal_entry");
|
||||
}
|
||||
);
|
||||
}, __('Make'));
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -0,0 +1,14 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'loyalty_program',
|
||||
'transactions': [
|
||||
{
|
||||
'items': ['Sales Invoice', 'Customer']
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'monthly_distribution',
|
||||
'non_standard_fieldnames': {
|
||||
'Sales Person': 'distribution_id',
|
||||
'Territory': 'distribution_id',
|
||||
'Sales Partner': 'distribution_id',
|
||||
},
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Target Details'),
|
||||
'items': ['Sales Person', 'Territory', 'Sales Partner']
|
||||
},
|
||||
{
|
||||
'items': ['Budget']
|
||||
}
|
||||
]
|
||||
}
|
@ -10,6 +10,22 @@ frappe.ui.form.on('Opening Invoice Creation Tool', {
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
frm.set_query('cost_center', 'invoices', function(doc, cdt, cdn) {
|
||||
return {
|
||||
filters: {
|
||||
'company': doc.company
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
frm.set_query('cost_center', function(doc) {
|
||||
return {
|
||||
filters: {
|
||||
'company': doc.company
|
||||
}
|
||||
};
|
||||
});
|
||||
},
|
||||
|
||||
refresh: function(frm) {
|
||||
@ -84,6 +100,11 @@ frappe.ui.form.on('Opening Invoice Creation Tool', {
|
||||
if (!row.temporary_opening_account) {
|
||||
row.temporary_opening_account = frm.doc.__onload.temporary_opening_account;
|
||||
}
|
||||
|
||||
if(!row.cost_center) {
|
||||
row.cost_center = frm.doc.cost_center;
|
||||
}
|
||||
|
||||
row.party_type = frm.doc.invoice_type == "Sales"? "Customer": "Supplier";
|
||||
});
|
||||
}
|
||||
|
@ -1,244 +1,86 @@
|
||||
{
|
||||
"allow_copy": 1,
|
||||
"allow_guest_to_view": 0,
|
||||
"allow_import": 0,
|
||||
"allow_rename": 0,
|
||||
"beta": 1,
|
||||
"creation": "2017-08-29 02:22:54.947711",
|
||||
"custom": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "DocType",
|
||||
"document_type": "",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"allow_copy": 1,
|
||||
"beta": 1,
|
||||
"creation": "2017-08-29 02:22:54.947711",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"company",
|
||||
"create_missing_party",
|
||||
"column_break_3",
|
||||
"invoice_type",
|
||||
"cost_center",
|
||||
"section_break_4",
|
||||
"invoices"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "company",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Company",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Company",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
"fieldname": "company",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Company",
|
||||
"options": "Company",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"description": "Create missing customer or supplier.",
|
||||
"fieldname": "create_missing_party",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Create Missing Party",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
"default": "0",
|
||||
"description": "Create missing customer or supplier.",
|
||||
"fieldname": "create_missing_party",
|
||||
"fieldtype": "Check",
|
||||
"label": "Create Missing Party"
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "column_break_3",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
"fieldname": "column_break_3",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "invoice_type",
|
||||
"fieldtype": "Select",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Invoice Type",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Sales\nPurchase",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
"fieldname": "invoice_type",
|
||||
"fieldtype": "Select",
|
||||
"in_list_view": 1,
|
||||
"label": "Invoice Type",
|
||||
"options": "Sales\nPurchase",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "section_break_4",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Invoices",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
"fieldname": "section_break_4",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Invoices"
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 1,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "invoices",
|
||||
"fieldtype": "Table",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Opening Invoice Creation Tool Item",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
"allow_bulk_edit": 1,
|
||||
"fieldname": "invoices",
|
||||
"fieldtype": "Table",
|
||||
"options": "Opening Invoice Creation Tool Item",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "cost_center",
|
||||
"fieldtype": "Link",
|
||||
"label": "Cost Center",
|
||||
"options": "Cost Center"
|
||||
}
|
||||
],
|
||||
"has_web_view": 0,
|
||||
"hide_heading": 0,
|
||||
"hide_toolbar": 1,
|
||||
"idx": 0,
|
||||
"image_view": 0,
|
||||
"in_create": 0,
|
||||
"is_submittable": 0,
|
||||
"issingle": 1,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2018-02-14 17:59:35.269118",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Opening Invoice Creation Tool",
|
||||
"name_case": "",
|
||||
"owner": "Administrator",
|
||||
],
|
||||
"hide_toolbar": 1,
|
||||
"issingle": 1,
|
||||
"modified": "2019-06-13 11:45:31.405267",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Opening Invoice Creation Tool",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"amend": 0,
|
||||
"apply_user_permissions": 0,
|
||||
"cancel": 0,
|
||||
"create": 1,
|
||||
"delete": 0,
|
||||
"email": 1,
|
||||
"export": 0,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 0,
|
||||
"role": "System Manager",
|
||||
"set_user_permissions": 0,
|
||||
"share": 1,
|
||||
"submit": 0,
|
||||
"create": 1,
|
||||
"email": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"role": "System Manager",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"quick_entry": 1,
|
||||
"read_only": 0,
|
||||
"read_only_onload": 0,
|
||||
"show_name_in_global_search": 0,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1,
|
||||
"track_seen": 0
|
||||
],
|
||||
"quick_entry": 1,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1
|
||||
}
|
@ -129,7 +129,9 @@ class OpeningInvoiceCreationTool(Document):
|
||||
def get_invoice_dict(self, row=None):
|
||||
def get_item_dict():
|
||||
default_uom = frappe.db.get_single_value("Stock Settings", "stock_uom") or _("Nos")
|
||||
cost_center = frappe.get_cached_value('Company', self.company, "cost_center")
|
||||
cost_center = row.get('cost_center') or frappe.get_cached_value('Company',
|
||||
self.company, "cost_center")
|
||||
|
||||
if not cost_center:
|
||||
frappe.throw(
|
||||
_("Please set the Default Cost Center in {0} company.").format(frappe.bold(self.company))
|
||||
@ -163,6 +165,7 @@ class OpeningInvoiceCreationTool(Document):
|
||||
"is_opening": "Yes",
|
||||
"set_posting_time": 1,
|
||||
"company": self.company,
|
||||
"cost_center": self.cost_center,
|
||||
"due_date": row.due_date,
|
||||
"posting_date": row.posting_date,
|
||||
frappe.scrub(party_type): row.party,
|
||||
|
@ -1,378 +1,108 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
"allow_import": 0,
|
||||
"allow_rename": 0,
|
||||
"beta": 0,
|
||||
"creation": "2017-08-29 04:26:36.159247",
|
||||
"custom": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "DocType",
|
||||
"document_type": "",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"creation": "2017-08-29 04:26:36.159247",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"party_type",
|
||||
"party",
|
||||
"temporary_opening_account",
|
||||
"column_break_3",
|
||||
"posting_date",
|
||||
"due_date",
|
||||
"section_break_5",
|
||||
"item_name",
|
||||
"outstanding_amount",
|
||||
"column_break_4",
|
||||
"qty",
|
||||
"cost_center"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "party_type",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 1,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Party Type",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "DocType",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
"fieldname": "party_type",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 1,
|
||||
"label": "Party Type",
|
||||
"options": "DocType",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "party",
|
||||
"fieldtype": "Dynamic Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 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,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
"fieldname": "party",
|
||||
"fieldtype": "Dynamic Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Party",
|
||||
"options": "party_type",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "temporary_opening_account",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Temporary Opening Account",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Account",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
"fieldname": "temporary_opening_account",
|
||||
"fieldtype": "Link",
|
||||
"label": "Temporary Opening Account",
|
||||
"options": "Account"
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "column_break_3",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
"fieldname": "column_break_3",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "Today",
|
||||
"fieldname": "posting_date",
|
||||
"fieldtype": "Date",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Posting Date",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
"default": "Today",
|
||||
"fieldname": "posting_date",
|
||||
"fieldtype": "Date",
|
||||
"in_list_view": 1,
|
||||
"label": "Posting Date"
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "Today",
|
||||
"fieldname": "due_date",
|
||||
"fieldtype": "Date",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Due Date",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
"default": "Today",
|
||||
"fieldname": "due_date",
|
||||
"fieldtype": "Date",
|
||||
"in_list_view": 1,
|
||||
"label": "Due Date"
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "section_break_5",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
"fieldname": "section_break_5",
|
||||
"fieldtype": "Section Break"
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "Opening Invoice Item",
|
||||
"fieldname": "item_name",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Item Name",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
"default": "Opening Invoice Item",
|
||||
"fieldname": "item_name",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Item Name"
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "0",
|
||||
"fieldname": "outstanding_amount",
|
||||
"fieldtype": "Currency",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Outstanding Amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
"default": "0",
|
||||
"fieldname": "outstanding_amount",
|
||||
"fieldtype": "Currency",
|
||||
"in_list_view": 1,
|
||||
"label": "Outstanding Amount",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "column_break_4",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
"fieldname": "column_break_4",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "1",
|
||||
"fieldname": "qty",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Quantity",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
"default": "1",
|
||||
"fieldname": "qty",
|
||||
"fieldtype": "Data",
|
||||
"label": "Quantity"
|
||||
},
|
||||
{
|
||||
"fieldname": "cost_center",
|
||||
"fieldtype": "Link",
|
||||
"label": "Cost Center",
|
||||
"options": "Cost Center"
|
||||
}
|
||||
],
|
||||
"has_web_view": 0,
|
||||
"hide_heading": 0,
|
||||
"hide_toolbar": 0,
|
||||
"idx": 0,
|
||||
"image_view": 0,
|
||||
"in_create": 0,
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"max_attachments": 0,
|
||||
"modified": "2017-12-19 05:07:01.549918",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Opening Invoice Creation Tool Item",
|
||||
"name_case": "",
|
||||
"owner": "Administrator",
|
||||
"permissions": [],
|
||||
"quick_entry": 1,
|
||||
"read_only": 0,
|
||||
"read_only_onload": 0,
|
||||
"show_name_in_global_search": 0,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1,
|
||||
"track_seen": 0
|
||||
],
|
||||
"istable": 1,
|
||||
"modified": "2019-06-13 11:48:08.324063",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Opening Invoice Creation Tool Item",
|
||||
"owner": "Administrator",
|
||||
"permissions": [],
|
||||
"quick_entry": 1,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'payment_gateway_account',
|
||||
'non_standard_fieldnames': {
|
||||
'Subscription Plan': 'payment_gateway'
|
||||
},
|
||||
'transactions': [
|
||||
{
|
||||
'items': ['Payment Request']
|
||||
},
|
||||
{
|
||||
'items': ['Subscription Plan']
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'payment_term',
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Sales'),
|
||||
'items': ['Sales Invoice', 'Sales Order', 'Quotation']
|
||||
},
|
||||
{
|
||||
'label': _('Purchase'),
|
||||
'items': ['Purchase Invoice', 'Purchase Order']
|
||||
},
|
||||
{
|
||||
'items': ['Payment Terms Template']
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'payment_terms_template',
|
||||
'non_standard_fieldnames': {
|
||||
'Customer Group': 'payment_terms',
|
||||
'Supplier Group': 'payment_terms',
|
||||
'Supplier': 'payment_terms',
|
||||
'Customer': 'payment_terms'
|
||||
},
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Sales'),
|
||||
'items': ['Sales Invoice', 'Sales Order', 'Quotation']
|
||||
},
|
||||
{
|
||||
'label': _('Purchase'),
|
||||
'items': ['Purchase Invoice', 'Purchase Order']
|
||||
},
|
||||
{
|
||||
'label': _('Party'),
|
||||
'items': ['Customer', 'Supplier']
|
||||
},
|
||||
{
|
||||
'label': _('Group'),
|
||||
'items': ['Customer Group', 'Supplier Group']
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'pos_profile',
|
||||
'transactions': [
|
||||
{
|
||||
'items': ['Sales Invoice', 'POS Closing Voucher']
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'taxes_and_charges',
|
||||
'non_standard_fieldnames': {
|
||||
'Tax Rule': 'purchase_tax_template',
|
||||
},
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Transactions'),
|
||||
'items': ['Purchase Invoice', 'Purchase Order', 'Purchase Receipt']
|
||||
},
|
||||
{
|
||||
'label': _('References'),
|
||||
'items': ['Supplier Quotation', 'Tax Rule']
|
||||
}
|
||||
]
|
||||
}
|
@ -384,6 +384,10 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
||||
me.frm.pos_print_format = r.message.print_format;
|
||||
}
|
||||
me.frm.script_manager.trigger("update_stock");
|
||||
if(me.frm.doc.taxes_and_charges) {
|
||||
me.frm.script_manager.trigger("taxes_and_charges");
|
||||
}
|
||||
|
||||
frappe.model.set_default_values(me.frm.doc);
|
||||
me.set_dynamic_labels();
|
||||
me.calculate_taxes_and_totals();
|
||||
|
@ -0,0 +1,24 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'taxes_and_charges',
|
||||
'non_standard_fieldnames': {
|
||||
'Tax Rule': 'sales_tax_template',
|
||||
'Subscription': 'tax_template',
|
||||
'Restaurant': 'default_tax_template'
|
||||
},
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Transactions'),
|
||||
'items': ['Sales Invoice', 'Sales Order', 'Delivery Note']
|
||||
},
|
||||
{
|
||||
'label': _('References'),
|
||||
'items': ['POS Profile', 'Subscription', 'Restaurant', 'Tax Rule']
|
||||
}
|
||||
]
|
||||
}
|
15
erpnext/accounts/doctype/share_type/share_type_dashboard.py
Normal file
15
erpnext/accounts/doctype/share_type/share_type_dashboard.py
Normal file
@ -0,0 +1,15 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'share_type',
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('References'),
|
||||
'items': ['Share Transfer', 'Shareholder']
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'shareholder',
|
||||
'non_standard_fieldnames': {
|
||||
'Share Transfer': 'to_shareholder'
|
||||
},
|
||||
'transactions': [
|
||||
{
|
||||
'items': ['Share Transfer']
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'shipping_rule',
|
||||
'non_standard_fieldnames': {
|
||||
'Payment Entry': 'party_name'
|
||||
},
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Pre Sales'),
|
||||
'items': ['Quotation', 'Supplier Quotation']
|
||||
},
|
||||
{
|
||||
'label': _('Sales'),
|
||||
'items': ['Sales Order', 'Delivery Note', 'Sales Invoice']
|
||||
},
|
||||
{
|
||||
'label': _('Purchase'),
|
||||
'items': ['Purchase Invoice', 'Purchase Order', 'Purchase Receipt']
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'subscription_plan',
|
||||
'non_standard_fieldnames': {
|
||||
'Payment Request': 'plan',
|
||||
'Subscription': 'plan'
|
||||
},
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('References'),
|
||||
'items': ['Payment Request', 'Subscription']
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'tax_category',
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Pre Sales'),
|
||||
'items': ['Quotation', 'Supplier Quotation']
|
||||
},
|
||||
{
|
||||
'label': _('Sales'),
|
||||
'items': ['Sales Invoice', 'Delivery Note', 'Sales Order']
|
||||
},
|
||||
{
|
||||
'label': _('Purchase'),
|
||||
'items': ['Purchase Invoice', 'Purchase Receipt']
|
||||
},
|
||||
{
|
||||
'label': _('Party'),
|
||||
'items': ['Customer', 'Supplier']
|
||||
},
|
||||
{
|
||||
'label': _('Taxes'),
|
||||
'items': ['Item', 'Tax Rule']
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'tax_withholding_category',
|
||||
'transactions': [
|
||||
{
|
||||
'items': ['Supplier']
|
||||
}
|
||||
]
|
||||
}
|
@ -60,7 +60,7 @@ def validate_filters(filters):
|
||||
frappe.throw(_("Filter based on Cost Center is only applicable if Budget Against is selected as Cost Center"))
|
||||
|
||||
def get_columns(filters):
|
||||
columns = [_(filters.get("budget_against")) + ":Link/%s:80"%(filters.get("budget_against")), _("Account") + ":Link/Account:80"]
|
||||
columns = [_(filters.get("budget_against")) + ":Link/%s:150"%(filters.get("budget_against")), _("Account") + ":Link/Account:150"]
|
||||
|
||||
group_months = False if filters["period"] == "Monthly" else True
|
||||
|
||||
@ -71,7 +71,7 @@ def get_columns(filters):
|
||||
if filters["period"] == "Yearly":
|
||||
labels = [_("Budget") + " " + str(year[0]), _("Actual ") + " " + str(year[0]), _("Varaiance ") + " " + str(year[0])]
|
||||
for label in labels:
|
||||
columns.append(label+":Float:80")
|
||||
columns.append(label+":Float:150")
|
||||
else:
|
||||
for label in [_("Budget") + " (%s)" + " " + str(year[0]), _("Actual") + " (%s)" + " " + str(year[0]), _("Variance") + " (%s)" + " " + str(year[0])]:
|
||||
if group_months:
|
||||
@ -79,11 +79,11 @@ def get_columns(filters):
|
||||
else:
|
||||
label = label % formatdate(from_date, format_string="MMM")
|
||||
|
||||
columns.append(label+":Float:80")
|
||||
columns.append(label+":Float:150")
|
||||
|
||||
if filters["period"] != "Yearly" :
|
||||
return columns + [_("Total Budget") + ":Float:80", _("Total Actual") + ":Float:80",
|
||||
_("Total Variance") + ":Float:80"]
|
||||
return columns + [_("Total Budget") + ":Float:150", _("Total Actual") + ":Float:150",
|
||||
_("Total Variance") + ":Float:150"]
|
||||
else:
|
||||
return columns
|
||||
|
||||
|
@ -128,7 +128,8 @@ def get_gl_entries(filters):
|
||||
order_by_statement = "order by posting_date, voucher_type, voucher_no"
|
||||
|
||||
if filters.get("group_by") == _("Group by Voucher (Consolidated)"):
|
||||
group_by_statement = "group by voucher_type, voucher_no, account, cost_center, against_voucher"
|
||||
group_by_statement = "group by voucher_type, voucher_no, account, cost_center"
|
||||
|
||||
select_fields = """, sum(debit) as debit, sum(credit) as credit,
|
||||
sum(debit_in_account_currency) as debit_in_account_currency,
|
||||
sum(credit_in_account_currency) as credit_in_account_currency"""
|
||||
|
@ -180,20 +180,28 @@ def calculate_values(accounts, gl_entries_by_account, opening_balances, filters,
|
||||
|
||||
if d["root_type"] == "Asset" or d["root_type"] == "Equity" or d["root_type"] == "Expense":
|
||||
d["opening_debit"] -= d["opening_credit"]
|
||||
d["opening_credit"] = 0.0
|
||||
total_row["opening_debit"] += d["opening_debit"]
|
||||
d["closing_debit"] -= d["closing_credit"]
|
||||
|
||||
# For opening
|
||||
check_opening_closing_has_negative_value(d, "opening_debit", "opening_credit")
|
||||
|
||||
# For closing
|
||||
check_opening_closing_has_negative_value(d, "closing_debit", "closing_credit")
|
||||
|
||||
if d["root_type"] == "Liability" or d["root_type"] == "Income":
|
||||
d["opening_credit"] -= d["opening_debit"]
|
||||
d["opening_debit"] = 0.0
|
||||
total_row["opening_credit"] += d["opening_credit"]
|
||||
if d["root_type"] == "Asset" or d["root_type"] == "Equity" or d["root_type"] == "Expense":
|
||||
d["closing_debit"] -= d["closing_credit"]
|
||||
d["closing_credit"] = 0.0
|
||||
total_row["closing_debit"] += d["closing_debit"]
|
||||
if d["root_type"] == "Liability" or d["root_type"] == "Income":
|
||||
d["closing_credit"] -= d["closing_debit"]
|
||||
d["closing_debit"] = 0.0
|
||||
total_row["closing_credit"] += d["closing_credit"]
|
||||
|
||||
# For opening
|
||||
check_opening_closing_has_negative_value(d, "opening_credit", "opening_debit")
|
||||
|
||||
# For closing
|
||||
check_opening_closing_has_negative_value(d, "closing_credit", "closing_debit")
|
||||
|
||||
total_row["opening_debit"] += d["opening_debit"]
|
||||
total_row["closing_debit"] += d["closing_debit"]
|
||||
total_row["opening_credit"] += d["opening_credit"]
|
||||
total_row["closing_credit"] += d["closing_credit"]
|
||||
|
||||
return total_row
|
||||
|
||||
@ -219,8 +227,6 @@ def prepare_data(accounts, filters, total_row, parent_children_map, company_curr
|
||||
if d.account_number else d.account_name)
|
||||
}
|
||||
|
||||
prepare_opening_and_closing(d)
|
||||
|
||||
for key in value_fields:
|
||||
row[key] = flt(d.get(key, 0.0), 3)
|
||||
|
||||
@ -295,22 +301,11 @@ def get_columns():
|
||||
}
|
||||
]
|
||||
|
||||
def prepare_opening_and_closing(d):
|
||||
d["closing_debit"] = d["opening_debit"] + d["debit"]
|
||||
d["closing_credit"] = d["opening_credit"] + d["credit"]
|
||||
def check_opening_closing_has_negative_value(d, dr_or_cr, switch_to_column):
|
||||
# If opening debit has negetive value then move it to opening credit and vice versa.
|
||||
|
||||
if d["root_type"] == "Asset" or d["root_type"] == "Equity" or d["root_type"] == "Expense":
|
||||
d["opening_debit"] -= d["opening_credit"]
|
||||
d["opening_credit"] = 0.0
|
||||
|
||||
if d["root_type"] == "Liability" or d["root_type"] == "Income":
|
||||
d["opening_credit"] -= d["opening_debit"]
|
||||
d["opening_debit"] = 0.0
|
||||
|
||||
if d["root_type"] == "Asset" or d["root_type"] == "Equity" or d["root_type"] == "Expense":
|
||||
d["closing_debit"] -= d["closing_credit"]
|
||||
d["closing_credit"] = 0.0
|
||||
|
||||
if d["root_type"] == "Liability" or d["root_type"] == "Income":
|
||||
d["closing_credit"] -= d["closing_debit"]
|
||||
d["closing_debit"] = 0.0
|
||||
if d[dr_or_cr] < 0:
|
||||
d[switch_to_column] = abs(d[dr_or_cr])
|
||||
d[dr_or_cr] = 0.0
|
||||
else:
|
||||
d[switch_to_column] = 0.0
|
||||
|
@ -70,11 +70,16 @@ def get_data():
|
||||
"link": "Tree/Item Group",
|
||||
"description": _("Tree of Item Groups."),
|
||||
},
|
||||
{
|
||||
"type": "doctype",
|
||||
"name": "Promotional Scheme",
|
||||
"description": _("Rules for applying different promotional schemes.")
|
||||
},
|
||||
{
|
||||
"type": "doctype",
|
||||
"name": "Pricing Rule",
|
||||
"description": _("Rules for applying pricing and discount.")
|
||||
},
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -111,6 +111,11 @@ def get_data():
|
||||
"description": _("Bundle items at time of sale."),
|
||||
"dependencies": ["Item"],
|
||||
},
|
||||
{
|
||||
"type": "doctype",
|
||||
"name": "Promotional Scheme",
|
||||
"description": _("Rules for applying different promotional schemes.")
|
||||
},
|
||||
{
|
||||
"type": "doctype",
|
||||
"name": "Pricing Rule",
|
||||
|
@ -0,0 +1,12 @@
|
||||
from __future__ import unicode_literals
|
||||
from frappe import _
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'kra_template',
|
||||
'transactions': [
|
||||
{
|
||||
'items': ['Appraisal']
|
||||
},
|
||||
],
|
||||
}
|
@ -12,24 +12,32 @@ def get_data():
|
||||
'items': ['Attendance', 'Attendance Request', 'Leave Application', 'Leave Allocation']
|
||||
},
|
||||
{
|
||||
'label': _('Payroll'),
|
||||
'items': ['Salary Structure Assignment', 'Salary Slip', 'Timesheet']
|
||||
'label': _('Lifecycle'),
|
||||
'items': ['Employee Transfer', 'Employee Promotion', 'Employee Separation']
|
||||
},
|
||||
{
|
||||
'label': _('Shift'),
|
||||
'items': ['Shift Request', 'Shift Assignment']
|
||||
},
|
||||
{
|
||||
'label': _('Expense'),
|
||||
'items': ['Expense Claim']
|
||||
'items': ['Expense Claim', 'Travel Request']
|
||||
},
|
||||
{
|
||||
'label': _('Benefit'),
|
||||
'items': ['Employee Benefit Application', 'Employee Benefit Claim']
|
||||
},
|
||||
{
|
||||
'label': _('Evaluation'),
|
||||
'items': ['Appraisal']
|
||||
},
|
||||
{
|
||||
'label': _('Training'),
|
||||
'items': ['Training Event', 'Training Result']
|
||||
'label': _('Payroll'),
|
||||
'items': ['Salary Structure Assignment', 'Salary Slip', 'Additional Salary', 'Timesheet','Employee Incentive', 'Retention Bonus']
|
||||
},
|
||||
{
|
||||
'label': _('Lifecycle'),
|
||||
'items': ['Employee Transfer', 'Employee Promotion', 'Employee Separation']
|
||||
}
|
||||
'label': _('Training'),
|
||||
'items': ['Training Event', 'Training Result', 'Training Feedback', 'Employee Skill Map']
|
||||
},
|
||||
]
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
from __future__ import unicode_literals
|
||||
from frappe import _
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'employee_onboarding_template',
|
||||
'transactions': [
|
||||
{
|
||||
'items': ['Employee Onboarding']
|
||||
},
|
||||
],
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
from __future__ import unicode_literals
|
||||
from frappe import _
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'employee_separation_template',
|
||||
'transactions': [
|
||||
{
|
||||
'items': ['Employee Separation']
|
||||
},
|
||||
],
|
||||
}
|
@ -13,6 +13,9 @@ def get_data():
|
||||
},
|
||||
{
|
||||
'items': ['Leave Period', 'Shift Type']
|
||||
},
|
||||
{
|
||||
'items': ['Service Level', 'Service Level Agreement']
|
||||
}
|
||||
]
|
||||
}
|
15
erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py
Normal file
15
erpnext/hr/doctype/job_applicant/job_applicant_dashboard.py
Normal file
@ -0,0 +1,15 @@
|
||||
from __future__ import unicode_literals
|
||||
from frappe import _
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'job_applicant',
|
||||
'transactions': [
|
||||
{
|
||||
'items': ['Employee', 'Employee Onboarding']
|
||||
},
|
||||
{
|
||||
'items': ['Job Offer']
|
||||
},
|
||||
],
|
||||
}
|
12
erpnext/hr/doctype/job_opening/job_opening_dashboard.py
Normal file
12
erpnext/hr/doctype/job_opening/job_opening_dashboard.py
Normal file
@ -0,0 +1,12 @@
|
||||
from __future__ import unicode_literals
|
||||
from frappe import _
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'job_title',
|
||||
'transactions': [
|
||||
{
|
||||
'items': ['Job Applicant']
|
||||
}
|
||||
],
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
from __future__ import unicode_literals
|
||||
from frappe import _
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'leave_allocation',
|
||||
'transactions': [
|
||||
{
|
||||
'items': ['Compensatory Leave Request']
|
||||
},
|
||||
{
|
||||
'items': ['Leave Encashment']
|
||||
}
|
||||
],
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
from __future__ import unicode_literals
|
||||
from frappe import _
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'loan_application',
|
||||
'transactions': [
|
||||
{
|
||||
'items': ['Loan']
|
||||
},
|
||||
],
|
||||
}
|
12
erpnext/hr/doctype/loan_type/loan_type_dashboard.py
Normal file
12
erpnext/hr/doctype/loan_type/loan_type_dashboard.py
Normal file
@ -0,0 +1,12 @@
|
||||
from __future__ import unicode_literals
|
||||
from frappe import _
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'loan_type',
|
||||
'transactions': [
|
||||
{
|
||||
'items': ['Loan Application']
|
||||
},
|
||||
],
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
from __future__ import unicode_literals
|
||||
from frappe import _
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'payroll_period',
|
||||
'transactions': [
|
||||
{
|
||||
'items': ['Employee Tax Exemption Proof Submission', 'Employee Tax Exemption Declaration']
|
||||
},
|
||||
],
|
||||
}
|
@ -448,6 +448,8 @@ class SalarySlip(TransactionBase):
|
||||
|
||||
if not overwrite and component_row.default_amount:
|
||||
amount += component_row.default_amount
|
||||
else:
|
||||
component_row.default_amount = amount
|
||||
|
||||
component_row.amount = amount
|
||||
component_row.deduct_full_tax_on_selected_payroll_date = struct_row.deduct_full_tax_on_selected_payroll_date
|
||||
|
@ -4,9 +4,15 @@ from frappe import _
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'salary_structure',
|
||||
'non_standard_fieldnames': {
|
||||
'Employee Grade': 'default_salary_structure'
|
||||
},
|
||||
'transactions': [
|
||||
{
|
||||
'items': ['Salary Structure Assignment']
|
||||
}
|
||||
'items': ['Salary Structure Assignment', 'Salary Slip']
|
||||
},
|
||||
{
|
||||
'items': ['Employee Grade']
|
||||
},
|
||||
]
|
||||
}
|
12
erpnext/hr/doctype/shift_request/shift_request_dashboard.py
Normal file
12
erpnext/hr/doctype/shift_request/shift_request_dashboard.py
Normal file
@ -0,0 +1,12 @@
|
||||
from __future__ import unicode_literals
|
||||
from frappe import _
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'shift_request',
|
||||
'transactions': [
|
||||
{
|
||||
'items': ['Shift Assignment']
|
||||
},
|
||||
],
|
||||
}
|
12
erpnext/hr/doctype/shift_type/shift_type_dashboard.py
Normal file
12
erpnext/hr/doctype/shift_type/shift_type_dashboard.py
Normal file
@ -0,0 +1,12 @@
|
||||
from __future__ import unicode_literals
|
||||
from frappe import _
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'shift_type',
|
||||
'transactions': [
|
||||
{
|
||||
'items': ['Shift Request', 'Shift Assignment']
|
||||
}
|
||||
],
|
||||
}
|
12
erpnext/hr/doctype/staffing_plan/staffing_plan_dashboard.py
Normal file
12
erpnext/hr/doctype/staffing_plan/staffing_plan_dashboard.py
Normal file
@ -0,0 +1,12 @@
|
||||
from __future__ import unicode_literals
|
||||
from frappe import _
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'staffing_plan',
|
||||
'transactions': [
|
||||
{
|
||||
'items': ['Job Opening']
|
||||
}
|
||||
],
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
from __future__ import unicode_literals
|
||||
from frappe import _
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'training_event',
|
||||
'transactions': [
|
||||
{
|
||||
'items': ['Training Result', 'Training Feedback']
|
||||
},
|
||||
],
|
||||
}
|
@ -1,14 +1,20 @@
|
||||
from __future__ import unicode_literals
|
||||
from frappe import _
|
||||
|
||||
data = {
|
||||
'heatmap': True,
|
||||
'heatmap_message': _('This is based on logs against this Vehicle. See timeline below for details'),
|
||||
'fieldname': 'license_plate',
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Logs'),
|
||||
'items': ['Vehicle Log']
|
||||
}
|
||||
]
|
||||
}
|
||||
def get_data():
|
||||
return {
|
||||
'heatmap': True,
|
||||
'heatmap_message': _('This is based on logs against this Vehicle. See timeline below for details'),
|
||||
'fieldname': 'license_plate',
|
||||
'non_standard_fieldnames':{
|
||||
'Delivery Trip': 'vehicle'
|
||||
},
|
||||
'transactions': [
|
||||
{
|
||||
'items': ['Vehicle Log']
|
||||
},
|
||||
{
|
||||
'items': ['Delivery Trip']
|
||||
}
|
||||
]
|
||||
}
|
@ -72,9 +72,10 @@ frappe.ui.form.on("Work Order", {
|
||||
frm.set_query("production_item", function() {
|
||||
return {
|
||||
query: "erpnext.controllers.queries.item_query",
|
||||
filters:{
|
||||
'is_stock_item': 1,
|
||||
}
|
||||
filters:[
|
||||
['is_stock_item', '=',1],
|
||||
['default_bom', '!=', '']
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -602,6 +602,6 @@ erpnext.patches.v11_1.set_salary_details_submittable
|
||||
erpnext.patches.v11_1.rename_depends_on_lwp
|
||||
execute:frappe.delete_doc("Report", "Inactive Items")
|
||||
erpnext.patches.v11_1.delete_scheduling_tool
|
||||
erpnext.patches.v12_0.make_custom_fields_for_bank_remittance
|
||||
erpnext.patches.v12_0.make_custom_fields_for_bank_remittance #14-06-2019
|
||||
execute:frappe.delete_doc_if_exists("Page", "support-analytics")
|
||||
erpnext.patches.v12_0.make_item_manufacturer
|
@ -30,23 +30,23 @@ def get_columns():
|
||||
"options": "Timesheet",
|
||||
"width": 150
|
||||
},
|
||||
{
|
||||
"label": _("Billable Hours"),
|
||||
"fieldtype": "Float",
|
||||
"fieldname": "total_billable_hours",
|
||||
"width": 50
|
||||
},
|
||||
{
|
||||
"label": _("Working Hours"),
|
||||
"fieldtype": "Float",
|
||||
"fieldname": "total_hours",
|
||||
"width": 50
|
||||
"width": 150
|
||||
},
|
||||
{
|
||||
"label": _("Billable Hours"),
|
||||
"fieldtype": "Float",
|
||||
"fieldname": "total_billable_hours",
|
||||
"width": 150
|
||||
},
|
||||
{
|
||||
"label": _("Billing Amount"),
|
||||
"fieldtype": "Currency",
|
||||
"fieldname": "amount",
|
||||
"width": 100
|
||||
"width": 150
|
||||
}
|
||||
]
|
||||
|
||||
|
@ -1,34 +1,34 @@
|
||||
{
|
||||
"add_total_row": 0,
|
||||
"creation": "2019-03-08 15:08:19.929728",
|
||||
"disable_prepared_report": 0,
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 0,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2019-03-08 15:08:19.929728",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Projects",
|
||||
"name": "Employee Billing Summary",
|
||||
"owner": "Administrator",
|
||||
"prepared_report": 0,
|
||||
"ref_doctype": "Timesheet",
|
||||
"report_name": "Employee Billing Summary",
|
||||
"report_type": "Script Report",
|
||||
"add_total_row": 1,
|
||||
"creation": "2019-03-08 15:08:19.929728",
|
||||
"disable_prepared_report": 0,
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 0,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2019-06-13 15:54:49.213973",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Projects",
|
||||
"name": "Employee Billing Summary",
|
||||
"owner": "Administrator",
|
||||
"prepared_report": 0,
|
||||
"ref_doctype": "Timesheet",
|
||||
"report_name": "Employee Billing Summary",
|
||||
"report_type": "Script Report",
|
||||
"roles": [
|
||||
{
|
||||
"role": "Projects User"
|
||||
},
|
||||
},
|
||||
{
|
||||
"role": "HR User"
|
||||
},
|
||||
},
|
||||
{
|
||||
"role": "Manufacturing User"
|
||||
},
|
||||
},
|
||||
{
|
||||
"role": "Employee"
|
||||
},
|
||||
},
|
||||
{
|
||||
"role": "Accounts User"
|
||||
}
|
||||
|
@ -1,34 +1,34 @@
|
||||
{
|
||||
"add_total_row": 0,
|
||||
"creation": "2019-03-11 16:22:39.460524",
|
||||
"disable_prepared_report": 0,
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 0,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2019-03-11 16:22:39.460524",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Projects",
|
||||
"name": "Project Billing Summary",
|
||||
"owner": "Administrator",
|
||||
"prepared_report": 0,
|
||||
"ref_doctype": "Timesheet",
|
||||
"report_name": "Project Billing Summary",
|
||||
"report_type": "Script Report",
|
||||
"add_total_row": 1,
|
||||
"creation": "2019-03-11 16:22:39.460524",
|
||||
"disable_prepared_report": 0,
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 0,
|
||||
"is_standard": "Yes",
|
||||
"modified": "2019-06-13 15:54:55.255947",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Projects",
|
||||
"name": "Project Billing Summary",
|
||||
"owner": "Administrator",
|
||||
"prepared_report": 0,
|
||||
"ref_doctype": "Timesheet",
|
||||
"report_name": "Project Billing Summary",
|
||||
"report_type": "Script Report",
|
||||
"roles": [
|
||||
{
|
||||
"role": "Projects User"
|
||||
},
|
||||
},
|
||||
{
|
||||
"role": "HR User"
|
||||
},
|
||||
},
|
||||
{
|
||||
"role": "Manufacturing User"
|
||||
},
|
||||
},
|
||||
{
|
||||
"role": "Employee"
|
||||
},
|
||||
},
|
||||
{
|
||||
"role": "Accounts User"
|
||||
}
|
||||
|
@ -14,8 +14,12 @@ erpnext.doctypes_with_dimensions.forEach((doctype) => {
|
||||
onload: function(frm) {
|
||||
dimension_filters.then((dimensions) => {
|
||||
dimensions.forEach((dimension) => {
|
||||
frm.set_query(dimension['fieldname'],{
|
||||
"is_group": 0
|
||||
frappe.model.with_doctype(dimension['document_type'], () => {
|
||||
if (frappe.meta.has_field(dimension['document_type'], 'is_group')) {
|
||||
frm.set_query(dimension['fieldname'], {
|
||||
"is_group": 0
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -268,26 +268,27 @@ erpnext.SerialNoBatchSelector = Class.extend({
|
||||
{fieldname: 'batches', fieldtype: 'Table', label: __('Batch Entries'),
|
||||
fields: [
|
||||
{
|
||||
fieldtype:'Link',
|
||||
fieldname:'batch_no',
|
||||
options: 'Batch',
|
||||
label: __('Select Batch'),
|
||||
in_list_view:1,
|
||||
get_query: function() {
|
||||
'fieldtype': 'Link',
|
||||
'read_only': 0,
|
||||
'fieldname': 'batch_no',
|
||||
'options': 'Batch',
|
||||
'label': __('Select Batch'),
|
||||
'in_list_view': 1,
|
||||
get_query: function () {
|
||||
return {
|
||||
filters: {item: me.item_code },
|
||||
query: 'erpnext.controllers.queries.get_batch_numbers'
|
||||
};
|
||||
filters: { item: me.item_code },
|
||||
query: 'erpnext.controllers.queries.get_batch_numbers'
|
||||
};
|
||||
},
|
||||
onchange: function(e) {
|
||||
change: function () {
|
||||
let val = this.get_value();
|
||||
if(val.length === 0) {
|
||||
if (val.length === 0) {
|
||||
this.grid_row.on_grid_fields_dict
|
||||
.available_qty.set_value(0);
|
||||
return;
|
||||
}
|
||||
let selected_batches = this.grid.grid_rows.map((row) => {
|
||||
if(row === this.grid_row) {
|
||||
if (row === this.grid_row) {
|
||||
return "";
|
||||
}
|
||||
|
||||
@ -295,12 +296,12 @@ erpnext.SerialNoBatchSelector = Class.extend({
|
||||
return row.on_grid_fields_dict.batch_no.get_value();
|
||||
}
|
||||
});
|
||||
if(selected_batches.includes(val)) {
|
||||
if (selected_batches.includes(val)) {
|
||||
this.set_value("");
|
||||
frappe.throw(__(`Batch ${val} already selected.`));
|
||||
return;
|
||||
}
|
||||
if(me.warehouse_details.name) {
|
||||
if (me.warehouse_details.name) {
|
||||
frappe.call({
|
||||
method: 'erpnext.stock.doctype.batch.batch.get_batch_qty',
|
||||
args: {
|
||||
@ -323,31 +324,32 @@ erpnext.SerialNoBatchSelector = Class.extend({
|
||||
}
|
||||
},
|
||||
{
|
||||
fieldtype:'Float',
|
||||
read_only:1,
|
||||
fieldname:'available_qty',
|
||||
label: __('Available'),
|
||||
in_list_view:1,
|
||||
default: 0,
|
||||
onchange: function() {
|
||||
'fieldtype': 'Float',
|
||||
'read_only': 1,
|
||||
'fieldname': 'available_qty',
|
||||
'label': __('Available'),
|
||||
'in_list_view': 1,
|
||||
'default': 0,
|
||||
change: function () {
|
||||
this.grid_row.on_grid_fields_dict.selected_qty.set_value('0');
|
||||
}
|
||||
},
|
||||
{
|
||||
fieldtype:'Float',
|
||||
fieldname:'selected_qty',
|
||||
label: __('Qty'),
|
||||
in_list_view:1,
|
||||
'fieldtype': 'Float',
|
||||
'read_only': 0,
|
||||
'fieldname': 'selected_qty',
|
||||
'label': __('Qty'),
|
||||
'in_list_view': 1,
|
||||
'default': 0,
|
||||
onchange: function(e) {
|
||||
change: function () {
|
||||
var batch_no = this.grid_row.on_grid_fields_dict.batch_no.get_value();
|
||||
var available_qty = this.grid_row.on_grid_fields_dict.available_qty.get_value();
|
||||
var selected_qty = this.grid_row.on_grid_fields_dict.selected_qty.get_value();
|
||||
|
||||
if(batch_no.length === 0 && parseInt(selected_qty)!==0) {
|
||||
if (batch_no.length === 0 && parseInt(selected_qty) !== 0) {
|
||||
frappe.throw(__("Please select a batch"));
|
||||
}
|
||||
if(me.warehouse_details.type === 'Source Warehouse' &&
|
||||
if (me.warehouse_details.type === 'Source Warehouse' &&
|
||||
parseFloat(available_qty) < parseFloat(selected_qty)) {
|
||||
|
||||
this.set_value('0');
|
||||
@ -363,7 +365,7 @@ erpnext.SerialNoBatchSelector = Class.extend({
|
||||
],
|
||||
in_place_edit: true,
|
||||
data: this.data,
|
||||
get_data: function() {
|
||||
get_data: function () {
|
||||
return this.data;
|
||||
},
|
||||
}
|
||||
|
@ -2,16 +2,13 @@
|
||||
// MIT License. See license.txt
|
||||
|
||||
frappe.ui.form.on('Website Theme', {
|
||||
apply_custom_theme(frm) {
|
||||
let custom_theme = frm.doc.custom_theme;
|
||||
custom_theme = custom_theme.split('\n');
|
||||
if (
|
||||
frm.doc.apply_custom_theme
|
||||
&& custom_theme.length === 2
|
||||
&& custom_theme[1].includes('frappe/public/scss/website')
|
||||
validate(frm) {
|
||||
let theme_scss = frm.doc.theme_scss;
|
||||
if (theme_scss.includes('frappe/public/scss/website')
|
||||
&& !theme_scss.includes('erpnext/public/scss/website')
|
||||
) {
|
||||
frm.set_value('custom_theme',
|
||||
`$primary: #7575ff;\n@import "frappe/public/scss/website";\n@import "erpnext/public/scss/website";`);
|
||||
frm.set_value('theme_scss',
|
||||
`${frm.doc.theme_scss}\n@import "erpnext/public/scss/website";`);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -138,14 +138,15 @@ class GSTR3BReport(Document):
|
||||
outward_supply_tax_amounts = self.get_tax_amounts("Sales Invoice")
|
||||
inward_supply_tax_amounts = self.get_tax_amounts("Purchase Invoice", reverse_charge="Y")
|
||||
itc_details = self.get_itc_details()
|
||||
inter_state_supplies = self.get_inter_state_supplies(self.gst_details.get("gst_state"))
|
||||
inward_nil_exempt = self.get_inward_nil_exempt(self.gst_details.get("gst_state"))
|
||||
|
||||
self.prepare_data("Sales Invoice", outward_supply_tax_amounts, "sup_details", "osup_det", ["Registered Regular"])
|
||||
self.prepare_data("Sales Invoice", outward_supply_tax_amounts, "sup_details", "osup_zero", ["SEZ", "Deemed Export", "Overseas"])
|
||||
self.prepare_data("Purchase Invoice", inward_supply_tax_amounts, "sup_details", "isup_rev", ["Registered Regular"], reverse_charge="Y")
|
||||
self.report_dict["sup_details"]["osup_nil_exmp"]["txval"] = flt(self.get_nil_rated_supply_value(), 2)
|
||||
self.set_itc_details(itc_details)
|
||||
|
||||
inter_state_supplies = self.get_inter_state_supplies(self.gst_details.get("gst_state_number"))
|
||||
inward_nil_exempt = self.get_inward_nil_exempt(self.gst_details.get("gst_state"))
|
||||
self.set_inter_state_supply(inter_state_supplies)
|
||||
self.set_inward_nil_exempt(inward_nil_exempt)
|
||||
|
||||
@ -221,7 +222,7 @@ class GSTR3BReport(Document):
|
||||
for k, v in iteritems(account_map):
|
||||
txval -= self.report_dict.get(supply_type, {}).get(supply_category, {}).get(v, 0)
|
||||
|
||||
self.report_dict[supply_type][supply_category]["txval"] = flt(txval, 2)
|
||||
self.report_dict[supply_type][supply_category]["txval"] += flt(txval, 2)
|
||||
|
||||
def set_inter_state_supply(self, inter_state_supply):
|
||||
|
||||
@ -283,28 +284,40 @@ class GSTR3BReport(Document):
|
||||
and s.company = %s and s.company_gstin = %s""",
|
||||
(self.month_no, self.year, self.company, self.gst_details.get("gstin")), as_dict=1)[0].total
|
||||
|
||||
def get_inter_state_supplies(self, state):
|
||||
def get_inter_state_supplies(self, state_number):
|
||||
|
||||
inter_state_supply = frappe.db.sql(""" select sum(s.grand_total) as total, t.tax_amount, a.gst_state, s.gst_category
|
||||
from `tabSales Invoice` s, `tabSales Taxes and Charges` t, `tabAddress` a
|
||||
where t.parent = s.name and s.customer_address = a.name and
|
||||
s.docstatus = 1 and month(s.posting_date) = %s and year(s.posting_date) = %s and
|
||||
a.gst_state <> %s and s.company = %s and s.company_gstin = %s and
|
||||
s.gst_category in ('Unregistered', 'Registered Composition', 'UIN Holders')
|
||||
group by s.gst_category, a.state""", (self.month_no, self.year, state, self.company, self.gst_details.get("gstin")), as_dict=1)
|
||||
inter_state_supply_taxable_value = frappe.db.sql(""" select sum(s.net_total) as total, s.place_of_supply, s.gst_category
|
||||
from `tabSales Invoice` s where s.docstatus = 1 and month(s.posting_date) = %s and year(s.posting_date) = %s
|
||||
and s.company = %s and s.company_gstin = %s and s.gst_category in ('Unregistered', 'Registered Composition', 'UIN Holders')
|
||||
group by s.gst_category, s.place_of_supply""", (self.month_no, self.year, self.company, self.gst_details.get("gstin")), as_dict=1)
|
||||
|
||||
inter_state_supply_tax = frappe.db.sql(""" select sum(t.tax_amount) as tax_amount, s.place_of_supply, s.gst_category
|
||||
from `tabSales Invoice` s, `tabSales Taxes and Charges` t
|
||||
where t.parent = s.name and s.docstatus = 1 and month(s.posting_date) = %s and year(s.posting_date) = %s
|
||||
and s.company = %s and s.company_gstin = %s and s.gst_category in ('Unregistered', 'Registered Composition', 'UIN Holders')
|
||||
group by s.gst_category, s.place_of_supply""", (self.month_no, self.year, self.company, self.gst_details.get("gstin")), as_dict=1)
|
||||
|
||||
inter_state_supply_tax_mapping={}
|
||||
inter_state_supply_details = {}
|
||||
|
||||
for d in inter_state_supply:
|
||||
for d in inter_state_supply_tax:
|
||||
inter_state_supply_tax_mapping.setdefault(d.place_of_supply, d.tax_amount)
|
||||
|
||||
for d in inter_state_supply_taxable_value:
|
||||
inter_state_supply_details.setdefault(
|
||||
d.gst_category, []
|
||||
)
|
||||
|
||||
inter_state_supply_details[d.gst_category].append({
|
||||
"pos": get_state_code(d.gst_state),
|
||||
"txval": d.total - d.tax_amount,
|
||||
"iamt": d.tax_amount
|
||||
})
|
||||
if state_number != d.place_of_supply.split("-")[0]:
|
||||
inter_state_supply_details[d.gst_category].append({
|
||||
"pos": d.place_of_supply,
|
||||
"txval": flt(d.total, 2),
|
||||
"iamt": flt(inter_state_supply_tax_mapping.get(d.place_of_supply), 2)
|
||||
})
|
||||
else:
|
||||
self.report_dict["sup_details"]["osup_det"]["txval"] += flt(d.total, 2)
|
||||
self.report_dict["sup_details"]["osup_det"]["camt"] += flt(inter_state_supply_tax_mapping.get(d.place_of_supply)/2, 2)
|
||||
self.report_dict["sup_details"]["osup_det"]["samt"] += flt(inter_state_supply_tax_mapping.get(d.place_of_supply)/2, 2)
|
||||
|
||||
return inter_state_supply_details
|
||||
|
||||
|
@ -275,7 +275,7 @@ def make_custom_fields(update=True):
|
||||
],
|
||||
'Company': [
|
||||
dict(fieldname='hra_section', label='HRA Settings',
|
||||
fieldtype='Section Break', insert_after='asset_received_but_not_billed'),
|
||||
fieldtype='Section Break', insert_after='asset_received_but_not_billed', collapsible=1),
|
||||
dict(fieldname='basic_component', label='Basic Component',
|
||||
fieldtype='Link', options='Salary Component', insert_after='hra_section'),
|
||||
dict(fieldname='hra_component', label='HRA Component',
|
||||
|
@ -14,6 +14,15 @@ def validate_gstin_for_india(doc, method):
|
||||
if not hasattr(doc, 'gstin') or not doc.gstin:
|
||||
return
|
||||
|
||||
gst_category = []
|
||||
|
||||
if len(doc.links):
|
||||
link_doctype = doc.links[0].get("link_doctype")
|
||||
link_name = doc.links[0].get("link_name")
|
||||
|
||||
if link_doctype in ["Customer", "Supplier"]:
|
||||
gst_category = frappe.db.get_value(link_doctype, {'name': link_name}, ['gst_category'])
|
||||
|
||||
doc.gstin = doc.gstin.upper().strip()
|
||||
if not doc.gstin or doc.gstin == 'NA':
|
||||
return
|
||||
@ -21,26 +30,31 @@ def validate_gstin_for_india(doc, method):
|
||||
if len(doc.gstin) != 15:
|
||||
frappe.throw(_("Invalid GSTIN! A GSTIN must have 15 characters."))
|
||||
|
||||
p = re.compile("^[0-9]{2}[A-Z]{4}[0-9A-Z]{1}[0-9]{4}[A-Z]{1}[1-9A-Z]{1}[1-9A-Z]{1}[0-9A-Z]{1}$")
|
||||
if not p.match(doc.gstin):
|
||||
frappe.throw(_("Invalid GSTIN! The input you've entered doesn't match the format of GSTIN."))
|
||||
if gst_category and gst_category == 'UIN Holders':
|
||||
p = re.compile("^[0-9]{4}[A-Z]{3}[0-9]{5}[0-9A-Z]{3}")
|
||||
if not p.match(doc.gstin):
|
||||
frappe.throw(_("Invalid GSTIN! The input you've entered doesn't match the GSTIN format for UIN Holders or Non-Resident OIDAR Service Providers"))
|
||||
else:
|
||||
p = re.compile("^[0-9]{2}[A-Z]{4}[0-9A-Z]{1}[0-9]{4}[A-Z]{1}[1-9A-Z]{1}[1-9A-Z]{1}[0-9A-Z]{1}$")
|
||||
if not p.match(doc.gstin):
|
||||
frappe.throw(_("Invalid GSTIN! The input you've entered doesn't match the format of GSTIN."))
|
||||
|
||||
validate_gstin_check_digit(doc.gstin)
|
||||
validate_gstin_check_digit(doc.gstin)
|
||||
|
||||
if not doc.gst_state:
|
||||
if not doc.state:
|
||||
return
|
||||
state = doc.state.lower()
|
||||
states_lowercase = {s.lower():s for s in states}
|
||||
if state in states_lowercase:
|
||||
doc.gst_state = states_lowercase[state]
|
||||
else:
|
||||
return
|
||||
if not doc.gst_state:
|
||||
if not doc.state:
|
||||
return
|
||||
state = doc.state.lower()
|
||||
states_lowercase = {s.lower():s for s in states}
|
||||
if state in states_lowercase:
|
||||
doc.gst_state = states_lowercase[state]
|
||||
else:
|
||||
return
|
||||
|
||||
doc.gst_state_number = state_numbers[doc.gst_state]
|
||||
if doc.gst_state_number != doc.gstin[:2]:
|
||||
frappe.throw(_("Invalid GSTIN! First 2 digits of GSTIN should match with State number {0}.")
|
||||
.format(doc.gst_state_number))
|
||||
doc.gst_state_number = state_numbers[doc.gst_state]
|
||||
if doc.gst_state_number != doc.gstin[:2]:
|
||||
frappe.throw(_("Invalid GSTIN! First 2 digits of GSTIN should match with State number {0}.")
|
||||
.format(doc.gst_state_number))
|
||||
|
||||
def validate_gstin_check_digit(gstin):
|
||||
''' Function to validate the check digit of the GSTIN.'''
|
||||
|
0
erpnext/regional/report/datev/__init__.py
Normal file
0
erpnext/regional/report/datev/__init__.py
Normal file
32
erpnext/regional/report/datev/datev.js
Normal file
32
erpnext/regional/report/datev/datev.js
Normal file
@ -0,0 +1,32 @@
|
||||
frappe.query_reports["DATEV"] = {
|
||||
"filters": [
|
||||
{
|
||||
"fieldname": "company",
|
||||
"label": __("Company"),
|
||||
"fieldtype": "Link",
|
||||
"options": "Company",
|
||||
"default": frappe.defaults.get_user_default("Company") || frappe.defaults.get_global_default("Company"),
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "from_date",
|
||||
"label": __("From Date"),
|
||||
"default": frappe.datetime.month_start(),
|
||||
"fieldtype": "Date",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "to_date",
|
||||
"label": __("To Date"),
|
||||
"default": frappe.datetime.now_date(),
|
||||
"fieldtype": "Date",
|
||||
"reqd": 1
|
||||
}
|
||||
],
|
||||
onload: function(query_report) {
|
||||
query_report.page.add_inner_button("Download DATEV Export", () => {
|
||||
const filters = JSON.stringify(query_report.get_values());
|
||||
window.open(`/api/method/erpnext.regional.report.datev.datev.download_datev_csv?filters=${filters}`);
|
||||
});
|
||||
}
|
||||
};
|
29
erpnext/regional/report/datev/datev.json
Normal file
29
erpnext/regional/report/datev/datev.json
Normal file
@ -0,0 +1,29 @@
|
||||
{
|
||||
"add_total_row": 0,
|
||||
"apply_user_permissions": 0,
|
||||
"creation": "2019-04-24 08:45:16.650129",
|
||||
"disabled": 0,
|
||||
"icon": "octicon octicon-repo-pull",
|
||||
"color": "#4CB944",
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 0,
|
||||
"is_standard": "Yes",
|
||||
"module": "Regional",
|
||||
"name": "DATEV",
|
||||
"owner": "Administrator",
|
||||
"ref_doctype": "GL Entry",
|
||||
"report_name": "DATEV",
|
||||
"report_type": "Script Report",
|
||||
"roles": [
|
||||
{
|
||||
"role": "Accounts User"
|
||||
},
|
||||
{
|
||||
"role": "Accounts Manager"
|
||||
},
|
||||
{
|
||||
"role": "Auditor"
|
||||
}
|
||||
]
|
||||
}
|
373
erpnext/regional/report/datev/datev.py
Normal file
373
erpnext/regional/report/datev/datev.py
Normal file
@ -0,0 +1,373 @@
|
||||
# coding: utf-8
|
||||
"""
|
||||
Provide a report and downloadable CSV according to the German DATEV format.
|
||||
|
||||
- Query report showing only the columns that contain data, formatted nicely for
|
||||
dispay to the user.
|
||||
- CSV download functionality `download_datev_csv` that provides a CSV file with
|
||||
all required columns. Used to import the data into the DATEV Software.
|
||||
"""
|
||||
from __future__ import unicode_literals
|
||||
import json
|
||||
from six import string_types
|
||||
import frappe
|
||||
from frappe import _
|
||||
import pandas as pd
|
||||
|
||||
|
||||
def execute(filters=None):
|
||||
"""Entry point for frappe."""
|
||||
validate_filters(filters)
|
||||
result = get_gl_entries(filters, as_dict=0)
|
||||
columns = get_columns()
|
||||
|
||||
return columns, result
|
||||
|
||||
|
||||
def validate_filters(filters):
|
||||
"""Make sure all mandatory filters are present."""
|
||||
if not filters.get('company'):
|
||||
frappe.throw(_('{0} is mandatory').format(_('Company')))
|
||||
|
||||
if not filters.get('from_date'):
|
||||
frappe.throw(_('{0} is mandatory').format(_('From Date')))
|
||||
|
||||
if not filters.get('to_date'):
|
||||
frappe.throw(_('{0} is mandatory').format(_('To Date')))
|
||||
|
||||
|
||||
def get_columns():
|
||||
"""Return the list of columns that will be shown in query report."""
|
||||
columns = [
|
||||
{
|
||||
"label": "Umsatz (ohne Soll/Haben-Kz)",
|
||||
"fieldname": "Umsatz (ohne Soll/Haben-Kz)",
|
||||
"fieldtype": "Currency",
|
||||
},
|
||||
{
|
||||
"label": "Soll/Haben-Kennzeichen",
|
||||
"fieldname": "Soll/Haben-Kennzeichen",
|
||||
"fieldtype": "Data",
|
||||
},
|
||||
{
|
||||
"label": "Kontonummer",
|
||||
"fieldname": "Kontonummer",
|
||||
"fieldtype": "Data",
|
||||
},
|
||||
{
|
||||
"label": "Gegenkonto (ohne BU-Schlüssel)",
|
||||
"fieldname": "Gegenkonto (ohne BU-Schlüssel)",
|
||||
"fieldtype": "Data",
|
||||
},
|
||||
{
|
||||
"label": "Belegdatum",
|
||||
"fieldname": "Belegdatum",
|
||||
"fieldtype": "Date",
|
||||
},
|
||||
{
|
||||
"label": "Buchungstext",
|
||||
"fieldname": "Buchungstext",
|
||||
"fieldtype": "Text",
|
||||
},
|
||||
{
|
||||
"label": "Beleginfo - Art 1",
|
||||
"fieldname": "Beleginfo - Art 1",
|
||||
"fieldtype": "Data",
|
||||
},
|
||||
{
|
||||
"label": "Beleginfo - Inhalt 1",
|
||||
"fieldname": "Beleginfo - Inhalt 1",
|
||||
"fieldtype": "Data",
|
||||
},
|
||||
{
|
||||
"label": "Beleginfo - Art 2",
|
||||
"fieldname": "Beleginfo - Art 2",
|
||||
"fieldtype": "Data",
|
||||
},
|
||||
{
|
||||
"label": "Beleginfo - Inhalt 2",
|
||||
"fieldname": "Beleginfo - Inhalt 2",
|
||||
"fieldtype": "Data",
|
||||
}
|
||||
]
|
||||
|
||||
return columns
|
||||
|
||||
|
||||
def get_gl_entries(filters, as_dict):
|
||||
"""
|
||||
Get a list of accounting entries.
|
||||
|
||||
Select GL Entries joined with Account and Party Account in order to get the
|
||||
account numbers. Returns a list of accounting entries.
|
||||
|
||||
Arguments:
|
||||
filters -- dict of filters to be passed to the sql query
|
||||
as_dict -- return as list of dicts [0,1]
|
||||
"""
|
||||
gl_entries = frappe.db.sql("""
|
||||
select
|
||||
|
||||
/* either debit or credit amount; always positive */
|
||||
case gl.debit when 0 then gl.credit else gl.debit end as 'Umsatz (ohne Soll/Haben-Kz)',
|
||||
|
||||
/* 'H' when credit, 'S' when debit */
|
||||
case gl.debit when 0 then 'H' else 'S' end as 'Soll/Haben-Kennzeichen',
|
||||
|
||||
/* account number or, if empty, party account number */
|
||||
coalesce(acc.account_number, acc_pa.account_number) as 'Kontonummer',
|
||||
|
||||
/* against number or, if empty, party against number */
|
||||
coalesce(acc_against.account_number, acc_against_pa.account_number) as 'Gegenkonto (ohne BU-Schlüssel)',
|
||||
|
||||
gl.posting_date as 'Belegdatum',
|
||||
gl.remarks as 'Buchungstext',
|
||||
gl.voucher_type as 'Beleginfo - Art 1',
|
||||
gl.voucher_no as 'Beleginfo - Inhalt 1',
|
||||
gl.against_voucher_type as 'Beleginfo - Art 2',
|
||||
gl.against_voucher as 'Beleginfo - Inhalt 2'
|
||||
|
||||
from `tabGL Entry` gl
|
||||
|
||||
/* Statistisches Konto (Debitoren/Kreditoren) */
|
||||
left join `tabParty Account` pa
|
||||
on gl.against = pa.parent
|
||||
and gl.company = pa.company
|
||||
|
||||
/* Kontonummer */
|
||||
left join `tabAccount` acc
|
||||
on gl.account = acc.name
|
||||
|
||||
/* Gegenkonto-Nummer */
|
||||
left join `tabAccount` acc_against
|
||||
on gl.against = acc_against.name
|
||||
|
||||
/* Statistische Kontonummer */
|
||||
left join `tabAccount` acc_pa
|
||||
on pa.account = acc_pa.name
|
||||
|
||||
/* Statistische Gegenkonto-Nummer */
|
||||
left join `tabAccount` acc_against_pa
|
||||
on pa.account = acc_against_pa.name
|
||||
|
||||
where gl.company = %(company)s
|
||||
and DATE(gl.posting_date) >= %(from_date)s
|
||||
and DATE(gl.posting_date) <= %(to_date)s
|
||||
order by 'Belegdatum', gl.voucher_no""", filters, as_dict=as_dict)
|
||||
|
||||
return gl_entries
|
||||
|
||||
|
||||
def get_datev_csv(data):
|
||||
"""
|
||||
Fill in missing columns and return a CSV in DATEV Format.
|
||||
|
||||
Arguments:
|
||||
data -- array of dictionaries
|
||||
"""
|
||||
columns = [
|
||||
# All possible columns must tbe listed here, because DATEV requires them to
|
||||
# be present in the CSV.
|
||||
# ---
|
||||
# Umsatz
|
||||
"Umsatz (ohne Soll/Haben-Kz)",
|
||||
"Soll/Haben-Kennzeichen",
|
||||
"WKZ Umsatz",
|
||||
"Kurs",
|
||||
"Basis-Umsatz",
|
||||
"WKZ Basis-Umsatz",
|
||||
# Konto/Gegenkonto
|
||||
"Kontonummer",
|
||||
"Gegenkonto (ohne BU-Schlüssel)",
|
||||
"BU-Schlüssel",
|
||||
# Datum
|
||||
"Belegdatum",
|
||||
# Belegfelder
|
||||
"Belegfeld 1",
|
||||
"Belegfeld 2",
|
||||
# Weitere Felder
|
||||
"Skonto",
|
||||
"Buchungstext",
|
||||
# OPOS-Informationen
|
||||
"Postensperre",
|
||||
"Diverse Adressnummer",
|
||||
"Geschäftspartnerbank",
|
||||
"Sachverhalt",
|
||||
"Zinssperre",
|
||||
# Digitaler Beleg
|
||||
"Beleglink",
|
||||
# Beleginfo
|
||||
"Beleginfo - Art 1",
|
||||
"Beleginfo - Inhalt 1",
|
||||
"Beleginfo - Art 2",
|
||||
"Beleginfo - Inhalt 2",
|
||||
"Beleginfo - Art 3",
|
||||
"Beleginfo - Inhalt 3",
|
||||
"Beleginfo - Art 4",
|
||||
"Beleginfo - Inhalt 4",
|
||||
"Beleginfo - Art 5",
|
||||
"Beleginfo - Inhalt 5",
|
||||
"Beleginfo - Art 6",
|
||||
"Beleginfo - Inhalt 6",
|
||||
"Beleginfo - Art 7",
|
||||
"Beleginfo - Inhalt 7",
|
||||
"Beleginfo - Art 8",
|
||||
"Beleginfo - Inhalt 8",
|
||||
# Kostenrechnung
|
||||
"Kost 1 - Kostenstelle",
|
||||
"Kost 2 - Kostenstelle",
|
||||
"Kost-Menge",
|
||||
# Steuerrechnung
|
||||
"EU-Land u. UStID",
|
||||
"EU-Steuersatz",
|
||||
"Abw. Versteuerungsart",
|
||||
# L+L Sachverhalt
|
||||
"Sachverhalt L+L",
|
||||
"Funktionsergänzung L+L",
|
||||
# Funktion Steuerschlüssel 49
|
||||
"BU 49 Hauptfunktionstyp",
|
||||
"BU 49 Hauptfunktionsnummer",
|
||||
"BU 49 Funktionsergänzung",
|
||||
# Zusatzinformationen
|
||||
"Zusatzinformation - Art 1",
|
||||
"Zusatzinformation - Inhalt 1",
|
||||
"Zusatzinformation - Art 2",
|
||||
"Zusatzinformation - Inhalt 2",
|
||||
"Zusatzinformation - Art 3",
|
||||
"Zusatzinformation - Inhalt 3",
|
||||
"Zusatzinformation - Art 4",
|
||||
"Zusatzinformation - Inhalt 4",
|
||||
"Zusatzinformation - Art 5",
|
||||
"Zusatzinformation - Inhalt 5",
|
||||
"Zusatzinformation - Art 6",
|
||||
"Zusatzinformation - Inhalt 6",
|
||||
"Zusatzinformation - Art 7",
|
||||
"Zusatzinformation - Inhalt 7",
|
||||
"Zusatzinformation - Art 8",
|
||||
"Zusatzinformation - Inhalt 8",
|
||||
"Zusatzinformation - Art 9",
|
||||
"Zusatzinformation - Inhalt 9",
|
||||
"Zusatzinformation - Art 10",
|
||||
"Zusatzinformation - Inhalt 10",
|
||||
"Zusatzinformation - Art 11",
|
||||
"Zusatzinformation - Inhalt 11",
|
||||
"Zusatzinformation - Art 12",
|
||||
"Zusatzinformation - Inhalt 12",
|
||||
"Zusatzinformation - Art 13",
|
||||
"Zusatzinformation - Inhalt 13",
|
||||
"Zusatzinformation - Art 14",
|
||||
"Zusatzinformation - Inhalt 14",
|
||||
"Zusatzinformation - Art 15",
|
||||
"Zusatzinformation - Inhalt 15",
|
||||
"Zusatzinformation - Art 16",
|
||||
"Zusatzinformation - Inhalt 16",
|
||||
"Zusatzinformation - Art 17",
|
||||
"Zusatzinformation - Inhalt 17",
|
||||
"Zusatzinformation - Art 18",
|
||||
"Zusatzinformation - Inhalt 18",
|
||||
"Zusatzinformation - Art 19",
|
||||
"Zusatzinformation - Inhalt 19",
|
||||
"Zusatzinformation - Art 20",
|
||||
"Zusatzinformation - Inhalt 20",
|
||||
# Mengenfelder LuF
|
||||
"Stück",
|
||||
"Gewicht",
|
||||
# Forderungsart
|
||||
"Zahlweise",
|
||||
"Forderungsart",
|
||||
"Veranlagungsjahr",
|
||||
"Zugeordnete Fälligkeit",
|
||||
# Weitere Felder
|
||||
"Skontotyp",
|
||||
# Anzahlungen
|
||||
"Auftragsnummer",
|
||||
"Buchungstyp",
|
||||
"USt-Schlüssel (Anzahlungen)",
|
||||
"EU-Land (Anzahlungen)",
|
||||
"Sachverhalt L+L (Anzahlungen)",
|
||||
"EU-Steuersatz (Anzahlungen)",
|
||||
"Erlöskonto (Anzahlungen)",
|
||||
# Stapelinformationen
|
||||
"Herkunft-Kz",
|
||||
# Technische Identifikation
|
||||
"Buchungs GUID",
|
||||
# Kostenrechnung
|
||||
"Kost-Datum",
|
||||
# OPOS-Informationen
|
||||
"SEPA-Mandatsreferenz",
|
||||
"Skontosperre",
|
||||
# Gesellschafter und Sonderbilanzsachverhalt
|
||||
"Gesellschaftername",
|
||||
"Beteiligtennummer",
|
||||
"Identifikationsnummer",
|
||||
"Zeichnernummer",
|
||||
# OPOS-Informationen
|
||||
"Postensperre bis",
|
||||
# Gesellschafter und Sonderbilanzsachverhalt
|
||||
"Bezeichnung SoBil-Sachverhalt",
|
||||
"Kennzeichen SoBil-Buchung",
|
||||
# Stapelinformationen
|
||||
"Festschreibung",
|
||||
# Datum
|
||||
"Leistungsdatum",
|
||||
"Datum Zuord. Steuerperiode",
|
||||
# OPOS-Informationen
|
||||
"Fälligkeit",
|
||||
# Konto/Gegenkonto
|
||||
"Generalumkehr (GU)",
|
||||
# Steuersatz für Steuerschlüssel
|
||||
"Steuersatz",
|
||||
"Land"
|
||||
]
|
||||
|
||||
empty_df = pd.DataFrame(columns=columns)
|
||||
data_df = pd.DataFrame.from_records(data)
|
||||
|
||||
result = empty_df.append(data_df)
|
||||
result["Belegdatum"] = pd.to_datetime(result["Belegdatum"])
|
||||
|
||||
return result.to_csv(
|
||||
sep=b';',
|
||||
# European decimal seperator
|
||||
decimal=',',
|
||||
# Windows "ANSI" encoding
|
||||
encoding='latin_1',
|
||||
# format date as DDMM
|
||||
date_format='%d%m',
|
||||
# Windows line terminator
|
||||
line_terminator=b'\r\n',
|
||||
# Do not number rows
|
||||
index=False,
|
||||
# Use all columns defined above
|
||||
columns=columns
|
||||
)
|
||||
|
||||
|
||||
@frappe.whitelist()
|
||||
def download_datev_csv(filters=None):
|
||||
"""
|
||||
Provide accounting entries for download in DATEV format.
|
||||
|
||||
Validate the filters, get the data, produce the CSV file and provide it for
|
||||
download. Can be called like this:
|
||||
|
||||
GET /api/method/erpnext.regional.report.datev.datev.download_datev_csv
|
||||
|
||||
Arguments / Params:
|
||||
filters -- dict of filters to be passed to the sql query
|
||||
"""
|
||||
if isinstance(filters, string_types):
|
||||
filters = json.loads(filters)
|
||||
|
||||
validate_filters(filters)
|
||||
data = get_gl_entries(filters, as_dict=1)
|
||||
|
||||
filename = 'DATEV_Buchungsstapel_{}-{}_bis_{}'.format(
|
||||
filters.get('company'),
|
||||
filters.get('from_date'),
|
||||
filters.get('to_date')
|
||||
)
|
||||
|
||||
frappe.response['result'] = get_datev_csv(data)
|
||||
frappe.response['doctype'] = filename
|
||||
frappe.response['type'] = 'csv'
|
@ -209,7 +209,10 @@ class Gstr1Report(object):
|
||||
sum(i.get('base_net_amount', 0) for i in items
|
||||
if i.item_code == d.item_code and i.parent == d.parent))
|
||||
|
||||
item_tax_rate = json.loads(d.item_tax_rate)
|
||||
item_tax_rate = {}
|
||||
|
||||
if d.item_tax_rate:
|
||||
item_tax_rate = json.loads(d.item_tax_rate)
|
||||
|
||||
if item_tax_rate:
|
||||
self.item_tax_rate.setdefault(d.parent, {}).setdefault(d.item_code, item_tax_rate)
|
||||
|
@ -43,8 +43,11 @@ class Gstr2Report(Gstr1Report):
|
||||
self.get_igst_invoices()
|
||||
for inv, items_based_on_rate in self.items_based_on_tax_rate.items():
|
||||
invoice_details = self.invoices.get(inv)
|
||||
for rate, items in items_based_on_rate.items():
|
||||
row, taxable_value = self.get_row_data_for_invoice(inv, invoice_details, rate, items)
|
||||
for key, items in items_based_on_rate.items():
|
||||
rate = key[0]
|
||||
account = key[1]
|
||||
|
||||
row, taxable_value = self.get_row_data_for_invoice(inv, invoice_details, rate, account, items)
|
||||
tax_amount = taxable_value * rate / 100
|
||||
if inv in self.igst_invoices:
|
||||
row += [tax_amount, 0, 0]
|
||||
|
@ -779,6 +779,17 @@ class POSCart {
|
||||
|
||||
const customer = this.frm.doc.customer;
|
||||
this.customer_field.set_value(customer);
|
||||
|
||||
if (this.numpad) {
|
||||
const disable_btns = this.disable_numpad_control()
|
||||
const enable_btns = [__('Rate'), __('Disc')]
|
||||
|
||||
if (disable_btns) {
|
||||
enable_btns.filter(btn => !disable_btns.includes(btn))
|
||||
}
|
||||
|
||||
this.numpad.enable_buttons(enable_btns);
|
||||
}
|
||||
}
|
||||
|
||||
get_grand_total() {
|
||||
@ -1551,6 +1562,16 @@ class NumberPad {
|
||||
}
|
||||
}
|
||||
|
||||
enable_buttons(btns) {
|
||||
btns.forEach((btn) => {
|
||||
const $btn = this.get_btn(btn);
|
||||
$btn.prop("disabled", false)
|
||||
$btn.hover(() => {
|
||||
$btn.css('cursor','pointer');
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
set_class() {
|
||||
for (const btn in this.add_class) {
|
||||
const class_name = this.add_class[btn];
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -13,8 +13,11 @@ from erpnext.utilities.product import get_price, get_qty_in_stock
|
||||
def get_product_info_for_website(item_code):
|
||||
"""get product price / stock info for website"""
|
||||
|
||||
cart_quotation = _get_cart_quotation()
|
||||
cart_settings = get_shopping_cart_settings()
|
||||
if not cart_settings.enabled:
|
||||
return frappe._dict()
|
||||
|
||||
cart_quotation = _get_cart_quotation()
|
||||
|
||||
price = get_price(
|
||||
item_code,
|
||||
|
@ -192,6 +192,7 @@ frappe.ui.form.on('Material Request', {
|
||||
var values = d.get_values();
|
||||
if(!values) return;
|
||||
values["company"] = frm.doc.company;
|
||||
if(!frm.doc.company) frappe.throw(__("Company field is required"));
|
||||
frappe.call({
|
||||
method: "erpnext.manufacturing.doctype.bom.bom.get_bom_items",
|
||||
args: values,
|
||||
|
@ -107,6 +107,8 @@ erpnext.stock.PurchaseReceiptController = erpnext.buying.BuyingController.extend
|
||||
|
||||
cur_frm.add_custom_button(__('Return'), this.make_purchase_return, __('Create'));
|
||||
|
||||
cur_frm.add_custom_button(__('Make Stock Entry'), cur_frm.cscript['Make Stock Entry'], __('Create'));
|
||||
|
||||
if(flt(this.frm.doc.per_billed) < 100) {
|
||||
cur_frm.add_custom_button(__('Invoice'), this.make_purchase_invoice, __('Create'));
|
||||
}
|
||||
@ -249,6 +251,13 @@ frappe.ui.form.on('Purchase Receipt Item', {
|
||||
},
|
||||
});
|
||||
|
||||
cur_frm.cscript['Make Stock Entry'] = function() {
|
||||
frappe.model.open_mapped_doc({
|
||||
method: "erpnext.stock.doctype.purchase_receipt.purchase_receipt.make_stock_entry",
|
||||
frm: cur_frm,
|
||||
})
|
||||
}
|
||||
|
||||
var validate_sample_quantity = function(frm, cdt, cdn) {
|
||||
var d = locals[cdt][cdn];
|
||||
if (d.sample_quantity) {
|
||||
|
@ -12,6 +12,7 @@ from frappe.utils import getdate
|
||||
from erpnext.controllers.buying_controller import BuyingController
|
||||
from erpnext.accounts.utils import get_account_currency
|
||||
from frappe.desk.notifications import clear_doctype_notifications
|
||||
from frappe.model.mapper import get_mapped_doc
|
||||
from erpnext.buying.utils import check_on_hold_or_closed_status
|
||||
from erpnext.assets.doctype.asset.asset import get_asset_account, is_cwip_accounting_disabled
|
||||
from six import iteritems
|
||||
@ -530,3 +531,24 @@ def make_purchase_return(source_name, target_doc=None):
|
||||
def update_purchase_receipt_status(docname, status):
|
||||
pr = frappe.get_doc("Purchase Receipt", docname)
|
||||
pr.update_status(status)
|
||||
|
||||
@frappe.whitelist()
|
||||
def make_stock_entry(source_name,target_doc=None):
|
||||
def set_missing_values(source, target):
|
||||
target.stock_entry_type = "Material Transfer"
|
||||
target.purpose = "Material Transfer"
|
||||
|
||||
doclist = get_mapped_doc("Purchase Receipt", source_name,{
|
||||
"Purchase Receipt": {
|
||||
"doctype": "Stock Entry",
|
||||
},
|
||||
"Purchase Receipt Item": {
|
||||
"doctype": "Stock Entry Detail",
|
||||
"field_map": {
|
||||
"warehouse": "s_warehouse",
|
||||
"parent": "reference_purchase_receipt"
|
||||
},
|
||||
},
|
||||
}, target_doc, set_missing_values)
|
||||
|
||||
return doclist
|
||||
|
@ -13,6 +13,7 @@
|
||||
"t_warehouse",
|
||||
"sec_break1",
|
||||
"item_code",
|
||||
"item_group",
|
||||
"col_break2",
|
||||
"item_name",
|
||||
"section_break_8",
|
||||
@ -59,7 +60,8 @@
|
||||
"against_stock_entry",
|
||||
"ste_detail",
|
||||
"column_break_51",
|
||||
"transferred_qty"
|
||||
"transferred_qty",
|
||||
"reference_purchase_receipt"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
@ -72,7 +74,6 @@
|
||||
"fieldtype": "Section Break"
|
||||
},
|
||||
{
|
||||
"columns": 2,
|
||||
"fieldname": "s_warehouse",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
@ -86,7 +87,6 @@
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"columns": 2,
|
||||
"fieldname": "t_warehouse",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
@ -101,7 +101,6 @@
|
||||
},
|
||||
{
|
||||
"bold": 1,
|
||||
"columns": 3,
|
||||
"fieldname": "item_code",
|
||||
"fieldtype": "Link",
|
||||
"in_global_search": 1,
|
||||
@ -164,7 +163,6 @@
|
||||
},
|
||||
{
|
||||
"bold": 1,
|
||||
"columns": 3,
|
||||
"fieldname": "qty",
|
||||
"fieldtype": "Float",
|
||||
"in_list_view": 1,
|
||||
@ -460,15 +458,30 @@
|
||||
{
|
||||
"fieldname": "dimension_col_break",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fetch_from": "item_code.item_group",
|
||||
"fieldname": "item_group",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Item Group"
|
||||
},
|
||||
{
|
||||
"fieldname": "reference_purchase_receipt",
|
||||
"fieldtype": "Link",
|
||||
"label": "Reference Purchase Receipt",
|
||||
"options": "Purchase Receipt",
|
||||
"read_only": 1
|
||||
}
|
||||
],
|
||||
"idx": 1,
|
||||
"istable": 1,
|
||||
"modified": "2019-05-25 22:51:00.802226",
|
||||
"modified": "2019-06-14 11:58:41.958144",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Stock Entry Detail",
|
||||
"owner": "Administrator",
|
||||
"permissions": [],
|
||||
"sort_field": "modified",
|
||||
"sort_order": "ASC"
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
/* eslint-disable */
|
||||
|
||||
frappe.query_reports["Delayed Item Report"] = {
|
||||
"filters": [
|
||||
{
|
||||
fieldname: "company",
|
||||
label: __("Company"),
|
||||
fieldtype: "Link",
|
||||
options: "Company",
|
||||
default: frappe.defaults.get_default("company"),
|
||||
reqd: 1
|
||||
},
|
||||
{
|
||||
fieldname:"from_date",
|
||||
label: __("From Date"),
|
||||
fieldtype: "Date",
|
||||
default: frappe.datetime.month_start(),
|
||||
reqd: 1
|
||||
},
|
||||
{
|
||||
fieldname:"to_date",
|
||||
label: __("To Date"),
|
||||
fieldtype: "Date",
|
||||
default: frappe.datetime.now_date(),
|
||||
reqd: 1
|
||||
},
|
||||
{
|
||||
fieldname:"sales_order",
|
||||
label: __("Sales Order"),
|
||||
fieldtype: "Link",
|
||||
options: "Sales Order",
|
||||
},
|
||||
{
|
||||
fieldname:"customer",
|
||||
label: __("Customer"),
|
||||
fieldtype: "Link",
|
||||
options: "Customer",
|
||||
},
|
||||
{
|
||||
fieldname:"customer_group",
|
||||
label: __("Customer Group"),
|
||||
fieldtype: "Link",
|
||||
options: "Customer Group",
|
||||
},
|
||||
{
|
||||
fieldname:"item_group",
|
||||
label: __("Item Group"),
|
||||
fieldtype: "Link",
|
||||
options: "Item Group",
|
||||
},
|
||||
{
|
||||
fieldname:"based_on",
|
||||
label: __("Based On"),
|
||||
fieldtype: "Select",
|
||||
options: ["Delivery Note", "Sales Invoice"],
|
||||
default: "Delivery Note",
|
||||
reqd: 1
|
||||
},
|
||||
]
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
{
|
||||
"add_total_row": 0,
|
||||
"creation": "2019-06-17 12:45:07.324014",
|
||||
"disable_prepared_report": 0,
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 0,
|
||||
"is_standard": "Yes",
|
||||
"letter_head": "Gadgets International",
|
||||
"modified": "2019-06-17 12:45:07.324014",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Delayed Item Report",
|
||||
"owner": "Administrator",
|
||||
"prepared_report": 0,
|
||||
"ref_doctype": "Delivery Note",
|
||||
"report_name": "Delayed Item Report",
|
||||
"report_type": "Script Report",
|
||||
"roles": [
|
||||
{
|
||||
"role": "Accounts User"
|
||||
},
|
||||
{
|
||||
"role": "Sales User"
|
||||
},
|
||||
{
|
||||
"role": "Stock Manager"
|
||||
},
|
||||
{
|
||||
"role": "Stock User"
|
||||
},
|
||||
{
|
||||
"role": "Maintenance User"
|
||||
}
|
||||
]
|
||||
}
|
168
erpnext/stock/report/delayed_item_report/delayed_item_report.py
Normal file
168
erpnext/stock/report/delayed_item_report/delayed_item_report.py
Normal file
@ -0,0 +1,168 @@
|
||||
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.utils import date_diff
|
||||
|
||||
def execute(filters=None, consolidated = False):
|
||||
data, columns = DelayedItemReport(filters).run()
|
||||
|
||||
return data, columns
|
||||
|
||||
class DelayedItemReport(object):
|
||||
def __init__(self, filters=None):
|
||||
self.filters = frappe._dict(filters or {})
|
||||
|
||||
def run(self):
|
||||
return self.get_columns(), self.get_data() or []
|
||||
|
||||
def get_data(self, consolidated=False):
|
||||
conditions = ""
|
||||
|
||||
doctype = self.filters.get("based_on")
|
||||
child_doc= "%s Item" % doctype
|
||||
|
||||
if doctype == "Sales Invoice":
|
||||
conditions = " and `tabSales Invoice`.update_stock = 1 and `tabSales Invoice`.is_pos = 0"
|
||||
|
||||
if self.filters.get("item_group"):
|
||||
conditions += " and `tab%s`.item_group = %s" % (child_doc,
|
||||
frappe.db.escape(self.filters.get("item_group")))
|
||||
|
||||
for field in ["customer", "customer_group", "company"]:
|
||||
if self.filters.get(field):
|
||||
conditions += " and `tab%s`.%s = %s" % (doctype,
|
||||
field, frappe.db.escape(self.filters.get(field)))
|
||||
|
||||
sales_order_field = "against_sales_order"
|
||||
if doctype == "Sales Invoice":
|
||||
sales_order_field = "sales_order"
|
||||
|
||||
if self.filters.get("sales_order"):
|
||||
conditions = " and `tab%s`.%s = '%s'" %(child_doc, sales_order_field, self.filters.get("sales_order"))
|
||||
|
||||
self.transactions = frappe.db.sql(""" SELECT `tab{child_doc}`.item_code, `tab{child_doc}`.item_name,
|
||||
`tab{child_doc}`.item_group, `tab{child_doc}`.qty, `tab{child_doc}`.rate, `tab{child_doc}`.amount,
|
||||
`tab{child_doc}`.so_detail, `tab{child_doc}`.{so_field} as sales_order,
|
||||
`tab{doctype}`.customer, `tab{doctype}`.posting_date, `tab{doctype}`.name, `tab{doctype}`.grand_total
|
||||
FROM `tab{child_doc}`, `tab{doctype}`
|
||||
WHERE
|
||||
`tab{child_doc}`.parent = `tab{doctype}`.name and `tab{doctype}`.docstatus = 1 and
|
||||
`tab{doctype}`.posting_date between %(from_date)s and %(to_date)s and
|
||||
`tab{child_doc}`.{so_field} is not null and `tab{child_doc}`.{so_field} != '' {cond}
|
||||
""".format(cond=conditions, doctype=doctype, child_doc=child_doc, so_field=sales_order_field), {
|
||||
'from_date': self.filters.get('from_date'),
|
||||
'to_date': self.filters.get('to_date')
|
||||
}, as_dict=1)
|
||||
|
||||
if self.transactions:
|
||||
self.filter_transactions_data(consolidated)
|
||||
|
||||
return self.transactions
|
||||
|
||||
def filter_transactions_data(self, consolidated=False):
|
||||
sales_orders = [d.sales_order for d in self.transactions]
|
||||
doctype = "Sales Order"
|
||||
filters = {'name': ('in', sales_orders)}
|
||||
|
||||
if not consolidated:
|
||||
sales_order_items = [d.so_detail for d in self.transactions]
|
||||
doctype = "Sales Order Item"
|
||||
filters = {'parent': ('in', sales_orders), 'name': ('in', sales_order_items)}
|
||||
|
||||
so_data = {}
|
||||
for d in frappe.get_all(doctype, filters = filters,
|
||||
fields = ["delivery_date", "parent", "name"]):
|
||||
key = d.name if consolidated else (d.parent, d.name)
|
||||
if key not in so_data:
|
||||
so_data.setdefault(key, d.delivery_date)
|
||||
|
||||
for row in self.transactions:
|
||||
key = row.sales_order if consolidated else (row.sales_order, row.so_detail)
|
||||
row.update({
|
||||
'delivery_date': so_data.get(key),
|
||||
'delayed_days': date_diff(row.posting_date, so_data.get(key))
|
||||
})
|
||||
|
||||
return self.transactions
|
||||
|
||||
def get_columns(self):
|
||||
based_on = self.filters.get("based_on")
|
||||
|
||||
return [{
|
||||
"label": _(based_on),
|
||||
"fieldname": "name",
|
||||
"fieldtype": "Link",
|
||||
"options": based_on,
|
||||
"width": 100
|
||||
},{
|
||||
"label": _("Customer"),
|
||||
"fieldname": "customer",
|
||||
"fieldtype": "Link",
|
||||
"options": "Customer",
|
||||
"width": 100
|
||||
},
|
||||
{
|
||||
"label": _("Expected Delivery Date"),
|
||||
"fieldname": "delivery_date",
|
||||
"fieldtype": "Date",
|
||||
"width": 100
|
||||
},
|
||||
{
|
||||
"label": _("Actual Delivery Date"),
|
||||
"fieldname": "posting_date",
|
||||
"fieldtype": "Date",
|
||||
"width": 100
|
||||
},
|
||||
{
|
||||
"label": _("Item Code"),
|
||||
"fieldname": "item_code",
|
||||
"fieldtype": "Link",
|
||||
"options": "Item",
|
||||
"width": 100
|
||||
},
|
||||
{
|
||||
"label": _("Item Name"),
|
||||
"fieldname": "item_name",
|
||||
"fieldtype": "Data",
|
||||
"width": 100
|
||||
},
|
||||
{
|
||||
"label": _("Quantity"),
|
||||
"fieldname": "qty",
|
||||
"fieldtype": "Float",
|
||||
"width": 100
|
||||
},
|
||||
{
|
||||
"label": _("Rate"),
|
||||
"fieldname": "rate",
|
||||
"fieldtype": "Currency",
|
||||
"width": 100
|
||||
},
|
||||
{
|
||||
"label": _("Amount"),
|
||||
"fieldname": "amount",
|
||||
"fieldtype": "Currency",
|
||||
"width": 100
|
||||
},
|
||||
{
|
||||
"label": _("Delayed Days"),
|
||||
"fieldname": "delayed_days",
|
||||
"fieldtype": "Int",
|
||||
"width": 100
|
||||
},
|
||||
{
|
||||
"label": _("Sales Order"),
|
||||
"fieldname": "sales_order",
|
||||
"fieldtype": "Link",
|
||||
"options": "Sales Order",
|
||||
"width": 100
|
||||
},
|
||||
{
|
||||
"label": _("Customer PO"),
|
||||
"fieldname": "po_no",
|
||||
"fieldtype": "Data",
|
||||
"width": 100
|
||||
}]
|
@ -0,0 +1,62 @@
|
||||
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
/* eslint-disable */
|
||||
|
||||
frappe.query_reports["Delayed Order Report"] = {
|
||||
"filters": [
|
||||
{
|
||||
fieldname: "company",
|
||||
label: __("Company"),
|
||||
fieldtype: "Link",
|
||||
options: "Company",
|
||||
default: frappe.defaults.get_default("company"),
|
||||
reqd: 1
|
||||
},
|
||||
{
|
||||
fieldname:"from_date",
|
||||
label: __("From Date"),
|
||||
fieldtype: "Date",
|
||||
default: frappe.datetime.month_start(),
|
||||
reqd: 1
|
||||
},
|
||||
{
|
||||
fieldname:"to_date",
|
||||
label: __("To Date"),
|
||||
fieldtype: "Date",
|
||||
default: frappe.datetime.now_date(),
|
||||
reqd: 1
|
||||
},
|
||||
{
|
||||
fieldname:"sales_order",
|
||||
label: __("Sales Order"),
|
||||
fieldtype: "Link",
|
||||
options: "Sales Order",
|
||||
},
|
||||
{
|
||||
fieldname:"customer",
|
||||
label: __("Customer"),
|
||||
fieldtype: "Link",
|
||||
options: "Customer",
|
||||
},
|
||||
{
|
||||
fieldname:"customer_group",
|
||||
label: __("Customer Group"),
|
||||
fieldtype: "Link",
|
||||
options: "Customer Group",
|
||||
},
|
||||
{
|
||||
fieldname:"item_group",
|
||||
label: __("Item Group"),
|
||||
fieldtype: "Link",
|
||||
options: "Item Group",
|
||||
},
|
||||
{
|
||||
fieldname:"based_on",
|
||||
label: __("Based On"),
|
||||
fieldtype: "Select",
|
||||
options: ["Delivery Note", "Sales Invoice"],
|
||||
default: "Delivery Note",
|
||||
reqd: 1
|
||||
},
|
||||
]
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
{
|
||||
"add_total_row": 0,
|
||||
"creation": "2019-06-17 12:45:56.359322",
|
||||
"disable_prepared_report": 0,
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 0,
|
||||
"is_standard": "Yes",
|
||||
"letter_head": "Gadgets International",
|
||||
"modified": "2019-06-17 12:45:56.359322",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Delayed Order Report",
|
||||
"owner": "Administrator",
|
||||
"prepared_report": 0,
|
||||
"ref_doctype": "Delivery Note",
|
||||
"report_name": "Delayed Order Report",
|
||||
"report_type": "Script Report",
|
||||
"roles": [
|
||||
{
|
||||
"role": "Accounts User"
|
||||
},
|
||||
{
|
||||
"role": "Sales User"
|
||||
},
|
||||
{
|
||||
"role": "Stock Manager"
|
||||
},
|
||||
{
|
||||
"role": "Stock User"
|
||||
},
|
||||
{
|
||||
"role": "Maintenance User"
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
from frappe import _
|
||||
from erpnext.stock.report.delayed_item_report.delayed_item_report import DelayedItemReport
|
||||
|
||||
def execute(filters=None):
|
||||
columns, data = [], []
|
||||
|
||||
columns, data = DelayedOrderReport(filters).run()
|
||||
|
||||
return columns, data
|
||||
|
||||
class DelayedOrderReport(DelayedItemReport):
|
||||
def run(self):
|
||||
return self.get_columns(), self.get_data(consolidated=True) or []
|
||||
|
||||
def get_data(self, consolidated=False):
|
||||
data = super(DelayedOrderReport, self).get_data(consolidated) or []
|
||||
|
||||
so_list = []
|
||||
result = []
|
||||
for d in data:
|
||||
if d.sales_order not in so_list:
|
||||
so_list.append(d.sales_order)
|
||||
result.append(d)
|
||||
|
||||
return result
|
||||
|
||||
def get_columns(self):
|
||||
based_on = self.filters.get("based_on")
|
||||
|
||||
return [{
|
||||
"label": _(based_on),
|
||||
"fieldname": "name",
|
||||
"fieldtype": "Link",
|
||||
"options": based_on,
|
||||
"width": 100
|
||||
},{
|
||||
"label": _("Customer"),
|
||||
"fieldname": "customer",
|
||||
"fieldtype": "Link",
|
||||
"options": "Customer",
|
||||
"width": 100
|
||||
},
|
||||
{
|
||||
"label": _("Expected Delivery Date"),
|
||||
"fieldname": "delivery_date",
|
||||
"fieldtype": "Date",
|
||||
"width": 100
|
||||
},
|
||||
{
|
||||
"label": _("Actual Delivery Date"),
|
||||
"fieldname": "posting_date",
|
||||
"fieldtype": "Date",
|
||||
"width": 100
|
||||
},
|
||||
{
|
||||
"label": _("Amount"),
|
||||
"fieldname": "grand_total",
|
||||
"fieldtype": "Currency",
|
||||
"width": 100
|
||||
},
|
||||
{
|
||||
"label": _("Delayed Days"),
|
||||
"fieldname": "delayed_days",
|
||||
"fieldtype": "Int",
|
||||
"width": 100
|
||||
},
|
||||
{
|
||||
"label": _("Sales Order"),
|
||||
"fieldname": "sales_order",
|
||||
"fieldtype": "Link",
|
||||
"options": "Sales Order",
|
||||
"width": 100
|
||||
},
|
||||
{
|
||||
"label": _("Customer PO"),
|
||||
"fieldname": "po_no",
|
||||
"fieldtype": "Data",
|
||||
"width": 100
|
||||
}]
|
@ -40,7 +40,7 @@ frappe.query_reports["Stock Balance"] = {
|
||||
"options": "Item",
|
||||
"get_query": function() {
|
||||
return {
|
||||
query: "erpnext.controllers.queries.item_query"
|
||||
query: "erpnext.controllers.queries.item_query",
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -10,8 +10,23 @@ frappe.query_reports["Total Stock Summary"] = {
|
||||
"fieldtype": "Select",
|
||||
"width": "80",
|
||||
"reqd": 1,
|
||||
"options": ["","Warehouse", "Company"],
|
||||
"default": "Warehouse"
|
||||
"options": ["", "Warehouse", "Company"],
|
||||
"change": function() {
|
||||
let group_by = frappe.query_report.get_filter_value("group_by")
|
||||
let company_filter = frappe.query_report.get_filter("company")
|
||||
if (group_by == "Company") {
|
||||
company_filter.df.reqd = 0;
|
||||
company_filter.df.hidden = 1;
|
||||
frappe.query_report.set_filter_value("company", "");
|
||||
company_filter.refresh();
|
||||
}
|
||||
else {
|
||||
company_filter.df.reqd = 1;
|
||||
company_filter.df.hidden = 0;
|
||||
company_filter.refresh();
|
||||
frappe.query_report.refresh();
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"fieldname": "company",
|
||||
|
@ -9,7 +9,13 @@
|
||||
</p>
|
||||
<!-- description -->
|
||||
<div itemprop="description">
|
||||
{{ doc.web_long_description or doc.description or _("No description given") | safe }}
|
||||
{% if frappe.utils.strip_html(doc.web_long_description) %}
|
||||
{{ doc.web_long_description | safe }}
|
||||
{% elif frappe.utils.strip_html(doc.description) %}
|
||||
{{ doc.description | safe }}
|
||||
{% else %}
|
||||
{{ _("No description given") }}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if has_variants %}
|
||||
|
@ -1,8 +1,6 @@
|
||||
{% if doc.website_specifications -%}
|
||||
<div class="row item-website-specification mt-5">
|
||||
<div class="col-md-12">
|
||||
<h6 class="text-uppercase text-muted">{{ _("Specifications") }}</h6>
|
||||
|
||||
<table class="table table-bordered">
|
||||
{% for d in doc.website_specifications -%}
|
||||
<tr>
|
||||
|
@ -33,7 +33,7 @@
|
||||
{% for item in homepage.products %}
|
||||
<div class="col-md-4 mb-4">
|
||||
<div class="card h-100 justify-content-between">
|
||||
<div class="website-image-lazy" data-class="card-img-top h-100" data-src="{{ item.image }}" data-alt="{{ item.item_name }}"></div>
|
||||
<div class="website-image-lazy" data-class="card-img-top website-image-extra-large" data-src="{{ item.image }}" data-alt="{{ item.item_name }}"></div>
|
||||
<div class="card-body flex-grow-0">
|
||||
<h5 class="card-title">{{ item.item_name }}</h5>
|
||||
<a href="{{ item.route }}" class="card-link">{{ _('More details') }}</a>
|
||||
|
@ -42,7 +42,7 @@
|
||||
</div>
|
||||
<div class="col-12 order-1 col-md-4 order-md-2">
|
||||
|
||||
{% if frappe.form_dict.start or frappe.form_dict.field_filters or frappe.form_dict.search %}
|
||||
{% if frappe.form_dict.start or frappe.form_dict.field_filters or frappe.form_dict.attribute_filters or frappe.form_dict.search %}
|
||||
<a class="mb-3 d-inline-block" href="/all-products">{{ _('Clear filters') }}</a>
|
||||
{% endif %}
|
||||
|
||||
|
@ -42,7 +42,7 @@
|
||||
{% if has_access %}
|
||||
<a href="/lms/topic?program={{ program }}&course={{ course.name }}&topic={{ topic.name }}" class="no-decoration no-underline">
|
||||
{% else %}
|
||||
<div onclick="show_singup()">
|
||||
<a href="/login#login">
|
||||
{% endif %}
|
||||
{% if topic.hero_image %}
|
||||
<div class="card-hero-img" style="background-image: url('{{ topic.hero_image }}')"></div>
|
||||
@ -81,7 +81,7 @@
|
||||
</div>
|
||||
</a>
|
||||
{% else %}
|
||||
</div>
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
@ -103,23 +103,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
||||
{% block script %}
|
||||
<script>
|
||||
function show_singup() {
|
||||
if (frappe.session.user == "Guest") {
|
||||
let signup_dialog = new frappe.ui.Dialog({
|
||||
title: __('Sign Up'),
|
||||
primary_action: function() {
|
||||
window.location.href = '/login#signup'
|
||||
},
|
||||
primary_action_label: 'Sign Up'
|
||||
})
|
||||
signup_dialog.set_message('You have to sign up to access the course');
|
||||
signup_dialog.$message.show()
|
||||
signup_dialog.show();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
Loading…
x
Reference in New Issue
Block a user