Skip to content

Commit

Permalink
fix: change display audit report and bugs
Browse files Browse the repository at this point in the history
- fix payment pos invoice not deleted if null
- fix reversed credit account in breakfast
  • Loading branch information
anhilmy committed Jul 2, 2024
1 parent 9d6c4f9 commit d38d510
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def post_individual_room_charges(parent_id, tobe_posted_list):
breakfast_commission.amount = float(int(channel.breakfast_cashback))
accumulated_amount += float(int(channel.breakfast_cashback))
breakfast_commission.credit_account = PROFIT_SHARING_ACCOUNT
breakfast_commission.debit_account = breakfast_charge_credit_account
breakfast_commission.debit_account = breakfast_charge_debit_account
breakfast_commission.remark = 'Commission ' + channel.name + ' : ' + item_doc.room_id + " - " + get_last_audit_date().strftime("%d-%m-%Y")
breakfast_commission.parent = item_doc.folio_id
breakfast_commission.parenttype = 'Inn Folio'
Expand Down
8 changes: 8 additions & 0 deletions inn/inn_hotels/report/audit_report/audit_report.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,12 @@ frappe.query_reports["Audit Report"] = {
"name_field": "account",
"parent_field": "parent_account",
"initial_depth": 1,
"formatter": function (value, row, column, data, default_formatter) {
value = default_formatter(value, row, column, data)

if (column.fieldname == "rsv") {
value = `<a href='/app/inn-reservation/${value}'>${value}</a>`
}
return value
}
};
12 changes: 2 additions & 10 deletions inn/inn_hotels/report/audit_report/audit_report.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,11 @@
"disabled": 0,
"docstatus": 0,
"doctype": "Report",
"filters": [
{
"fieldname": "start_date",
"fieldtype": "Date",
"label": "Audit Date",
"mandatory": 1,
"wildcard_filter": 0
}
],
"filters": [],
"idx": 0,
"is_standard": "Yes",
"letterhead": null,
"modified": "2024-03-04 14:37:38.306455",
"modified": "2024-07-02 11:42:04.364467",
"modified_by": "Administrator",
"module": "Inn Hotels",
"name": "Audit Report",
Expand Down
9 changes: 2 additions & 7 deletions inn/overrides/erpnext/accounts/pos_invoice/pos_invoice.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import frappe

def before_submit(doc, method=None):

for index, payment in enumerate(doc.payments):
if payment.amount == 0:
frappe.delete_doc_if_exists("Sales Invoice Payment", payment.name)
doc.payments.pop(index)


def before_submit(doc, method=None):
doc.payments = [payment for payment in doc.payments if payment.amount != 0]

0 comments on commit d38d510

Please sign in to comment.