Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
4f13b7a
feat: Budget validation for accounting entries
hridyalakshmi Mar 6, 2026
09c84fd
fix: update controller methods
hridyalakshmi Mar 7, 2026
d0e9389
Merge pull request #1449 from efeone/beams01
MhmdSinanKT Mar 7, 2026
e91f145
refactor(bureau_trip_sheet): remove work_details table, use parent-le…
ajmalroshan123 Mar 9, 2026
6fc98cc
feat: add bureau trip sheet to monthly consolidated trip sheet of tha…
ajmalroshan123 Mar 10, 2026
b3a6b46
chore: code stadards (docs)
ajmalroshan123 Mar 10, 2026
0bfd087
Merge pull request #1451 from efeone/monthly_consolidated_bureau_trip…
MhmdSinanKT Mar 10, 2026
266ecea
Merge pull request #1450 from efeone/redesign_bureau_trip_sheet
MhmdSinanKT Mar 10, 2026
ba65c22
feat: create batta claim from bureau trip sheet
ajmalroshan123 Mar 10, 2026
65a39cb
fix: set food batta condition
ajmalroshan123 Mar 11, 2026
8ebbd9c
fix: refresh trip sheets on validate when month/year changes
ajmalroshan123 Mar 11, 2026
0f46712
feat: add breakfast, lunch, dinner fields for food batta
ajmalroshan123 Mar 11, 2026
2ca153f
feat: fuel calculation
ajmalroshan123 Mar 11, 2026
180f9f7
Merge pull request #1452 from efeone/create_batta_claim_bureau_ts
MhmdSinanKT Mar 11, 2026
21f8d8a
feat: settlement journal entry for driver/supplier payment from burea…
ajmalroshan123 Mar 12, 2026
450307f
feat: create log related to bureau trip sheets journal entry
ajmalroshan123 Mar 12, 2026
9edf698
chore: remove misbehaving validation
ajmalroshan123 Mar 12, 2026
7d962da
Merge pull request #1453 from efeone/create_batta_claim_bureau_ts
MhmdSinanKT Mar 12, 2026
215229e
feat: add fuel and batta details and agrregations
ajmalroshan123 Mar 12, 2026
ddd29ba
feat: aggreated batta amount
ajmalroshan123 Mar 13, 2026
ddece90
feat(Monthly Consolidated Trip Sheet): batta totals, amount received,…
ajmalroshan123 Mar 13, 2026
9c5ce00
fix: fetch item_name and unit too
ajmalroshan123 Mar 13, 2026
a9f48a4
feat: add bureau trip sheet table to store related journal entries
ajmalroshan123 Mar 13, 2026
9d42432
Merge pull request #1454 from efeone/create_batta_claim_bureau_ts
MhmdSinanKT Mar 13, 2026
c07df3f
feat: mark advance journal entry from bureau trip sheet
ajmalroshan123 Mar 13, 2026
a5daaf2
fix: change button name to petty cash payments and show only after fo…
ajmalroshan123 Mar 16, 2026
0f70ee5
feat: fetch advance payments for that suppler
ajmalroshan123 Mar 16, 2026
23b93b2
Merge pull request #1455 from efeone/create_batta_claim_bureau_ts
MhmdSinanKT Mar 17, 2026
b3e6f1d
fix: fetch total ot amount and create jv in draft
ajmalroshan123 Mar 17, 2026
a545177
feat: add accouts related to bureau trip sheet settlement
ajmalroshan123 Mar 17, 2026
0a99b78
fix: replace PI to JV and Add fuel-card deduction
ajmalroshan123 Mar 17, 2026
0127205
feat(mcts): batta/OT amounts after advances (child + parent totals)
ajmalroshan123 Mar 18, 2026
8b1010b
fix: label correction
ajmalroshan123 Mar 18, 2026
685f8ab
Merge pull request #1456 from efeone/create_batta_claim_bureau_ts
MhmdSinanKT Mar 18, 2026
d7a631c
fix: remove PI creation
ajmalroshan123 Mar 21, 2026
8e97d15
fix: interchange the dibit and credit accounts
ajmalroshan123 Mar 21, 2026
27de77c
chore: remove unused on_submit method
NaseeraVP Mar 23, 2026
30b5700
Merge pull request #1457 from efeone/create_batta_claim_bureau_ts
SherinKR Mar 23, 2026
30199bc
fix(bureau-trip-sheet): preserve manual daily batta on save and align…
ajmalroshan123 Mar 24, 2026
f08d147
Merge pull request #1458 from efeone/create_batta_claim_bureau_ts
SherinKR Mar 24, 2026
ab4f510
fix: Processed only new trip sheet rows in Monthly Consolidated Trip …
NaseeraVP Mar 26, 2026
ed86a48
Merge pull request #1459 from efeone/TASK-2026-00406
MhmdSinanKT Mar 26, 2026
d370cda
fix:Implement check-in based OT calculation in Bureau Trip Sheet
NaseeraVP Mar 26, 2026
a0c87a5
Merge pull request #1460 from efeone/TASK-2026-00405
MhmdSinanKT Mar 26, 2026
fb0519d
fix:Prevented duplication of trip sheets when re fetching in monthly …
NaseeraVP Mar 27, 2026
8ecee2d
Merge pull request #1461 from efeone/beams_march27
MhmdSinanKT Mar 27, 2026
39e1e94
fix:Control Editability of Daily Batta and Food Allowance
NaseeraVP Mar 30, 2026
1510b83
Merge pull request #1462 from efeone/TASK-2026-00419
MhmdSinanKT Mar 30, 2026
832f476
feat: Budget Behavior
SherinKR Mar 31, 2026
467e469
Merge pull request #1464 from efeone/dev_sherin_budget
SherinKR Mar 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion beams/beams/custom_scripts/budget/budget.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def beams_budget_validate(doc, method=None):
convert_currency(doc, method)

