def make_gl_entries(self):
		if self.doc.docstatus == 2:
			delete_gl_entries(voucher_type=self.doc.doctype, voucher_no=self.doc.name)
			
		if cint(webnotes.defaults.get_global_default("auto_accounting_for_stock")):
			warehouse_account = self.get_warehouse_account()
		
			if self.doc.docstatus==1:
				gl_entries = self.get_gl_entries_for_stock(warehouse_account)
				make_gl_entries(gl_entries)

			self.update_gl_entries_after(warehouse_account)
Example #2
0
	def make_gl_entries(self, update_gl_entries_after=True):
		if self.doc.docstatus == 2:
			delete_gl_entries(voucher_type=self.doc.doctype, voucher_no=self.doc.name)
			
		if cint(webnotes.defaults.get_global_default("auto_accounting_for_stock")):
			warehouse_account = self.get_warehouse_account()
		
			if self.doc.docstatus==1:
				gl_entries = self.get_gl_entries(warehouse_account)
				make_gl_entries(gl_entries)

			if update_gl_entries_after:
				self.update_gl_entries_after(warehouse_account)
Example #3
0
	def make_gl_entries(self, repost_future_gle=True):
		if self.doc.docstatus == 2:
			delete_gl_entries(voucher_type=self.doc.doctype, voucher_no=self.doc.name)
			
		if cint(webnotes.defaults.get_global_default("auto_accounting_for_stock")):
			warehouse_account = get_warehouse_account()
		
			if self.doc.docstatus==1:
				gl_entries = self.get_gl_entries(warehouse_account)
				make_gl_entries(gl_entries)

			if repost_future_gle:
				items, warehouse_account = self.get_items_and_warehouse_accounts(warehouse_account)
				update_gl_entries_after(self.doc.posting_date, self.doc.posting_time, 
					warehouse_account, items)
Example #4
0
    def make_gl_entries(self, repost_future_gle=True):
        if self.doc.docstatus == 2:
            delete_gl_entries(voucher_type=self.doc.doctype,
                              voucher_no=self.doc.name)

        if cint(
                webnotes.defaults.get_global_default(
                    "auto_accounting_for_stock")):
            warehouse_account = get_warehouse_account()

            if self.doc.docstatus == 1:
                gl_entries = self.get_gl_entries(warehouse_account)
                make_gl_entries(gl_entries)

            if repost_future_gle:
                items, warehouse_account = self.get_items_and_warehouse_accounts(
                    warehouse_account)
                update_gl_entries_after(self.doc.posting_date,
                                        self.doc.posting_time,
                                        warehouse_account, items)