• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python utils.money_in_words函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中webnotes.utils.money_in_words函数的典型用法代码示例。如果您正苦于以下问题:Python money_in_words函数的具体用法?Python money_in_words怎么用?Python money_in_words使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了money_in_words函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: set_total_in_words

	def set_total_in_words(self):
		from webnotes.utils import money_in_words
		company_currency = get_company_currency(self.doc.company)
		if self.meta.get_field("in_words"):
			self.doc.in_words = money_in_words(self.doc.grand_total, company_currency)
		if self.meta.get_field("in_words_import"):
			self.doc.in_words_import = money_in_words(self.doc.grand_total_import,
		 		self.doc.currency)
开发者ID:PhamThoTam,项目名称:erpnext,代码行数:8,代码来源:buying_controller.py


示例2: set_total_in_words

	def set_total_in_words(self):
		from webnotes.utils import money_in_words
		company_currency = get_company_currency(self.doc.company)
		
		disable_rounded_total = cint(webnotes.conn.get_value("Global Defaults", None, 
			"disable_rounded_total"))
			
		if self.meta.get_field("in_words"):
			self.doc.in_words = money_in_words(disable_rounded_total and 
				self.doc.grand_total or self.doc.rounded_total, company_currency)
		if self.meta.get_field("in_words_export"):
			self.doc.in_words_export = money_in_words(disable_rounded_total and 
				self.doc.grand_total_export or self.doc.rounded_total_export, self.doc.currency)
开发者ID:Jdfkat,项目名称:erpnext,代码行数:13,代码来源:selling_controller.py


示例3: set_amount_in_words

	def set_amount_in_words(self):
		from webnotes.utils import money_in_words
		base_currency = webnotes.conn.get_value("Company", self.doc.currency,
			"default_currency")
		
		self.doc.fields[self.fmap.grand_total_in_words] = \
			money_in_words(self.doc.grand_total, base_currency)
		self.doc.fields[self.fmap.rounded_total_in_words] = \
			money_in_words(self.doc.rounded_total, base_currency)
		
		self.doc.fields[self.fmap.grand_total_in_words_print] = \
			money_in_words(self.doc.fields.get(self.fmap.grand_total_print),
			self.doc.currency)
		self.doc.fields[self.fmap.rounded_total_in_words_print] = \
			money_in_words(self.doc.fields.get(self.fmap.rounded_total_print),
			self.doc.currency)
开发者ID:AminfiBerlin,项目名称:erpnext,代码行数:16,代码来源:tax_controller.py


示例4: validate

	def validate(self):
		from webnotes.utils import money_in_words
		self.check_existing()
		
		if not (len(self.doclist.get({"parentfield": "earning_details"})) or 
			len(self.doclist.get({"parentfield": "deduction_details"}))):
				self.get_emp_and_leave_details()
		else:
			self.get_leave_details(self.doc.leave_without_pay)

		if not self.doc.net_pay:
			self.calculate_net_pay()
			
		company_currency = get_company_currency(self.doc.company)
		self.doc.total_in_words = money_in_words(self.doc.rounded_total, company_currency)
开发者ID:Tejal011089,项目名称:med2-app,代码行数:15,代码来源:salary_slip.py


示例5: set_print_format_fields

	def set_print_format_fields(self):
		for d in getlist(self.doclist, 'entries'):
			#msgprint(self.doc.company)
			chk_type = sql("select master_type, account_type from `tabAccount` where name='%s'" % d.account)
			master_type, acc_type = chk_type and cstr(chk_type[0][0]) or '', chk_type and cstr(chk_type[0][1]) or ''
			if master_type in ['Supplier', 'Customer']:
				if not self.doc.pay_to_recd_from:
					self.doc.pay_to_recd_from = webnotes.conn.get_value(master_type, ' - '.join(d.account.split(' - ')[:-1]), master_type == 'Customer' and 'customer_name' or 'supplier_name')
			
			if acc_type == 'Bank or Cash':
				company_currency = get_company_currency(self.doc.company)
				amt = flt(d.debit) and d.debit or d.credit	
				self.doc.total_amount = company_currency +' '+ cstr(amt)
				from webnotes.utils import money_in_words
				self.doc.total_amount_in_words = money_in_words(amt, company_currency)
开发者ID:MiteshC,项目名称:erpnext,代码行数:15,代码来源:journal_voucher.py


示例6: set_print_format_fields

	def set_print_format_fields(self):
		for d in getlist(self.doclist, 'entries'):
			account_type, master_type = webnotes.conn.get_value("Account", d.account, 
				["account_type", "master_type"])
				
			if master_type in ['Supplier', 'Customer']:
				if not self.doc.pay_to_recd_from:
					self.doc.pay_to_recd_from = webnotes.conn.get_value(master_type, 
						' - '.join(d.account.split(' - ')[:-1]), 
						master_type == 'Customer' and 'customer_name' or 'supplier_name')
			
			if account_type == 'Bank or Cash':
				company_currency = get_company_currency(self.doc.company)
				amt = flt(d.debit) and d.debit or d.credit	
				self.doc.total_amount = company_currency +' '+ cstr(amt)
				from webnotes.utils import money_in_words
				self.doc.total_amount_in_words = money_in_words(amt, company_currency)
