Skip to content

Commit 1ab0795

Browse files
committed
Fix supplier headers and purchase back navigation
1 parent 5a3bba2 commit 1ab0795

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

‎docs/js/app.js‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2763,12 +2763,33 @@ function printLedger() {
27632763
(s ? esc(s.name) : "নির্বাচন করা হয়নি") +
27642764
"</strong>";
27652765
};
2766+
window.e24PurchaseReturnView = "list";
2767+
window.e24BackPurchasePage = () => {
2768+
if (window.e24PurchaseReturnView === "detail" && db.selectedSupplierId) {
2769+
const supplierExists = (db.suppliers || []).some(
2770+
(supplier) => String(supplier.id) === String(db.selectedSupplierId),
2771+
);
2772+
if (supplierExists) {
2773+
switchPage("9");
2774+
window.e24ShowSupplier(db.selectedSupplierId);
2775+
return;
2776+
}
2777+
}
2778+
switchPage("9");
2779+
renderSupplierPage();
2780+
};
27662781
window.e24OpenPurchasePage = () => {
27672782
const suppliers = db.suppliers || [];
27682783
if (!suppliers.length) {
27692784
showToast("আগে নতুন সাপ্লায়ার যুক্ত করুন");
27702785
return;
27712786
}
2787+
const detailView = document.getElementById("supplier-detail-view");
2788+
window.e24PurchaseReturnView =
2789+
document.getElementById("page-9")?.classList.contains("active-page") &&
2790+
detailView && !detailView.hidden
2791+
? "detail"
2792+
: "list";
27722793
const select = document.getElementById("purchase-supplier-select");
27732794
if (!select.dataset.purchaseSupplierChangeBound) {
27742795
select.addEventListener("change", () =>

0 commit comments

Comments
 (0)