Merge branch 'develop' into purchase-taxes-and-charges-account-name-issue
This commit is contained in:
commit
a9e02bba77
@ -160,6 +160,8 @@ class ReceivablePayableReport(object):
|
||||
else:
|
||||
# advance / unlinked payment or other adjustment
|
||||
row.paid -= gle_balance
|
||||
if gle.cost_center:
|
||||
row.cost_center = str(gle.cost_center)
|
||||
|
||||
def update_sub_total_row(self, row, party):
|
||||
total_row = self.total_row_map.get(party)
|
||||
@ -210,7 +212,6 @@ class ReceivablePayableReport(object):
|
||||
for key, row in self.voucher_balance.items():
|
||||
row.outstanding = flt(row.invoiced - row.paid - row.credit_note, self.currency_precision)
|
||||
row.invoice_grand_total = row.invoiced
|
||||
|
||||
if abs(row.outstanding) > 1.0/10 ** self.currency_precision:
|
||||
# non-zero oustanding, we must consider this row
|
||||
|
||||
@ -577,7 +578,7 @@ class ReceivablePayableReport(object):
|
||||
|
||||
self.gl_entries = frappe.db.sql("""
|
||||
select
|
||||
name, posting_date, account, party_type, party, voucher_type, voucher_no,
|
||||
name, posting_date, account, party_type, party, voucher_type, voucher_no, cost_center,
|
||||
against_voucher_type, against_voucher, account_currency, remarks, {0}
|
||||
from
|
||||
`tabGL Entry`
|
||||
@ -741,6 +742,7 @@ class ReceivablePayableReport(object):
|
||||
self.add_column(_("Customer Contact"), fieldname='customer_primary_contact',
|
||||
fieldtype='Link', options='Contact')
|
||||
|
||||
self.add_column(label=_('Cost Center'), fieldname='cost_center', fieldtype='Data')
|
||||
self.add_column(label=_('Voucher Type'), fieldname='voucher_type', fieldtype='Data')
|
||||
self.add_column(label=_('Voucher No'), fieldname='voucher_no', fieldtype='Dynamic Link',
|
||||
options='voucher_type', width=180)
|
||||
|
@ -1,12 +1,14 @@
|
||||
{
|
||||
"actions": [],
|
||||
"autoname": "Prompt",
|
||||
"creation": "2019-06-05 11:48:30.572795",
|
||||
"doctype": "DocType",
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"communication_channel",
|
||||
"communication_medium_type",
|
||||
"catch_all",
|
||||
"column_break_3",
|
||||
"catch_all",
|
||||
"provider",
|
||||
"disabled",
|
||||
"timeslots_section",
|
||||
@ -54,9 +56,16 @@
|
||||
"fieldtype": "Table",
|
||||
"label": "Timeslots",
|
||||
"options": "Communication Medium Timeslot"
|
||||
},
|
||||
{
|
||||
"fieldname": "communication_channel",
|
||||
"fieldtype": "Select",
|
||||
"label": "Communication Channel",
|
||||
"options": "\nExotel"
|
||||
}
|
||||
],
|
||||
"modified": "2019-06-05 11:49:30.769006",
|
||||
"links": [],
|
||||
"modified": "2020-10-27 16:22:08.068542",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Communication",
|
||||
"name": "Communication Medium",
|
||||
|
@ -15,10 +15,10 @@ app_logo_url = '/assets/erpnext/images/erp-icon.svg'
|
||||
|
||||
develop_version = '13.x.x-develop'
|
||||
|
||||
app_include_js = "assets/js/erpnext.min.js"
|
||||
app_include_css = "assets/css/erpnext.css"
|
||||
web_include_js = "assets/js/erpnext-web.min.js"
|
||||
web_include_css = "assets/css/erpnext-web.css"
|
||||
app_include_js = "/assets/js/erpnext.min.js"
|
||||
app_include_css = "/assets/css/erpnext.css"
|
||||
web_include_js = "/assets/js/erpnext-web.min.js"
|
||||
web_include_css = "/assets/css/erpnext-web.css"
|
||||
|
||||
doctype_js = {
|
||||
"Address": "public/js/address.js",
|
||||
|
@ -45,7 +45,7 @@ erpnext.salary_slip_deductions_report_filters = {
|
||||
},
|
||||
{
|
||||
fieldname: "branch",
|
||||
label: __("Barnch"),
|
||||
label: __("Branch"),
|
||||
fieldtype: "Link",
|
||||
options: "Branch",
|
||||
}
|
||||
@ -63,4 +63,4 @@ erpnext.salary_slip_deductions_report_filters = {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,8 +15,7 @@ REQUIRED_FIELDS = {
|
||||
},
|
||||
{
|
||||
"field_name": "taxes",
|
||||
"regulation": "§ 14 Abs. 4 Nr. 8 UStG",
|
||||
"condition": "not exempt_from_sales_tax"
|
||||
"regulation": "§ 14 Abs. 4 Nr. 8 UStG"
|
||||
},
|
||||
{
|
||||
"field_name": "customer_address",
|
||||
|
@ -155,20 +155,22 @@ def get_header(filters, csv_class):
|
||||
return header
|
||||
|
||||
|
||||
def download_csv_files_as_zip(csv_data_list):
|
||||
def zip_and_download(zip_filename, csv_files):
|
||||
"""
|
||||
Put CSV files in a zip archive and send that to the client.
|
||||
|
||||
Params:
|
||||
csv_data_list -- list of dicts [{'file_name': 'EXTF_Buchunsstapel.zip', 'csv_data': get_datev_csv()}]
|
||||
zip_filename Name of the zip file
|
||||
csv_files list of dicts [{'file_name': 'my_file.csv', 'csv_data': 'comma,separated,values'}]
|
||||
"""
|
||||
zip_buffer = BytesIO()
|
||||
|
||||
datev_zip = zipfile.ZipFile(zip_buffer, mode='w', compression=zipfile.ZIP_DEFLATED)
|
||||
for csv_file in csv_data_list:
|
||||
datev_zip.writestr(csv_file.get('file_name'), csv_file.get('csv_data'))
|
||||
datev_zip.close()
|
||||
zip_file = zipfile.ZipFile(zip_buffer, mode='w', compression=zipfile.ZIP_DEFLATED)
|
||||
for csv_file in csv_files:
|
||||
zip_file.writestr(csv_file.get('file_name'), csv_file.get('csv_data'))
|
||||
|
||||
zip_file.close()
|
||||
|
||||
frappe.response['filecontent'] = zip_buffer.getvalue()
|
||||
frappe.response['filename'] = 'DATEV.zip'
|
||||
frappe.response['filename'] = zip_filename
|
||||
frappe.response['type'] = 'binary'
|
||||
|
@ -11,10 +11,11 @@ from __future__ import unicode_literals
|
||||
|
||||
import json
|
||||
import frappe
|
||||
from frappe import _
|
||||
from six import string_types
|
||||
|
||||
from frappe import _
|
||||
from erpnext.accounts.utils import get_fiscal_year
|
||||
from erpnext.regional.germany.utils.datev.datev_csv import download_csv_files_as_zip, get_datev_csv
|
||||
from erpnext.regional.germany.utils.datev.datev_csv import zip_and_download, get_datev_csv
|
||||
from erpnext.regional.germany.utils.datev.datev_constants import Transactions, DebtorsCreditors, AccountNames
|
||||
|
||||
COLUMNS = [
|
||||
@ -344,7 +345,8 @@ def download_datev_csv(filters):
|
||||
customers = get_customers(filters)
|
||||
suppliers = get_suppliers(filters)
|
||||
|
||||
download_csv_files_as_zip([
|
||||
zip_name = '{} DATEV.zip'.format(frappe.utils.datetime.date.today())
|
||||
zip_and_download(zip_name, [
|
||||
{
|
||||
'file_name': 'EXTF_Buchungsstapel.csv',
|
||||
'csv_data': get_datev_csv(transactions, filters, csv_class=Transactions)
|
||||
|
@ -90,29 +90,41 @@ frappe.ui.form.on("Company", {
|
||||
frm.toggle_enable("default_currency", (frm.doc.__onload &&
|
||||
!frm.doc.__onload.transactions_exist));
|
||||
|
||||
frm.add_custom_button(__('Create Tax Template'), function() {
|
||||
frm.trigger("make_default_tax_template");
|
||||
});
|
||||
if (frm.has_perm('write')) {
|
||||
frm.add_custom_button(__('Create Tax Template'), function() {
|
||||
frm.trigger("make_default_tax_template");
|
||||
});
|
||||
}
|
||||
|
||||
frm.add_custom_button(__('Cost Centers'), function() {
|
||||
frappe.set_route('Tree', 'Cost Center', {'company': frm.doc.name})
|
||||
}, __("View"));
|
||||
if (frappe.perm.has_perm("Cost Center", 0, 'read')) {
|
||||
frm.add_custom_button(__('Cost Centers'), function() {
|
||||
frappe.set_route('Tree', 'Cost Center', {'company': frm.doc.name});
|
||||
}, __("View"));
|
||||
}
|
||||
|
||||
frm.add_custom_button(__('Chart of Accounts'), function() {
|
||||
frappe.set_route('Tree', 'Account', {'company': frm.doc.name})
|
||||
}, __("View"));
|
||||
if (frappe.perm.has_perm("Account", 0, 'read')) {
|
||||
frm.add_custom_button(__('Chart of Accounts'), function() {
|
||||
frappe.set_route('Tree', 'Account', {'company': frm.doc.name});
|
||||
}, __("View"));
|
||||
}
|
||||
|
||||
frm.add_custom_button(__('Sales Tax Template'), function() {
|
||||
frappe.set_route('List', 'Sales Taxes and Charges Template', {'company': frm.doc.name});
|
||||
}, __("View"));
|
||||
if (frappe.perm.has_perm("Sales Taxes and Charges Template", 0, 'read')) {
|
||||
frm.add_custom_button(__('Sales Tax Template'), function() {
|
||||
frappe.set_route('List', 'Sales Taxes and Charges Template', {'company': frm.doc.name});
|
||||
}, __("View"));
|
||||
}
|
||||
|
||||
frm.add_custom_button(__('Purchase Tax Template'), function() {
|
||||
frappe.set_route('List', 'Purchase Taxes and Charges Template', {'company': frm.doc.name});
|
||||
}, __("View"));
|
||||
if (frappe.perm.has_perm("Purchase Taxes and Charges Template", 0, 'read')) {
|
||||
frm.add_custom_button(__('Purchase Tax Template'), function() {
|
||||
frappe.set_route('List', 'Purchase Taxes and Charges Template', {'company': frm.doc.name});
|
||||
}, __("View"));
|
||||
}
|
||||
|
||||
frm.add_custom_button(__('Default Tax Template'), function() {
|
||||
frm.trigger("make_default_tax_template");
|
||||
}, __('Create'));
|
||||
if (frm.has_perm('write')) {
|
||||
frm.add_custom_button(__('Default Tax Template'), function() {
|
||||
frm.trigger("make_default_tax_template");
|
||||
}, __('Create'));
|
||||
}
|
||||
}
|
||||
|
||||
erpnext.company.set_chart_of_accounts_options(frm.doc);
|
||||
|
@ -27,7 +27,8 @@ def delete_company_transactions(company_name):
|
||||
if doctype not in ("Account", "Cost Center", "Warehouse", "Budget",
|
||||
"Party Account", "Employee", "Sales Taxes and Charges Template",
|
||||
"Purchase Taxes and Charges Template", "POS Profile", "BOM",
|
||||
"Company", "Bank Account"):
|
||||
"Company", "Bank Account", "Item Tax Template", "Mode Of Payment",
|
||||
"Item Default"):
|
||||
delete_for_doctype(doctype, company_name)
|
||||
|
||||
# reset company values
|
||||
|
Loading…
x
Reference in New Issue
Block a user