diff --git a/calicut_textiles/calicut_textiles/doctype/daliy_cash_entry/daliy_cash_entry.js b/calicut_textiles/calicut_textiles/doctype/daliy_cash_entry/daliy_cash_entry.js index 55e4a70..0e79e33 100644 --- a/calicut_textiles/calicut_textiles/doctype/daliy_cash_entry/daliy_cash_entry.js +++ b/calicut_textiles/calicut_textiles/doctype/daliy_cash_entry/daliy_cash_entry.js @@ -3,6 +3,13 @@ frappe.ui.form.on("Daliy Cash Entry", { refresh:function(frm) { + frm.set_query("cost_center", function() { + return { + filters: { + 'is_group': 0 + } + }; + }); if (frm.doc.paid_type!="Other" && frm.doc.docstatus === 1 && !frm.doc.payment_entry) { frm.add_custom_button(__("Payment Entry"),function () { frappe.call({ diff --git a/calicut_textiles/calicut_textiles/doctype/daliy_cash_entry/daliy_cash_entry.json b/calicut_textiles/calicut_textiles/doctype/daliy_cash_entry/daliy_cash_entry.json index feaea8b..b266788 100644 --- a/calicut_textiles/calicut_textiles/doctype/daliy_cash_entry/daliy_cash_entry.json +++ b/calicut_textiles/calicut_textiles/doctype/daliy_cash_entry/daliy_cash_entry.json @@ -19,7 +19,8 @@ "payment_entry", "journal_entry", "amended_from", - "naming_series" + "naming_series", + "voucher_status" ], "fields": [ { @@ -30,7 +31,6 @@ "default": "Today", "fieldname": "posting_date", "fieldtype": "Date", - "in_list_view": 1, "label": "Date", "reqd": 1 }, @@ -42,7 +42,6 @@ "allow_in_quick_entry": 1, "fieldname": "amount", "fieldtype": "Currency", - "in_list_view": 1, "label": "Amount ", "reqd": 1 }, @@ -50,7 +49,6 @@ "allow_in_quick_entry": 1, "fieldname": "note", "fieldtype": "Small Text", - "in_list_view": 1, "label": "Remarks", "reqd": 1 }, @@ -123,13 +121,34 @@ "hidden": 1, "label": "Naming SeriesDCE-.YYYY.-.#####", "options": "DCE-.YYYY.-.#####" + }, + { + "allow_in_quick_entry": 1, + "allow_on_submit": 1, + "columns": 1, + "fieldname": "voucher_status", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Voucher Status", + "read_only": 1 } ], "grid_page_length": 50, "index_web_pages_for_search": 1, "is_submittable": 1, - "links": [], - "modified": "2026-01-28 16:28:04.425592", + "links": [ + { + "group": "Voucher Entry", + "link_doctype": "Journal Entry", + "link_fieldname": "custom_daily_cash_entry" + }, + { + "group": "Voucher Entry", + "link_doctype": "Payment Entry", + "link_fieldname": "custom_daily_cash_entry" + } + ], + "modified": "2026-02-04 10:59:54.634383", "modified_by": "Administrator", "module": "Calicut Textiles", "name": "Daliy Cash Entry", diff --git a/calicut_textiles/calicut_textiles/doctype/daliy_cash_entry/daliy_cash_entry.py b/calicut_textiles/calicut_textiles/doctype/daliy_cash_entry/daliy_cash_entry.py index ed49bbb..54a791a 100644 --- a/calicut_textiles/calicut_textiles/doctype/daliy_cash_entry/daliy_cash_entry.py +++ b/calicut_textiles/calicut_textiles/doctype/daliy_cash_entry/daliy_cash_entry.py @@ -12,6 +12,7 @@ def on_cancel(self): if pe.docstatus == 1: pe.cancel() frappe.db.set_value(self.doctype, self.name, "payment_entry", None) + frappe.db.set_value(self.doctype, self.name, "voucher_status", None) frappe.db.commit() # pe.delete() if self.journal_entry: @@ -19,6 +20,7 @@ def on_cancel(self): if je.docstatus == 1: je.cancel() frappe.db.set_value(self.doctype, self.name, "journal_entry", None) + frappe.db.set_value(self.doctype, self.name, "voucher_status", None) frappe.db.commit() # je.delete() @@ -31,6 +33,7 @@ def create_payment_entry(daliy_cash_entry): "doctype": "Payment Entry", "payment_type": "Pay", "mode_of_payment": "Cash", + "custom_daily_cash_entry": doc.name, "company": company, "paid_from": frappe.db.get_value("Company", company, "default_cash_account"), "party_type": doc.paid_type, @@ -44,6 +47,7 @@ def create_payment_entry(daliy_cash_entry): }) payment_entry.insert() frappe.db.set_value(doc.doctype, doc.name, "payment_entry", payment_entry.name) + frappe.db.set_value(doc.doctype, doc.name, "voucher_status", "Voucher Created") frappe.db.commit() return payment_entry @@ -56,23 +60,26 @@ def create_journal_entry(daliy_cash_entry): "company": company, "posting_date": doc.posting_date, "user_remark": f"Paid To :{doc.paid_name}, Note:{doc.note}", + "custom_cost_center": doc.cost_center if doc.cost_center else frappe.db.get_value("Company", company, "cost_center"), + "custom_daily_cash_entry": doc.name, "accounts": [ { "account": frappe.db.get_value("Company", company, "default_cash_account"), - "debit_in_account_currency": doc.amount, - "debit": doc.amount, + "credit_in_account_currency": doc.amount, + "credit": doc.amount, "cost_center": doc.cost_center if doc.cost_center else frappe.db.get_value("Company", company, "cost_center"), }, { "account": frappe.db.get_value("Company", company, "default_expense_account"), - "credit_in_account_currency": doc.amount, - "credit": doc.amount, + "debit_in_account_currency": doc.amount, + "debit": doc.amount, "cost_center": doc.cost_center if doc.cost_center else frappe.db.get_value("Company", company, "cost_center"), } ] }) journal_entry.insert() frappe.db.set_value(doc.doctype, doc.name, "journal_entry", journal_entry.name) + frappe.db.set_value(doc.doctype, doc.name, "voucher_status", "Voucher Created") frappe.db.commit() return journal_entry @@ -83,6 +90,7 @@ def delete_linked_daliy_cash_entry(payment_entry, method): if dce_name: dce = frappe.get_doc("Daliy Cash Entry", dce_name) frappe.db.set_value(dce.doctype, dce.name, "payment_entry", None) + frappe.db.set_value(dce.doctype, dce.name, "voucher_status", None) frappe.db.commit() if dce.docstatus == 1: dce.cancel() @@ -93,6 +101,7 @@ def delete_linked_journal_daliy_cash_entry(journal_entry, method): if dce_name: dce = frappe.get_doc("Daliy Cash Entry", dce_name) frappe.db.set_value(dce.doctype, dce.name, "journal_entry", None) + frappe.db.set_value(dce.doctype, dce.name, "voucher_status", None) frappe.db.commit() if dce.docstatus == 1: dce.cancel() \ No newline at end of file