我需要在vb.net中从SQL获得增值税 [英] i need to get VAT from SQL in vb.net

查看:81
本文介绍了我需要在vb.net中从SQL获得增值税的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有多种增值税,例如8%和16%,我将其添加到物品主数据下的一个名为增值税的表格,并通过其税收设置任何项目,例如KITKAT售价1和增值税8,我有牛奶卖价2,增值税16

所以发票需要在发票末尾显示增值税,所以我写下面没有结果。

PS以下只显示和计算发票上的增值税

i have multi VAT such as 8% and 16% which i add it to the item master under a table called VAT and set any item there by its tax for instance KITKAT sell price 1 and vat 8 and i have Milk sell price 2 and vat 16
so the invoice need to display the vat at the end of the invoice so i write the below with no result.
P.S the below only to display and calculate the VAT on the invoice

Dim pConn2 As SqlConnection = Code.GetConnection()
Dim sql3 As String = "select std_cost from sc_mast where tax='8'"
Dim cmd3 As New SqlCommand(sql3, pConn2)
Dim dr3 As SqlDataReader
dr3 = cmd3.ExecuteReader
dr3.Read()
Dim tax8 As Decimal
If tax8 = 8 Then
    tax8 = sql3 / (1 + (8 / 100))
End If


gp3.AddString("Tax 8%: ", Total_Font.FontFamily, Total_Font.Style.Bold, Total_Font.Size, New Rectangle(x3, y3 + 140, 100, 30), ft)
gp3.AddString((Format(tax8, "0.000")), Price_Font.FontFamily, Price_Font.Style.Bold, Price_Font.Size, New Rectangle(price_X + 10, y3 + 140, price_width, 30), ftprices)

推荐答案

您只能以8%的比率计算一个税值,但不会在任何地方打印该值。此外,您应该从数据库中为需要打印的每个项目提取税率,并在计算中使用该值,而不是对数字进行硬编码。
You calculate only one tax value at the rate of 8% but you do not print that value anywhere. Also, you should pull the tax rate from the database for each item that needs to be printed, and use that value in your calculations, rather than hardcoding the numbers.


这篇关于我需要在vb.net中从SQL获得增值税的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