def update_total_amount(doc, method):
total = sum([row.budget_amount for row in doc.get('accounts') if row.budget_amount])
total = sum([row.budget_amount for row in doc.get('budget_accounts') if row.budget_amount])
doc.total_amount = total

def populate_og_accounts(doc, method=None):
Expand Down
85 changes: 65 additions & 20 deletions beams/beams/custom_scripts/journal_entry/journal_entry.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,69 @@
import frappe
from frappe import _
from frappe.utils import flt, getdate


def on_submit(doc, method=None):
"""When a Journal Entry linked to a Bureau Trip Sheet is submitted (docstatus=1), add it to the BTS settlement table."""
if not getattr(doc, "bureau_trip_sheet", None):
return
bts_name = doc.bureau_trip_sheet
if not frappe.db.exists("Bureau Trip Sheet", bts_name):
return
# Avoid duplicate row if already in table
existing = frappe.db.get_all(
"Bureau Trip Sheet Journal Entry",
filters={"parent": bts_name, "parenttype": "Bureau Trip Sheet", "journal_entry": doc.name},
limit=1,
)
if existing:
return
# Settlement amount = total debit (or credit) in the JE
amount = sum(flt(acc.get("debit_in_account_currency") or 0) for acc in (doc.accounts or []))
if amount <= 0:
amount = sum(flt(acc.get("credit_in_account_currency") or 0) for acc in (doc.accounts or []))
bts = frappe.get_doc("Bureau Trip Sheet", bts_name)
bts.append("settlement_journal_entries", {
"journal_entry": doc.name,
"posting_date": getdate(doc.posting_date),
"amount": amount,
})
bts.flags.ignore_validate_update_after_submit = True
bts.save(ignore_permissions=True)


def on_cancel(doc, method):
"""
This method is called when the Journal Entry is canceled.
and updates the 'is_paid' field in the Substitute Booking.
"""
# Check if the Journal Entry is linked to a Substitute Booking
substitute_booking_name = doc.substitute_booking_reference
if substitute_booking_name:
# Fetch the related Substitute Booking document
substitute_booking = frappe.get_doc('Substitute Booking', substitute_booking_name)

# Uncheck 'is_paid' in Substitute Booking
substitute_booking.db_set('is_paid', 0)
substitute_booking.save()

# Display success message
frappe.msgprint(_("Journal Entry cancelled, and Substitute Booking updated successfully."))

else:
# Handle case where no Substitute Booking is linked
frappe.msgprint(_("No Substitute Booking linked to this Journal Entry."))
# Remove this JE from Bureau Trip Sheet settlement_journal_entries if linked
bts_name = getattr(doc, "bureau_trip_sheet", None)
if bts_name and frappe.db.exists("Bureau Trip Sheet", bts_name):
child = frappe.db.get_value(
"Bureau Trip Sheet Journal Entry",
{"parent": bts_name, "parenttype": "Bureau Trip Sheet", "journal_entry": doc.name},
"name",
)
if child:
bts = frappe.get_doc("Bureau Trip Sheet", bts_name)
bts.flags.ignore_validate_update_after_submit = True
for i, row in enumerate(bts.settlement_journal_entries or []):
if row.journal_entry == doc.name:
bts.settlement_journal_entries.pop(i)
break
bts.save(ignore_permissions=True)

# This method is called when the Journal Entry is canceled.
# Updates the 'is_paid' field in the Substitute Booking.
substitute_booking_name = doc.substitute_booking_reference
if substitute_booking_name:
# Fetch the related Substitute Booking document
substitute_booking = frappe.get_doc('Substitute Booking', substitute_booking_name)

# Uncheck 'is_paid' in Substitute Booking
substitute_booking.db_set('is_paid', 0)
substitute_booking.save()

# Display success message
frappe.msgprint(_("Journal Entry cancelled, and Substitute Booking updated successfully."))

else:
# Handle case where no Substitute Booking is linked
frappe.msgprint(_("No Substitute Booking linked to this Journal Entry."))
22 changes: 22 additions & 0 deletions beams/beams/custom_scripts/purchase_invoice/purchase_invoice.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ frappe.ui.form.on('Purchase Invoice', {
frm.set_df_property('supplier', 'read_only', 1);
}
},
refresh: function (frm) {
fetch_advances_from_mcts(frm);
},
bureau: function (frm) {
fetch_mode_of_payment_from_bureau(frm, frm.doc.bureau);
}
Expand Down Expand Up @@ -168,3 +171,22 @@ function fetch_mode_of_payment_from_bureau(frm, bureau) {
});
}

function fetch_advances_from_mcts(frm) {
// When opened from Monthly Consolidated Trip Sheet, fetch advances for the supplier (like "Get Advances Paid")
if (frappe.route_options && frappe.route_options.fetch_advances_from_mcts && frm.doc.supplier && frm.doc.__islocal) {
delete frappe.route_options.fetch_advances_from_mcts;
frappe.call({
method: "run_doc_method",
args: { docs: frm.doc, method: "set_advances" },
callback: function (r) {
if (!r.exc && r.docs && r.docs[0] && r.docs[0].advances && r.docs[0].advances.length) {
frm.clear_table("advances");
(r.docs[0].advances || []).forEach(function (row) {
frm.add_child("advances", row);
});
frm.refresh_field("advances");
}
},
});
}
}
Loading