def on_cancel(self): self.validate_cancellation() self.delete_depreciation_entries() self.set_status() self.ignore_linked_doctypes = ('GL Entry', 'Stock Ledger Entry') make_reverse_gl_entries(voucher_type='Asset', voucher_no=self.name) self.db_set('booked_fixed_asset', 0)
def on_cancel(self): self.validate_cancellation() self.cancel_movement_entries() self.delete_depreciation_entries() self.set_status() self.ignore_linked_doctypes = ("GL Entry", "Stock Ledger Entry") make_reverse_gl_entries(voucher_type="Asset", voucher_no=self.name) self.db_set("booked_fixed_asset", 0)
def on_cancel(self): self.ignore_linked_doctypes = ['GL Entry'] gl_entries = frappe.get_all('GL Entry', fields=['*'], filters={ 'against_voucher_type': self.doctype, 'against_voucher': self.name }) make_reverse_gl_entries(gl_entries=gl_entries)
def make_gl_entries(self, gl_entries=None): if self.docstatus == 2: make_reverse_gl_entries(voucher_type=self.doctype, voucher_no=self.name) if cint(erpnext.is_perpetual_inventory_enabled(self.company)): warehouse_account = get_warehouse_account_map(self.company) if self.docstatus==1: if not gl_entries: gl_entries = self.get_gl_entries(warehouse_account) make_gl_entries(gl_entries) elif self.doctype in ['Purchase Receipt', 'Purchase Invoice'] and self.docstatus == 1: gl_entries = [] gl_entries = self.get_asset_gl_entry(gl_entries) make_gl_entries(gl_entries)
def make_gl_entries(self, gl_entries=None): if not gl_entries: gl_entries = self.get_gl_entries() if gl_entries: update_outstanding = "No" if (cint(self.is_paid) or self.write_off_account) else "Yes" if self.docstatus == 1: make_gl_entries(gl_entries, update_outstanding=update_outstanding, merge_entries=False) elif self.docstatus == 2: make_reverse_gl_entries(voucher_type=self.doctype, voucher_no=self.name) if update_outstanding == "No": update_outstanding_amt(self.credit_to, "Supplier", self.supplier, self.doctype, self.return_against if cint(self.is_return) and self.return_against else self.name) elif self.docstatus == 2 and cint(self.update_stock) and self.auto_accounting_for_stock: make_reverse_gl_entries(voucher_type=self.doctype, voucher_no=self.name)
def make_gl_entries(self, gl_entries=None, from_repost=False): if self.docstatus == 2: make_reverse_gl_entries(voucher_type=self.doctype, voucher_no=self.name) provisional_accounting_for_non_stock_items = cint( frappe.db.get_value( "Company", self.company, "enable_provisional_accounting_for_non_stock_items")) if (cint(erpnext.is_perpetual_inventory_enabled(self.company)) or provisional_accounting_for_non_stock_items): warehouse_account = get_warehouse_account_map(self.company) if self.docstatus == 1: if not gl_entries: gl_entries = self.get_gl_entries(warehouse_account) make_gl_entries(gl_entries, from_repost=from_repost) elif self.doctype in ["Purchase Receipt", "Purchase Invoice" ] and self.docstatus == 1: gl_entries = [] gl_entries = self.get_asset_gl_entry(gl_entries) make_gl_entries(gl_entries, from_repost=from_repost)
def on_cancel(self): self.ignore_linked_doctypes = ('GL Entry', 'Stock Ledger Entry') from erpnext.accounts.general_ledger import make_reverse_gl_entries make_reverse_gl_entries(voucher_type="Period Closing Voucher", voucher_no=self.name)
def on_cancel(self): self.ignore_linked_doctypes = ('GL Entry', 'Stock Ledger Entry') make_reverse_gl_entries(voucher_type=self.doctype, voucher_no=self.name)
def on_cancel(self): if self.dunning_amount: self.ignore_linked_doctypes = ("GL Entry", "Stock Ledger Entry") make_reverse_gl_entries(voucher_type=self.doctype, voucher_no=self.name)