mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 03:39:11 +00:00
style: format js files
This commit is contained in:
@@ -1,39 +1,39 @@
|
||||
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
// License: GNU General Public License v3. See license.txt
|
||||
|
||||
frappe.ui.form.on('Import Supplier Invoice', {
|
||||
onload: function(frm) {
|
||||
frappe.ui.form.on("Import Supplier Invoice", {
|
||||
onload: function (frm) {
|
||||
frappe.realtime.on("import_invoice_update", function (data) {
|
||||
frm.dashboard.show_progress(data.title, (data.count / data.total) * 100, data.message);
|
||||
if (data.count == data.total) {
|
||||
window.setTimeout(title => frm.dashboard.hide_progress(title), 1500, data.title);
|
||||
window.setTimeout((title) => frm.dashboard.hide_progress(title), 1500, data.title);
|
||||
}
|
||||
});
|
||||
},
|
||||
setup: function(frm) {
|
||||
frm.set_query("tax_account", function(doc) {
|
||||
setup: function (frm) {
|
||||
frm.set_query("tax_account", function (doc) {
|
||||
return {
|
||||
filters: {
|
||||
account_type: 'Tax',
|
||||
company: doc.company
|
||||
}
|
||||
account_type: "Tax",
|
||||
company: doc.company,
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
frm.set_query("default_buying_price_list", function(doc) {
|
||||
frm.set_query("default_buying_price_list", function (doc) {
|
||||
return {
|
||||
filters: {
|
||||
currency: frappe.get_doc(":Company", doc.company).default_currency
|
||||
}
|
||||
currency: frappe.get_doc(":Company", doc.company).default_currency,
|
||||
},
|
||||
};
|
||||
});
|
||||
},
|
||||
|
||||
refresh: function(frm) {
|
||||
refresh: function (frm) {
|
||||
frm.trigger("toggle_read_only_fields");
|
||||
},
|
||||
|
||||
toggle_read_only_fields: function(frm) {
|
||||
toggle_read_only_fields: function (frm) {
|
||||
if (in_list(["File Import Completed", "Processing File Data"], frm.doc.status)) {
|
||||
cur_frm.set_read_only();
|
||||
cur_frm.refresh_fields();
|
||||
@@ -41,6 +41,5 @@ frappe.ui.form.on('Import Supplier Invoice', {
|
||||
} else {
|
||||
frm.set_df_property("import_invoices", "hidden", 0);
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
// Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Lower Deduction Certificate', {
|
||||
frappe.ui.form.on("Lower Deduction Certificate", {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
// Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('South Africa VAT Settings', {
|
||||
refresh: function(frm) {
|
||||
frm.set_query("company", function() {
|
||||
frappe.ui.form.on("South Africa VAT Settings", {
|
||||
refresh: function (frm) {
|
||||
frm.set_query("company", function () {
|
||||
return {
|
||||
filters: {
|
||||
country: "South Africa",
|
||||
}
|
||||
},
|
||||
};
|
||||
});
|
||||
frm.set_query("account", "vat_accounts", function() {
|
||||
frm.set_query("account", "vat_accounts", function () {
|
||||
return {
|
||||
filters: {
|
||||
company: frm.doc.company,
|
||||
account_type: "Tax",
|
||||
is_group: 0
|
||||
}
|
||||
is_group: 0,
|
||||
},
|
||||
};
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('UAE VAT Settings', {
|
||||
onload: function(frm) {
|
||||
frm.set_query('account', 'uae_vat_accounts', function() {
|
||||
frappe.ui.form.on("UAE VAT Settings", {
|
||||
onload: function (frm) {
|
||||
frm.set_query("account", "uae_vat_accounts", function () {
|
||||
return {
|
||||
filters: {
|
||||
'company': frm.doc.company
|
||||
}
|
||||
company: frm.doc.company,
|
||||
},
|
||||
};
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1,53 +1,54 @@
|
||||
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
|
||||
frappe.query_reports["Electronic Invoice Register"] = {
|
||||
"filters": [
|
||||
filters: [
|
||||
{
|
||||
"fieldname":"from_date",
|
||||
"label": __("From Date"),
|
||||
"fieldtype": "Date",
|
||||
"default": frappe.datetime.add_months(frappe.datetime.get_today(), -1),
|
||||
"width": "80"
|
||||
fieldname: "from_date",
|
||||
label: __("From Date"),
|
||||
fieldtype: "Date",
|
||||
default: frappe.datetime.add_months(frappe.datetime.get_today(), -1),
|
||||
width: "80",
|
||||
},
|
||||
{
|
||||
"fieldname":"to_date",
|
||||
"label": __("To Date"),
|
||||
"fieldtype": "Date",
|
||||
"default": frappe.datetime.get_today()
|
||||
fieldname: "to_date",
|
||||
label: __("To Date"),
|
||||
fieldtype: "Date",
|
||||
default: frappe.datetime.get_today(),
|
||||
},
|
||||
{
|
||||
"fieldname":"customer",
|
||||
"label": __("Customer"),
|
||||
"fieldtype": "Link",
|
||||
"options": "Customer"
|
||||
fieldname: "customer",
|
||||
label: __("Customer"),
|
||||
fieldtype: "Link",
|
||||
options: "Customer",
|
||||
},
|
||||
{
|
||||
"fieldname":"company",
|
||||
"label": __("Company"),
|
||||
"fieldtype": "Link",
|
||||
"options": "Company",
|
||||
"default": frappe.defaults.get_user_default("Company")
|
||||
fieldname: "company",
|
||||
label: __("Company"),
|
||||
fieldtype: "Link",
|
||||
options: "Company",
|
||||
default: frappe.defaults.get_user_default("Company"),
|
||||
},
|
||||
],
|
||||
"onload": function(reportview) {
|
||||
reportview.page.add_inner_button(__("Export E-Invoices"), function() {
|
||||
onload: function (reportview) {
|
||||
reportview.page.add_inner_button(__("Export E-Invoices"), function () {
|
||||
//TODO: refactor condition to disallow export if report has no data.
|
||||
if (!reportview.data.length) {
|
||||
frappe.msgprint(__("No data to export"));
|
||||
return
|
||||
return;
|
||||
}
|
||||
|
||||
var w = window.open(
|
||||
frappe.urllib.get_full_url(
|
||||
"/api/method/erpnext.regional.italy.utils.export_invoices?"
|
||||
+ "filters=" + JSON.stringify(reportview.get_filter_values())
|
||||
"/api/method/erpnext.regional.italy.utils.export_invoices?" +
|
||||
"filters=" +
|
||||
JSON.stringify(reportview.get_filter_values())
|
||||
)
|
||||
);
|
||||
if (!w) {
|
||||
frappe.msgprint(__("Please enable pop-ups")); return;
|
||||
frappe.msgprint(__("Please enable pop-ups"));
|
||||
return;
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
@@ -2,33 +2,33 @@
|
||||
// License: GNU General Public License v3. See license.txt
|
||||
|
||||
frappe.query_reports["IRS 1099"] = {
|
||||
"filters": [
|
||||
filters: [
|
||||
{
|
||||
"fieldname": "company",
|
||||
"label": __("Company"),
|
||||
"fieldtype": "Link",
|
||||
"options": "Company",
|
||||
"default": frappe.defaults.get_user_default("Company"),
|
||||
"reqd": 1,
|
||||
"width": 80,
|
||||
fieldname: "company",
|
||||
label: __("Company"),
|
||||
fieldtype: "Link",
|
||||
options: "Company",
|
||||
default: frappe.defaults.get_user_default("Company"),
|
||||
reqd: 1,
|
||||
width: 80,
|
||||
},
|
||||
{
|
||||
"fieldname": "fiscal_year",
|
||||
"label": __("Fiscal Year"),
|
||||
"fieldtype": "Link",
|
||||
"options": "Fiscal Year",
|
||||
"default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today()),
|
||||
"reqd": 1,
|
||||
"width": 80,
|
||||
fieldname: "fiscal_year",
|
||||
label: __("Fiscal Year"),
|
||||
fieldtype: "Link",
|
||||
options: "Fiscal Year",
|
||||
default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today()),
|
||||
reqd: 1,
|
||||
width: 80,
|
||||
},
|
||||
{
|
||||
"fieldname": "supplier_group",
|
||||
"label": __("Supplier Group"),
|
||||
"fieldtype": "Link",
|
||||
"options": "Supplier Group",
|
||||
"default": "",
|
||||
"reqd": 0,
|
||||
"width": 80
|
||||
fieldname: "supplier_group",
|
||||
label: __("Supplier Group"),
|
||||
fieldtype: "Link",
|
||||
options: "Supplier Group",
|
||||
default: "",
|
||||
reqd: 0,
|
||||
width: 80,
|
||||
},
|
||||
],
|
||||
|
||||
@@ -36,12 +36,15 @@ frappe.query_reports["IRS 1099"] = {
|
||||
query_report.page.add_inner_button(__("Print IRS 1099 Forms"), () => {
|
||||
build_1099_print(query_report);
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
function build_1099_print(query_report) {
|
||||
let filters = JSON.stringify(query_report.get_values());
|
||||
let w = window.open('/api/method/erpnext.regional.report.irs_1099.irs_1099.irs_1099_print?' +
|
||||
'&filters=' + encodeURIComponent(filters));
|
||||
let w = window.open(
|
||||
"/api/method/erpnext.regional.report.irs_1099.irs_1099.irs_1099_print?" +
|
||||
"&filters=" +
|
||||
encodeURIComponent(filters)
|
||||
);
|
||||
// w.print();
|
||||
}
|
||||
|
||||
@@ -1,36 +1,38 @@
|
||||
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
|
||||
frappe.query_reports["UAE VAT 201"] = {
|
||||
"filters": [
|
||||
filters: [
|
||||
{
|
||||
"fieldname": "company",
|
||||
"label": __("Company"),
|
||||
"fieldtype": "Link",
|
||||
"options": "Company",
|
||||
"reqd": 1,
|
||||
"default": frappe.defaults.get_user_default("Company")
|
||||
fieldname: "company",
|
||||
label: __("Company"),
|
||||
fieldtype: "Link",
|
||||
options: "Company",
|
||||
reqd: 1,
|
||||
default: frappe.defaults.get_user_default("Company"),
|
||||
},
|
||||
{
|
||||
"fieldname": "from_date",
|
||||
"label": __("From Date"),
|
||||
"fieldtype": "Date",
|
||||
"reqd": 1,
|
||||
"default": frappe.datetime.add_months(frappe.datetime.get_today(), -3),
|
||||
fieldname: "from_date",
|
||||
label: __("From Date"),
|
||||
fieldtype: "Date",
|
||||
reqd: 1,
|
||||
default: frappe.datetime.add_months(frappe.datetime.get_today(), -3),
|
||||
},
|
||||
{
|
||||
"fieldname": "to_date",
|
||||
"label": __("To Date"),
|
||||
"fieldtype": "Date",
|
||||
"reqd": 1,
|
||||
"default": frappe.datetime.get_today()
|
||||
fieldname: "to_date",
|
||||
label: __("To Date"),
|
||||
fieldtype: "Date",
|
||||
reqd: 1,
|
||||
default: frappe.datetime.get_today(),
|
||||
},
|
||||
],
|
||||
"formatter": function(value, row, column, data, default_formatter) {
|
||||
if (data
|
||||
&& (data.legend=='VAT on Sales and All Other Outputs' || data.legend=='VAT on Expenses and All Other Inputs')
|
||||
&& data.legend==value) {
|
||||
formatter: function (value, row, column, data, default_formatter) {
|
||||
if (
|
||||
data &&
|
||||
(data.legend == "VAT on Sales and All Other Outputs" ||
|
||||
data.legend == "VAT on Expenses and All Other Inputs") &&
|
||||
data.legend == value
|
||||
) {
|
||||
value = $(`<span>${value}</span>`);
|
||||
var $value = $(value).css("font-weight", "bold");
|
||||
value = $value.wrap("<p></p>").parent().html();
|
||||
|
||||
@@ -1,31 +1,30 @@
|
||||
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
|
||||
frappe.query_reports["VAT Audit Report"] = {
|
||||
"filters": [
|
||||
filters: [
|
||||
{
|
||||
"fieldname": "company",
|
||||
"label": __("Company"),
|
||||
"fieldtype": "Link",
|
||||
"options": "Company",
|
||||
"reqd": 1,
|
||||
"default": frappe.defaults.get_user_default("Company")
|
||||
fieldname: "company",
|
||||
label: __("Company"),
|
||||
fieldtype: "Link",
|
||||
options: "Company",
|
||||
reqd: 1,
|
||||
default: frappe.defaults.get_user_default("Company"),
|
||||
},
|
||||
{
|
||||
"fieldname": "from_date",
|
||||
"label": __("From Date"),
|
||||
"fieldtype": "Date",
|
||||
"reqd": 1,
|
||||
"default": frappe.datetime.add_months(frappe.datetime.get_today(), -2),
|
||||
"width": "80"
|
||||
fieldname: "from_date",
|
||||
label: __("From Date"),
|
||||
fieldtype: "Date",
|
||||
reqd: 1,
|
||||
default: frappe.datetime.add_months(frappe.datetime.get_today(), -2),
|
||||
width: "80",
|
||||
},
|
||||
{
|
||||
"fieldname": "to_date",
|
||||
"label": __("To Date"),
|
||||
"fieldtype": "Date",
|
||||
"reqd": 1,
|
||||
"default": frappe.datetime.get_today()
|
||||
}
|
||||
]
|
||||
fieldname: "to_date",
|
||||
label: __("To Date"),
|
||||
fieldtype: "Date",
|
||||
reqd: 1,
|
||||
default: frappe.datetime.get_today(),
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user