Merge branch 'version-13-hotfix' into fetch-valuation-rate

This commit is contained in:
Saqib Ansari
2022-02-22 14:23:29 +05:30
committed by GitHub
4 changed files with 13 additions and 11 deletions

View File

@@ -62,7 +62,7 @@ class JobCard(Document):
if self.get('time_logs'): if self.get('time_logs'):
for d in self.get('time_logs'): for d in self.get('time_logs'):
if get_datetime(d.from_time) > get_datetime(d.to_time): if d.to_time and get_datetime(d.from_time) > get_datetime(d.to_time):
frappe.throw(_("Row {0}: From time must be less than to time").format(d.idx)) frappe.throw(_("Row {0}: From time must be less than to time").format(d.idx))
data = self.get_overlap_for(d) data = self.get_overlap_for(d)

View File

@@ -1265,7 +1265,7 @@ class SalarySlip(TransactionBase):
for i, earning in enumerate(self.earnings): for i, earning in enumerate(self.earnings):
if earning.salary_component == salary_component: if earning.salary_component == salary_component:
self.earnings[i].amount = wages_amount self.earnings[i].amount = wages_amount
self.gross_pay += self.earnings[i].amount self.gross_pay += flt(self.earnings[i].amount, earning.precision("amount"))
self.net_pay = flt(self.gross_pay) - flt(self.total_deduction) self.net_pay = flt(self.gross_pay) - flt(self.total_deduction)
def compute_year_to_date(self): def compute_year_to_date(self):

View File

@@ -525,6 +525,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
item.weight_per_unit = 0; item.weight_per_unit = 0;
item.weight_uom = ''; item.weight_uom = '';
item.conversion_factor = 0;
if(['Sales Invoice'].includes(this.frm.doc.doctype)) { if(['Sales Invoice'].includes(this.frm.doc.doctype)) {
update_stock = cint(me.frm.doc.update_stock); update_stock = cint(me.frm.doc.update_stock);

View File

@@ -11,7 +11,7 @@
{% if frappe.session.user == 'Guest' %} {% if frappe.session.user == 'Guest' %}
<a id="signup" class="btn btn-primary btn-lg" href="/login#signup">{{_('Sign Up')}}</a> <a id="signup" class="btn btn-primary btn-lg" href="/login#signup">{{_('Sign Up')}}</a>
{% elif not has_access %} {% elif not has_access %}
<button id="enroll" class="btn btn-primary btn-lg" onclick="enroll()" disabled>{{_('Enroll')}}</button> <button id="enroll" class="btn btn-primary btn-lg" onclick="enroll()">{{_('Enroll')}}</button>
{% endif %} {% endif %}
</p> </p>
</div> </div>
@@ -20,34 +20,35 @@
<script type="text/javascript"> <script type="text/javascript">
frappe.ready(() => { frappe.ready(() => {
btn = document.getElementById('enroll'); btn = document.getElementById('enroll');
if (btn) btn.disabled = false;
}) })
function enroll() { function enroll() {
let params = frappe.utils.get_query_params() let params = frappe.utils.get_query_params()
let btn = document.getElementById('enroll'); let btn = document.getElementById('enroll');
btn.disbaled = true;
btn.innerText = __('Enrolling...')
let opts = { let opts = {
method: 'erpnext.education.utils.enroll_in_program', method: 'erpnext.education.utils.enroll_in_program',
args: { args: {
program_name: params.program program_name: params.program
} },
freeze: true,
freeze_message: __('Enrolling...')
} }
frappe.call(opts).then(res => { frappe.call(opts).then(res => {
let success_dialog = new frappe.ui.Dialog({ let success_dialog = new frappe.ui.Dialog({
title: __('Success'), title: __('Success'),
primary_action_label: __('View Program Content'),
primary_action: function() {
window.location.reload();
},
secondary_action: function() { secondary_action: function() {
window.location.reload() window.location.reload();
} }
}) })
success_dialog.set_message(__('You have successfully enrolled for the program '));
success_dialog.$message.show()
success_dialog.show(); success_dialog.show();
btn.disbaled = false; success_dialog.set_message(__('You have successfully enrolled for the program '));
}) })
} }
</script> </script>