mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-24 13:42:10 +01:00
Merge pull request #35323 from frappe/version-13-hotfix
chore: release v13
This commit is contained in:
@@ -303,7 +303,7 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
|
||||
|
||||
apply_tds: function(frm) {
|
||||
var me = this;
|
||||
|
||||
me.frm.set_value("tax_withheld_vouchers", []);
|
||||
if (!me.frm.doc.apply_tds) {
|
||||
me.frm.set_value("tax_withholding_category", '');
|
||||
me.frm.set_df_property("tax_withholding_category", "hidden", 1);
|
||||
|
||||
@@ -165,6 +165,7 @@
|
||||
"fieldname": "slide_3_content_align",
|
||||
"fieldtype": "Select",
|
||||
"label": "Content Align",
|
||||
"options": "Left\nCentre\nRight",
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
@@ -214,6 +215,7 @@
|
||||
"fieldname": "slide_4_content_align",
|
||||
"fieldtype": "Select",
|
||||
"label": "Content Align",
|
||||
"options": "Left\nCentre\nRight",
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
@@ -263,6 +265,7 @@
|
||||
"fieldname": "slide_5_content_align",
|
||||
"fieldtype": "Select",
|
||||
"label": "Content Align",
|
||||
"options": "Left\nCentre\nRight",
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
@@ -274,7 +277,7 @@
|
||||
}
|
||||
],
|
||||
"idx": 2,
|
||||
"modified": "2021-02-24 15:57:05.889709",
|
||||
"modified": "2023-05-12 15:03:57.604060",
|
||||
"modified_by": "Administrator",
|
||||
"module": "E-commerce",
|
||||
"name": "Hero Slider",
|
||||
|
||||
@@ -80,22 +80,27 @@ frappe.ui.form.on("Salary Slip", {
|
||||
},
|
||||
|
||||
currency: function(frm) {
|
||||
frm.trigger("update_currency_changes");
|
||||
},
|
||||
|
||||
update_currency_changes: function(frm) {
|
||||
frm.trigger("set_exchange_rate");
|
||||
frm.trigger("set_dynamic_labels");
|
||||
},
|
||||
|
||||
set_dynamic_labels: function(frm) {
|
||||
var company_currency = frm.doc.company? erpnext.get_currency(frm.doc.company): frappe.defaults.get_default("currency");
|
||||
if (frm.doc.employee && frm.doc.currency) {
|
||||
frappe.run_serially([
|
||||
() => frm.events.set_exchange_rate(frm, company_currency),
|
||||
() => frm.events.change_form_labels(frm, company_currency),
|
||||
() => frm.events.change_grid_labels(frm),
|
||||
() => frm.refresh_fields()
|
||||
() => frm.events.change_form_labels(frm),
|
||||
() => frm.events.change_grid_labels(frm),
|
||||
() => frm.refresh_fields()
|
||||
]);
|
||||
}
|
||||
},
|
||||
|
||||
set_exchange_rate: function(frm, company_currency) {
|
||||
set_exchange_rate: function(frm) {
|
||||
const company_currency = erpnext.get_currency(frm.doc.company);
|
||||
|
||||
if (frm.doc.docstatus === 0) {
|
||||
if (frm.doc.currency) {
|
||||
var from_currency = frm.doc.currency;
|
||||
@@ -133,9 +138,11 @@ frappe.ui.form.on("Salary Slip", {
|
||||
frm.set_df_property('section_break_43', 'hidden', 1);
|
||||
},
|
||||
|
||||
change_form_labels: function(frm, company_currency) {
|
||||
change_form_labels: function(frm) {
|
||||
const company_currency = erpnext.get_currency(frm.doc.company);
|
||||
|
||||
frm.set_currency_labels(["base_hour_rate", "base_gross_pay", "base_total_deduction",
|
||||
"base_net_pay", "base_rounded_total", "base_total_in_words", "base_year_to_date", "base_month_to_date", "gross_base_year_to_date"],
|
||||
"base_net_pay", "base_rounded_total", "base_total_in_words", "base_year_to_date", "base_month_to_date", "base_gross_year_to_date"],
|
||||
company_currency);
|
||||
|
||||
frm.set_currency_labels(["hour_rate", "gross_pay", "total_deduction", "net_pay", "rounded_total", "total_in_words", "year_to_date", "month_to_date", "gross_year_to_date"],
|
||||
@@ -207,6 +214,9 @@ frappe.ui.form.on("Salary Slip", {
|
||||
frm.fields_dict.absent_days.set_description(__("Unmarked Days is treated as {0}. You can can change this in {1}", [r.message, frappe.utils.get_form_link("Payroll Settings", "Payroll Settings", true)]));
|
||||
}
|
||||
frm.refresh();
|
||||
// triggering events explicitly because structure is set on the server-side
|
||||
// and currency is fetched from the structure
|
||||
frm.trigger("update_currency_changes");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -653,15 +653,17 @@ class SalarySlip(TransactionBase):
|
||||
amount = self.eval_condition_and_formula(struct_row, data)
|
||||
|
||||
if struct_row.statistical_component:
|
||||
default_data[struct_row.abbr] = amount
|
||||
|
||||
# update statitical component amount in reference data based on payment days
|
||||
# since row for statistical component is not added to salary slip
|
||||
if struct_row.depends_on_payment_days:
|
||||
joining_date, relieving_date = self.get_joining_and_relieving_dates()
|
||||
default_data[struct_row.abbr] = amount
|
||||
data[struct_row.abbr] = flt(
|
||||
(flt(amount) * flt(self.payment_days) / cint(self.total_working_days)),
|
||||
struct_row.precision("amount"),
|
||||
payment_days_amount = (
|
||||
flt(amount) * flt(self.payment_days) / cint(self.total_working_days)
|
||||
if self.total_working_days
|
||||
else 0
|
||||
)
|
||||
data[struct_row.abbr] = payment_days_amount
|
||||
|
||||
elif amount or struct_row.amount_based_on_formula and amount is not None:
|
||||
default_amount = self.eval_condition_and_formula(struct_row, default_data)
|
||||
|
||||
Reference in New Issue
Block a user