Exemplo n.º 1
0
    def create_account_head(self):
        if self.doc.company:
            abbr = self.get_company_abbr()
            parent_account = self.get_parent_account(abbr)

            if not sql("select name from tabAccount where name=%s",
                       (self.doc.name + " - " + abbr)):

                ac = add_ac({
                    'account_name': self.doc.name,
                    'parent_account': parent_account,
                    'group_or_ledger': 'Ledger',
                    'company': self.doc.company,
                    'account_type': '',
                    'tax_rate': '0',
                    'master_type': 'Supplier',
                    'master_name': self.doc.name,
                })
                msgprint(_("Created Account Head: ") + ac)
            else:
                self.check_parent_account(parent_account, abbr)
        else:
            msgprint(
                "Please select Company under which you want to create account head"
            )
Exemplo n.º 2
0
	def add_account(self, ac, par, abbr):
		ac = add_ac({
			'account_name':ac,
			'parent_account':par,
			'group_or_ledger':'Group',
			'company':self.doc.company,
			'account_type':'',
			'tax_rate':'0'
		})
		
		msgprint(_("Created Group ") + ac)
Exemplo n.º 3
0
    def add_account(self, ac, par, abbr):
        ac = add_ac({
            'account_name': ac,
            'parent_account': par,
            'group_or_ledger': 'Group',
            'company': self.doc.company,
            'account_type': '',
            'tax_rate': '0'
        })

        msgprint(_("Created Group ") + ac)
Exemplo n.º 4
0
	def create_account_head(self):
		if self.doc.company :
			abbr = self.get_company_abbr()
			if not webnotes.conn.exists("Account", (self.doc.name + " - " + abbr)):
				parent_account = self.get_receivables_group()
				# create
				from accounts.utils import add_ac
				ac = add_ac({
					'account_name':self.doc.name,
					'parent_account': parent_account, 
					'group_or_ledger':'Ledger',
					'company':self.doc.company, 
					'account_type':'', 
					'tax_rate':'0', 
					'master_type':'Customer', 
					'master_name':self.doc.name
				})
				msgprint("Account Head: %s created" % ac)
		else :
			msgprint("Please Select Company under which you want to create account head")
Exemplo n.º 5
0
	def create_account_head(self):
		if self.doc.company :
			abbr = self.get_company_abbr()
			if not webnotes.conn.exists("Account", (self.doc.name + " - " + abbr)):
				parent_account = self.get_receivables_group()
				# create
				from accounts.utils import add_ac
				ac = add_ac({
					'account_name':self.doc.name,
					'parent_account': parent_account, 
					'group_or_ledger':'Ledger',
					'company':self.doc.company, 
					'account_type':'', 
					'tax_rate':'0', 
					'master_type':'Customer', 
					'master_name':self.doc.name
				})
				msgprint("Account Head: %s created" % ac)
		else :
			msgprint("Please Select Company under which you want to create account head")
Exemplo n.º 6
0
	def create_account_head(self):
		if self.doc.company :
			abbr = self.get_company_abbr() 
						
			if not sql("select name from tabAccount where name=%s", (self.doc.name + " - " + abbr)):
				parent_account = self.get_parent_account(abbr)
				
				ac = add_ac({
					'account_name': self.doc.name,
					'parent_account': parent_account,
					'group_or_ledger':'Ledger',
					'company': self.doc.company,
					'account_type': '',
					'tax_rate': '0',
					'master_type': 'Supplier',
					'master_name': self.doc.name,
				})
				msgprint(_("Created Account Head: ") + ac)
				
		else : 
			msgprint("Please select Company under which you want to create account head")