; ; if(tbNo.ReadOnly == false) { if(tbNo.CValue != StringEmpty()) { UpdateForm(false, ""); if(Search("SearchSaleInvoiceWithNo", tbNo.CValue)) { ChangeMode("View",#SaleInvoice.ID_Assessor); if(#SaleInvoice.Disable_SaleInvoice==true) ikGradualLabel1.Text=ikGradualLabel1.Text+"(已作废)"; } else { MessageBox("该销项发票不存在!",@Title); } } else { MessageBox("请输入销项发票单号!", @Title); } } ShowSearchBox("BillSearch","NODEPOT", "tbNo", tbNo.CValue); #SaleInvoice.Type_SaleInvoice=cbType.SelectedIndex; if(!Equals(#SaleInvoice.ID_Customer,GuidEmpty())) { if(Equals(#SaleInvoice.GetMethod_Customer,"先款后货")) #SaleInvoice.PayDate_SaleInvoice=dtInvoiceDate.Value; else if(Equals(#SaleInvoice.GetMethod_Customer,"票到当月结")) { Search("SearchPayDate",dtInvoiceDate.Value,#Customer.DunDate_Customer); #SaleInvoice.PayDate_SaleInvoice= #PayDate.NextEndDate; } else if(Equals(#SaleInvoice.GetMethod_Customer,"两月结")) { Search("SearchPayDate2",dtInvoiceDate.Value,#Customer.DunDate_Customer); #SaleInvoice.PayDate_SaleInvoice=#PayDate2.NextEndDate; } else if(Equals(#SaleInvoice.GetMethod_Customer,"三月结")) { Search("SearchPayDate3",dtInvoiceDate.Value,#Customer.DunDate_Customer); #SaleInvoice.PayDate_SaleInvoice=#PayDate3.NextEndDate; } else if(Equals(#SaleInvoice.GetMethod_Customer,"四月结")) { Search("SearchPayDate4",dtInvoiceDate.Value,#Customer.DunDate_Customer); #SaleInvoice.PayDate_SaleInvoice=#PayDate4.NextEndDate; } else if(Equals(#SaleInvoice.GetMethod_Customer,"票到付款")) { Search("SearchPayDate5",dtInvoiceDate.Value,#Customer.DunDate_Customer); #SaleInvoice.PayDate_SaleInvoice=#PayDate5.NextEndDate; } UpdateForm(true,"dtPayDate"); } if(Equals(btnModify.Text,"修改")) { txtInvoiceNo.ReadOnly=false; btnModify.Text="保存"; } else { if(Equals(txtInvoiceNo.CValue,"")) { MessageBox("请填入发票编号!",@Title); txtInvoiceNo.Focus(); } else { if(Search("SearchInvoiceNo",txtInvoiceNo.CValue,#SaleInvoice.No_SaleInvoice)) { MessageBox("此发票号码已存在,请重新填入发票编号!",@Title); txtInvoiceNo.Focus(); return; } else { #SaleInvoice.LastModUser=GetCurrentUser(); #SaleInvoice.LastModUser_SaleInvoice=GetLoginUserID(); #SaleInvoice.LastModDate_SaleInvoice=GetCurrentTime(); UpdateForm(false,""); #SaleInvoice.Type_SaleInvoice=cbType.SelectedIndex; Update(); txtInvoiceNo.ReadOnly=true; btnModify.Text="修改"; } } } UpdateForm(false,""); if(tbCustomerNo.CValue!=StringEmpty()) { if(!Search("SearchCustomer",tbCustomerNo.CValue)) { MessageBox("该客户不存在!",@Title); @temp = ShowSearchBox("CustomerSearch","INFOMATION",tbCustomerNo.CValue); if(@temp != "") { tbCustomerNo.CValue = @temp; ActiveControlEvent("tbCustomerNo", "Enter"); } } else { if(!Equals(#Customer.SuspendDate_Customer,DBNull())) { MessageBox("该客户已暂停!",@Title); } #SaleInvoice.ID_Customer=#Customer.ID_Customer; #SaleInvoice.ShortName_Customer=#Customer.ShortName_Customer; #SaleInvoice.RevenueRegisterNo_Customer=#Customer.RevenueRegisterNo_Customer; #SaleInvoice.Bank_SaleInvoice=#Customer.Bank_Customer; #SaleInvoice.Account_SaleInvoice=#Customer.Account_Customer; #SaleInvoice.GetMethod_Customer=#Customer.GetMethod_Customer; #SaleInvoice.InvoiceTitle_SaleInvoice=#Customer.Title_Invoice; #SaleInvoice.InvoiceAddress_SaleInvoice=#Customer.Address_Invoice; #SaleInvoice.Company_Customer=#Customer.Company_Customer; if(Equals(#SaleInvoice.GetMethod_Customer,"先款后货")) #SaleInvoice.PayDate_SaleInvoice=dtInvoiceDate.Value; else if(Equals(#SaleInvoice.GetMethod_Customer,"票到当月结")) { Search("SearchPayDate",dtInvoiceDate.Value,#Customer.DunDate_Customer); #SaleInvoice.PayDate_SaleInvoice= #PayDate.NextEndDate; } else if(Equals(#SaleInvoice.GetMethod_Customer,"两月结")) { Search("SearchPayDate2",dtInvoiceDate.Value,#Customer.DunDate_Customer); #SaleInvoice.PayDate_SaleInvoice=#PayDate2.NextEndDate; } else if(Equals(#SaleInvoice.GetMethod_Customer,"三月结")) { Search("SearchPayDate3",dtInvoiceDate.Value,#Customer.DunDate_Customer); #SaleInvoice.PayDate_SaleInvoice=#PayDate3.NextEndDate; } else if(Equals(#SaleInvoice.GetMethod_Customer,"四月结")) { Search("SearchPayDate4",dtInvoiceDate.Value,#Customer.DunDate_Customer); #SaleInvoice.PayDate_SaleInvoice=#PayDate4.NextEndDate; } else if(Equals(#SaleInvoice.GetMethod_Customer,"票到付款")) { Search("SearchPayDate5",dtInvoiceDate.Value,#Customer.DunDate_Customer); #SaleInvoice.PayDate_SaleInvoice=#PayDate5.NextEndDate; } } } else { MessageBox("请输入客户编号!",@Title); #SaleInvoice.ID_Customer=GuidEmpty(); #SaleInvoice.ShortName_Customer=""; #SaleInvoice.InvoiceTitle_SaleInvoice=""; #SaleInvoice.InvoiceAddress_SaleInvoice=""; #SaleInvoice.RevenueRegisterNo_Customer=""; #SaleInvoice.Bank_SaleInvoice=""; #SaleInvoice.Account_SaleInvoice=""; #SaleInvoice.GetMethod_Customer=""; #SaleInvoice.Company_Customer=""; tbCustomerNo.Focus(); } UpdateForm(true,""); UpdateForm(false, "cbInvoiceTitle"); Search("SearchInvoiceTitle",#SaleInvoice.ID_Customer); UpdateForm(true, "cbInvoiceTitle"); UpdateForm(false, "cbInvoiceAddress"); Search("SearchInvoiceAddress",#SaleInvoice.ID_Customer); UpdateForm(true, "cbInvoiceAddress"); UpdateForm(false, "cbBank"); Search("SearchBank"); UpdateForm(true, "cbBank"); Search("SearchBillType"); SetDataGridColumnDataSource(0,"dgProduct"); ShowSearchBox("ProductSearch","INFOMATION",#SaleInvoiceProduct.No_Product); dtEnd.Checked = dtStart.Checked; dtEnd.CValue = dtStart.CValue; MergeTable("#SaleInvoiceProduct","#Temp"); Empty("#SaleInvoiceProduct"); @DateStart = null; @DateEnd = null; @ckRtn = 0; if (dtStart.Checked) @DateStart = dtStart.CValue; else { MessageBox("请选择日期!"); return; } if (dtEnd.Checked) @DateEnd = dtEnd.CValue; if (ckRtn.Checked) { @ckRtn = 1; if(Search("SearchAllSaleAndRtnBill",#SaleInvoice.No_Customer,@DateStart,@DateEnd,@ckRtn)) { MergeTable("#SaleInvoiceProduct1","#SaleInvoiceProduct"); } } else { @ckRtn = 0; if(Search("SearchAllSale",#SaleInvoice.No_Customer,@DateStart,@DateEnd,@ckRtn)) MergeTable("#SaleInvoiceProduct2","#SaleInvoiceProduct"); } dgProduct.SetColumnReadOnly(14,true); if(Search("SearchSaleInvoiceFirst")) { ChangeMode("View",#SaleInvoice.ID_Assessor); if(#SaleInvoice.Disable_SaleInvoice==true) ikGradualLabel1.Text=ikGradualLabel1.Text+"(已作废)"; } if(Search("SearchSaleInvoicePrevious", tbNo.CValue)) { ChangeMode("View",#SaleInvoice.ID_Assessor); if(#SaleInvoice.Disable_SaleInvoice==true) ikGradualLabel1.Text=ikGradualLabel1.Text+"(已作废)"; } if(Search("SearchSaleInvoiceNext",tbNo.CValue)) { ChangeMode("View",#SaleInvoice.ID_Assessor); if(#SaleInvoice.Disable_SaleInvoice==true) ikGradualLabel1.Text=ikGradualLabel1.Text+"(已作废)"; } if(Search("SearchSaleInvoiceLast")) { ChangeMode("View",#SaleInvoice.ID_Assessor); if(#SaleInvoice.Disable_SaleInvoice==true) ikGradualLabel1.Text=ikGradualLabel1.Text+"(已作废)"; } ChangeMode("Search"); ChangeMode("Modify"); Delete(); ChangeMode("Search"); BeginBlank(); #SaleInvoice.Disable_SaleInvoice=true; Blank(); EndBlank(); ChangeMode("View",#SaleInvoice.ID_Assessor); if(#SaleInvoice.Disable_SaleInvoice==true) ikGradualLabel1.Text=ikGradualLabel1.Text+"(已作废)"; ShowPrintBox("BillSearch",#SaleInvoice.No_SaleInvoice,#SaleInvoice.No_SaleInvoice); BeginAudit(); #SaleInvoice.ID_Assessor=GetLoginUserID(); #SaleInvoice.Assessor=GetCurrentUser(); #SaleInvoice.AssessDate_SaleInvoice=DateTimeNow(); Audit(); ChangeMode("View",#SaleInvoice.ID_Assessor); EndAudit(); BeginUnAudit(); #SaleInvoice.ID_Assessor=DBNull(); #SaleInvoice.Assessor=DBNull(); #SaleInvoice.AssessDate_SaleInvoice=DataTimeNow(); UnAudit(); ChangeMode("View",#SaleInvoice.ID_Assessor); EndUnAudit(); ; ; ; if(Equals(#SaleInvoiceProduct.No_Product,"") || !Search("SearchProduct",#SaleInvoiceProduct.No_Product)) { if(!Equals(#SaleInvoiceProduct.No_Product,"")) MessageBox("该产品不存在!",@Title); #SaleInvoiceProduct.ID_Product=GuidEmpty(); #SaleInvoiceProduct.Name_Product=""; #SaleInvoiceProduct.Unit_Product=""; #SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct=0.00; #SaleInvoiceProduct.InvoiceName_Product=""; @temp = ShowSearchBox("InputSearchProduct","INFOMATION",#SaleInvoiceProduct.No_Product); if(@temp != "") { ResumeColumnEvent("#SaleInvoiceProduct.No_Product"); #SaleInvoiceProduct.No_Product = @temp; ClearColumnEvent(); } } else { #SaleInvoiceProduct.ID_Product=#Product.ID_Product; #SaleInvoiceProduct.Name_Product=#Product.Name_Product; #SaleInvoiceProduct.Unit_Product=#Product.Unit_Product; #SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct=#Product.Price_Product; #SaleInvoiceProduct.InvoiceName_Product=#Product.InvoiceName_Product; }
UpdateForm(true, "tbCustomerNo"); @InvoiceAddress=#SaleInvoice.InvoiceAddress_SaleInvoice; @InvoiceTitle=#SaleInvoice.InvoiceTitle_SaleInvoice; ActiveControlEvent("tbCustomerNo", "Enter"); #SaleInvoice.InvoiceAddress_SaleInvoice=@InvoiceAddress; #SaleInvoice.InvoiceTitle_SaleInvoice=@InvoiceTitle; UpdateForm(true, "cbInvoiceTitle"); UpdateForm(true, "cbInvoiceAddress");
Empty(); NewInstance(); tbNo.ReadOnly=false; dtDate.Enabled=false; cbType.Enabled=false; dtInvoiceDate.Enabled=false; txtInvoiceNo.ReadOnly=true; btnModify.Enabled=false; tbCustomerNo.ReadOnly=true; cbInvoiceTitle.Enabled=false; cbInvoiceAddress.Enabled=false; cbBank.Enabled=false; txtAccount.ReadOnly=true; dtPayDate.Enabled=false; dgProduct.ReadOnly=true; txtMoneySum.CValue=0.00; txtTaxSum.CValue=0.00; txtSum.CValue=0.00; dtStart.Enabled = false; dtEnd.Enabled = false; ckRtn.Enabled = false; btnSearch.Enabled=false; #SaleInvoice.Creator=DBNull(); #SaleInvoice.ID_Creator=DBNull(); #SaleInvoice.Assessor=DBNull(); #SaleInvoice.ID_Assessor=DBNull(); #SaleInvoice.AssessDate_SaleInvoice=DBNull(); #SaleInvoice.LastModUser_SaleInvoice=DBNull(); #SaleInvoice.LastModUser=DBNull(); #SaleInvoice.LastModDate_SaleInvoice=DBNull(); toolBar.EnableSubmit=false; toolBar.EnableModify=false; toolBar.EnableDelete=false; toolBar.EnableAudit=false; toolBar.EnableNew=GetRight(@Title,"新增"); toolBar.EnablePrint=false; toolBar.EnableBlank=false; toolBar.EnableImport = false; OperateControlEvent("dtInvoiceDate","ValueChanged",false); UpdateForm(true,""); OperateControlEvent("dtInvoiceDate","ValueChanged",true); tbNo.Focus(); cbType.Text=""; @Status=0; Empty(); NewInstance(); tbNo.ReadOnly=true; dtDate.Enabled=true; cbType.Enabled=true; dtInvoiceDate.Enabled=true; txtInvoiceNo.ReadOnly=false; btnModify.Enabled=false; tbCustomerNo.ReadOnly=false; cbInvoiceTitle.Enabled=true; cbInvoiceAddress.Enabled=true; cbBank.Enabled=true; txtAccount.ReadOnly=false; dtPayDate.Enabled=false; dgProduct.ReadOnly=false; txtMoneySum.CValue=0.00; txtTaxSum.CValue=0.00; txtSum.CValue=0.00; dtStart.Enabled = true; dtEnd.Enabled = true; ckRtn.Enabled = true; btnSearch.Enabled=true; dtDate.Focus(); #SaleInvoice.TypeName="增值税发票"; #SaleInvoice.Currency_SaleInvoice= @SysCurrency; #SaleInvoice.ID_SaleInvoice=NewGuid(); #SaleInvoice.Creator=GetCurrentUser(); #SaleInvoice.ID_Creator=GetLoginUserID(); #SaleInvoice.Assessor=DBNull(); #SaleInvoice.ID_Assessor=DBNull(); #SaleInvoice.AssessDate_SaleInvoice=DBNull(); #SaleInvoice.LastModUser_SaleInvoice=DBNull(); #SaleInvoice.LastModUser=DBNull(); #SaleInvoice.LastModDate_SaleInvoice=DBNull(); toolBar.EnableSubmit=GetRight(@Title,"新增"); toolBar.EnableModify=false; toolBar.EnableDelete=false; toolBar.EnableAudit=false; toolBar.EnableNew=false; toolBar.EnablePrint=false; toolBar.EnableBlank=false; toolBar.EnableImport = true; OperateControlEvent("dtInvoiceDate","ValueChanged",false); UpdateForm(true,""); OperateControlEvent("dtInvoiceDate","ValueChanged",true); @Status=1; tbNo.ReadOnly=true; dtDate.Enabled=false; cbType.Enabled=false; dtInvoiceDate.Enabled=false; txtInvoiceNo.ReadOnly=true; if(!Equals(#SaleInvoice.ID_Assessor,DBNull())&&#SaleInvoice.Disable_SaleInvoice==false) btnModify.Enabled=true; else btnModify.Enabled=false; tbCustomerNo.ReadOnly=true; cbInvoiceTitle.Enabled=false; cbInvoiceAddress.Enabled=false; cbBank.Enabled=false; txtAccount.ReadOnly=true; dtPayDate.Enabled=false; dgProduct.ReadOnly=true; dtStart.Enabled = false; dtEnd.Enabled = false; ckRtn.Enabled = false; btnSearch.Enabled=false; toolBar.EnableSubmit=false; toolBar.EnableNew=GetRight(@Title,"新增"); if(Equals(#SaleInvoice.ID_Assessor, DBNull())) { toolBar.EnableAudit=GetRight(@Title,"审核"); toolBar.EnableModify=GetRight(@Title,"修改"); toolBar.EnableDelete=GetRight(@Title,"删除"); toolBar.EnableBlank=false; } else { toolBar.EnableAudit=false; toolBar.EnableModify=false; toolBar.EnableDelete=false; if(#SaleInvoice.Disable_SaleInvoice==false) toolBar.EnableBlank=GetRight(@Title,"审核"); else toolBar.EnableBlank=false; } toolBar.EnablePrint=GetRight(@Title,"打印"); toolBar.EnableImport = false; OperateControlEvent("dtInvoiceDate","ValueChanged",false); UpdateForm(true,""); OperateControlEvent("dtInvoiceDate","ValueChanged",true); @Status=2; tbNo.ReadOnly=true; dtDate.Enabled=false; cbType.Enabled=true; dtInvoiceDate.Enabled=true; txtInvoiceNo.ReadOnly=false; btnModify.Enabled=false; tbCustomerNo.ReadOnly=false; cbInvoiceTitle.Enabled=true; cbInvoiceAddress.Enabled=true; cbBank.Enabled=true; txtAccount.ReadOnly=false; dtPayDate.Enabled=false; dgProduct.ReadOnly=false; dtStart.Enabled = true; dtEnd.Enabled = true; ckRtn.Enabled = true; btnSearch.Enabled=true; #SaleInvoice.LastModUser=GetCurrentUser(); #SaleInvoice.LastModUser_SaleInvoice=GetLoginUserID(); #SaleInvoice.LastModDate_SaleInvoice=GetCurrentTime(); toolBar.EnableSubmit=GetRight(@Title,"修改"); toolBar.EnableModify=false; toolBar.EnableDelete=false; toolBar.EnableAudit=false; toolBar.EnableNew=false; toolBar.EnablePrint=false; toolBar.EnableImport = true; OperateControlEvent("dtInvoiceDate","ValueChanged",false); UpdateForm(true,""); OperateControlEvent("dtInvoiceDate","ValueChanged",true); @Status=3; if(!Equals(#SaleInvoiceProduct.Name_BillType,"")&&!Equals(#SaleInvoiceProduct.No_FromBill,"")&& !Equals(#SaleInvoiceProduct.No_FromBillProduct,"")) { if(Equals(#SaleInvoiceProduct.Name_BillType,"销货单")&&Search("SearchSaleBillProduct",#SaleInvoiceProduct.No_FromBill,#SaleInvoiceProduct.No_FromBillProduct)) { #SaleInvoiceProduct.ID_Product=#SaleBillProduct.ID_Product; #SaleInvoiceProduct.No_Product=#SaleBillProduct.No_Product; #SaleInvoiceProduct.Name_Product=#SaleBillProduct.Name_Product; #SaleInvoiceProduct.Unit_Product=#SaleBillProduct.Unit_Product; #SaleInvoiceProduct.Quantity_SaleInvoiceProduct=#SaleBillProduct.Quantity_SaleBillProduct; #SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct=#SaleBillProduct.UnitPrice_SaleBillProduct; #SaleInvoiceProduct.InvoiceName_Product=#SaleBillProduct.InvoiceName_Product; #SaleInvoiceProduct.Amount_SaleInvoiceProduct=FormatNumber(#SaleInvoiceProduct.Quantity_SaleInvoiceProduct*#SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct,@PriceDecimal); #SaleInvoiceProduct.TaxCurrency_SaleInvoiceProduct=#SaleBillProduct.TaxCurrency_SaleBill; if(Equals(#SaleInvoiceProduct.TaxCurrency_SaleInvoiceProduct,"内含")) { #SaleInvoiceProduct.GoodsAmount_SaleInvoiceProduct = FormatNumber((#SaleInvoiceProduct.Quantity_SaleInvoiceProduct*#SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct)/(1+#SaleInvoiceProduct.TaxRate_SaleInvoiceProduct),@PriceDecimal); } else { #SaleInvoiceProduct.GoodsAmount_SaleInvoiceProduct = FormatNumber(#SaleInvoiceProduct.Quantity_SaleInvoiceProduct*#SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct,@PriceDecimal); } #SaleInvoiceProduct.No_Customer=#SaleBillProduct.No_Customer; #SaleInvoiceProduct.ShortName_Customer=#SaleBillProduct.ShortName_Customer; #SaleInvoiceProduct.TaxAmount_SaleInvoiceProduct=FormatNumber(#SaleInvoiceProduct.Amount_SaleInvoiceProduct*#SaleInvoiceProduct.TaxRate_SaleInvoiceProduct,@PriceDecimal); } if(Equals(#SaleInvoiceProduct.Name_BillType,"销售退货单")&&Search("SearchSaleRtnBillProduct",#SaleInvoiceProduct.No_FromBill,#SaleInvoiceProduct.No_FromBillProduct)) { #SaleInvoiceProduct.ID_Product=#SaleRtnBillProduct.ID_Product; #SaleInvoiceProduct.No_Product=#SaleRtnBillProduct.No_Product; #SaleInvoiceProduct.Name_Product=#SaleRtnBillProduct.Name_Product; #SaleInvoiceProduct.Unit_Product=#SaleRtnBillProduct.Unit_Product; #SaleInvoiceProduct.Quantity_SaleInvoiceProduct=#SaleRtnBillProduct.Quantity_SaleRtnBillProduct; #SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct=#SaleRtnBillProduct.UnitPrice_SaleRtnBillProduct; #SaleInvoiceProduct.InvoiceName_Product=#SaleRtnBillProduct.InvoiceName_Product; #SaleInvoiceProduct.Amount_SaleInvoiceProduct=FormatNumber(#SaleInvoiceProduct.Quantity_SaleInvoiceProduct*#SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct,@PriceDecimal); #SaleInvoiceProduct.TaxCurrency_SaleInvoiceProduct=#SaleRtnBillProduct.TaxCurrency_SaleRtnBill; if(Equals(#SaleInvoiceProduct.TaxCurrency_SaleInvoiceProduct,"内含")) { #SaleInvoiceProduct.GoodsAmount_SaleInvoiceProduct = FormatNumber((#SaleInvoiceProduct.Quantity_SaleInvoiceProduct*#SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct)/(1+#SaleInvoiceProduct.TaxRate_SaleInvoiceProduct),@PriceDecimal); } else { #SaleInvoiceProduct.GoodsAmount_SaleInvoiceProduct = FormatNumber(#SaleInvoiceProduct.Quantity_SaleInvoiceProduct*#SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct,@PriceDecimal); } #SaleInvoiceProduct.No_Customer=#SaleRtnBillProduct.No_Customer; #SaleInvoiceProduct.ShortName_Customer=#SaleRtnBillProduct.ShortName_Customer; #SaleInvoiceProduct.TaxAmount_SaleInvoiceProduct=FormatNumber(#SaleInvoiceProduct.Amount_SaleInvoiceProduct*#SaleInvoiceProduct.TaxRate_SaleInvoiceProduct,@PriceDecimal); } dgProduct.SetColumnReadOnly(14, true); } if(Equals(#SaleInvoiceProduct.Name_BillType,"销货单")&&Search("SearchSaleBillProduct",#SaleInvoiceProduct.No_FromBill,#SaleInvoiceProduct.No_FromBillProduct)) { dgProduct.SetColumnReadOnly(14,true); if(Equals(#SaleInvoiceProduct.TaxCurrency_SaleInvoiceProduct,"内含")) { #SaleInvoiceProduct.GoodsAmount_SaleInvoiceProduct = FormatNumber((#SaleInvoiceProduct.Quantity_SaleInvoiceProduct*#SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct)/(1+#SaleInvoiceProduct.TaxRate_SaleInvoiceProduct),@PriceDecimal); } else { #SaleInvoiceProduct.GoodsAmount_SaleInvoiceProduct = FormatNumber(#SaleInvoiceProduct.Quantity_SaleInvoiceProduct*#SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct,@PriceDecimal); } } if(Equals(#SaleInvoiceProduct.Name_BillType,"销售退货单")&&Search("SearchSaleRtnBillProduct",#SaleInvoiceProduct.No_FromBill,#SaleInvoiceProduct.No_FromBillProduct)) { dgProduct.SetColumnReadOnly(14,true); if(Equals(#SaleInvoiceProduct.TaxCurrency_SaleInvoiceProduct,"内含")) { #SaleInvoiceProduct.GoodsAmount_SaleInvoiceProduct = FormatNumber((#SaleInvoiceProduct.Quantity_SaleInvoiceProduct*#SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct)/(1+#SaleInvoiceProduct.TaxRate_SaleInvoiceProduct),@PriceDecimal); } else { #SaleInvoiceProduct.GoodsAmount_SaleInvoiceProduct = FormatNumber(#SaleInvoiceProduct.Quantity_SaleInvoiceProduct*#SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct,@PriceDecimal); } } if(Equals(#SaleInvoiceProduct.Name_BillType,"")&&Equals(#SaleInvoiceProduct.No_FromBill,"")&&Equals(#SaleInvoiceProduct.No_FromBillProduct,"")) { if(!Equals(#SaleInvoiceProduct.No_Product,"")&&!Equals(#SaleInvoiceProduct.Quantity_SaleInvoiceProduct,"")&&!Equals(#SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct,"")) { dgProduct.SetColumnReadOnly(14, false); if(!Equals(#SaleInvoiceProduct.TaxCurrency_SaleInvoiceProduct,"")) { if(Equals(#SaleInvoiceProduct.TaxCurrency_SaleInvoiceProduct,"内含")) { #SaleInvoiceProduct.GoodsAmount_SaleInvoiceProduct=FormatNumber((#SaleInvoiceProduct.Quantity_SaleInvoiceProduct*#SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct)/(1+#SaleInvoiceProduct.TaxRate_SaleInvoiceProduct),@PriceDecimal); } else if(Equals(#SaleInvoiceProduct.TaxCurrency_SaleInvoiceProduct,"外加")) { #SaleInvoiceProduct.GoodsAmount_SaleInvoiceProduct = FormatNumber(#SaleInvoiceProduct.Quantity_SaleInvoiceProduct*#SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct,@PriceDecimal); } else if(Equals(#SaleInvoiceProduct.TaxCurrency_SaleInvoiceProduct,"零税")) { #SaleInvoiceProduct.TaxRate_SaleInvoiceProduct = 0.00; #SaleInvoiceProduct.TaxAmount_SaleInvoiceProduct = 0.00; #SaleInvoiceProduct.GoodsAmount_SaleInvoiceProduct = FormatNumber(#SaleInvoiceProduct.Quantity_SaleInvoiceProduct*#SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct,@PriceDecimal); } else if(Equals(#SaleInvoiceProduct.TaxCurrency_SaleInvoiceProduct,"免税")) { #SaleInvoiceProduct.TaxRate_SaleInvoiceProduct = 0.00; #SaleInvoiceProduct.TaxAmount_SaleInvoiceProduct = 0.00; #SaleInvoiceProduct.GoodsAmount_SaleInvoiceProduct = FormatNumber(#SaleInvoiceProduct.Quantity_SaleInvoiceProduct*#SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct,@PriceDecimal); } else if(!Equals(#SaleInvoiceProduct.TaxCurrency_SaleInvoiceProduct,"免税")||!Equals(#SaleInvoiceProduct.TaxCurrency_SaleInvoiceProduct,"零税")||!Equals(#SaleInvoiceProduct.TaxCurrency_SaleInvoiceProduct,"内含")||!Equals(#SaleInvoiceProduct.TaxCurrency_SaleInvoiceProduct,"外加")) { MessageBox("您输入的税别不正确,请重新输入!",@Title); return; } } } } #SaleInvoiceProduct.Amount_SaleInvoiceProduct=FormatNumber(#SaleInvoiceProduct.Quantity_SaleInvoiceProduct*#SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct,@PriceDecimal); #SaleInvoiceProduct.TaxAmount_SaleInvoiceProduct=FormatNumber(#SaleInvoiceProduct.Amount_SaleInvoiceProduct*#SaleInvoiceProduct.TaxRate_SaleInvoiceProduct,@PriceDecimal);