Skip to content

Commit

Permalink
Merge pull request #886 from aakvatech/version-14-hotfix
Browse files Browse the repository at this point in the history
v14.13.1
  • Loading branch information
aakvatech authored Feb 12, 2024
2 parents 5cfb29c + 3f6d526 commit 00b677c
Show file tree
Hide file tree
Showing 22 changed files with 969 additions and 458 deletions.
2 changes: 1 addition & 1 deletion hms_tz/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

__version__ = "14.12.0"
__version__ = "14.13.1"
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,14 @@
(c) ESS 2015-16
*/
frappe.listview_settings['Patient Encounter'] = {
filters: [["docstatus", "!=", "2"], ["duplicated", "==", "0"]]
filters: [["docstatus", "!=", "2"], ["duplicated", "==", "0"]],
onload: function (listview) {
listview.page.fields_dict['admission_service_unit_type'].get_query = function () {
return {
filters: {
inpatient_occupancy: 1
}
};
};
}
};
178 changes: 102 additions & 76 deletions hms_tz/hms_tz/report/ipd_billing_report/ipd_billing_report.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,83 +3,89 @@
/* eslint-disable */

frappe.query_reports["IPD Billing Report"] = {
onload: (report) => {
report.page.add_inner_button(__("Make Deposit"), () => {
let filters = report.get_values();
make_deposit(filters.inpatient_record);
}).addClass("font-weight-bold");
},
onload: (report) => {
report.page.add_inner_button(__("Make Deposit"), () => {
let filters = report.get_values();
make_deposit(filters.inpatient_record);
}).addClass("font-weight-bold");

"filters": [
{
"fieldname": "inpatient_record",
"fieldtype": "Link",
"label": __("Inpatient Record"),
"options": "Inpatient Record",
"reqd": 1
},
{
"fieldname": "patient",
"fieldtype": "Link",
"label": __("Patient"),
"options": "Patient",
"reqd": 1
},
{
"fieldname": "appointment_no",
"fieldtype": "Data",
"label": __("AppointmentNo"),
"reqd": 1
},
{
"fieldname": "company",
"fieldtype": "Link",
"label": __("Company"),
"options": "Company",
"reqd": 1
},
{
fieldname: 'patient_type',
label: __('Patient Type'),
fieldtype: 'Select',
// options: ["", 'Out-Patient', 'In-Patient'],
options: ['In-Patient'],
default: 'In-Patient',
reqd: 1,
},
{
fieldname: "from_date",
label: __("From Date"),
fieldtype: "Date",
reqd: 0,
},
{
fieldname: "to_date",
label: __("To Date"),
fieldtype: "Date",
reqd: 0,
},
{
"fieldname": "summarized_view",
"fieldtype": "Check",
"label": __("Summarized View")
},
],
'formatter': (value, row, column, data, default_formatter) => {
value = default_formatter(value, row, column, data);
if (column.fieldtype == 'Currency' && data[column.fieldname] > 0) {
value = `<span class='font-weight-bold text-secondary'>${value}</span>`;
}
if (column.fieldtype == 'Currency' && data[column.fieldname] == 0) {
value = `<span class='text-warning'>${value}</span>`;
}
if (data && row[1].content == 'Total') {
value = $(`<span>${value}</span>`);
var $value = $(value).css("font-weight", "bold");
value = $value.wrap("<p></p>").parent().html();
}
return value
}
report.page.add_inner_button(__("Create Invoice"), () => {
let args = report.get_values();
create_sales_invoice(args);

}).addClass("font-weight-bold");
},

"filters": [
{
"fieldname": "inpatient_record",
"fieldtype": "Link",
"label": __("Inpatient Record"),
"options": "Inpatient Record",
"reqd": 1
},
{
"fieldname": "patient",
"fieldtype": "Link",
"label": __("Patient"),
"options": "Patient",
"reqd": 1
},
{
"fieldname": "appointment_no",
"fieldtype": "Data",
"label": __("AppointmentNo"),
"reqd": 1
},
{
"fieldname": "company",
"fieldtype": "Link",
"label": __("Company"),
"options": "Company",
"reqd": 1
},
{
fieldname: 'patient_type',
label: __('Patient Type'),
fieldtype: 'Select',
// options: ["", 'Out-Patient', 'In-Patient'],
options: ['In-Patient'],
default: 'In-Patient',
reqd: 1,
},
{
fieldname: "from_date",
label: __("From Date"),
fieldtype: "Date",
reqd: 0,
},
{
fieldname: "to_date",
label: __("To Date"),
fieldtype: "Date",
reqd: 0,
},
{
"fieldname": "summarized_view",
"fieldtype": "Check",
"label": __("Summarized View")
},
],
'formatter': (value, row, column, data, default_formatter) => {
value = default_formatter(value, row, column, data);
if (column.fieldtype == 'Currency' && data[column.fieldname] > 0) {
value = `<span class='font-weight-bold text-secondary'>${value}</span>`;
}
if (column.fieldtype == 'Currency' && data[column.fieldname] == 0) {
value = `<span class='text-warning'>${value}</span>`;
}
if (data && row[1].content == 'Total') {
value = $(`<span>${value}</span>`);
var $value = $(value).css("font-weight", "bold");
value = $value.wrap("<p></p>").parent().html();
}
return value
}
};

var make_deposit = (inpatient_record) => {
Expand Down Expand Up @@ -166,4 +172,24 @@ var make_deposit = (inpatient_record) => {
});

d.show();
}

var create_sales_invoice = (args) => {
frappe.call({
method: "hms_tz.nhif.api.inpatient_record.create_sales_invoice",
args: {
args: {
"patient": args.patient,
"appointment_no": args.appointment_no,
"inpatient_record": args.inpatient_record,
"company": args.company,
}
},
freeze: true,
freeze_message: __('<i class="fa fa-spinner fa-spin fa-4x"></i>'),
}).then((r) => {
if (r.message) {
frappe.set_route("Form", "Sales Invoice", r.message);
}
});
}
Loading

0 comments on commit 00b677c

Please sign in to comment.