开发者ID:cocoy,项目名称:erpnext,代码行数:17,代码来源:journal_voucher.py


示例7: validate

	def validate(self):
		from webnotes.utils import money_in_words
		self.check_existing()
		company_currency = get_company_currency(self.doc.company)
		self.doc.total_in_words = money_in_words(self.doc.rounded_total, company_currency)
开发者ID:MiteshC,项目名称:erpnext,代码行数:5,代码来源:salary_slip.py


示例8: execute

def execute():
    import webnotes
    from webnotes.utils import flt
    from webnotes.model.code import get_obj
    from webnotes.utils import money_in_words

    vouchers = webnotes.conn.sql(
        """
		select 
			parent, parenttype, modified, docstatus, 
			sum(if(category in ('Valuation and Total', 'Total') and add_deduct_tax='Add',
 				tax_amount, 0)) as tax_added, 
			sum(if(category in ('Valuation and Total', 'Total') and add_deduct_tax='Deduct', 
 				tax_amount, 0)) as tax_ded			
		from 
			`tabPurchase Taxes and Charges`
		where 
			modified >= '2012-07-12'
			and parenttype != 'Purchase Taxes and Charges Master'
			and parent not like 'old_p%'
			and docstatus != 2
		group by parenttype, parent
		order by modified
	""",
        as_dict=1,
    )

    for d in vouchers:
        current_total_tax = webnotes.conn.sql(
            """select total_tax from `tab%s` where name = %s""" % (d["parenttype"], "%s"), d["parent"]
        )
        correct_total_tax = flt(d["tax_added"]) - flt(d["tax_ded"])

        if flt(current_total_tax[0][0]) != correct_total_tax:
            if d["parenttype"] == "Purchase Invoice":
                webnotes.conn.sql(
                    """
					update `tab%s` 
					set 
						total_tax = %s, 
						other_charges_added = %s, 
						other_charges_added_import = other_charges_added / conversion_rate, 
						other_charges_deducted = %s, 
						other_charges_deducted_import = other_charges_deducted / conversion_rate, 
						grand_total = net_total + other_charges_added - other_charges_deducted,
						grand_total_import = grand_total / conversion_rate,
						total_amount_to_pay = grand_total - total_tds_on_voucher,
						outstanding_amount = total_amount_to_pay - total_advance
					where 
						name = %s
				"""
                    % (d["parenttype"], "%s", "%s", "%s", "%s"),
                    (correct_total_tax, d["tax_added"], d["tax_ded"], d["parent"]),
                )

            else:
                webnotes.conn.sql(
                    """
					update `tab%s` 
					set 
						total_tax = %s, 
						other_charges_added = %s, 
						other_charges_added_import = other_charges_added / conversion_rate, 
						other_charges_deducted = %s, 
						other_charges_deducted_import = other_charges_deducted / conversion_rate,
						grand_total = net_total + total_tax, 
						grand_total_import = grand_total / conversion_rate,
						rounded_total = round(grand_total)
					where 
						name = %s
				"""
                    % (d["parenttype"], "%s", "%s", "%s", "%s"),
                    (correct_total_tax, d["tax_added"], d["tax_ded"], d["parent"]),
                )

                # set in words
            obj = get_obj(d["parenttype"], d["parent"], with_children=1)

            base_currency = webnotes.conn.get_value("Company", obj.doc.company, "default_currency") or get_defaults(
                "default_currency"
            )

            webnotes.conn.set_value(
                d["parenttype"], d["parent"], "in_words", money_in_words(obj.doc.grand_total, base_currency)
            )
            webnotes.conn.set_value(
                d["parenttype"],
                d["parent"],
                "in_words_import",
                money_in_words(obj.doc.grand_total_import, obj.doc.currency),
            )

            # fix gl entries
            if d["parenttype"] == "Purchase Invoice" and d["docstatus"] == 1:
                webnotes.conn.sql(
                    """update `tabGL Entry` set is_cancelled = 'Yes' 
					where voucher_type = %s and voucher_no = %s""",
                    (d["parenttype"], d["parent"]),
                )

#.........这里部分代码省略.........
开发者ID:kritinline,项目名称:erpnext,代码行数:101,代码来源:fix_wrong_vouchers.py



注:本文中的webnotes.utils.money_in_words函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python utils.now函数代码示例发布时间:2022-05-26
下一篇:
Python utils.load_json函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap