12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021 |
- <?xml version="1.0" encoding="utf-8"?>
- <Forms>
- <Form Name="FrmPriceQueryBill">
- <Client>
- <Events>
- <Load>
- <![CDATA[
- @SetFlag=1;
- @viewMode=false;
- @Title="报价单";
- GetSchema();
- Search("SearchCessOut");
- @CessOut = #System.CessOut_SystemSetting / 100;
- Search("SearchPQDate");
- Search("SearchSystemSetting");
-
- Search("SearchProductWithNo","p");
- Search("SearchRelation","p","p");
-
- @SysCurrency=#SystemSetting.SysCurrency_SystemSetting;
- @PriceDecimal=#SystemSetting.PriceDecimal_SystemSetting;
- @AuditMode = #SystemSetting.PQAudit_FunctionSetting;
- ChangeMode("Search");
- dgProduct.NoMember="No_PriceQueryBillProduct";
- if(@AuditMode)
- {
- toolBar.VisibleAudit = false;
- toolBar.EnableAudit = false;
- }
- ]]>
- </Load>
- <Closing>
- </Closing>
- <Closed>
- </Closed>
- </Events>
- <Mode>
- <Search>
- <Lable name="Search" />
- </Search>
- <New>
- <Lable name="New" />
- </New>
- <View>
- <Lable name="View" />
- </View>
- <Modify>
- <Lable name="Modify" />
- </Modify>
- </Mode>
- <Controls>
- <IKDateTimePicker name="dtpDate" DataSource="PriceQueryBill.Date_PriceQueryBill"/>
- <IKTextButton name="tbNo" DataSource="PriceQueryBill.No_PriceQueryBill">
- <Events>
- <Enter>
- <![CDATA[
- if(tbNo.ReadOnly == false)
- {
- if(tbNo.CValue != StringEmpty())
- {
- UpdateForm(false, "");
- if(Search("SearchPriceQueryBillWithNo", tbNo.CValue))
- {
- if(!Search("SearchCustomersIsInRegionalLeader",#PriceQueryBill.No_Customer, GetCurrentUser()))
- {
- MessageBox("你与客户不在同一个区域,不能查看!");
- ChangeMode("Search");
- return;
- }
-
- if(GetRight("客户基本资料","全权查看")||Equals(GetLoginUserID(),#PriceQueryBill.CustomerCreator)&&(GetFieldRight(@Title,"最低报价","查看")||!#PriceQueryBill.Special_PriceQueryBill))
- ChangeMode("View");
- else
- {
- @EnterNo=tbNo.CValue;
- ChangeMode("Search");
- tbNo.CValue=@EnterNo;
- MessageBox("你没有查看该单据资料的权限!",@Title);
- return;
- }
- }
-
- else
- {
- MessageBox("该报价单不存在!",@Title);
- }
- }
- else
- {
- MessageBox("请输入报价单号!",@Title);
- }
- }
- ]]>
- <Lable name="CountSum" />
- </Enter>
- <Click>
- ShowSearchBox("BillSearch","NODEPOT", "tbNo",tbNo.CValue);
- </Click>
- </Events>
- </IKTextButton>
- <IKDateTimePicker name="dtpQueryDate" DataSource="PriceQueryBill.QueryDate_PriceQueryBill"/>
- <IKTextButton name="tbCustomerNo" DataSource="PriceQueryBill.No_Customer">
- <Events>
- <Enter>
- <![CDATA[
- if (tbCustomerNo.ReadOnly == false)
- {
- UpdateForm(false, "");
- if (tbCustomerNo.CValue == "" || !Search("SearchCustomerWithNo", tbCustomerNo.CValue))
- {
- if (tbCustomerNo.CValue == "")
- {
- MessageBox("请输入客户编号!", @Title);
- }
- else
- {
- MessageBox("该客户不存在!",@Title);
- @temp = ShowSearchBox("CustomerSearch","INFOMATION",tbCustomerNo.CValue);
- if(@temp != "")
- {
- tbCustomerNo.CValue = @temp;
- ActiveControlEvent("tbCustomerNo", "Enter");
- }
- }
- }
- else
- {
- if (!Search("SearchCustomersIsInRegionalLeader",tbCustomerNo.CValue, GetCurrentUser()))
- {
- MessageBox("你与客户不在同一个区域,不能填单!");
- tbCustomerNo.Text = "";
- return;
- }
- if (!Equals(#Customer.SuspendDate_Customer,DBNull()))
- {
- MessageBox("该客户已停用!",@Title);
- }
- #PriceQueryBill.ID_Customer = #Customer.ID_Customer;
- #PriceQueryBill.Discount_PriceQueryBill = #Customer.LastDiscount_Customer;
- #PriceQueryBill.Name_Customer = #Customer.Name_Customer;
- #PriceQueryBill.ShortName_Customer = #Customer.ShortName_Customer;
- #PriceQueryBill.Type_Customer = #Customer.Type_Customer;
- #PriceQueryBill.ToGet_PriceQueryBill = #Customer.ToGetBalance_Customer;
- #PriceQueryBill.PostalCode_Customer = #Customer.PostalCode_Customer;
- #PriceQueryBill.SendAddr_PriceQueryBill = #Customer.SendAddr_Customer;
- #PriceQueryBill.TaxCurrency_PriceQueryBill = #Customer.LastTax_Customer;
- #PriceQueryBill.ID_Principal = #Customer.LastPrincipal_Customer;
- #PriceQueryBill.Principal_PriceQueryBill = #Customer.Name_Employee;
- #PriceQueryBill.No_Principal = #Customer.No_Employee;
- Empty("#ReportComment");
- Search("SearchTypeComment",#PriceQueryBill.ID_Customer);
- MergeTable("#TypeComment","#ReportComment");
-
- if (RowCount("Linkman") > 0)
- {
- #PriceQueryBill.Name_Linkman = #Linkman.Name_Linkman;
- }
- else
- {
- #PriceQueryBill.Name_Linkman = DBNull();
- }
- if (RowCount("Telephone") > 0)
- {
- #PriceQueryBill.Name_Telephone = #Telephone.No_Telephone;
- }
- else
- {
- #PriceQueryBill.Name_Telephone = DBNull();
- }
- if (RowCount("Fax") > 0)
- {
- #PriceQueryBill.Fax_Telephone = #Fax.No_Fax;
- }
- else
- {
- #PriceQueryBill.Fax_Telephone = DBNull();
- }
- }
- UpdateForm(true, "");
- }
- ]]>
- <Lable name="ChangeDiscount" />
- </Enter>
- <Click>
- <![CDATA[
- if (tbCustomerNo.ReadOnly == false)
- {
- @temp = ShowSearchBox("CustomerSearch","INFOMATION",tbCustomerNo.CValue);
- if( @temp == "" )
- return;
- tbCustomerNo.CValue = @temp;
- ActiveControlEvent("tbCustomerNo", "Enter");
- }
- ]]>
- </Click>
- </Events>
- </IKTextButton>
- <IKTextBox name="txtCustomerShortName" DataSource="PriceQueryBill.ShortName_Customer"></IKTextBox>
- <IKDateTimePicker name="dtpValidDate" DataSource="PriceQueryBill.ValidDate_PriceQueryBill"/>
- <IKTextBox name="tbToGet" DataSource="PriceQueryBill.ToGet_PriceQueryBill"></IKTextBox>
- <IKNumericTextBox name="ntbDiscount" DataSource="PriceQueryBill.Discount_PriceQueryBill">
- <Events>
- <Enter>
- UpdateForm(false, "ntbDiscount");
- <Lable name="ChangeDiscount" />
- </Enter>
- </Events>
- </IKNumericTextBox>
- <IKComboBoxEx name="cbTaxCurrency" DisplaySource="PriceQueryBill.TaxCurrency_PriceQueryBill">
- <Events>
- <SelectedIndexChanged>
- if(!@viewMode)
- {
- <Lable name="CountPrice"/>
- }
- <Lable name="CountSum" />
- </SelectedIndexChanged>
- </Events>
- </IKComboBoxEx>
- <IKComboBoxEx name="cbCurrency" DisplaySource="PriceQueryBill.Currency_PriceQueryBill" DataSource="PriceQueryBill"></IKComboBoxEx>
- <IKComboBoxEx name="cbPrincipal" ValueSource="PriceQueryBill.ID_Principal" DisplaySource="PriceQueryBill.Principal_PriceQueryBill" NoSource="PriceQueryBill.No_Principal" DataSource="Principal" ValueMember="ID_Employee" DisplayMember="Principal_PriceQueryBill" NoMember="No_Principal">
- <Events>
- <Reload>
- UpdateForm(false, "cbPrincipal");
- Search("SearchAllPrincipal");
- UpdateForm(true, "cbPrincipal");
- </Reload>
- </Events>
- </IKComboBoxEx>
- <IKTextBox name="txtMaker" DataSource="PriceQueryBill.Name_Creator"></IKTextBox>
- <IKTextBox name="txtAudi" DataSource="PriceQueryBill.Name_Assessor"></IKTextBox>
- <IKDateTimeText name="dtAssessDate" DataSource="PriceQueryBill.AssessDate_PriceQueryBill"></IKDateTimeText>
- <IKTextBox name="txtLastModUser" DataSource="PriceQueryBill.LastModUserName"></IKTextBox>
- <IKDateTimeText name="dtLastModDate" DataSource="PriceQueryBill.LastModDate_PriceQueryBill"></IKDateTimeText>
- <IKTextBox name="txtCustomerName" DataSource="PriceQueryBill.Name_Customer"></IKTextBox>
- <IKTextBox name="txtCustomerType" DataSource="PriceQueryBill.Type_Customer"></IKTextBox>
- <IKComboBoxEx name="cbLinkman" DisplaySource="PriceQueryBill.Name_Linkman" DataSource="Linkman" DisplayMember="Name_Linkman">
- <Events>
- <Reload>
- UpdateForm(false, "cbLinkman");
- Search("SearchLinkman", tbCustomerNo.CValue);
- UpdateForm(true, "cbLinkman");
- </Reload>
- </Events>
- </IKComboBoxEx>
- <IKTextBox name="cbTele" DisplaySource="PriceQueryBill.Name_Telephone" DataSource="Telephone" DisplayMember="No_Telephone">
- <Events>
- <Reload>
- UpdateForm(false, "cbTele");
- Search("SearchTele", tbCustomerNo.CValue);
- UpdateForm(true, "cbTele");
- </Reload>
- </Events>
- </IKTextBox>
- <IKTextBox name="cbFax" DisplaySource="PriceQueryBill.Fax_Telephone" DataSource="Fax" DisplayMember="No_Fax">
- <Events>
- <Reload>
- UpdateForm(false, "cbFax");
- Search("SearchFax", tbCustomerNo.CValue);
- UpdateForm(true, "cbFax");
- </Reload>
- </Events>
- </IKTextBox>
- <IKTextBox name="txtSendAddr" DataSource="PriceQueryBill.SendAddr_PriceQueryBill"></IKTextBox>
- <IKNumericTextBox name="ntbNumSum" DataSource="PriceQueryBill.NumSum"></IKNumericTextBox>
- <IKNumericTextBox name="ntbTaxSum" DataSource="PriceQueryBill.TaxAmount_PriceQueryBill"></IKNumericTextBox>
- <IKNumericTextBox name="ntbMoneySum" DataSource="PriceQueryBill.GoodsAmount_PriceQueryBill"></IKNumericTextBox>
- <IKNumericTextBox name="ntbSum" DataSource="PriceQueryBill.Amount_PriceQueryBill"></IKNumericTextBox>
- <IKCheckBox name="ckSpecial" DataSource="PriceQueryBill.Special_PriceQueryBill"/>
- <IKDataGridEx name="dgProduct" DataSource="PriceQueryBillProduct" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="PriceQueryBillProduct.No_PriceQueryBillProduct" />
- <DataColumn Index="1" DataSource="PriceQueryBillProduct.No_Product" >
- <IKDataGridTextButtonColumn>
- <Events>
- <Click>
- @SetFlag=1;
- ShowSearchBox("ProductSearch","INFOMATION",#PriceQueryBillProduct.No_Product);
- </Click>
- <SetFlagBeforeClick>
- @SetFlag=0;
- </SetFlagBeforeClick>
- </Events>
- </IKDataGridTextButtonColumn>
- </DataColumn>
- <DataColumn Index="2" DataSource="PriceQueryBillProduct.Name_Product" />
- <DataColumn Index="3" DataSource="PriceQueryBillProduct.Quantity_PriceQueryBillProduct" />
- <DataColumn Index="4" DataSource="PriceQueryBillProduct.Unit_Product" />
- <DataColumn Index="5" DataSource="PriceQueryBillProduct.OrderPrice_PriceQueryBillProduct" />
- <DataColumn Index="6" DataSource="PriceQueryBillProduct.Discount_PriceQueryBillProduct" />
- <DataColumn Index="7" DataSource="PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct" />
- <DataColumn Index="8" DataSource="PriceQueryBillProduct.Amount_PriceQueryBillProduct" />
- <DataColumn Index="9" DataSource="PriceQueryBillProduct.Comment_PriceQueryBillProduct" />
- <DataColumn Index="10" DataSource="PriceQueryBillProduct.AvailableQty_ProductStocks" />
- </IKDataGridEx>
- <IKDataGridEx name="dgRemark" DataSource="BillComment" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="BillComment.Comment_BillComment" />
- </IKDataGridEx>
- <IKDataGridEx name="dgReport" DataSource="ReportComment" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="ReportComment.Comment_ReportComment" />
- </IKDataGridEx>
- <IKFormToolBar name="toolBar">
- <Events>
- <ClickFirst>
- if(Search("SearchPriceQueryBillFirst",GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),GetFieldRight(@Title,"最低报价","查看"),GetCurrentUser()))
- {
- ChangeMode("View");
- <Lable name="CountSum" />
- }
- </ClickFirst>
- <ClickPrev>
- if (Search("SearchPriceQueryBillPrevious", tbNo.CValue,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),GetFieldRight(@Title,"最低报价","查看"),GetCurrentUser()))
- {
- ChangeMode("View");
- <Lable name="CountSum" />
- }
- </ClickPrev>
- <ClickNext>
- if (Search("SearchPriceQueryBillNext", tbNo.CValue,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),GetFieldRight(@Title,"最低报价","查看"),GetCurrentUser()))
- {
- ChangeMode("View");
- <Lable name="CountSum" />
- }
- </ClickNext>
- <ClickLast>
- if (Search("SearchPriceQueryBillLast",GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),GetFieldRight(@Title,"最低报价","查看"),GetCurrentUser()))
- {
- ChangeMode("View");
- <Lable name="CountSum" />
- }
- </ClickLast>
- <ClickEmpty>
- ChangeMode("Search");
- </ClickEmpty>
- <ClickNew>
- <![CDATA[
- @NextNo = GetNextAutoNumber(true);
- if (!Equals(@NextNo, ""))
- {
- ChangeMode("New");
- #PriceQueryBill.No_PriceQueryBill = @NextNo;
- UpdateForm(true, "tbNo");
- }
- ]]>
- </ClickNew>
- <ClickSubmit>
- <Lable name="SubmitButtonClick" />
- if(@AuditMode)
- {
- <Lable name = "AuditLable"/>
- }
- </ClickSubmit>
- <ClickModify>
- Search("SearchPrincipal", tbCustomerNo.CValue);
- ChangeMode("Modify");
- <Lable name="CountSum" />
- <Lable name="AvailableQty_ProductStocks"/>
- </ClickModify>
- <ClickDelete>
- Delete();
- ChangeMode("Search");
- </ClickDelete>
- <ClickPrint>
- ShowPrintBox("BillSearch",#PriceQueryBill.No_PriceQueryBill,#PriceQueryBill.No_PriceQueryBill);
- </ClickPrint>
- <ClickAudit>
- if(@AuditMode)
- return;
- <Lable name = "AuditLable"/>
- </ClickAudit>
- <ClickUnAudit>
- BeginUnAudit();
- #PriceQueryBill.ID_Assessor = DBNull();
- #PriceQueryBill.Name_Assessor = "";
- UnAudit();
- ChangeMode("View");
- EndUnAudit();
- <Lable name="CountSum" />
- </ClickUnAudit>
- <ClickImport>
- ;
- </ClickImport>
- <ClickExport>
- ;
- </ClickExport>
- <ClickClose>
- ;
- </ClickClose>
- <ClickExpand>
- if(toolBar.ExpandForm==true)
- {
- pnRight.Visible=true;<!--PanelRight is not existed-->
- }
- else
- {
- pnRight.Visible=false;
- }
- </ClickExpand>
- <ClickImportItem>
- <![CDATA[
- if((@Status == 1 || @Status == 3) && toolBar.MenuItemText=="本单据")
- {
- ShowSearchBox("BillSearch","INFOMATIONCOPYNODEPOT","SearchPriceQueryBillWithNo1",false,"#PriceQueryBill.ID_PriceQueryBill","#PriceQueryBill.Date_PriceQueryBill","#PriceQueryBill.No_PriceQueryBill","#PriceQueryBill.Name_Assessor","#PriceQueryBill.ID_Assessor","#PriceQueryBill.LastModUserName","PriceQueryBill.LastModUser_PriceQueryBill","#PriceQueryBill.Name_Creator","#PriceQueryBill.ID_Creator","#PriceQueryBillProduct.ID_PriceQueryBillProduct","#BillComment.ID_BillComment","#ReportComment.ID_ReportComment",RowCount("#PriceQueryBillProduct"));
- }
- ]]>
- <!--使用前先访问ToolBar的MenuItemText属性以确定选中的是那一项-->
- <Lable name="CountSum" />
- </ClickImportItem>
- <ClickExportItem>
- if(toolBar.MenuItemText=="销货单")
- {
- ExportBillProductStart("#SaleBillProduct.Type_FromBill",23,"#SaleBillProduct.Name_BillType","报价单","#SaleBillProduct.No_FromBill",#PriceQueryBill.No_PriceQueryBill,"#SaleBill.No_Customer",#PriceQueryBill.No_Customer,"#SaleBill.TaxCurrency_SaleBill",#PriceQueryBill.TaxCurrency_PriceQueryBill);
- ExportBillProduct("dgProduct","#PriceQueryBillProduct","#SaleBillProduct.No_FromBillProduct","#PriceQueryBillProduct.No_PriceQueryBillProduct");
- }
- else if(toolBar.MenuItemText=="采购订单")
- {
- ExportBillProductStart("#PurchaseOrderBill.No_Supplier",#PriceQueryBill.No_Customer,"#PurchaseOrderBillProduct.Comment_PurchaseOrderBillProduct",#PriceQueryBill.No_PriceQueryBill,"#PurchaseOrderBill.TaxCurrency_PurchaseOrderBill",#PriceQueryBill.TaxCurrency_PriceQueryBill);
- ExportBillProduct("dgProduct","#PriceQueryBillProduct","#PurchaseOrderBillProduct.No_Product","#PriceQueryBillProduct.No_Product");
- }
- else if(toolBar.MenuItemText=="询价单")
- {
- ExportBillProductStart("#PurchaseQueryBill.No_Supplier",#PriceQueryBill.No_Customer,"#PurchaseQueryBillProduct.Comment_PurchaseQueryBillProduct",#PriceQueryBill.No_PriceQueryBill,"#PurchaseQueryBill.TaxCurrency_PurchaseQueryBill",#PriceQueryBill.TaxCurrency_PriceQueryBill);
- ExportBillProduct("dgProduct","#PriceQueryBillProduct","#PurchaseQueryBillProduct.No_Product","#PriceQueryBillProduct.No_Product");
- }
- <!--初始化目标数据-->
- <!--使用前先访问ToolBar的MenuItemText属性以确定选中的是那一项-->
- </ClickExportItem>
- </Events>
- </IKFormToolBar>
- </Controls>
- <Tables>
- <Table name="PriceQueryBillProduct">
- <Events>
- <ColumnsChanged>
- <No_Product>
- <![CDATA[
- if(@SetFlag==0)
- {
- return;
- }
- if (!Equals(#PriceQueryBillProduct.No_Product,"") && !Equals(#PriceQueryBillProduct.No_Product,DBNull()))
- {
- if (Search("SearchProductWithNo",#PriceQueryBillProduct.No_Product))
- {
- if(!Equals(#Product.SuspendDate_Product,DBNull()))
- {
- MessageBox("该产品已停用!",@Title);
- }
- #PriceQueryBillProduct.ID_Product = #Product.ID_Product;
- #PriceQueryBillProduct.Name_Product = #Product.Name_Product;
- #PriceQueryBillProduct.Unit_Product = #Product.Unit_Product;
- #PriceQueryBillProduct.AvailableQty_ProductStocks = #Product.AvailableQty_ProductStocks;
- if(cbTaxCurrency.Text=="内含")
- #PriceQueryBillProduct.OrderPrice_PriceQueryBillProduct=FormatNumber(#Product.Price_Product*(1+@CessOut),@PriceDecimal);
- else
- #PriceQueryBillProduct.OrderPrice_PriceQueryBillProduct=#Product.Price_Product;
- if(#PriceQueryBillProduct.Discount_PriceQueryBillProduct!=0)
- {
- #PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct = FormatNumber(#PriceQueryBillProduct.OrderPrice_PriceQueryBillProduct*#PriceQueryBillProduct.Discount_PriceQueryBillProduct/100,@PriceDecimal);
- }
- else
- {
- if(Search("SearchRelation",#PriceQueryBillProduct.No_Product,tbCustomerNo.CValue))
- {
- if(cbTaxCurrency.Text=="内含")
- #PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct=#PriceReference.UnitPriceWithTax_PriceReference;
- else
- #PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct = #PriceReference.UnitPrice_PriceReference;
- if(#PriceQueryBillProduct.OrderPrice_PriceQueryBillProduct==0)
- #PriceQueryBillProduct.Discount_PriceQueryBillProduct=100;
- else
- #PriceQueryBillProduct.Discount_PriceQueryBillProduct =FormatNumber(#PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct/#PriceQueryBillProduct.OrderPrice_PriceQueryBillProduct*100,@PriceDecimal);
- }
- else
- {
- #PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct = #PriceQueryBillProduct.OrderPrice_PriceQueryBillProduct;
- #PriceQueryBillProduct.Discount_PriceQueryBillProduct=100;
- }
- }
- #PriceQueryBillProduct.Amount_PriceQueryBillProduct =FormatNumber(#PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct * #PriceQueryBillProduct.Quantity_PriceQueryBillProduct,#SystemSetting.PriceDecimal_SystemSetting);
- }
- else
- {
- MessageBox("该产品不存在!",@Title);
- #PriceQueryBillProduct.ID_Product = GuidEmpty();
- #PriceQueryBillProduct.Name_Product = "";
- #PriceQueryBillProduct.Unit_Product = "";
- #PriceQueryBillProduct.Quantity_PriceQueryBillProduct = 0;
- #PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct = 0;
- #PriceQueryBillProduct.Amount_PriceQueryBillProduct = 0;
- @temp = ShowSearchBox("InputSearchProduct","INFOMATION",#PriceQueryBillProduct.No_Product);
- if(@temp != "")
- {
- ResumeColumnEvent("#PriceQueryBillProduct.No_Product");
- #PriceQueryBillProduct.No_Product = @temp;
- ClearColumnEvent();
- }
- }
- }
- else
- {
- #PriceQueryBillProduct.ID_Product = GuidEmpty();
- #PriceQueryBillProduct.Name_Product = "";
- #PriceQueryBillProduct.Unit_Product = "";
- #PriceQueryBillProduct.Quantity_PriceQueryBillProduct = 0;
- #PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct = 0;
- #PriceQueryBillProduct.Amount_PriceQueryBillProduct = 0;
- }
- ]]>
- <Lable name="CountSum" />
- </No_Product>
- <Quantity_PriceQueryBillProduct>
- #PriceQueryBillProduct.Quantity_PriceQueryBillProduct =FormatNumber(#PriceQueryBillProduct.Quantity_PriceQueryBillProduct, @PriceDecimal);
- #PriceQueryBillProduct.Amount_PriceQueryBillProduct =FormatNumber(#PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct * #PriceQueryBillProduct.Quantity_PriceQueryBillProduct, #SystemSetting.PriceDecimal_SystemSetting);
- <Lable name="CountSum" />
- </Quantity_PriceQueryBillProduct>
- <UnitPrice_PriceQueryBillProduct>
- #PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct =FormatNumber(#PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct, @PriceDecimal);
- if(#PriceQueryBillProduct.OrderPrice_PriceQueryBillProduct==0)
- #PriceQueryBillProduct.Discount_PriceQueryBillProduct=100;
- else
- #PriceQueryBillProduct.Discount_PriceQueryBillProduct =FormatNumber(#PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct/#PriceQueryBillProduct.OrderPrice_PriceQueryBillProduct*100,@PriceDecimal);
- #PriceQueryBillProduct.Amount_PriceQueryBillProduct = FormatNumber(#PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct * #PriceQueryBillProduct.Quantity_PriceQueryBillProduct, #SystemSetting.PriceDecimal_SystemSetting);
- <Lable name="CountSum" />
- </UnitPrice_PriceQueryBillProduct>
- <Discount_PriceQueryBillProduct>
- if(#PriceQueryBillProduct.Discount_PriceQueryBillProduct==0)
- {
- if(Search("SearchRelation",#PriceQueryBillProduct.No_Product,tbCustomerNo.CValue))
- {
- if(cbTaxCurrency.Text=="内含")
- #PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct=#PriceReference.UnitPriceWithTax_PriceReference;
- else
- #PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct = #PriceReference.UnitPrice_PriceReference;
- if(#PriceQueryBillProduct.OrderPrice_PriceQueryBillProduct==0)
- #PriceQueryBillProduct.Discount_PriceQueryBillProduct=100;
- else
- #PriceQueryBillProduct.Discount_PriceQueryBillProduct =FormatNumber(#PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct/#PriceQueryBillProduct.OrderPrice_PriceQueryBillProduct*100,@PriceDecimal);
- }
- else
- {
- #PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct = #PriceQueryBillProduct.OrderPrice_PriceQueryBillProduct;
- #PriceQueryBillProduct.Discount_PriceQueryBillProduct=100;
- }
- }
- else
- {
- #PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct = FormatNumber(#PriceQueryBillProduct.OrderPrice_PriceQueryBillProduct*#PriceQueryBillProduct.Discount_PriceQueryBillProduct/100,@PriceDecimal);
- }
- #PriceQueryBillProduct.Amount_PriceQueryBillProduct = FormatNumber(#PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct * #PriceQueryBillProduct.Quantity_PriceQueryBillProduct,#SystemSetting.PriceDecimal_SystemSetting);
- <Lable name="CountSum" />
- </Discount_PriceQueryBillProduct>
- </ColumnsChanged>
- <RowDeleted>
- <Lable name="CountSum" />
- </RowDeleted>
- </Events>
- </Table>
- </Tables>
- <LockInfomation LockID="ID_PriceQueryBill" LockNO="No_PriceQueryBill" LockSearchFunction="SearchPriceQueryBillWithNo" LockAudit="ID_Assessor"/>
- <LogInfomation LogNO="#PriceQueryBill.No_PriceQueryBill" RecordFormField="" RecordDataGridField=""/>
- <ChildForms>
- <ChildForm name="BillSearch" DataSource="PriceQueryBill" SearchFunction="SearchAllBill" SearchFunctionCondition="SearchBillCondition" SearchFunctionByNo="SearchPriceQueryBillWithNo">
- <DataColumn Index="0" MappingName="#PriceQueryBill.No_PriceQueryBill" HeaderText="报价单号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="1" MappingName="#PriceQueryBill.Date_PriceQueryBill" HeaderText="制单日期" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="2" MappingName="#PriceQueryBill.No_Customer" HeaderText="客户编号" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="3" MappingName="#PriceQueryBill.Type_Customer" HeaderText="客户类型" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="4" MappingName="#PriceQueryBill.ShortName_Customer" HeaderText="客户简称" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="5" MappingName="#PriceQueryBill.Principal_PriceQueryBill" HeaderText="业务负责" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="6" MappingName="#PriceQueryBill.QueryDate_PriceQueryBill" HeaderText="询价日期" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="7" MappingName="#PriceQueryBill.ValidDate_PriceQueryBill" HeaderText="有效期至" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="8" MappingName="#PriceQueryBill.Name_Linkman" HeaderText="联系人" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="9" MappingName="#PriceQueryBill.Name_Telephone" HeaderText="电话" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="10" MappingName="#PriceQueryBill.Fax_Telephone" HeaderText="传真" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
- </ChildForm>
- <ChildForm name="CustomerSearch" DataSource="Customer" SearchFunction="SearchAllCustomer" SearchFunctionCondition="SearchCustomerCondition" SearchFunctionByNo="" MappingName="客户">
- <DataColumn Index="0" MappingName="#Customer.No_Customer" HeaderText="客户编号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="1" MappingName="#Customer.ShortName_Customer" HeaderText="客户简称" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="2" MappingName="#Customer.Type_Customer" HeaderText="客户类型" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="3" MappingName="#Customer.Level_Customer" HeaderText="客户等级" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="4" MappingName="#Customer.No_RegionalLeader" HeaderText="所属区域" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="5" MappingName="#Customer.IsGeneric_Customer" HeaderText="一般客户" Width="75" ColumnType="IKDataGridBoolColumn"/>
- <DataColumn Index="6" MappingName="#Customer.Zone_Customer" HeaderText="地区" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="7" MappingName="#Customer.SendAddr_Customer" HeaderText="送货地址" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="8" MappingName="#Customer.Name_Linkman" HeaderText="主要联系人" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="9" MappingName="#Customer.No_Telephone" HeaderText="客户电话" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="10" MappingName="#Customer.No_Fax" HeaderText="传真" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- </ChildForm>
- <ChildForm name="ProductSearch" DataSource="Product" SearchFunction="SearchAllProduct" SearchFunctionByNo="" MappingName="产品" ReturnDataSource="PriceQueryBillProduct" ShowCheckBox="true">
- <DataColumn Index="0" MappingName="#Product.No_Product" HeaderText="产品编号" Width="120" ColumnType="IKDataGridTextBoxColumn" ReturnMappingName="#PriceQueryBillProduct.No_Product"/>
- <DataColumn Index="1" MappingName="#Product.Name_Product" HeaderText="产品简称" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="2" MappingName="#Product.Type_Product" HeaderText="产品类型" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="3" MappingName="#Product.Price_Product" HeaderText="标准售价" Width="120" ColumnType="IKDataGridTextBoxColumn" Format="F2"/>
- <DataColumn Index="4" MappingName="#Product.LowSalePrice_Product" HeaderText="最低售价" Width="120" ColumnType="IKDataGridTextBoxColumn" Format="F2"/>
- <DataColumn Index="5" MappingName="#Product.SafetyQty_Product" HeaderText="安全存量" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
- </ChildForm>
- <ChildForm name="InputSearchProduct" DataSource="Product" SearchFunction="SearchAllProduct" SearchFunctionByNo="" MappingName="产品">
- <DataColumn Index="0" MappingName="#Product.No_Product" HeaderText="产品编号" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="1" MappingName="#Product.Name_Product" HeaderText="产品简称" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="2" MappingName="#Product.Type_Product" HeaderText="产品类型" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="3" MappingName="#Product.Price_Product" HeaderText="标准售价" Width="120" ColumnType="IKDataGridTextBoxColumn" Format="F2"/>
- <DataColumn Index="4" MappingName="#Product.LowSalePrice_Product" HeaderText="最低售价" Width="120" ColumnType="IKDataGridTextBoxColumn" Format="F2"/>
- <DataColumn Index="5" MappingName="#Product.SafetyQty_Product" HeaderText="安全存量" Width="120" ColumnType="IKDataGridTextBoxColumn"/>
- </ChildForm>
- </ChildForms>
- <FormatString>
- <Format name="SearchCustomerCondition">
- if(GetRight("客户基本资料","全权查看"))
- {
- FormatString("");
- }
- else
- {
- FormatString(" Customer.ID_Creator='{0}' ",GetLoginUserID());
- }
- </Format>
- <Format name="SearchBillCondition">
- if(GetRight("客户基本资料","全权查看"))
- {
- FormatString("");
- }
- else
- {
- FormatString(" Customer.ID_Creator='{0}' ",GetLoginUserID());
- }
- </Format>
- </FormatString>
- </Client>
- <Server>
- <Tables>
- <Table name="PriceQueryBill" Type="Parent">
- <GetSchema CmdType="Text" CmdText="SELECT TOP 0 PriceQueryBill.*,Customer.No_Customer, Customer.Name_Customer, Customer.ShortName_Customer,
- Customer.Type_Customer, Customer.LastDiscount_Customer, Customer.PostalCode_Customer,
- a.Name_User AS Name_Creator, b.Name_User AS Name_Assessor, c.Name_User AS LastModUserName,Employee.No_Employee AS No_Principal,Employee.Name_Employee as Principal_PriceQueryBill,
- CONVERT(decimal(18,6), 0) AS NumSum
- FROM PriceQueryBill
- LEFT JOIN Customer ON Customer.ID_Customer = PriceQueryBill.ID_Customer
- LEFT JOIN AppUser a ON a.ID_User = PriceQueryBill.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = PriceQueryBill.ID_Assessor
- LEFT JOIN AppUser c ON c.ID_User = PriceQueryBill.LastModUser_PriceQueryBill
- LEFT JOIN Employee ON Employee.ID_Employee = PriceQueryBill.ID_Principal" />
- <New CmdType="Text" CmdText="INSERT INTO PriceQueryBill(ID_PriceQueryBill,
- No_PriceQueryBill,
- Date_PriceQueryBill,
- QueryDate_PriceQueryBill,
- ID_Customer,
- ValidDate_PriceQueryBill,
- ToGet_PriceQueryBill,
- TaxCurrency_PriceQueryBill,
- Currency_PriceQueryBill,
- ID_Principal,
- Name_Linkman,
- Name_Telephone,
- Fax_Telephone,
- SendAddr_PriceQueryBill,
- ID_Creator,
- CreateDate_PriceQueryBill,
- Discount_PriceQueryBill,
- Amount_PriceQueryBill,
- GoodsAmount_PriceQueryBill,
- TaxAmount_PriceQueryBill,
- Special_PriceQueryBill
- )
- VALUES( @ID_PriceQueryBill,
- @No_PriceQueryBill,
- @Date_PriceQueryBill,
- @QueryDate_PriceQueryBill,
- @ID_Customer,
- @ValidDate_PriceQueryBill,
- @ToGet_PriceQueryBill,
- @TaxCurrency_PriceQueryBill,
- @Currency_PriceQueryBill,
- @ID_Principal,
- @Name_Linkman,
- @Name_Telephone,
- @Fax_Telephone,
- @SendAddr_PriceQueryBill,
- @ID_Creator,
- @CreateDate_PriceQueryBill,
- @Discount_PriceQueryBill,
- @Amount_PriceQueryBill,
- @GoodsAmount_PriceQueryBill,
- @TaxAmount_PriceQueryBill,
- @Special_PriceQueryBill
- )
- UPDATE Customer SET Customer.LastPrincipal_Customer=@ID_Principal, Customer.LastDiscount_Customer = @Discount_PriceQueryBill, Customer.LastTax_Customer = @TaxCurrency_PriceQueryBill WHERE Customer.ID_Customer = @ID_Customer">
- <Params>
- <Param name="@ID_PriceQueryBill" type="PriceQueryBill.ID_PriceQueryBill" sourceColumn="ID_PriceQueryBill" />
- <Param name="@No_PriceQueryBill" type="PriceQueryBill.No_PriceQueryBill" sourceColumn="No_PriceQueryBill" />
- <Param name="@Date_PriceQueryBill" type="PriceQueryBill.Date_PriceQueryBill" sourceColumn="Date_PriceQueryBill" />
- <Param name="@QueryDate_PriceQueryBill" type="PriceQueryBill.QueryDate_PriceQueryBill" sourceColumn="QueryDate_PriceQueryBill" />
- <Param name="@ID_Customer" type="PriceQueryBill.ID_Customer" sourceColumn="ID_Customer" />
- <Param name="@ValidDate_PriceQueryBill" type="PriceQueryBill.ValidDate_PriceQueryBill" sourceColumn="ValidDate_PriceQueryBill" />
- <Param name="@ToGet_PriceQueryBill" type="PriceQueryBill.ToGet_PriceQueryBill" sourceColumn="ToGet_PriceQueryBill" />
- <Param name="@Name_Linkman" type="PriceQueryBill.Name_Linkman" sourceColumn="Name_Linkman" />
- <Param name="@Name_Telephone" type="PriceQueryBill.Name_Telephone" sourceColumn="Name_Telephone" />
- <Param name="@Fax_Telephone" type="PriceQueryBill.Fax_Telephone" sourceColumn="Fax_Telephone" />
- <Param name="@SendAddr_PriceQueryBill" type="PriceQueryBill.SendAddr_PriceQueryBill" sourceColumn="SendAddr_PriceQueryBill" />
- <Param name="@TaxCurrency_PriceQueryBill" type="PriceQueryBill.TaxCurrency_PriceQueryBill" sourceColumn="TaxCurrency_PriceQueryBill" />
- <Param name="@Currency_PriceQueryBill" type="PriceQueryBill.Currency_PriceQueryBill" sourceColumn="Currency_PriceQueryBill" />
- <Param name="@ID_Principal" type="PriceQueryBill.ID_Principal" sourceColumn="ID_Principal" />
- <Param name="@ID_Creator" type="PriceQueryBill.ID_Creator" sourceColumn="ID_Creator" />
- <Param name="@CreateDate_PriceQueryBill" type="PriceQueryBill.CreateDate_PriceQueryBill" sourceColumn="CreateDate_PriceQueryBill" />
- <Param name="@Discount_PriceQueryBill" type="PriceQueryBill.Discount_PriceQueryBill" sourceColumn="Discount_PriceQueryBill" />
- <Param name="@Amount_PriceQueryBill" type="PriceQueryBill.Amount_PriceQueryBill" sourceColumn="Amount_PriceQueryBill" />
- <Param name="@GoodsAmount_PriceQueryBill" type="PriceQueryBill.GoodsAmount_PriceQueryBill" sourceColumn="GoodsAmount_PriceQueryBill" />
- <Param name="@TaxAmount_PriceQueryBill" type="PriceQueryBill.TaxAmount_PriceQueryBill" sourceColumn="TaxAmount_PriceQueryBill" />
- <Param name="@Special_PriceQueryBill" type="PriceQueryBill.Special_PriceQueryBill" sourceColumn="Special_PriceQueryBill" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText="UPDATE PriceQueryBill
- SET No_PriceQueryBill=@No_PriceQueryBill,
- Date_PriceQueryBill=@Date_PriceQueryBill,
- QueryDate_PriceQueryBill=@QueryDate_PriceQueryBill,
- ID_Customer=@ID_Customer,
- ValidDate_PriceQueryBill=@ValidDate_PriceQueryBill,
- ToGet_PriceQueryBill=@ToGet_PriceQueryBill,
- TaxCurrency_PriceQueryBill=@TaxCurrency_PriceQueryBill,
- Currency_PriceQueryBill=@Currency_PriceQueryBill,
- ID_Principal=@ID_Principal,
- Name_Linkman=@Name_Linkman,
- Name_Telephone=@Name_Telephone,
- Fax_Telephone=@Fax_Telephone,
- SendAddr_PriceQueryBill=@SendAddr_PriceQueryBill,
- ID_Creator=@ID_Creator,
- ID_Assessor=@ID_Assessor,
- AssessDate_PriceQueryBill=@AssessDate_PriceQueryBill,
- CreateDate_PriceQueryBill=@CreateDate_PriceQueryBill,
- LastModUser_PriceQueryBill=@LastModUser_PriceQueryBill,
- LastModDate_PriceQueryBill=@LastModDate_PriceQueryBill,
- Discount_PriceQueryBill=@Discount_PriceQueryBill,
- Amount_PriceQueryBill=@Amount_PriceQueryBill,
- GoodsAmount_PriceQueryBill=@GoodsAmount_PriceQueryBill,
- TaxAmount_PriceQueryBill=@TaxAmount_PriceQueryBill,
- Special_PriceQueryBill=@Special_PriceQueryBill
- WHERE ID_PriceQueryBill=@ID_PriceQueryBill
- UPDATE Customer SET Customer.LastPrincipal_Customer=@ID_Principal, Customer.LastDiscount_Customer = @Discount_PriceQueryBill, Customer.LastTax_Customer = @TaxCurrency_PriceQueryBill WHERE Customer.ID_Customer = @ID_Customer">
- <Params>
- <Param name="@ID_PriceQueryBill" type="PriceQueryBill.ID_PriceQueryBill" sourceColumn="ID_PriceQueryBill" />
- <Param name="@No_PriceQueryBill" type="PriceQueryBill.No_PriceQueryBill" sourceColumn="No_PriceQueryBill" />
- <Param name="@Date_PriceQueryBill" type="PriceQueryBill.Date_PriceQueryBill" sourceColumn="Date_PriceQueryBill" />
- <Param name="@QueryDate_PriceQueryBill" type="PriceQueryBill.QueryDate_PriceQueryBill" sourceColumn="QueryDate_PriceQueryBill" />
- <Param name="@ID_Customer" type="PriceQueryBill.ID_Customer" sourceColumn="ID_Customer" />
- <Param name="@ValidDate_PriceQueryBill" type="PriceQueryBill.ValidDate_PriceQueryBill" sourceColumn="ValidDate_PriceQueryBill" />
- <Param name="@ToGet_PriceQueryBill" type="PriceQueryBill.ToGet_PriceQueryBill" sourceColumn="ToGet_PriceQueryBill" />
- <Param name="@Name_Linkman" type="PriceQueryBill.Name_Linkman" sourceColumn="Name_Linkman" />
- <Param name="@Name_Telephone" type="PriceQueryBill.Name_Telephone" sourceColumn="Name_Telephone" />
- <Param name="@Fax_Telephone" type="PriceQueryBill.Fax_Telephone" sourceColumn="Fax_Telephone" />
- <Param name="@SendAddr_PriceQueryBill" type="PriceQueryBill.SendAddr_PriceQueryBill" sourceColumn="SendAddr_PriceQueryBill" />
- <Param name="@TaxCurrency_PriceQueryBill" type="PriceQueryBill.TaxCurrency_PriceQueryBill" sourceColumn="TaxCurrency_PriceQueryBill" />
- <Param name="@Currency_PriceQueryBill" type="PriceQueryBill.Currency_PriceQueryBill" sourceColumn="Currency_PriceQueryBill" />
- <Param name="@ID_Principal" type="PriceQueryBill.ID_Principal" sourceColumn="ID_Principal" />
- <Param name="@ID_Creator" type="PriceQueryBill.ID_Creator" sourceColumn="ID_Creator" />
- <Param name="@CreateDate_PriceQueryBill" type="PriceQueryBill.CreateDate_PriceQueryBill" sourceColumn="CreateDate_PriceQueryBill" />
- <Param name="@Discount_PriceQueryBill" type="PriceQueryBill.Discount_PriceQueryBill" sourceColumn="Discount_PriceQueryBill" />
- <Param name="@AssessDate_PriceQueryBill" type="PriceQueryBill.AssessDate_PriceQueryBill" sourceColumn="AssessDate_PriceQueryBill" />
- <Param name="@ID_Assessor" type="PriceQueryBill.ID_Assessor" sourceColumn="ID_Assessor" />
- <Param name="@LastModUser_PriceQueryBill" type="PriceQueryBill.LastModUser_PriceQueryBill" sourceColumn="LastModUser_PriceQueryBill" />
- <Param name="@LastModDate_PriceQueryBill" type="PriceQueryBill.LastModDate_PriceQueryBill" sourceColumn="LastModDate_PriceQueryBill" />
- <Param name="@Amount_PriceQueryBill" type="PriceQueryBill.Amount_PriceQueryBill" sourceColumn="Amount_PriceQueryBill" />
- <Param name="@GoodsAmount_PriceQueryBill" type="PriceQueryBill.GoodsAmount_PriceQueryBill" sourceColumn="GoodsAmount_PriceQueryBill" />
- <Param name="@TaxAmount_PriceQueryBill" type="PriceQueryBill.TaxAmount_PriceQueryBill" sourceColumn="TaxAmount_PriceQueryBill" />
- <Param name="@Special_PriceQueryBill" type="PriceQueryBill.Special_PriceQueryBill" sourceColumn="Special_PriceQueryBill" />
- </Params>
- </Update>
- <Delete CmdType="Text" CmdText="DELETE PriceQueryBillProduct WHERE ID_PriceQueryBill=@ID_PriceQueryBill
- DELETE PriceQueryBill WHERE ID_PriceQueryBill=@ID_PriceQueryBill
- " >
- <Params>
- <Param name="@ID_PriceQueryBill" type="PriceQueryBill.ID_PriceQueryBill" sourceColumn="ID_PriceQueryBill" />
- </Params>
- </Delete>
- <Audit CmdType="Text" CmdText="UPDATE PriceQueryBill
- SET ID_Assessor=@ID_Assessor,
- AssessDate_PriceQueryBill=@AssessDate_PriceQueryBill
- WHERE ID_PriceQueryBill=@ID_PriceQueryBill
-
- Declare @ID_Product uniqueidentifier
- Declare @UnitPrice_PriceQueryBillProduct decimal(18,6)
- DECLARE @UnitPrice_PriceReference decimal(14,4)
- DECLARE @UnitPriceWithTax_PriceReference decimal(14,4)
- DECLARE @CessOut decimal(14,4)
-
- Declare cur cursor
- for
- Select ID_Product,UnitPrice_PriceQueryBillProduct
- From PriceQueryBillProduct
- Where ID_PriceQueryBill=@ID_PriceQueryBill
- SELECT @CessOut=CessOut_SystemSetting/100 FROM SystemSetting
- IF(@ID_Assessor Is Not Null)
- BEGIN
- open cur
- Fetch Next From cur Into @ID_Product,@UnitPrice_PriceQueryBillProduct
- While @@fetch_status=0
- BEGIN
- IF(@TaxCurrency_PriceQueryBill='内含')
- BEGIN
- SET @UnitPrice_PriceReference=@UnitPrice_PriceQueryBillProduct/(1+@CessOut)
- SET @UnitPriceWithTax_PriceReference=@UnitPrice_PriceQueryBillProduct
- END
- ELSE
- BEGIN
- SET @UnitPrice_PriceReference=@UnitPrice_PriceQueryBillProduct
- SET @UnitPriceWithTax_PriceReference=@UnitPrice_PriceQueryBillProduct*(1+@CessOut)
- END
- IF Exists (Select * From PriceReference Where ID_Customer=@ID_Customer AND ID_Product=@ID_Product)
- Update PriceReference Set UnitPrice_PriceReference=Convert(decimal(18,2),@UnitPrice_PriceReference),UnitPriceWithTax_PriceReference=Convert(decimal(18,2),@UnitPriceWithTax_PriceReference) Where ID_Customer=@ID_Customer ANd ID_Product=@ID_Product
- Else
- Insert Into PriceReference(ID_PriceReference,ID_Customer,ID_Product,UnitPrice_PriceReference,UnitPriceWithTax_PriceReference) Values(newID(),@ID_Customer,@ID_Product,Convert(decimal(18,2),@UnitPrice_PriceReference),Convert(decimal(18,2),@UnitPriceWithTax_PriceReference))
- Fetch Next From cur Into @ID_Product,@UnitPrice_PriceQueryBillProduct
- END
- CLOSE cur
- DEALLOCATE cur
- END
-
- ">
- <Params>
- <Param name="@ID_PriceQueryBill" type="PriceQueryBill.ID_PriceQueryBill" sourceColumn="ID_PriceQueryBill" />
- <Param name="@AssessDate_PriceQueryBill" type="PriceQueryBill.AssessDate_PriceQueryBill" sourceColumn="AssessDate_PriceQueryBill" />
- <Param name="@ID_Assessor" type="PriceQueryBill.ID_Assessor" sourceColumn="ID_Assessor" />
- <Param name="@ID_Customer" type="PriceQueryBill.ID_Customer" sourceColumn="ID_Customer" />
- <Param name="@TaxCurrency_PriceQueryBill" type="PriceQueryBill.TaxCurrency_PriceQueryBill" sourceColumn="TaxCurrency_PriceQueryBill" />
- </Params>
- </Audit>
- <FKErrorReport ErrorMessage="该单据已被其他单据引用,删除失败!" />
- <UNIQUEErrorReport ErrorMessage="该报价单号已存在,提交失败!" />
- </Table>
- <Table name="PriceQueryBillProduct" Type="Child">
- <GetSchema CmdType="Text" CmdText="SELECT TOP 0 PriceQueryBillProduct.*, Product.No_Product, Product.Name_Product, Product.Unit_Product,convert(decimal(14,2),0) as AvailableQty_ProductStocks,
- Product.LowSalePrice_Product,Product.Price_Product As OrderPrice,CONVERT(decimal(18,6), 0) AS Amount_PriceQueryBillProduct,CONVERT(Decimal(18,6),0) AS LastPrice_PriceQueryBillProduct,CONVERT(nvarchar(64),'') as No_PriceQueryBill
- FROM PriceQueryBillProduct
- LEFT JOIN Product ON Product.ID_Product = PriceQueryBillProduct.ID_Product"/>
- <New CmdType="Text" CmdText="INSERT INTO PriceQueryBillProduct(
- ID_PriceQueryBillProduct,
- No_PriceQueryBillProduct,
- ID_PriceQueryBill,
- ID_Product,
- Quantity_PriceQueryBillProduct,
- OrderPrice_PriceQueryBillProduct,
- UnitPrice_PriceQueryBillProduct,
- Discount_PriceQueryBillProduct,
- Comment_PriceQueryBillProduct
- )
- VALUES(
- @ID_PriceQueryBillProduct,
- @No_PriceQueryBillProduct,
- @ID_PriceQueryBill,
- @ID_Product,
- @Quantity_PriceQueryBillProduct,
- @OrderPrice_PriceQueryBillProduct,
- @UnitPrice_PriceQueryBillProduct,
- @Discount_PriceQueryBillProduct,
- @Comment_PriceQueryBillProduct
- )
-
- " >
- <Params>
- <Param name="@ID_PriceQueryBillProduct" type="PriceQueryBillProduct.ID_PriceQueryBillProduct" sourceColumn="ID_PriceQueryBillProduct" />
- <Param name="@No_PriceQueryBillProduct" type="PriceQueryBillProduct.No_PriceQueryBillProduct" sourceColumn="No_PriceQueryBillProduct" />
- <Param name="@ID_PriceQueryBill" type="PriceQueryBillProduct.ID_PriceQueryBill" sourceColumn="ID_PriceQueryBill" />
- <Param name="@ID_Product" type="PriceQueryBillProduct.ID_Product" sourceColumn="ID_Product" />
- <Param name="@Quantity_PriceQueryBillProduct" type="PriceQueryBillProduct.Quantity_PriceQueryBillProduct" sourceColumn="Quantity_PriceQueryBillProduct" />
- <Param name="@UnitPrice_PriceQueryBillProduct" type="PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct" sourceColumn="UnitPrice_PriceQueryBillProduct" />
- <Param name="@Discount_PriceQueryBillProduct" type="PriceQueryBillProduct.Discount_PriceQueryBillProduct" sourceColumn="Discount_PriceQueryBillProduct" />
- <Param name="@Comment_PriceQueryBillProduct" type="PriceQueryBillProduct.Comment_PriceQueryBillProduct" sourceColumn="Comment_PriceQueryBillProduct" />
- <Param name="@OrderPrice_PriceQueryBillProduct" type="PriceQueryBillProduct.OrderPrice_PriceQueryBillProduct" sourceColumn="OrderPrice_PriceQueryBillProduct" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText="UPDATE PriceQueryBillProduct
- SET No_PriceQueryBillProduct =@No_PriceQueryBillProduct ,
- ID_PriceQueryBill =@ID_PriceQueryBill ,
- ID_Product =@ID_Product ,
- Quantity_PriceQueryBillProduct =@Quantity_PriceQueryBillProduct ,
- OrderPrice_PriceQueryBillProduct=@OrderPrice_PriceQueryBillProduct,
- UnitPrice_PriceQueryBillProduct =@UnitPrice_PriceQueryBillProduct ,
- Discount_PriceQueryBillProduct =@Discount_PriceQueryBillProduct ,
- Comment_PriceQueryBillProduct =@Comment_PriceQueryBillProduct
- WHERE ID_PriceQueryBillProduct =@ID_PriceQueryBillProduct
-
-
- " >
- <Params>
- <Param name="@ID_PriceQueryBillProduct" type="PriceQueryBillProduct.ID_PriceQueryBillProduct" sourceColumn="ID_PriceQueryBillProduct" />
- <Param name="@No_PriceQueryBillProduct" type="PriceQueryBillProduct.No_PriceQueryBillProduct" sourceColumn="No_PriceQueryBillProduct" />
- <Param name="@ID_PriceQueryBill" type="PriceQueryBillProduct.ID_PriceQueryBill" sourceColumn="ID_PriceQueryBill" />
- <Param name="@ID_Product" type="PriceQueryBillProduct.ID_Product" sourceColumn="ID_Product" />
- <Param name="@Quantity_PriceQueryBillProduct" type="PriceQueryBillProduct.Quantity_PriceQueryBillProduct" sourceColumn="Quantity_PriceQueryBillProduct" />
- <Param name="@UnitPrice_PriceQueryBillProduct" type="PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct" sourceColumn="UnitPrice_PriceQueryBillProduct" />
- <Param name="@Discount_PriceQueryBillProduct" type="PriceQueryBillProduct.Discount_PriceQueryBillProduct" sourceColumn="Discount_PriceQueryBillProduct" />
- <Param name="@Comment_PriceQueryBillProduct" type="PriceQueryBillProduct.Comment_PriceQueryBillProduct" sourceColumn="Comment_PriceQueryBillProduct" />
- <Param name="@OrderPrice_PriceQueryBillProduct" type="PriceQueryBillProduct.OrderPrice_PriceQueryBillProduct" sourceColumn="OrderPrice_PriceQueryBillProduct" />
- </Params>
- </Update>
- <Delete CmdType="Text" CmdText="DELETE PriceQueryBillProduct WHERE ID_PriceQueryBillProduct = @ID_PriceQueryBillProduct" >
- <Params>
- <Param name="@ID_PriceQueryBillProduct" type="PriceQueryBillProduct.ID_PriceQueryBillProduct" sourceColumn="ID_PriceQueryBillProduct" />
- </Params>
- </Delete>
- </Table>
- <Table name="BillComment" Type="Child">
- <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 BillComment.* FROM BillComment"/>
- <New CmdType="Text" CmdText=" INSERT INTO BillComment (ID_BillComment, ID_Bill, Comment_BillComment)
- VALUES (@ID_BillComment, @ID_Bill, @Comment_BillComment)">
- <Params>
- <Param name="@ID_BillComment" type="BillComment.ID_BillComment" sourceColumn="ID_BillComment" />
- <Param name="@ID_Bill" type="BillComment.ID_Bill" sourceColumn="ID_Bill" />
- <Param name="@Comment_BillComment" type="BillComment.Comment_BillComment" sourceColumn="Comment_BillComment" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText=" UPDATE BillComment SET ID_Bill = @ID_Bill, Comment_BillComment = @Comment_BillComment
- WHERE ID_BillComment = @ID_BillComment">
- <Params>
- <Param name="@ID_BillComment" type="BillComment.ID_BillComment" sourceColumn="ID_BillComment" />
- <Param name="@ID_Bill" type="BillComment.ID_Bill" sourceColumn="ID_Bill" />
- <Param name="@Comment_BillComment" type="BillComment.Comment_BillComment" sourceColumn="Comment_BillComment" />
- </Params>
- </Update>
- <Delete CmdType="Text" CmdText=" DELETE BillComment WHERE ID_BillComment = @ID_BillComment">
- <Params>
- <Param name="@ID_BillComment" type="BillComment.ID_BillComment" sourceColumn="ID_BillComment" />
- </Params>
- </Delete>
- </Table>
- <Table name="ReportComment" Type="Child">
- <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 ReportComment.*, CONVERT(nvarchar(64),'') as No_PriceQueryBill FROM ReportComment"/>
- <New CmdType="Text" CmdText=" INSERT INTO ReportComment (ID_ReportComment, ID_Bill, Comment_ReportComment)
- VALUES (@ID_ReportComment, @ID_Bill, @Comment_ReportComment)">
- <Params>
- <Param name="@ID_ReportComment" type="ReportComment.ID_ReportComment" sourceColumn="ID_ReportComment" />
- <Param name="@ID_Bill" type="ReportComment.ID_Bill" sourceColumn="ID_Bill" />
- <Param name="@Comment_ReportComment" type="ReportComment.Comment_ReportComment" sourceColumn="Comment_ReportComment" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText=" UPDATE ReportComment SET ID_Bill = @ID_Bill, Comment_ReportComment = @Comment_ReportComment
- WHERE ID_ReportComment = @ID_ReportComment">
- <Params>
- <Param name="@ID_ReportComment" type="ReportComment.ID_ReportComment" sourceColumn="ID_ReportComment" />
- <Param name="@ID_Bill" type="ReportComment.ID_Bill" sourceColumn="ID_Bill" />
- <Param name="@Comment_ReportComment" type="ReportComment.Comment_ReportComment" sourceColumn="Comment_ReportComment" />
- </Params>
- </Update>
- <Delete CmdType="Text" CmdText=" DELETE ReportComment WHERE ID_ReportComment = @ID_ReportComment">
- <Params>
- <Param name="@ID_ReportComment" type="ReportComment.ID_ReportComment" sourceColumn="ID_ReportComment" />
- </Params>
- </Delete>
- </Table>
- </Tables>
- <Search>
- <SearchAllProduct CmdType="Text" CmdText="SELECT Product.No_Product,Product.Name_Product ,Type_Product, Price_Product, LowSalePrice_Product, SafetyQty_Product FROM Product ">
- <Tables>
- <Table name="AllProduct" />
- </Tables>
- </SearchAllProduct>
- <SearchAllCustomer CmdType="Text" CmdText="SELECT Customer.*,Linkman.Name_Linkman,Linkman.Tel_Linkman
- ,No_Telephone,No_Fax,RegionalLeader.No_RegionalLeader
- FROM
- (
- SELECT Customer.ID_Customer,Customer.No_Customer
- ,Customer.ShortName_Customer,Customer.Zone_Customer
- ,Customer.SendAddr_Customer,RegistedAddress_Customer
- ,SuspendDate_Customer,Customer.Type_Customer
- ,Customer.Level_Customer,Customer.IsGeneric_Customer
- ,ID_Linkman=(Select Top 1 ID_Linkman
- From Linkman
- Where ID_Person=Customer.ID_Customer
- And IsMain_Linkman=1 order by name_linkman)
- ,ID_RegionalLeader= (Select TOP 1 ID_RegionalLeader
- FROM RegionalLeader
- WHERE ID_RegionalLeader = Customer.ID_RegionalLeader)
- From Customer
- )Customer
- Left Join Linkman On Customer.ID_Linkman=Linkman.ID_Linkman
- LEFT JOIN RegionalLeader ON RegionalLeader.ID_RegionalLeader = Customer.ID_RegionalLeader
- LEFT JOIN Telephone ON Telephone.ID_Person = Customer.ID_Customer and Focus_Telephone = 1
- left join Fax ON Fax.ID_Person = Customer.ID_Customer and Focus_Fax = 1 ">
- <Tables>
- <Table name="AllCustomer" />
- </Tables>
- </SearchAllCustomer>
- <SearchAllBill CmdType="Text" CmdText="SELECT PriceQueryBill.*,Customer.No_Customer, Customer.Name_Customer, Customer.ShortName_Customer,
- Customer.Type_Customer, Customer.LastDiscount_Customer, Customer.PostalCode_Customer, Customer.ID_Creator,
- a.Name_User AS Name_Creator, b.Name_User AS Name_Assessor, c.Name_User AS LastModUserName,Employee.No_Employee AS No_Principal,Employee.Name_Employee as Principal_PriceQueryBill,
- CONVERT(decimal(18,6), 0) AS NumSum
- FROM PriceQueryBill
- LEFT JOIN Customer ON Customer.ID_Customer = PriceQueryBill.ID_Customer
- LEFT JOIN AppUser a ON a.ID_User = PriceQueryBill.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = PriceQueryBill.ID_Assessor
- LEFT JOIN AppUser c ON c.ID_User = PriceQueryBill.LastModUser_PriceQueryBill
- LEFT JOIN Employee ON Employee.ID_Employee = PriceQueryBill.ID_Principal ">
- <Tables>
- <Table name="AllBill" />
- </Tables>
- </SearchAllBill>
- <SearchPriceQueryBillWithNo CmdType="Text" CmdText="DECLARE @ID_PriceQueryBill uniqueidentifier
- SELECT PriceQueryBill.*,Customer.No_Customer, Customer.Name_Customer, Customer.ShortName_Customer,
- Customer.Type_Customer, Customer.LastDiscount_Customer, Customer.PostalCode_Customer,
- a.Name_User AS Name_Creator, ISNULL(b.Name_User, '') AS Name_Assessor, ISNULL(c.Name_User, '') AS LastModUserName,
- Employee.No_Employee AS No_Principal,Customer.ID_Creator As CustomerCreator,Employee.Name_Employee as Principal_PriceQueryBill
- FROM PriceQueryBill
- LEFT JOIN Customer ON Customer.ID_Customer = PriceQueryBill.ID_Customer
- LEFT JOIN AppUser a ON a.ID_User = PriceQueryBill.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = PriceQueryBill.ID_Assessor
- LEFT JOIN AppUser c ON c.ID_User = PriceQueryBill.LastModUser_PriceQueryBill
- LEFT JOIN Employee ON Employee.ID_Employee = PriceQueryBill.ID_Principal
- WHERE PriceQueryBill.No_PriceQueryBill = @No_PriceQueryBill
- SELECT @ID_PriceQueryBill=ID_PriceQueryBill FROM PriceQueryBill WHERE PriceQueryBill.No_PriceQueryBill = @No_PriceQueryBill
- SELECT PriceQueryBillProduct.*, Product.No_Product, Product.Name_Product, Product.Unit_Product,
- Product.LowSalePrice_Product,
- (UnitPrice_PriceQueryBillProduct * Quantity_PriceQueryBillProduct) as Amount_PriceQueryBillProduct,@No_PriceQueryBill as No_PriceQueryBill
- FROM PriceQueryBillProduct
- LEFT JOIN Product ON Product.ID_Product = PriceQueryBillProduct.ID_Product
- WHERE PriceQueryBillProduct.ID_PriceQueryBill = @ID_PriceQueryBill ORDER BY PriceQueryBillProduct.No_PriceQueryBillProduct
- SELECT BillComment.* FROM BillComment WHERE BillComment.ID_Bill = @ID_PriceQueryBill order by BillComment.No_BillComment
- SELECT ReportComment.*, @No_PriceQueryBill as No_PriceQueryBill FROM ReportComment WHERE ReportComment.ID_Bill = @ID_PriceQueryBill order by ReportComment.No_ReportComment">
- <Params>
- <Param name="@No_PriceQueryBill" type="PriceQueryBill.No_PriceQueryBill" Index="0" />
- </Params>
- <Tables>
- <Table name="PriceQueryBill" />
- <Table name="PriceQueryBillProduct" />
- <Table name="BillComment" />
- <Table name="ReportComment" />
- </Tables>
- </SearchPriceQueryBillWithNo>
- <SearchCustomerWithNo CmdType="Text" CmdText="
- declare @LastTax_Customer1 nvarchar(64)
- declare @LastTax_Customer2 nvarchar(64)
- declare @LastTax_Customer3 nvarchar(64)
- declare @STaxDefault1_FunctionSetting int
- declare @STaxDefault2_FunctionSetting int
- declare @STaxDefault3_FunctionSetting int
-
- select @STaxDefault1_FunctionSetting = STaxDefault1_FunctionSetting,
- @STaxDefault2_FunctionSetting = STaxDefault2_FunctionSetting, @STaxDefault3_FunctionSetting = STaxDefault3_FunctionSetting
- from FunctionSetting
- if @STaxDefault1_FunctionSetting=0
- begin
- select @LastTax_Customer1 = Customer.LastTax_Customer
- from Customer
- WHERE Customer.No_Customer = @No_Customer
- end
- else if @STaxDefault1_FunctionSetting = 1
- begin
- select top 1 @LastTax_Customer1 = TaxCurrency_PriceQueryBill
- from PriceQueryBill
- order by Date_PriceQueryBill desc
- end
- else
- begin
- set @LastTax_Customer1 = '外加'
- end
- if @STaxDefault2_FunctionSetting=0
- begin
- select @LastTax_Customer2 = Customer.LastTax_Customer
- from Customer
- WHERE Customer.No_Customer = @No_Customer
- end
- else if @STaxDefault2_FunctionSetting = 1
- begin
- select top 1 @LastTax_Customer2 = TaxCurrency_PriceQueryBill
- from PriceQueryBill
- order by Date_PriceQueryBill desc
-
- end
- else
- begin
- set @LastTax_Customer2 = '外加'
- end
- if @STaxDefault3_FunctionSetting=0
- begin
- select @LastTax_Customer3 = Customer.LastTax_Customer
- from Customer
- WHERE Customer.No_Customer = @No_Customer
- end
- else if @STaxDefault3_FunctionSetting = 1
- begin
- select top 1 @LastTax_Customer3 = TaxCurrency_PriceQueryBill
- from PriceQueryBill
- order by Date_PriceQueryBill desc
-
- end
- else
- begin
- set @LastTax_Customer3 = '外加'
- end
- if @LastTax_Customer1 is null
- set @LastTax_Customer1 = isnull(@LastTax_Customer2, @LastTax_Customer3)
- DECLARE @ID_Customer uniqueidentifier
-
- SELECT Customer.ID_Customer, Customer.No_Customer, Customer.Name_Customer,Employee.Name_Employee,Employee.No_Employee, Customer.ShortName_Customer, Customer.Type_Customer, Customer.GetMethod_Customer, Customer.PostalCode_Customer, ISNULL(Customer.LastDiscount_Customer, 100) AS LastDiscount_Customer, Customer.SendAddr_Customer, ISNULL(Customer.ToGetBalance_Customer, 0) AS ToGetBalance_Customer, Customer.SuspendDate_Customer, ISNULL(@LastTax_Customer1, '外加') AS LastTax_Customer, Employee.ID_Employee As LastPrincipal_Customer,IsNull(LowDiscount_Customer,0) As LowDiscount_Customer
- FROM Customer
- Left Join Principal On Principal.ID_Person = Customer.ID_Customer and IsMain_Principal = 1
- Left join Employee On Employee.ID_Employee = Principal.ID_Employee
- WHERE Customer.No_Customer = @No_Customer
- SELECT @ID_Customer = Customer.ID_Customer FROM Customer WHERE Customer.No_Customer = @No_Customer
- SELECT Telephone.No_Telephone FROM Telephone WHERE Telephone.ID_Person = @ID_Customer
- SELECT Fax.No_Fax FROM Fax WHERE Fax.ID_Person = @ID_Customer
- SELECT Linkman.Name_Linkman FROM Linkman WHERE Linkman.ID_Person = @ID_Customer And IsMain_Linkman=1
- --Drop table #Principal
- " >
- <Params>
- <Param name="@No_Customer" type="Customer.No_Customer" Index="0" />
- </Params>
- <Tables>
- <Table name="Customer" />
- <Table name="Telephone" />
- <Table name="Fax" />
- <Table name="Linkman" />
- </Tables>
- </SearchCustomerWithNo>
- <SearchPrincipal CmdType="Text" CmdText=" SELECT Employee.No_Employee AS No_Principal, Employee.Name_Employee AS Principal_PriceQueryBill
- FROM Principal
- INNER JOIN Employee ON Employee.ID_Employee = Principal.ID_Employee
- INNER JOIN Customer ON Customer.ID_Customer = Principal.ID_Person
- WHERE Customer.No_Customer = @No_Customer">
- <Params>
- <Param name="@No_Customer" type="Customer.No_Customer" Index="0" />
- </Params>
- <Tables>
- <Table name="Principal" />
- </Tables>
- </SearchPrincipal>
- <SearchAllPrincipal CmdType="Text" CmdText="SELECT Employee.ID_Employee,Employee.No_Employee AS No_Principal, Employee.Name_Employee AS Principal_PriceQueryBill
- FROM Employee order by Employee.No_Employee ">
- <Tables>
- <Table name="Principal" />
- </Tables>
- </SearchAllPrincipal>
- <SearchLinkman CmdType="Text" CmdText=" SELECT Linkman.Name_Linkman
- FROM Linkman
- INNER JOIN Customer ON Customer.ID_Customer = Linkman.ID_Person
- WHERE Customer.No_Customer = @No_Customer">
- <Params>
- <Param name="@No_Customer" type="Customer.No_Customer" Index="0" />
- </Params>
- <Tables>
- <Table name="Linkman" />
- </Tables>
- </SearchLinkman>
- <SearchTele CmdType="Text" CmdText=" SELECT Telephone.No_Telephone
- FROM Telephone
- INNER JOIN Customer ON Customer.ID_Customer = Telephone.ID_Person
- WHERE Customer.No_Customer = @No_Customer">
- <Params>
- <Param name="@No_Customer" type="Customer.No_Customer" Index="0" />
- </Params>
- <Tables>
- <Table name="Telephone" />
- </Tables>
- </SearchTele>
- <SearchFax CmdType="Text" CmdText=" SELECT Fax.No_Fax
- FROM Fax
- INNER JOIN Customer ON Customer.ID_Customer = Fax.ID_Person
- WHERE Customer.No_Customer = @No_Customer">
- <Params>
- <Param name="@No_Customer" type="Customer.No_Customer" Index="0" />
- </Params>
- <Tables>
- <Table name="Fax" />
- </Tables>
- </SearchFax>
- <SearchCessOut CmdType="Text" CmdText=" SELECT SystemSetting.CessOut_SystemSetting FROM SystemSetting">
- <Tables>
- <Table name="System" />
- </Tables>
- </SearchCessOut>
- <SearchProductWithNo CmdType="Text" CmdText=" SELECT Product.ID_Product, Name_Product, Unit_Product, Price_Product, SuspendDate_Product, LowSalePrice_Product,IsNull(A.AvailableQty_ProductStocks,0) As AvailableQty_ProductStocks
- From Product
- Left Join
- (
- Select ProductStocks.ID_Product,ProductStocks.AvailableQty_ProductStocks From ProductStocks
- Left Join Location On Location.ID_Location= ProductStocks.ID_Location
- Where Level_Location=0
- )A
- On A.ID_Product=Product.ID_Product
- WHERE No_Product = @No_Product
-
-
-
- ">
- <Params>
- <Param name="@No_Product" type="Product.No_Product" Index="0" />
- </Params>
- <Tables>
- <Table name="Product" />
- </Tables>
- </SearchProductWithNo>
- <SearchRelation CmdType="Text" CmdText=" Select UnitPrice_PriceReference,UnitPriceWithTax_PriceReference From PriceReference
- Left Join Product On Product.ID_Product = PriceReference.ID_Product
- Left Join Customer On Customer.ID_Customer = PriceReference.ID_Customer
- Where No_Product = @No_Product And No_Customer = @No_Customer">
- <Params>
- <Param name="@No_Product" type="Product.No_Product" Index="0" />
- <Param name="@No_Customer" type="Customer.No_Customer" Index="1" />
- </Params>
- <Tables>
- <Table name="PriceReference" />
- </Tables>
- </SearchRelation>
- <SearchPriceQueryBillFirst CmdType="Text" CmdText=" DECLARE @ID_PriceQueryBill uniqueidentifier
- DECLARE @PriceQueryBillNo nvarchar(64)
- SELECT TOP 1 @PriceQueryBillNo = PriceQueryBill.No_PriceQueryBill FROM PriceQueryBill
- Join Customer On Customer.ID_Customer=PriceQueryBill.ID_Customer
- Where Customer.ID_Creator=case IsNull(DataLength(@Right),0) When 0 Then Customer.ID_Creator Else @Right End --added for validating right
- and Special_PriceQueryBill=case @Special when 1 then Special_PriceQueryBill else 0 End --added for Special
- --and Customer.ID_RegionalLeader in
- --(Select ID_RegionalLeader From Principal
- --Where ID_Employee in(select ID_Employee from Employee where Name_Employee=@Name_Employee)
- --)
- ORDER BY PriceQueryBill.No_PriceQueryBill
-
- SELECT PriceQueryBill.*,Customer.No_Customer, Customer.Name_Customer, Customer.ShortName_Customer,
- Customer.Type_Customer, Customer.LastDiscount_Customer, Customer.PostalCode_Customer,
- a.Name_User AS Name_Creator, ISNULL(b.Name_User, '') AS Name_Assessor, ISNULL(c.Name_User, '') AS LastModUserName,
- Employee.No_Employee AS No_Principal,Employee.Name_Employee as Principal_PriceQueryBill
- FROM PriceQueryBill
- LEFT JOIN Customer ON Customer.ID_Customer = PriceQueryBill.ID_Customer
- LEFT JOIN AppUser a ON a.ID_User = PriceQueryBill.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = PriceQueryBill.ID_Assessor
- LEFT JOIN AppUser c ON c.ID_User = PriceQueryBill.LastModUser_PriceQueryBill
- LEFT JOIN Employee ON Employee.ID_Employee = PriceQueryBill.ID_Principal
- WHERE PriceQueryBill.No_PriceQueryBill = @PriceQueryBillNo
- SELECT @ID_PriceQueryBill=ID_PriceQueryBill FROM PriceQueryBill WHERE PriceQueryBill.No_PriceQueryBill = @PriceQueryBillNo
- SELECT PriceQueryBillProduct.*, Product.No_Product, Product.Name_Product, Product.Unit_Product,
- Product.LowSalePrice_Product,
- (UnitPrice_PriceQueryBillProduct * Quantity_PriceQueryBillProduct) as Amount_PriceQueryBillProduct,@PriceQueryBillNo as No_PriceQueryBill
- FROM PriceQueryBillProduct
- LEFT JOIN Product ON Product.ID_Product = PriceQueryBillProduct.ID_Product
- WHERE PriceQueryBillProduct.ID_PriceQueryBill = @ID_PriceQueryBill ORDER BY PriceQueryBillProduct.No_PriceQueryBillProduct
- SELECT BillComment.* FROM BillComment WHERE BillComment.ID_Bill = @ID_PriceQueryBill order by BillComment.No_BillComment
- SELECT ReportComment.*,@PriceQueryBillNo as No_PriceQueryBill FROM ReportComment WHERE ReportComment.ID_Bill = @ID_PriceQueryBill order by ReportComment.No_ReportComment">
- <Params>
- <Param name="@Right" type="SaleBill.ID_Customer" Index="0" />
- <Param name="@Special" type="PriceQueryBill.Special_PriceQueryBill" Index="1" />
- <Param name="@Name_Employee" type="Employee.Name_Employee" Index="2" />
- </Params>
- <Tables>
- <Table name="PriceQueryBill" />
- <Table name="PriceQueryBillProduct" />
- <Table name="BillComment" />
- <Table name="ReportComment" />
- </Tables>
- </SearchPriceQueryBillFirst>
- <SearchPriceQueryBillPrevious CmdType="Text" CmdText=" DECLARE @ID_PriceQueryBill uniqueidentifier
- DECLARE @PriceQueryBillNo nvarchar(64)
- SELECT TOP 1 @PriceQueryBillNo = PriceQueryBill.No_PriceQueryBill FROM PriceQueryBill
- Join Customer On Customer.ID_Customer=PriceQueryBill.ID_Customer
- WHERE PriceQueryBill.No_PriceQueryBill < @No_PriceQueryBill
- And Customer.ID_Creator=case IsNull(DataLength(@Right),0) When 0 Then Customer.ID_Creator Else @Right End --added for validating right
- and Special_PriceQueryBill=case @Special when 1 then Special_PriceQueryBill else 0 End --added for Special
- --and Customer.ID_RegionalLeader in
- --(Select ID_RegionalLeader From Principal
- -- Where ID_Employee in(select ID_Employee from Employee where Name_Employee=@Name_Employee)
- --)
- ORDER BY PriceQueryBill.No_PriceQueryBill DESC
-
- SELECT PriceQueryBill.*,Customer.No_Customer, Customer.Name_Customer, Customer.ShortName_Customer,
- Customer.Type_Customer, Customer.LastDiscount_Customer, Customer.PostalCode_Customer,
- a.Name_User AS Name_Creator, ISNULL(b.Name_User, '') AS Name_Assessor, ISNULL(c.Name_User, '') AS LastModUserName,
- Employee.No_Employee AS No_Principal,Employee.Name_Employee as Principal_PriceQueryBill
- FROM PriceQueryBill
- LEFT JOIN Customer ON Customer.ID_Customer = PriceQueryBill.ID_Customer
- LEFT JOIN AppUser a ON a.ID_User = PriceQueryBill.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = PriceQueryBill.ID_Assessor
- LEFT JOIN AppUser c ON c.ID_User = PriceQueryBill.LastModUser_PriceQueryBill
- LEFT JOIN Employee ON Employee.ID_Employee = PriceQueryBill.ID_Principal
- WHERE PriceQueryBill.No_PriceQueryBill = @PriceQueryBillNo
- SELECT @ID_PriceQueryBill=ID_PriceQueryBill FROM PriceQueryBill WHERE PriceQueryBill.No_PriceQueryBill = @PriceQueryBillNo
- SELECT PriceQueryBillProduct.*, Product.No_Product, Product.Name_Product, Product.Unit_Product,
- Product.LowSalePrice_Product,
- (UnitPrice_PriceQueryBillProduct * Quantity_PriceQueryBillProduct) as Amount_PriceQueryBillProduct,@PriceQueryBillNo as No_PriceQueryBill
- FROM PriceQueryBillProduct
- LEFT JOIN Product ON Product.ID_Product = PriceQueryBillProduct.ID_Product
- WHERE PriceQueryBillProduct.ID_PriceQueryBill = @ID_PriceQueryBill ORDER BY PriceQueryBillProduct.No_PriceQueryBillProduct
- SELECT BillComment.* FROM BillComment WHERE BillComment.ID_Bill = @ID_PriceQueryBill order by BillComment.No_BillComment
- SELECT ReportComment.*,@PriceQueryBillNo as No_PriceQueryBill FROM ReportComment WHERE ReportComment.ID_Bill = @ID_PriceQueryBill order by ReportComment.No_ReportComment">
- <Params>
- <Param name="@No_PriceQueryBill" type="PriceQueryBill.No_PriceQueryBill" Index="0" />
- <Param name="@Right" type="SaleBill.ID_Customer" Index="1" />
- <Param name="@Special" type="PriceQueryBill.Special_PriceQueryBill" Index="2" />
- <Param name="@Name_Employee" type="Employee.Name_Employee" Index="3" />
- </Params>
- <Tables>
- <Table name="PriceQueryBill" />
- <Table name="PriceQueryBillProduct" />
- <Table name="BillComment" />
- <Table name="ReportComment" />
- </Tables>
- </SearchPriceQueryBillPrevious>
- <SearchPriceQueryBillNext CmdType="Text" CmdText=" DECLARE @ID_PriceQueryBill uniqueidentifier
- DECLARE @PriceQueryBillNo nvarchar(64)
- SELECT TOP 1 @PriceQueryBillNo = PriceQueryBill.No_PriceQueryBill FROM PriceQueryBill
- Join Customer On Customer.ID_Customer=PriceQueryBill.ID_Customer
- WHERE PriceQueryBill.No_PriceQueryBill > @No_PriceQueryBill
- And Customer.ID_Creator=case IsNull(DataLength(@Right),0) When 0 Then Customer.ID_Creator Else @Right End --added for validating right
- and Special_PriceQueryBill=case @Special when 1 then Special_PriceQueryBill else 0 End --added for Special
- --and Customer.ID_RegionalLeader in
- --(Select ID_RegionalLeader From Principal
- --Where ID_Employee in(select ID_Employee from Employee where Name_Employee=@Name_Employee)
- --)
- ORDER BY PriceQueryBill.No_PriceQueryBill
- SELECT PriceQueryBill.*,Customer.No_Customer, Customer.Name_Customer, Customer.ShortName_Customer,
- Customer.Type_Customer, Customer.LastDiscount_Customer, Customer.PostalCode_Customer,
- a.Name_User AS Name_Creator, ISNULL(b.Name_User, '') AS Name_Assessor, ISNULL(c.Name_User, '') AS LastModUserName,
- Employee.No_Employee AS No_Principal,Employee.Name_Employee as Principal_PriceQueryBill
- FROM PriceQueryBill
- LEFT JOIN Customer ON Customer.ID_Customer = PriceQueryBill.ID_Customer
- LEFT JOIN AppUser a ON a.ID_User = PriceQueryBill.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = PriceQueryBill.ID_Assessor
- LEFT JOIN AppUser c ON c.ID_User = PriceQueryBill.LastModUser_PriceQueryBill
- LEFT JOIN Employee ON Employee.ID_Employee = PriceQueryBill.ID_Principal
- WHERE PriceQueryBill.No_PriceQueryBill = @PriceQueryBillNo
- SELECT @ID_PriceQueryBill=ID_PriceQueryBill FROM PriceQueryBill WHERE PriceQueryBill.No_PriceQueryBill = @PriceQueryBillNo
- SELECT PriceQueryBillProduct.*, Product.No_Product, Product.Name_Product, Product.Unit_Product,
- Product.LowSalePrice_Product,
- (UnitPrice_PriceQueryBillProduct * Quantity_PriceQueryBillProduct) as Amount_PriceQueryBillProduct,@PriceQueryBillNo as No_PriceQueryBill
- FROM PriceQueryBillProduct
- LEFT JOIN Product ON Product.ID_Product = PriceQueryBillProduct.ID_Product
- WHERE PriceQueryBillProduct.ID_PriceQueryBill = @ID_PriceQueryBill ORDER BY PriceQueryBillProduct.No_PriceQueryBillProduct
- SELECT BillComment.* FROM BillComment WHERE BillComment.ID_Bill = @ID_PriceQueryBill order by BillComment.No_BillComment
- SELECT ReportComment.*,@PriceQueryBillNo as No_PriceQueryBill FROM ReportComment WHERE ReportComment.ID_Bill = @ID_PriceQueryBill order by ReportComment.No_ReportComment">
- <Params>
- <Param name="@No_PriceQueryBill" type="PriceQueryBill.No_PriceQueryBill" Index="0" />
- <Param name="@Right" type="SaleBill.ID_Customer" Index="1" />
- <Param name="@Special" type="PriceQueryBill.Special_PriceQueryBill" Index="2" />
- <Param name="@Name_Employee" type="Employee.Name_Employee" Index="3" />
- </Params>
- <Tables>
- <Table name="PriceQueryBill" />
- <Table name="PriceQueryBillProduct" />
- <Table name="BillComment" />
- <Table name="ReportComment" />
- </Tables>
- </SearchPriceQueryBillNext>
- <SearchPriceQueryBillLast CmdType="Text" CmdText=" DECLARE @ID_PriceQueryBill uniqueidentifier
- DECLARE @PriceQueryBillNo nvarchar(64)
- SELECT TOP 1 @PriceQueryBillNo = PriceQueryBill.No_PriceQueryBill FROM PriceQueryBill
- Join Customer On Customer.ID_Customer=PriceQueryBill.ID_Customer
- Where Customer.ID_Creator=case IsNull(DataLength(@Right),0) When 0 Then Customer.ID_Creator Else @Right End --added for validating right
- and Special_PriceQueryBill=case @Special when 1 then Special_PriceQueryBill else 0 End --added for Special
- --and Customer.ID_RegionalLeader in
- --(Select ID_RegionalLeader From Principal
- --Where ID_Employee in(select ID_Employee from Employee where Name_Employee=@Name_Employee)
- -- )
- ORDER BY PriceQueryBill.No_PriceQueryBill DESC
- SELECT PriceQueryBill.*,Customer.No_Customer, Customer.Name_Customer, Customer.ShortName_Customer,
- Customer.Type_Customer, Customer.LastDiscount_Customer, Customer.PostalCode_Customer,
- a.Name_User AS Name_Creator, ISNULL(b.Name_User, '') AS Name_Assessor, ISNULL(c.Name_User, '') AS LastModUserName,
- Employee.No_Employee AS No_Principal,Employee.Name_Employee as Principal_PriceQueryBill
- FROM PriceQueryBill
- LEFT JOIN Customer ON Customer.ID_Customer = PriceQueryBill.ID_Customer
- LEFT JOIN AppUser a ON a.ID_User = PriceQueryBill.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = PriceQueryBill.ID_Assessor
- LEFT JOIN AppUser c ON c.ID_User = PriceQueryBill.LastModUser_PriceQueryBill
- LEFT JOIN Employee ON Employee.ID_Employee = PriceQueryBill.ID_Principal
- WHERE PriceQueryBill.No_PriceQueryBill = @PriceQueryBillNo
- SELECT @ID_PriceQueryBill=ID_PriceQueryBill FROM PriceQueryBill WHERE PriceQueryBill.No_PriceQueryBill = @PriceQueryBillNo
- SELECT PriceQueryBillProduct.*, Product.No_Product, Product.Name_Product, Product.Unit_Product,
- Product.LowSalePrice_Product,
- (UnitPrice_PriceQueryBillProduct * Quantity_PriceQueryBillProduct) as Amount_PriceQueryBillProduct,@PriceQueryBillNo as No_PriceQueryBill
- FROM PriceQueryBillProduct
- LEFT JOIN Product ON Product.ID_Product = PriceQueryBillProduct.ID_Product
- WHERE PriceQueryBillProduct.ID_PriceQueryBill = @ID_PriceQueryBill ORDER BY PriceQueryBillProduct.No_PriceQueryBillProduct
- SELECT BillComment.* FROM BillComment WHERE BillComment.ID_Bill = @ID_PriceQueryBill order by BillComment.No_BillComment
- SELECT ReportComment.*,@PriceQueryBillNo as No_PriceQueryBill FROM ReportComment WHERE ReportComment.ID_Bill = @ID_PriceQueryBill order by ReportComment.No_ReportComment">
- <Params>
- <Param name="@Right" type="SaleBill.ID_Customer" Index="0" />
- <Param name="@Special" type="PriceQueryBill.Special_PriceQueryBill" Index="1" />
- <Param name="@Name_Employee" type="Employee.Name_Employee" Index="2" />
- </Params>
- <Tables>
- <Table name="PriceQueryBill" />
- <Table name="PriceQueryBillProduct" />
- <Table name="BillComment" />
- <Table name="ReportComment" />
- </Tables>
- </SearchPriceQueryBillLast>
- <SearchPQDate CmdType="Text" CmdText=" declare @PQDate_FunctionSetting int
- select @PQDate_FunctionSetting=ISNULL(PQDate_FunctionSetting, 0) from FunctionSetting
- select dateadd(day,@PQDate_FunctionSetting,getdate()) as ValiDate ">
- <Tables>
- <Table name="PQDate"/>
- </Tables>
- </SearchPQDate>
- <SearchTypeComment CmdType="Text" CmdText="
- declare @PQRemark1_FunctionSetting int
- declare @PQRemark2_FunctionSetting int
- Select @PQRemark1_FunctionSetting = PQRemark1_FunctionSetting, @PQRemark2_FunctionSetting = PQRemark2_FunctionSetting
- from FunctionSetting
- declare @ID_PriceQueryBill uniqueidentifier
- declare @flag int
- set @flag = 0
-
- if @PQRemark1_FunctionSetting = 0
- begin
- select top 1 @ID_PriceQueryBill = PriceQueryBill.ID_PriceQueryBill
- from PriceQueryBill
- where ID_Customer = @ID_Customer
- order by PriceQueryBill.Date_PriceQueryBill desc
- if exists( select ReportComment.* from ReportComment where ReportComment.ID_Bill = @ID_PriceQueryBill)
- begin
- select ReportComment.Comment_ReportComment from ReportComment where ReportComment.ID_Bill = @ID_PriceQueryBill order by ReportComment.No_ReportComment
- set @flag = 1
- end
- end
- else
- begin
- if exists(SELECT Name_TypeDef FROM TypeDef WHERE Type_TypeDef=26 )
- begin
- SELECT Name_TypeDef as Comment_ReportComment FROM TypeDef WHERE Type_TypeDef=26
- set @flag = 1
- end
- end
- if @flag = 0
- begin
- if @PQRemark2_FunctionSetting = 0
- begin
- select top 1 @ID_PriceQueryBill = PriceQueryBill.ID_PriceQueryBill
- from PriceQueryBill
- where ID_Customer = @ID_Customer
- order by PriceQueryBill.Date_PriceQueryBill desc
- select ReportComment.Comment_ReportComment from ReportComment where ReportComment.ID_Bill = @ID_PriceQueryBill order by ReportComment.No_ReportComment
- end
- else
- begin
- SELECT Name_TypeDef as Comment_ReportComment FROM TypeDef WHERE Type_TypeDef=26
- end
- end
- ">
- <Params>
- <Param name="@ID_Customer" type="PriceQueryBill.ID_Customer" Index="0" />
- </Params>
- <Tables>
- <Table name="TypeComment" />
- </Tables>
- </SearchTypeComment>
- <SearchSystemSetting CmdType="Text" CmdText="SELECT SysCurrency_SystemSetting,PQAudit_FunctionSetting,PriceDecimal_SystemSetting From SystemSetting,FunctionSetting">
- <Tables>
- <Table name="SystemSetting"/>
- </Tables>
- </SearchSystemSetting>
- <SearchAvailableQty CmdType="Text" CmdText="SELECT IsNull(A.AvailableQty_ProductStocks,0) As AvailableQty_ProductStocks
- FROM Product
- Left Join
- (SELECT ProductStocks.ID_Product,ProductStocks.ID_Location,Sum(AvailableQty_ProductStocks) AS AvailableQty_ProductStocks from ProductStocks
- LEFT JOIN Location ON Location.ID_Location = ProductStocks.ID_Location
- WHERE Level_Location = 0 Group By ID_Product,ProductStocks.ID_Location) A ON A.ID_Product = Product.ID_Product
- WHERE No_Product = @No_Product">
- <Params>
- <Param name="@No_Product" type="Product.No_Product" Index="0" />
- </Params>
- <Tables>
- <Table name="AvailableQty" />
- </Tables>
- </SearchAvailableQty>
- <SearchPriceQueryBillWithNo1 CmdType="Text" CmdText="DECLARE @ID_PriceQueryBill uniqueidentifier
- SELECT PriceQueryBill.*,Customer.No_Customer, Customer.Name_Customer
- ,Customer.ShortName_Customer,Customer.Type_Customer,Customer.LastDiscount_Customer
- ,Customer.PostalCode_Customer,a.Name_User AS Name_Creator
- ,ISNULL(b.Name_User, '') AS Name_Assessor,ISNULL(c.Name_User, '') AS LastModUserName
- ,Employee.No_Employee AS No_Principal,Customer.ID_Creator As CustomerCreator
- ,Employee.Name_Employee as Principal_PriceQueryBill
- FROM PriceQueryBill
- LEFT JOIN Customer ON Customer.ID_Customer = PriceQueryBill.ID_Customer
- LEFT JOIN AppUser a ON a.ID_User = PriceQueryBill.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = PriceQueryBill.ID_Assessor
- LEFT JOIN AppUser c ON c.ID_User = PriceQueryBill.LastModUser_PriceQueryBill
- LEFT JOIN Employee ON Employee.ID_Employee = PriceQueryBill.ID_Principal
- WHERE PriceQueryBill.No_PriceQueryBill = @No_PriceQueryBill
-
- SELECT @ID_PriceQueryBill=ID_PriceQueryBill FROM PriceQueryBill WHERE PriceQueryBill.No_PriceQueryBill = @No_PriceQueryBill
-
- Select identity(int,1,1) as No_PriceQueryBillProduct, ID_PriceQueryBillProduct
- ,ID_PriceQueryBill,PriceQueryBillProduct.ID_Product,Quantity_PriceQueryBillProduct
- ,OrderPrice_PriceQueryBillProduct,Discount_PriceQueryBillProduct
- ,UnitPrice_PriceQueryBillProduct,Comment_PriceQueryBillProduct Into #PriceQueryBillProduct
- From PriceQueryBillProduct
- Where PriceQueryBillProduct.ID_PriceQueryBill = @ID_PriceQueryBill
-
- SELECT (@Count+No_PriceQueryBillProduct) as No_PriceQueryBillProduct,ID_PriceQueryBillProduct,ID_PriceQueryBill,#PriceQueryBillProduct.ID_Product,Quantity_PriceQueryBillProduct,OrderPrice_PriceQueryBillProduct,
- Discount_PriceQueryBillProduct,UnitPrice_PriceQueryBillProduct,Comment_PriceQueryBillProduct,Product.No_Product, Product.Name_Product, Product.Unit_Product,
- Product.LowSalePrice_Product,
- (UnitPrice_PriceQueryBillProduct * Quantity_PriceQueryBillProduct) as Amount_PriceQueryBillProduct,@No_PriceQueryBill as No_PriceQueryBill
- FROM #PriceQueryBillProduct
-
- LEFT JOIN Product ON Product.ID_Product = #PriceQueryBillProduct.ID_Product
- WHERE #PriceQueryBillProduct.ID_PriceQueryBill = @ID_PriceQueryBill ORDER BY #PriceQueryBillProduct.No_PriceQueryBillProduct
- Drop Table #PriceQueryBillProduct
- SELECT BillComment.* FROM BillComment WHERE BillComment.ID_Bill = @ID_PriceQueryBill order by BillComment.No_BillComment
- SELECT ReportComment.*, @No_PriceQueryBill as No_PriceQueryBill FROM ReportComment WHERE ReportComment.ID_Bill = @ID_PriceQueryBill order by ReportComment.No_ReportComment">
- <Params>
- <Param name="@No_PriceQueryBill" type="PriceQueryBill.No_PriceQueryBill" Index="0" />
- <Param name="@Count" type="SaleBillProduct.Type_FromBill" Index="1" />
- </Params>
- <Tables>
- <Table name="PriceQueryBill" />
- <Table name="PriceQueryBillProduct" />
- <Table name="BillComment" />
- <Table name="ReportComment" />
- </Tables>
- </SearchPriceQueryBillWithNo1>
- <SearchLowSalePrice CmdType="Text" CmdText="Select * From Product Where ID_Product = @ID_Product">
- <Params>
- <Param name="@ID_Product" type="Product.ID_Product" Index="0" />
- </Params>
- <Tables>
- <Table name="LowSalePrice" />
- </Tables>
- </SearchLowSalePrice>
- <SearchCustomersIsInRegionalLeader CmdType="Text" CmdText="select * from Employee
- where ID_Employee
- in
- (
- Select ID_Employee from Principal
- where ID_RegionalLeader
- in
- (
- select ID_RegionalLeader from Customer
- where No_Customer = @No_Customer
- )
- )
- and Employee.Name_Employee = @Name_Employee
- ">
- <Params>
- <Param name="@No_Customer" type="Customer.No_Customer" />
- <Param name="@Name_Employee" type="Employee.Name_Employee" />
- </Params>
- <Tables>
- <Table name="IsInRegionalLeader" />
- </Tables>
- </SearchCustomersIsInRegionalLeader>
- </Search>
- </Server>
- <Lables>
- <Search>
- Empty();
- NewInstance();
- dtpDate.Enabled = false;
- tbNo.ReadOnly = false;
- tbCustomerNo.ReadOnly = true;
- dtpQueryDate.Enabled = false;
- ntbDiscount.ReadOnly = true;
- dtpValidDate.Enabled = false;
- cbTaxCurrency.Enabled = false;
- cbPrincipal.Enabled = false;
- cbLinkman.Enabled = false;
- cbTele.Enabled = false;
- cbFax.Enabled = false;
- txtSendAddr.ReadOnly = true;
- dgProduct.ReadOnly = true;
- dgRemark.ReadOnly = true;
- dgReport.ReadOnly = true;
- ckSpecial.Enabled=false;
- toolBar.EnableNew = GetRight(@Title,"新增");
- toolBar.EnableSubmit = false;
- toolBar.EnableModify = false;
- toolBar.EnableDelete = false;
- toolBar.EnableAudit = false;
- toolBar.EnablePrint = false;
- toolBar.EnableUnAudit = false;
- toolBar.EnableExport = false;
- toolBar.EnableImport = false;
- #PriceQueryBill.ToGet_PriceQueryBill = 0;
- #PriceQueryBill.Discount_PriceQueryBill = 0;
- #PriceQueryBill.TaxCurrency_PriceQueryBill = "";
- #PriceQueryBill.Currency_PriceQueryBill = "";
- #PriceQueryBill.AssessDate_PriceQueryBill = DBNull();
- #PriceQueryBill.LastModUser_PriceQueryBill = DBNull();
- #PriceQueryBill.LastModDate_PriceQueryBill = DBNull();
- #PriceQueryBill.NumSum = 0;
- #PriceQueryBill.ValidDate_PriceQueryBill = #PQDate.ValiDate;
- UpdateForm(true, "");
- tbNo.Focus();
- @Status = 0;
- </Search>
- <New>
- Empty();
- NewInstance();
- @viewMode = false;
- dtpDate.Enabled = true;
- tbNo.ReadOnly = true;
- tbCustomerNo.ReadOnly = false;
- dtpQueryDate.Enabled = true;;
- ntbDiscount.ReadOnly = false;
- cbTaxCurrency.Enabled = true;
- dtpValidDate.Enabled = true;
- cbPrincipal.Enabled = true;
- cbLinkman.Enabled = true;
- cbTele.Enabled = true;
- cbFax.Enabled = true;
- txtSendAddr.ReadOnly = false;
- dgProduct.ReadOnly = false;
- dgRemark.ReadOnly = false;
- dgReport.ReadOnly = false;
- ckSpecial.Enabled=GetFieldRight(@Title,"最低报价","修改");
- toolBar.EnableNew = false;
- toolBar.EnableSubmit = GetRight(@Title,"新增");
- toolBar.EnableModify = false;
- toolBar.EnableDelete = false;
- toolBar.EnableAudit = false;
- toolBar.EnableUnAudit = false;
- toolBar.EnableExport = false;
- toolBar.EnableImport = true;
- toolBar.EnablePrint = false;
- #PriceQueryBill.ID_PriceQueryBill = NewGuid();
- #PriceQueryBill.ToGet_PriceQueryBill = 0;
- #PriceQueryBill.Discount_PriceQueryBill = 100;
- #PriceQueryBill.TaxCurrency_PriceQueryBill = "外加";
- #PriceQueryBill.Currency_PriceQueryBill = @SysCurrency;
- #PriceQueryBill.ID_Creator = GetLoginUserID();
- #PriceQueryBill.Name_Creator = GetCurrentUser();
- #PriceQueryBill.ID_Assessor = DBNull();
- #PriceQueryBill.AssessDate_PriceQueryBill = DBNull();
- #PriceQueryBill.LastModUser_PriceQueryBill = DBNull();
- #PriceQueryBill.LastModDate_PriceQueryBill = DBNull();
- #PriceQueryBill.ID_Principal = DBNull();
- #PriceQueryBill.NumSum = 0;
- #PriceQueryBill.ValidDate_PriceQueryBill = #PQDate.ValiDate;
- #PriceQueryBill.Date_PriceQueryBill = GetCurrentTime();
- SetColumnDefaultValue("PriceQueryBillProduct", "Discount_PriceQueryBillProduct", #PriceQueryBill.Discount_PriceQueryBill);
- SetColumnDefaultValue("PriceQueryBillProduct", "Quantity_PriceQueryBillProduct", 1);
- UpdateForm(true, "");
- dtpDate.Focus();
- @Status = 1;
- </New>
- <View>
- @viewMode = true;
- dtpDate.Enabled = false;
- tbNo.ReadOnly = false;
- tbCustomerNo.ReadOnly = true;
- ntbDiscount.ReadOnly = true;
- dtpValidDate.Enabled = false;
- dtpQueryDate.Enabled = false;
- cbTaxCurrency.Enabled = false;
- cbPrincipal.Enabled = false;
- cbLinkman.Enabled = false;
- cbTele.Enabled = false;
- cbFax.Enabled = false;
- txtSendAddr.ReadOnly = true;
- dgProduct.ReadOnly = true;
- dgRemark.ReadOnly = true;
- dgReport.ReadOnly = true;
- ckSpecial.Enabled=false;
- toolBar.EnableNew = GetRight(@Title,"新增");
- toolBar.EnableSubmit = false;
- toolBar.EnablePrint = true;
- if(Equals(#PriceQueryBill.ID_Assessor, DBNull()))
- {
- toolBar.EnableModify = GetRight(@Title,"修改");
- toolBar.EnableDelete = GetRight(@Title,"删除");
- toolBar.EnableAudit = GetRight(@Title,"审核");
- toolBar.EnableUnAudit = false;
- }
- else
- {
- toolBar.EnableModify = false;
- toolBar.EnableDelete = false;
- toolBar.EnableAudit = false;
- toolBar.EnableUnAudit = GetRight(@Title,"取消审核");
- }
- toolBar.EnableExport = true;
- toolBar.EnableImport = false;
- UpdateForm(true, "");
- @Status = 2;
- tbNo.Focus();
- <!--if (!Search("SearchCustomersIsInRegionalLeader",tbCustomerNo.CValue, GetCurrentUser()))
- {
- MessageBox("你与客户不在同一个区域,不能填单!");
- tbCustomerNo.Text = "";
- return;
- }-->
- </View>
- <Modify>
- @viewMode = false;
- dtpDate.Enabled = false;
- tbNo.ReadOnly = true;
- tbCustomerNo.ReadOnly = false;
- ntbDiscount.ReadOnly = false;
- dtpQueryDate.Enabled = true;
- dtpValidDate.Enabled = true;
- cbPrincipal.Enabled = true;
- cbLinkman.Enabled = true;
- cbTele.Enabled = true;
- cbFax.Enabled = true;
- txtSendAddr.ReadOnly = false;
- dgProduct.ReadOnly = false;
- dgRemark.ReadOnly = false;
- dgReport.ReadOnly = false;
- ckSpecial.Enabled=GetFieldRight(@Title,"最低报价","修改");
- toolBar.EnableNew = false;
- toolBar.EnableSubmit = GetRight(@Title,"新增");
- toolBar.EnableModify = false;
- toolBar.EnableDelete = false;
- toolBar.EnableAudit = false;
- toolBar.EnableUnAudit = false;
- toolBar.EnableExport = false;
- toolBar.EnablePrint = false;
- toolBar.EnableImport = false;
- #PriceQueryBill.LastModUser_PriceQueryBill = GetLoginUserID();
- #PriceQueryBill.LastModUserName = GetCurrentUser();
- #PriceQueryBill.LastModDate_PriceQueryBill = DateTimeNow();
- SetColumnDefaultValue("PriceQueryBillProduct", "Discount_PriceQueryBillProduct", #PriceQueryBill.Discount_PriceQueryBill);
- SetColumnDefaultValue("PriceQueryBillProduct", "Quantity_PriceQueryBillProduct", 1);
- @HaveAccessed = !Equals(#PriceQueryBill.AssessDate_PriceQueryBill,DBNull());
- if(@HaveAccessed)
- cbTaxCurrency.Enabled = false;
- else
- cbTaxCurrency.Enabled = true;
- UpdateForm(true, "");
- @Status = 3;
- </Modify>
- <SubmitButtonClick>
- <![CDATA[
- if (!Search("SearchCustomerWithNo", tbCustomerNo.CValue) || !Equals(#PriceQueryBill.ID_Customer,#Customer.ID_Customer))
- {
- MessageBox("请输入有效的客户编号,并按回车确认!",@Title);
- tbCustomerNo.Focus();
- return;
- }
- if (!cbTaxCurrency.CheckSelectedItem())
- {
- MessageBox("请选择有效的税别!",@Title);
- tbDetail.SelectedIndex = 0;
- cbTaxCurrency.Focus();
- return;
- }
- if (!cbPrincipal.CheckSelectedItem())
- {
- MessageBox("请选择有效的负责业务!",@Title);
- tbDetail.SelectedIndex = 0;
- cbPrincipal.Focus();
- return;
- }
- if (RowCount("#PriceQueryBillProduct") == 0)
- {
- MessageBox("请输入报价产品!",@Title);
- tbDetail.SelectedIndex = 1;
- dgProduct.Focus();
- return;
- }
- UpdateForm(false, "");
- SuspendLayout();
- @LowDiscount=GetFieldRight(@Title,"最低报价","查看");
- for (@i=0;@i<RowCount("#PriceQueryBillProduct");@i=@i+1)
- {
- SetPosition("#PriceQueryBillProduct", @i);
- if(Equals(#PriceQueryBillProduct.No_Product,""))
- {
- tbDetail.SelectedIndex = 1;
- dgProduct.CurrentRowIndex = @i;
- MessageBox("请填入产品编号!",@Title);
- dgProduct.Focus();
- ResumeLayout();
- return;
- }
- if(Equals(#PriceQueryBillProduct.ID_Product,GuidEmpty()))
- {
- tbDetail.SelectedIndex = 1;
- dgProduct.CurrentRowIndex = @i;
- MessageBox("该产品不存在!",@Title);
- dgProduct.Focus();
- ResumeLayout();
- return;
- }
- if (#PriceQueryBillProduct.Quantity_PriceQueryBillProduct <= 0 || #PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct < 0 || #PriceQueryBillProduct.Discount_PriceQueryBillProduct < 0)
- {
- tbDetail.SelectedIndex = 1;
- dgProduct.CurrentRowIndex = @i;
- if(#PriceQueryBillProduct.Quantity_PriceQueryBillProduct <= 0)
- MessageBox("数量不得小于等于0!",@Title);
- else if(#PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct < 0)
- MessageBox("单价不得小于0!",@Title);
- else
- MessageBox("折扣不得小于0!",@Title);
- dgProduct.Focus();
- ResumeLayout();
- return;
- }
-
- if(ckSpecial.Checked == false && (#PriceQueryBillProduct.Discount_PriceQueryBillProduct<#Customer.LowDiscount_Customer))
- {
- tbDetail.SelectedIndex = 1;
- dgProduct.CurrentRowIndex = @i;
- MessageBox("产品折扣低于客户最低折扣,提交失败!",@Title);
- dgProduct.Focus();
- ResumeLayout();
- return;
- }
-
- Search("SearchLowSalePrice",#PriceQueryBillProduct.ID_Product);
- if(ckSpecial.Checked == false)
- {
- if(cbTaxCurrency.SelectedName=="内含")
- {
- if (#PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct/1.17 < #LowSalePrice.LowSalePrice_Product)
- {
- tbDetail.SelectedIndex = 1;
- dgProduct.CurrentRowIndex = @i;
- MessageBox("产品单价低于最低售价,提交失败!",@Title);
- dgProduct.Focus();
- ResumeLayout();
- return;
- }
- }
- else
- {
- if (#PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct < #LowSalePrice.LowSalePrice_Product)
- {
- tbDetail.SelectedIndex = 1;
- dgProduct.CurrentRowIndex = @i;
- MessageBox("产品单价低于最低售价,提交失败!",@Title);
- dgProduct.Focus();
- ResumeLayout();
- return;
- }
- }
- }
-
-
- if (Equals(#PriceQueryBillProduct.ID_PriceQueryBillProduct,GuidEmpty()))
- #PriceQueryBillProduct.ID_PriceQueryBillProduct = NewGuid();
- #PriceQueryBillProduct.ID_PriceQueryBill =#PriceQueryBill.ID_PriceQueryBill;
- }
- for (@i=RowCount("#BillComment")-1;@i>=0;@i=@i-1)
- {
- SetPosition("#BillComment", @i);
- if(#BillComment.Comment_BillComment=="")
- {
- DeleteRow( "#BillComment",@i);
- continue;
- }
- if (Equals(#BillComment.ID_BillComment,GuidEmpty()))
- #BillComment.ID_BillComment = NewGuid();
- #BillComment.ID_Bill = #PriceQueryBill.ID_PriceQueryBill;
- }
- for (@i=0;@i<RowCount("#ReportComment");@i=@i+1)
- {
- SetPosition("#ReportComment", @i);
- if (Equals(#ReportComment.ID_ReportComment,GuidEmpty()))
- #ReportComment.ID_ReportComment = NewGuid();
- #ReportComment.ID_Bill = #PriceQueryBill.ID_PriceQueryBill;
- }
- ResumeLayout();
- if(@Status == 1)
- {
- #PriceQueryBill.CreateDate_PriceQueryBill=GetCurrentTime();
- #PriceQueryBill.No_PriceQueryBill = New("#PriceQueryBill.No_PriceQueryBill", dtpDate.CValue);
- }
- else if(@Status == 3)
- {
- #PriceQueryBill.LastModDate_PriceQueryBill=GetCurrentTime();
- Update();
- }
- ChangeMode("View");
- ]]>
- </SubmitButtonClick>
- <CountSum>
- <![CDATA[
- if (RowCount("#PriceQueryBillProduct") == 0)
- {
- #PriceQueryBill.NumSum = 0;
- #PriceQueryBill.GoodsAmount_PriceQueryBill = 0;
- #PriceQueryBill.TaxAmount_PriceQueryBill = 0;
- #PriceQueryBill.Amount_PriceQueryBill = 0;
- }
- else
- {
- #PriceQueryBill.NumSum = SumOfCol("#PriceQueryBillProduct.Quantity_PriceQueryBillProduct");
- switch (cbTaxCurrency.SelectedName)
- {
- case "外加":
- #PriceQueryBill.GoodsAmount_PriceQueryBill = SumOfCol("#PriceQueryBillProduct.Amount_PriceQueryBillProduct");
- #PriceQueryBill.TaxAmount_PriceQueryBill=0;
- SuspendLayout();
- for(@i=0;@i < RowCount("#PriceQueryBillProduct");@i++)
- {
- SetPosition("#PriceQueryBillProduct",@i);
- #PriceQueryBill.TaxAmount_PriceQueryBill +=FormatNumber(#PriceQueryBillProduct.Amount_PriceQueryBillProduct * @CessOut, #SystemSetting.PriceDecimal_SystemSetting);
- }
- ResumeLayout();
- #PriceQueryBill.Amount_PriceQueryBill = #PriceQueryBill.GoodsAmount_PriceQueryBill + #PriceQueryBill.TaxAmount_PriceQueryBill;
- break;
- case "内含":
- #PriceQueryBill.Amount_PriceQueryBill = SumOfCol("#PriceQueryBillProduct.Amount_PriceQueryBillProduct");
-
- #PriceQueryBill.TaxAmount_PriceQueryBill = 0;
- SuspendLayout();
- for(@i=0;@i < RowCount("#PriceQueryBillProduct");@i++)
- {
- SetPosition("#PriceQueryBillProduct",@i);
- #PriceQueryBill.TaxAmount_PriceQueryBill +=FormatNumber(#PriceQueryBillProduct.Amount_PriceQueryBillProduct * @CessOut / (1 + @CessOut), #SystemSetting.PriceDecimal_SystemSetting);
- }
- ResumeLayout();
- #PriceQueryBill.GoodsAmount_PriceQueryBill = #PriceQueryBill.Amount_PriceQueryBill - #PriceQueryBill.TaxAmount_PriceQueryBill;
- break;
- case "零税":
- case "免税":
- #PriceQueryBill.GoodsAmount_PriceQueryBill = SumOfCol("#PriceQueryBillProduct.Amount_PriceQueryBillProduct");
- #PriceQueryBill.TaxAmount_PriceQueryBill = 0;
- #PriceQueryBill.Amount_PriceQueryBill = #PriceQueryBill.GoodsAmount_PriceQueryBill;
- break;
- }
- }
- UpdateForm(true, "ntbNumSum");
- UpdateForm(true, "ntbTaxSum");
- UpdateForm(true, "ntbMoneySum");
- UpdateForm(true, "ntbSum");
- ]]>
- </CountSum>
- <CountPrice>
- <![CDATA[
- if (RowCount("#PriceQueryBillProduct") != 0)
- {
- switch (cbTaxCurrency.SelectedName)
- {
- case "内含":
- SuspendLayout();
- for(@j=0;@j<RowCount("#PriceQueryBillProduct");@j=@j+1)
- {
- SetPosition("#PriceQueryBillProduct", @j);
- if(Search("SearchProductWithNo",#PriceQueryBillProduct.No_Product))
- {
- @Price=#Product.Price_Product;
- #PriceQueryBillProduct.OrderPrice_PriceQueryBillProduct=FormatNumber(@Price*(1 + @CessOut),@PriceDecimal);
- #PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct = FormatNumber(#PriceQueryBillProduct.OrderPrice_PriceQueryBillProduct*#PriceQueryBillProduct.Discount_PriceQueryBillProduct/100,@PriceDecimal);
- }
- }
- ResumeLayout();
- break;
- case "外加":
- case "零税":
- case "免税":
- SuspendLayout();
- for(@j=0;@j<RowCount("#PriceQueryBillProduct");@j=@j+1)
- {
- SetPosition("#PriceQueryBillProduct", @j);
-
- if(Search("SearchProductWithNo",#PriceQueryBillProduct.No_Product))
- {
- @Price=#Product.Price_Product;
- #PriceQueryBillProduct.OrderPrice_PriceQueryBillProduct=@Price;
- #PriceQueryBillProduct.UnitPrice_PriceQueryBillProduct = FormatNumber(#PriceQueryBillProduct.OrderPrice_PriceQueryBillProduct*#PriceQueryBillProduct.Discount_PriceQueryBillProduct/100,@PriceDecimal);
- }
- }
- ResumeLayout();
- break;
- }
-
- }
- ]]>
- </CountPrice>
- <ChangeDiscount>
- <![CDATA[
- if (RowCount("#PriceQueryBillProduct") > 0)
- {
- SuspendLayout();
- for (@a=0;@a<RowCount("#PriceQueryBillProduct");@a=@a+1)
- {
- SetPosition("#PriceQueryBillProduct", @a);
- #PriceQueryBillProduct.Discount_PriceQueryBillProduct = #PriceQueryBill.Discount_PriceQueryBill;
- }
- ResumeLayout();
- }
- SetColumnDefaultValue("PriceQueryBillProduct", "Discount_PriceQueryBillProduct", #PriceQueryBill.Discount_PriceQueryBill);
- ]]>
- </ChangeDiscount>
- <AuditLable>
- BeginAudit();
- #PriceQueryBill.ID_Assessor = GetLoginUserID();
- #PriceQueryBill.Name_Assessor = GetCurrentUser();
- #PriceQueryBill.AssessDate_PriceQueryBill = DateTimeNow();
- Audit();
- ChangeMode("View");
- EndAudit();
- <Lable name="CountSum" />
- </AuditLable>
- <AvailableQty_ProductStocks>
- <![CDATA[
- SuspendLayout();
- for (@i=0;@i<RowCount("#PriceQueryBillProduct");@i=@i+1)
- {
- SetPosition("#PriceQueryBillProduct", @i);
- Search("SearchAvailableQty",#PriceQueryBillProduct.No_Product);
- #PriceQueryBillProduct.AvailableQty_ProductStocks = #AvailableQty.AvailableQty_ProductStocks;
- UpdateForm(true, "");
- }
- ResumeLayout();
- ]]>
- </AvailableQty_ProductStocks>
- </Lables>
- </Form>
- </Forms>
|