12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501 |
- <?xml version="1.0" encoding="UTF-8"?>
- <Forms>
- <Form Name="FrmSaleInvoicce">
- <Client>
- <Events>
- <Load>
- <![CDATA[
- @Title="销项发票";
- GetSchema();
- Search("SearchCessOut");
-
- Search("SearchSaleBillProduct","p","p");
- Search("SearchSaleRtnBillProduct","p","p");
- Search("SearchProduct","p");
-
- @CessOut=#SystemSetting.CessOut_SystemSetting/100;
- @PriceDecimal=#SystemSetting.PriceDecimal_SystemSetting;
- @SysCurrency=#SystemSetting.SysCurrency_SystemSetting;
- SetColumnDefaultValue("SaleInvoiceProduct", "TaxRate_SaleInvoiceProduct",@CessOut);
- ChangeMode("Search");
- Search("SearchBillType");
- Search("SearchTemp");
- ]]>
- </Load>
- <Closing>
- ;<!--TODO-->
- </Closing>
- <Closed>
- ;<!--TODO-->
- </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>
- <IKTextButton name="tbNo" DataSource="SaleInvoice.No_SaleInvoice">
- <Events>
- <Enter>
- if(tbNo.ReadOnly == false)
- {
- if(tbNo.CValue != StringEmpty())
- {
- UpdateForm(false, "");
- if(Search("SearchSaleInvoiceWithNo", tbNo.CValue))
- {
- ChangeMode("View",#SaleInvoice.ID_Assessor);
- if(#SaleInvoice.Disable_SaleInvoice==true)
- ikGradualLabel1.Text=ikGradualLabel1.Text+"(已作废)";
- <Lable name="CountSum"/>
- }
- else
- {
- MessageBox("该销项发票不存在!",@Title);
- }
-
- }
- else
- {
- MessageBox("请输入销项发票单号!", @Title);
- }
- }
- </Enter>
- <Click>
- ShowSearchBox("BillSearch","NODEPOT", "tbNo", tbNo.CValue);
- </Click>
- </Events>
- </IKTextButton>
- <IKDataTimePicker name="dtDate" DataSource="SaleInvoice.Date_SaleInvoice" />
- <IKComboBoxEx name="cbType" DisplaySource="SaleInvoice.TypeName">
- <Events>
- <SelectedIndexChanged>
- #SaleInvoice.Type_SaleInvoice=cbType.SelectedIndex;
- </SelectedIndexChanged>
- </Events>
- </IKComboBoxEx>
- <IKDataTimePicker name="dtInvoiceDate" DataSource="SaleInvoice.InvoiceDate_SaleInvoice" >
- <Events>
- <ValueChanged>
- if(!Equals(#SaleInvoice.ID_Customer,GuidEmpty()))
- {
- if(Equals(#SaleInvoice.GetMethod_Customer,"先款后货"))
- #SaleInvoice.PayDate_SaleInvoice=dtInvoiceDate.Value;
- else if(Equals(#SaleInvoice.GetMethod_Customer,"票到当月结"))
- {
- Search("SearchPayDate",dtInvoiceDate.Value,#Customer.DunDate_Customer);
- #SaleInvoice.PayDate_SaleInvoice= #PayDate.NextEndDate;
- }
- else if(Equals(#SaleInvoice.GetMethod_Customer,"两月结"))
- {
- Search("SearchPayDate2",dtInvoiceDate.Value,#Customer.DunDate_Customer);
- #SaleInvoice.PayDate_SaleInvoice=#PayDate2.NextEndDate;
- }
- else if(Equals(#SaleInvoice.GetMethod_Customer,"三月结"))
- {
- Search("SearchPayDate3",dtInvoiceDate.Value,#Customer.DunDate_Customer);
- #SaleInvoice.PayDate_SaleInvoice=#PayDate3.NextEndDate;
- }
- else if(Equals(#SaleInvoice.GetMethod_Customer,"四月结"))
- {
- Search("SearchPayDate4",dtInvoiceDate.Value,#Customer.DunDate_Customer);
- #SaleInvoice.PayDate_SaleInvoice=#PayDate4.NextEndDate;
- }
- else if(Equals(#SaleInvoice.GetMethod_Customer,"票到付款"))
- {
- Search("SearchPayDate5",dtInvoiceDate.Value,#Customer.DunDate_Customer);
- #SaleInvoice.PayDate_SaleInvoice=#PayDate5.NextEndDate;
- }
- UpdateForm(true,"dtPayDate");
- }
- </ValueChanged>
- </Events>
- </IKDataTimePicker>
- <IKTextBox name="txtInvoiceNo" DataSource="SaleInvoice.No_Invoice"/>
- <IKButton name="btnModify">
- <Events>
- <Click>
- if(Equals(btnModify.Text,"修改"))
- {
- txtInvoiceNo.ReadOnly=false;
- btnModify.Text="保存";
- }
- else
- {
- if(Equals(txtInvoiceNo.CValue,""))
- {
- MessageBox("请填入发票编号!",@Title);
- txtInvoiceNo.Focus();
- }
- else
- {
- if(Search("SearchInvoiceNo",txtInvoiceNo.CValue,#SaleInvoice.No_SaleInvoice))
- {
- MessageBox("此发票号码已存在,请重新填入发票编号!",@Title);
- txtInvoiceNo.Focus();
- return;
- }
- else
- {
- #SaleInvoice.LastModUser=GetCurrentUser();
- #SaleInvoice.LastModUser_SaleInvoice=GetLoginUserID();
- #SaleInvoice.LastModDate_SaleInvoice=GetCurrentTime();
- UpdateForm(false,"");
- #SaleInvoice.Type_SaleInvoice=cbType.SelectedIndex;
- Update();
- txtInvoiceNo.ReadOnly=true;
- btnModify.Text="修改";
- }
- }
- }
- </Click>
- </Events>
- </IKButton>
- <IKTextBox name="txtMaker" DataSource="SaleInvoice.Creator" />
- <IKTextButton name="tbCustomerNo" DataSource="SaleInvoice.No_Customer" >
- <Events>
- <Enter>
- UpdateForm(false,"");
- if(tbCustomerNo.CValue!=StringEmpty())
- {
- if(!Search("SearchCustomer",tbCustomerNo.CValue))
- {
- MessageBox("该客户不存在!",@Title);
- @temp = ShowSearchBox("CustomerSearch","INFOMATION",tbCustomerNo.CValue);
- if(@temp != "")
- {
- tbCustomerNo.CValue = @temp;
- ActiveControlEvent("tbCustomerNo", "Enter");
- }
- }
- else
- {
- if(!Equals(#Customer.SuspendDate_Customer,DBNull()))
- {
- MessageBox("该客户已暂停!",@Title);
- }
- #SaleInvoice.ID_Customer=#Customer.ID_Customer;
- #SaleInvoice.ShortName_Customer=#Customer.ShortName_Customer;
- #SaleInvoice.RevenueRegisterNo_Customer=#Customer.RevenueRegisterNo_Customer;
- #SaleInvoice.Bank_SaleInvoice=#Customer.Bank_Customer;
- #SaleInvoice.Account_SaleInvoice=#Customer.Account_Customer;
- #SaleInvoice.GetMethod_Customer=#Customer.GetMethod_Customer;
- #SaleInvoice.InvoiceTitle_SaleInvoice=#Customer.Title_Invoice;
- #SaleInvoice.InvoiceAddress_SaleInvoice=#Customer.Address_Invoice;
- #SaleInvoice.Company_Customer=#Customer.Company_Customer;
- if(Equals(#SaleInvoice.GetMethod_Customer,"先款后货"))
- #SaleInvoice.PayDate_SaleInvoice=dtInvoiceDate.Value;
- else if(Equals(#SaleInvoice.GetMethod_Customer,"票到当月结"))
- {
- Search("SearchPayDate",dtInvoiceDate.Value,#Customer.DunDate_Customer);
- #SaleInvoice.PayDate_SaleInvoice= #PayDate.NextEndDate;
- }
- else if(Equals(#SaleInvoice.GetMethod_Customer,"两月结"))
- {
- Search("SearchPayDate2",dtInvoiceDate.Value,#Customer.DunDate_Customer);
- #SaleInvoice.PayDate_SaleInvoice=#PayDate2.NextEndDate;
- }
- else if(Equals(#SaleInvoice.GetMethod_Customer,"三月结"))
- {
- Search("SearchPayDate3",dtInvoiceDate.Value,#Customer.DunDate_Customer);
- #SaleInvoice.PayDate_SaleInvoice=#PayDate3.NextEndDate;
- }
- else if(Equals(#SaleInvoice.GetMethod_Customer,"四月结"))
- {
- Search("SearchPayDate4",dtInvoiceDate.Value,#Customer.DunDate_Customer);
- #SaleInvoice.PayDate_SaleInvoice=#PayDate4.NextEndDate;
- }
- else if(Equals(#SaleInvoice.GetMethod_Customer,"票到付款"))
- {
- Search("SearchPayDate5",dtInvoiceDate.Value,#Customer.DunDate_Customer);
- #SaleInvoice.PayDate_SaleInvoice=#PayDate5.NextEndDate;
- }
- }
- }
- else
- {
- MessageBox("请输入客户编号!",@Title);
- #SaleInvoice.ID_Customer=GuidEmpty();
- #SaleInvoice.ShortName_Customer="";
- #SaleInvoice.InvoiceTitle_SaleInvoice="";
- #SaleInvoice.InvoiceAddress_SaleInvoice="";
- #SaleInvoice.RevenueRegisterNo_Customer="";
- #SaleInvoice.Bank_SaleInvoice="";
- #SaleInvoice.Account_SaleInvoice="";
- #SaleInvoice.GetMethod_Customer="";
- #SaleInvoice.Company_Customer="";
- tbCustomerNo.Focus();
- }
- UpdateForm(true,"");
- </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="txtCustomerName" DataSource="SaleInvoice.ShortName_Customer"/>
- <IKComboBoxEx name="cbInvoiceTitle" DisplaySource="SaleInvoice.InvoiceTitle_SaleInvoice" DataSource="InvoiceTitle" DisplayMember="Title_Invoice">
- <Events>
- <Reload>
- UpdateForm(false, "cbInvoiceTitle");
- Search("SearchInvoiceTitle",#SaleInvoice.ID_Customer);
- UpdateForm(true, "cbInvoiceTitle");
- </Reload>
- </Events>
- </IKComboBoxEx>
- <IKComboBoxEx name="cbInvoiceAddress" DisplaySource="SaleInvoice.InvoiceAddress_SaleInvoice" DataSource="InvoiceAddress" DisplayMember="Address_Invoice">
- <Events>
- <Reload>
- UpdateForm(false, "cbInvoiceAddress");
- Search("SearchInvoiceAddress",#SaleInvoice.ID_Customer);
- UpdateForm(true, "cbInvoiceAddress");
- </Reload>
- </Events>
- </IKComboBoxEx>
- <IKComboBoxEx name="cbCurrency" DisplaySource="SaleInvoice.Currency_SaleInvoice" />
- <IKTextBox name="ikTextBox1" DataSource="SaleInvoice.RevenueRegisterNo_Customer"/>
- <IKComboBoxEx name="cbBank" DisplaySource="SaleInvoice.Bank_SaleInvoice" DataSource="Bank" DisplayMember="Name_TypeDef">
- <Events>
- <Reload>
- UpdateForm(false, "cbBank");
- Search("SearchBank");
- UpdateForm(true, "cbBank");
- </Reload>
- </Events>
- </IKComboBoxEx>
- <IKTextBox name="txtAccount" DataSource="SaleInvoice.Account_SaleInvoice" />
- <IKTextBox name="ikTextBox3" DataSource="SaleInvoice.GetMethod_Customer" />
- <IKTextBox name="txtCompany" DataSource="SaleInvoice.Company_Customer" />
- <IKDataTimePicker name="dtPayDate" DataSource="SaleInvoice.PayDate_SaleInvoice" />
- <IKTextBox name="txtAssessor" DataSource="SaleInvoice.Assessor" />
- <IKDateTimeText name="dtAssessDate" DataSource="SaleInvoice.AssessDate_SaleInvoice" />
- <IKTextBox name="txtLastModUser" DataSource="SaleInvoice.LastModUser"/>
- <IKDateTimeText name="dtLastModDate" DataSource="SaleInvoice.LastModDate_SaleInvoice"/>
- <IKNumericTextBox name="txtMoneySum" DataSource="SaleInvoice.GoodsAmount_SaleInvoice"/>
- <IKNumericTextBox name="txtTaxSum" DataSource="SaleInvoice.TaxAmount_SaleInvoice"/>
- <IKNumericTextBox name="txtSum" DataSource="SaleInvoice.Amount_SaleInvoice"/>
- <IKDataGridEx name="dgProduct" DataSource="SaleInvoiceProduct" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="SaleInvoiceProduct.Name_BillType" >
- <IKDataGridComboBoxColumn DisplaySourceEx="SaleInvoiceProduct.Name_BillType" ValueSourceEx="SaleInvoiceProduct.Type_FromBill" DataSourceEx="BillType" DisplayMemberEx="Name_BillType" ValueMemberEx="Value_BillType">
- <Events>
- <Reload>
- Search("SearchBillType");
- SetDataGridColumnDataSource(0,"dgProduct");
- </Reload>
- </Events>
- </IKDataGridComboBoxColumn>
- </DataColumn>
- <DataColumn Index="1" DataSource="SaleInvoiceProduct.No_FromBill" />
- <DataColumn Index="2" DataSource="SaleInvoiceProduct.No_FromBillProduct" />
- <DataColumn Index="3" DataSource="SaleInvoiceProduct.No_Customer" />
- <DataColumn Index="4" DataSource="SaleInvoiceProduct.ShortName_Customer" />
- <DataColumn Index="5" DataSource="SaleInvoiceProduct.No_Product" >
- <IKDataGridTextButtonColumn>
- <Events>
- <Click>
- ShowSearchBox("ProductSearch","INFOMATION",#SaleInvoiceProduct.No_Product);
- </Click>
- </Events>
- </IKDataGridTextButtonColumn>
- </DataColumn>
- <DataColumn Index="6" DataSource="SaleInvoiceProduct.Name_Product" />
- <DataColumn Index="7" DataSource="SaleInvoiceProduct.InvoiceName_Product" />
- <DataColumn Index="8" DataSource="SaleInvoiceProduct.Unit_Product" />
- <DataColumn Index="9" DataSource="SaleInvoiceProduct.Quantity_SaleInvoiceProduct" />
- <DataColumn Index="10" DataSource="SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct" />
- <DataColumn Index="11" DataSource="SaleInvoiceProduct.Amount_SaleInvoiceProduct" />
- <DataColumn Index="12" DataSource="SaleInvoiceProduct.TaxRate_SaleInvoiceProduct" />
- <DataColumn Index="13" DataSource="SaleInvoiceProduct.TaxAmount_SaleInvoiceProduct" />
- <DataColumn Index="14" DataSource="SaleInvoiceProduct.TaxCurrency_SaleInvoiceProduct" />
- <DataColumn Index="15" DataSource="SaleInvoiceProduct.GoodsAmount_SaleInvoiceProduct" />
- <DataColumn Index="16" DataSource="SaleInvoiceProduct.Comment_SaleInvoiceProduct" />
- </IKDataGridEx>
- <IKDateTimePicker name = "dtStart" DataSource="SaleInvoice.StartDate">
- <Events>
- <CheckedChanged>
- dtEnd.Checked = dtStart.Checked;
- </CheckedChanged>
- <ValueChanged>
- dtEnd.CValue = dtStart.CValue;
- </ValueChanged>
- </Events>
- </IKDateTimePicker>
- <IKDateTimePicker name = "dtEnd" DataSource="SaleInvoice.EndDate"/>
- <IKCheckBox name="ckRtn" DataSource="SaleInvoice.ckRtn"/>
- <IKButton name ="btnSearch">
- <Events>
- <Click>
- MergeTable("#SaleInvoiceProduct","#Temp");
- Empty("#SaleInvoiceProduct");
- @DateStart = null;
- @DateEnd = null;
- @ckRtn = 0;
- if (dtStart.Checked)
- @DateStart = dtStart.CValue;
- else
- {
- MessageBox("请选择日期!");
- return;
- }
- if (dtEnd.Checked)
- @DateEnd = dtEnd.CValue;
-
- if (ckRtn.Checked)
- {
- @ckRtn = 1;
- if(Search("SearchAllSaleAndRtnBill",#SaleInvoice.No_Customer,@DateStart,@DateEnd,@ckRtn))
- {
- MergeTable("#SaleInvoiceProduct1","#SaleInvoiceProduct");
- }
- }
- else
- {
- @ckRtn = 0;
- if(Search("SearchAllSale",#SaleInvoice.No_Customer,@DateStart,@DateEnd,@ckRtn))
- MergeTable("#SaleInvoiceProduct2","#SaleInvoiceProduct");
- }
- dgProduct.SetColumnReadOnly(14,true);
- <Lable name="CountSum"/>
- </Click>
- </Events>
- </IKButton>
- <IKFormToolBar name="toolBar">
- <Events>
- <ClickFirst>
- if(Search("SearchSaleInvoiceFirst"))
- {
- ChangeMode("View",#SaleInvoice.ID_Assessor);
- if(#SaleInvoice.Disable_SaleInvoice==true)
- ikGradualLabel1.Text=ikGradualLabel1.Text+"(已作废)";
- <Lable name="CountSum"/>
- }
- </ClickFirst>
- <ClickPrev>
- if(Search("SearchSaleInvoicePrevious", tbNo.CValue))
- {
- ChangeMode("View",#SaleInvoice.ID_Assessor);
- if(#SaleInvoice.Disable_SaleInvoice==true)
- ikGradualLabel1.Text=ikGradualLabel1.Text+"(已作废)";
- <Lable name="CountSum"/>
- }
- </ClickPrev>
- <ClickNext>
- if(Search("SearchSaleInvoiceNext",tbNo.CValue))
- {
- ChangeMode("View",#SaleInvoice.ID_Assessor);
- if(#SaleInvoice.Disable_SaleInvoice==true)
- ikGradualLabel1.Text=ikGradualLabel1.Text+"(已作废)";
- <Lable name="CountSum"/>
- }
- </ClickNext>
- <ClickLast>
- if(Search("SearchSaleInvoiceLast"))
- {
- ChangeMode("View",#SaleInvoice.ID_Assessor);
- if(#SaleInvoice.Disable_SaleInvoice==true)
- ikGradualLabel1.Text=ikGradualLabel1.Text+"(已作废)";
- <Lable name="CountSum"/>
- }
- </ClickLast>
- <ClickNew>
- <![CDATA[
- @NextNo = GetNextAutoNumber(true);
- if (!Equals(@NextNo, ""))
- {
- ChangeMode("New");
- #SaleInvoice.No_SaleInvoice= @NextNo;
- UpdateForm(true, "tbNo");
- }
- ]]>
- </ClickNew>
- <ClickEmpty>
- ChangeMode("Search");
- </ClickEmpty>
- <ClickSubmit>
- <Lable name="SubmitButtonClick" />
- </ClickSubmit>
- <ClickModify>
- ChangeMode("Modify");
- <Lable name="CountSum"/>
- </ClickModify>
- <ClickDelete>
- Delete();
- ChangeMode("Search");
- </ClickDelete>
- <ClickBlank>
- BeginBlank();
- #SaleInvoice.Disable_SaleInvoice=true;
- Blank();
- EndBlank();
- ChangeMode("View",#SaleInvoice.ID_Assessor);
- if(#SaleInvoice.Disable_SaleInvoice==true)
- ikGradualLabel1.Text=ikGradualLabel1.Text+"(已作废)";
- <Lable name="CountSum"/>
- </ClickBlank>
- <ClickPrint>
- ShowPrintBox("BillSearch",#SaleInvoice.No_SaleInvoice,#SaleInvoice.No_SaleInvoice);
- </ClickPrint>
- <ClickAudit>
- <![CDATA[
- SuspendLayout();
- for (@i=0;@i<RowCount("#SaleInvoiceProduct");@i=@i+1)
- {
- SetPosition("#SaleInvoiceProduct", @i);
- if(Equals(#SaleInvoiceProduct.Name_BillType,"销货单"))
- {
- if(Search("SearchSaleBill",#SaleInvoiceProduct.No_FromBill,#SaleInvoiceProduct.No_FromBillProduct))
- {
- if (Equals(#SaleBill.ID_Assessor,DBNull()))
- {
- tbDetail.SelectedIndex = 1;
- dgProduct.CurrentRowIndex = @i;
- MessageBox("该来源单据未经审核,审核失败!",@Title);
- dgProduct.Focus();
- ResumeLayout();
- return;
- }
- if (!Search("SearchCustomerRelation",#SaleInvoice.ID_Customer,#SaleBill.ID_Customer))
- {
- tbDetail.SelectedIndex = 1;
- dgProduct.CurrentRowIndex = @i;
- MessageBox("该来源单据的客户与本销项发票的客户或下级客户不一致,审核失败!",@Title);
- dgProduct.Focus();
- ResumeLayout();
- return;
- }
- }
-
- }
- if(Equals(#SaleInvoiceProduct.Name_BillType,"销售退货单"))
- {
- if(Search("SearchSaleRtnBill",#SaleInvoiceProduct.No_FromBill,#SaleInvoiceProduct.No_FromBillProduct))
- {
- if (Equals(#SaleRtnBill.ID_Assessor,DBNull()))
- {
- tbDetail.SelectedIndex = 1;
- dgProduct.CurrentRowIndex = @i;
- MessageBox("该来源单据未经审核,提交失败!",@Title);
- dgProduct.Focus();
- ResumeLayout();
- return;
- }
- if (!Search("SearchCustomerRelation",#SaleInvoice.ID_Customer,#SaleRtnBill.ID_Customer))
- {
- tbDetail.SelectedIndex = 1;
- dgProduct.CurrentRowIndex = @i;
- MessageBox("该来源单据的客户与本销项发票的客户或下级客户不一致,审核失败!",@Title);
- dgProduct.Focus();
- ResumeLayout();
- return;
- }
- }
-
- }
- }
- ResumeLayout();
- ]]>
- BeginAudit();
- #SaleInvoice.ID_Assessor=GetLoginUserID();
- #SaleInvoice.Assessor=GetCurrentUser();
- #SaleInvoice.AssessDate_SaleInvoice=DateTimeNow();
- Audit();
- ChangeMode("View",#SaleInvoice.ID_Assessor);
- EndAudit();
- <Lable name="CountSum"/>
- </ClickAudit>
- <ClickUnAudit>
- BeginUnAudit();
- #SaleInvoice.ID_Assessor=DBNull();
- #SaleInvoice.Assessor=DBNull();
- #SaleInvoice.AssessDate_SaleInvoice=DataTimeNow();
- UnAudit();
- ChangeMode("View",#SaleInvoice.ID_Assessor);
- EndUnAudit();
- <Lable name="CountSum"/>
- </ClickUnAudit>
- <ClickImportItem>
- <![CDATA[
- if((@Status == 1 || @Status == 3) && toolBar.MenuItemText=="销售退货单")
- {
- if(Search("SearchContr"))
- {
- ShowSearchBox("ImportSaleRtnBillControl","BILLCONVERTEX","#SaleInvoiceProduct.Type_FromBill",22,"#SaleInvoiceProduct.Name_BillType","销售退货单");
- }
- else
- {
- ShowSearchBox("ImportSaleRtnBillUnControl","BILLCONVERTEX");
- }
- }
- else if((@Status == 1 || @Status == 3) && toolBar.MenuItemText=="销货单")
- {
- @ImportClicked = 1;
- if(Search("SearchContrSOB"))
- {
- ShowSearchBox("ImportSaleBillControl","BILLCONVERTEX","#SaleInvoiceProduct.Type_FromBill",21,"#SaleInvoiceProduct.Name_BillType","销货单");
- }
- else
- {
- ShowSearchBox("ImportSaleBillUnControl","BILLCONVERTEX");
- }
- }
- ]]>
- <!--使用前先访问ToolBar的MenuItemText属性以确定选中的是那一项-->
- </ClickImportItem>
- <ClickExport>
- ;
- </ClickExport>
- <ClickClose>
- ;
- </ClickClose>
- <ClickExpand>
- ;
- </ClickExpand>
- </Events>
- </IKFormToolBar>
- </Controls>
- <Tables>
- <Table name="SaleInvoiceProduct">
- <Events>
- <ColumnsChanged>
- <Name_BillType>
- <Lable name="FromBillChange"/>
- <Lable name="CountSum" />
- </Name_BillType>
- <No_FromBill>
- <Lable name="FromBillChange"/>
- <Lable name="CountSum" />
- </No_FromBill>
- <No_FromBillProduct>
- <Lable name="FromBillChange"/>
- <Lable name="CountSum" />
- </No_FromBillProduct>
- <No_Product>
- if(Equals(#SaleInvoiceProduct.No_Product,"") || !Search("SearchProduct",#SaleInvoiceProduct.No_Product))
- {
- if(!Equals(#SaleInvoiceProduct.No_Product,""))
- MessageBox("该产品不存在!",@Title);
- #SaleInvoiceProduct.ID_Product=GuidEmpty();
- #SaleInvoiceProduct.Name_Product="";
- #SaleInvoiceProduct.Unit_Product="";
- #SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct=0.00;
- #SaleInvoiceProduct.InvoiceName_Product="";
- @temp = ShowSearchBox("InputSearchProduct","INFOMATION",#SaleInvoiceProduct.No_Product);
- if(@temp != "")
- {
- ResumeColumnEvent("#SaleInvoiceProduct.No_Product");
- #SaleInvoiceProduct.No_Product = @temp;
- ClearColumnEvent();
- }
- }
- else
- {
- #SaleInvoiceProduct.ID_Product=#Product.ID_Product;
- #SaleInvoiceProduct.Name_Product=#Product.Name_Product;
- #SaleInvoiceProduct.Unit_Product=#Product.Unit_Product;
- #SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct=#Product.Price_Product;
- #SaleInvoiceProduct.InvoiceName_Product=#Product.InvoiceName_Product;
- }
- <Lable name="CountAmount"/>
- <Lable name="CountSum"/>
- </No_Product>
- <Quantity_SaleInvoiceProduct>
- <Lable name="CountAmount"/>
- <Lable name="CountSum"/>
- </Quantity_SaleInvoiceProduct>
- <UnitPrice_SaleInvoiceProduct>
- <Lable name="CountAmount"/>
- <Lable name="CountSum"/>
- </UnitPrice_SaleInvoiceProduct>
- <TaxRate_SaleInvoiceProduct>
- <Lable name="CountAmount"/>
- <Lable name="CountSum"/>
- </TaxRate_SaleInvoiceProduct>
- <TaxCurrency_SaleInvoiceProduct>
- <Lable name="CountAmount"/>
- <Lable name="CountSum"/>
- </TaxCurrency_SaleInvoiceProduct>
- </ColumnsChanged>
- <RowDeleted>
- <Lable name="CountSum"/>
- </RowDeleted>
- </Events>
- </Table>
- </Tables>
- <LockInfomation LockID="ID_SaleInvoice" LockNO="No_SaleInvoice" LockSearchFunction="SearchSaleInvoiceWithNo" LockAudit="ID_Assessor" LockBlank="Disable_SaleInvoice" />
- <LogInfomation LogNO="#SaleInvoice.No_SaleInvoice" RecordFormField="发票号码:#SaleInvoice.No_Invoice,客户编号:#SaleInvoice.No_Customer,银行帐号:#SaleInvoice.Account_Customer" RecordDataGridField="#SaleInvoiceProduct.No_Product,#SaleInvoiceProduct.Quantity_SaleInvoiceProduct,#SaleInvoiceProduct.Amount_SaleInvoiceProduct"/>
- <ChildForms>
- <ChildForm name="BillSearch" DataSource="SaleInvoice" SearchFunction="SearchAllBill" SearchFunctionByNo="SearchSaleInvoiceWithNo">
- <DataColumn Index="0" MappingName="#SaleInvoice.No_SaleInvoice" HeaderText="销项发票单号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="1" MappingName="#SaleInvoice.Date_SaleInvoice" HeaderText="制单日期" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="2" MappingName="#SaleInvoice.ShortName_Customer" HeaderText="客户简称" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="3" MappingName="#SaleInvoice.No_Invoice" HeaderText="发票号码" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="4" MappingName="#SaleInvoice.AllAmount" HeaderText="发票含税金额" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="5" MappingName="#SaleInvoice.Disable_SaleInvoice" HeaderText="是否作废" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
- </ChildForm>
- <ChildForm name="CustomerSearch" DataSource="Customer" SearchFunction="SearchAllCustomer" 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.IsGeneric_Customer" HeaderText="一般客户" Width="75" ColumnType="IKDataGridBoolColumn"/>
- </ChildForm>
- <ChildForm name="ProductSearch" DataSource="Product" SearchFunction="SearchAllProduct" SearchFunctionByNo="" MappingName="产品" ReturnDataSource="SaleInvoiceProduct" ShowCheckBox="true">
- <DataColumn Index="0" MappingName="#Product.No_Product" HeaderText="产品编号" Width="120" ColumnType="IKDataGridTextBoxColumn" ReturnMappingName="#SaleInvoiceProduct.No_Product"/>
- <DataColumn Index="1" MappingName="#Product.Name_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"/>
- </ChildForm>
- <ChildForm name="ImportSaleBillControl" >
- <DataGridIndex DataSource="SaleBill" SearchFunction="SearchAllSaleBill" SearchFunctionStandby="SearchAllSaleBillProduct" SearchFunctionByNo="" MappingName="" ReturnDataSource="SaleInvoiceProduct">
- <DataColumn Index="0" MappingName="#SaleBill.No_SaleBill" ReadOnly="true" HeaderText="单据编号" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="child"/>
- <DataColumn Index="1" MappingName="#SaleBill.Date_SaleBill" ReadOnly="true" HeaderText="制单日期" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="child"/>
- <DataColumn Index="2" MappingName="#SaleBill.No_Customer" ReadOnly="true" HeaderText="客户编号" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="parent" ReturnMappingName="#SaleInvoice.No_Customer"/>
- <DataColumn Index="3" MappingName="#SaleBill.ShortName_Customer" ReadOnly="true" HeaderText="客户简称" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="child"/>
- <DataColumn Index="4" MappingName="#SaleBill.TaxCurrency_SaleBill" ReadOnly="true" HeaderText="税别" Width="30" ColumnType="IKDataGridTextBoxColumn" ReturnPath="child" />
- <DataColumn Index="5" MappingName="#SaleBill.Currency_SaleBill" ReadOnly="true" HeaderText="币别" Width="30" ColumnType="IKDataGridTextBoxColumn" ReturnPath="parent"/>
- <DataColumn Index="6" MappingName="#SaleBill.State_SaleBill" ReadOnly="true" HeaderText="单据状态" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="child"/>
- <DataColumn Index="7" MappingName="#SaleBill.Name_Location" ReadOnly="true" HeaderText="出货仓库" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="parent" />
- <DataColumn Index="8" MappingName="#SaleBill.InvoiceAddress_Company" ReadOnly="true" HeaderText="发票地址" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="parent" ReturnMappingName="#SaleInvoice.InvoiceAddress_SaleInvoice"/>
- <DataColumn Index="9" MappingName="#SaleBill.InvoiceTitle_Company" ReadOnly="true" HeaderText="发票抬头" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="parent" ReturnMappingName="#SaleInvoice.InvoiceTitle_SaleInvoice"/>
- </DataGridIndex>
- <ReturnFieldMapping>
- <DataColumn Index="0" MappingName="#SaleBill.No_SaleBill" ReturnPath="child" ReturnMappingName="#SaleInvoiceProduct.No_FromBill"/>
- <DataColumn Index="0" MappingName="#SaleBillProduct.No_SaleBillProduct" ReturnPath="child" ReturnMappingName="#SaleInvoiceProduct.No_FromBillProduct"/>
- </ReturnFieldMapping>
- </ChildForm>
- <ChildForm name="ImportSaleBillUnControl">
- <DataGridIndex DataSource="SaleBill" SearchFunction="SearchAllSaleBill" SearchFunctionStandby="SearchAllSaleBillProduct" SearchFunctionByNo="" MappingName=""
- ReturnDataSource="SaleInvoiceProduct">
- <DataColumn Index="0" MappingName="#SaleBill.No_SaleBill" HeaderText="单据编号" Width="90" ColumnType="IKDataGridTextBoxColumn" ReadOnly="true"
- ReturnPath="child" ReturnMappingName="#SaleInvoiceProduct.SaleInvoiceProduct" />
- <DataColumn Index="1" MappingName="#SaleBill.Date_SaleBill" HeaderText="制单日期" Width="90" ColumnType="IKDataGridTextBoxColumn" ReadOnly="true"
- ReturnPath="child" />
- <DataColumn Index="2" MappingName="#SaleBill.No_Customer" HeaderText="客户编号" Width="90" ColumnType="IKDataGridTextBoxColumn" ReadOnly="true"
- ReturnPath="parent" ReturnMappingName="#SaleInvoice.No_Customer" />
- <DataColumn Index="3" MappingName="#SaleBill.ShortName_Customer" HeaderText="客户简称" Width="90" ReadOnly="true"
- ColumnType="IKDataGridTextBoxColumn" ReturnPath="child" />
- <DataColumn Index="4" MappingName="#SaleBill.TaxCurrency_SaleBill" HeaderText="税别" Width="90" ReadOnly="true" ColumnType="IKDataGridTextBoxColumn" ReturnPath="parent" />
- <DataColumn Index="5" MappingName="#SaleBill.State_SaleBill" HeaderText="单据状态" Width="90" ColumnType="IKDataGridTextBoxColumn" ReadOnly="true"
- ReturnPath="child" />
- <DataColumn Index="6" MappingName="#SaleBill.Name_Location" HeaderText="出货仓库" Width="90" ColumnType="IKDataGridTextBoxColumn" ReadOnly="true"
- ReturnPath="parent" />
- <DataColumn Index="7" MappingName="#SaleBill.OutStatus_SaleBill" HeaderText="发货状态" Width="90" ColumnType="IKDataGridTextBoxColumn" ReadOnly="true"
- ReturnPath="child" />
- </DataGridIndex>
- <ReturnFieldMapping>
- <DataColumn Index="0" MappingName="#SaleBillProduct.No_Product" ReturnPath="child" ReturnMappingName="#SaleInvoiceProduct.No_Product"/>
- </ReturnFieldMapping>
- </ChildForm>
- <ChildForm name="ImportSaleRtnBillControl">
- <DataGridIndex DataSource="SaleRtnBill" SearchFunction="SearchAllSaleRtnBill" SearchFunctionStandby="SearchAllSaleRtnBillProduct" SearchFunctionByNo=""
- MappingName="" ReturnDataSource="SaleInvoiceProduct">
- <DataColumn Index="0" MappingName="#SaleRtnBill.No_SaleRtnBill" HeaderText="单据编号" Width="90" ReadOnly="true"
- ColumnType="IKDataGridTextBoxColumn" ReturnPath="child" ReturnMappingName="#SaleInvoiceProduct.No_FromBill" />
- <DataColumn Index="1" MappingName="#SaleRtnBill.Date_SaleRtnBill" HeaderText="制单日期" Width="90" ReadOnly="true"
- ColumnType="IKDataGridTextBoxColumn" ReturnPath="child" />
- <DataColumn Index="2" MappingName="#SaleRtnBill.No_Customer" HeaderText="客户编号" Width="90" ReadOnly="true" ColumnType="IKDataGridTextBoxColumn"
- ReturnPath="parent" ReturnMappingName="#SaleInvoice.No_Customer"/>
- <DataColumn Index="3" MappingName="#SaleRtnBill.ShortName_Customer" HeaderText="客户简称" Width="90" ReadOnly="true"
- ColumnType="IKDataGridTextBoxColumn" ReturnPath="child" />
- <DataColumn Index="4" MappingName="#SaleRtnBill.State_SaleRtnBill" HeaderText="单据状态" Width="90" ReadOnly="true"
- ColumnType="IKDataGridTextBoxColumn" ReturnPath="child" />
- <DataColumn Index="5" MappingName="#SaleRtnBill.Name_Location" HeaderText="入库仓库" Width="90" ReadOnly="true"
- ColumnType="IKDataGridTextBoxColumn" ReturnPath="parent" />
- </DataGridIndex>
- <ReturnFieldMapping>
- <DataColumn Index="0" MappingName="#SaleRtnBillProduct.No_SaleRtnBillProduct" ReturnPath="child" ReturnMappingName="#SaleInvoiceProduct.No_FromBillProduct"/>
- </ReturnFieldMapping>
- </ChildForm>
- <ChildForm name="ImportSaleRtnBillUnControl">
- <DataGridIndex DataSource="SaleRtnBill" SearchFunction="SearchAllSaleRtnBill" SearchFunctionStandby="SearchAllSaleRtnBillProduct" SearchFunctionByNo=""
- MappingName="" ReturnDataSource="SaleInvoiceProduct">
- <DataColumn Index="0" MappingName="#SaleRtnBill.No_SaleRtnBill" HeaderText="单据编号" Width="90" ReadOnly="true"
- ColumnType="IKDataGridTextBoxColumn" ReturnPath="child" ReturnMappingName="#SaleInvoiceProduct.Comment_SaleInvoiceProduct" />
- <DataColumn Index="1" MappingName="#SaleRtnBill.Date_SaleRtnBill" HeaderText="制单日期" Width="90" ReadOnly="true"
- ColumnType="IKDataGridTextBoxColumn" ReturnPath="child" />
- <DataColumn Index="2" MappingName="#SaleRtnBill.No_Customer" HeaderText="客户编号" Width="90" ReadOnly="true" ColumnType="IKDataGridTextBoxColumn"
- ReturnPath="parent" ReturnMappingName="#SaleInvoice.No_Customer"/>
- <DataColumn Index="3" MappingName="#SaleRtnBill.ShortName_Customer" HeaderText="客户简称" Width="90" ReadOnly="true"
- ColumnType="IKDataGridTextBoxColumn" ReturnPath="child" />
- <DataColumn Index="4" MappingName="#SaleRtnBill.State_SaleRtnBill" HeaderText="单据状态" Width="90" ReadOnly="true"
- ColumnType="IKDataGridTextBoxColumn" ReturnPath="child" />
- <DataColumn Index="5" MappingName="#SaleRtnBill.Name_Location" HeaderText="入库仓库" Width="90" ReadOnly="true"
- ColumnType="IKDataGridTextBoxColumn" ReturnPath="parent" />
- </DataGridIndex>
- <ReturnFieldMapping>
- <DataColumn Index="0" MappingName="#SaleRtnBillProduct.No_Product" ReturnPath="child" ReturnMappingName="#SaleInvoiceProduct.No_Product"/>
- </ReturnFieldMapping>
- </ChildForm>
- </ChildForms>
- <ImportedInfo>
- UpdateForm(true, "tbCustomerNo");
- @InvoiceAddress=#SaleInvoice.InvoiceAddress_SaleInvoice;
- @InvoiceTitle=#SaleInvoice.InvoiceTitle_SaleInvoice;
- ActiveControlEvent("tbCustomerNo", "Enter");
- #SaleInvoice.InvoiceAddress_SaleInvoice=@InvoiceAddress;
- #SaleInvoice.InvoiceTitle_SaleInvoice=@InvoiceTitle;
- UpdateForm(true, "cbInvoiceTitle");
- UpdateForm(true, "cbInvoiceAddress");
- </ImportedInfo>
- </Client>
- <Server>
- <Tables>
- <Table name="SaleInvoice" Type="Parent">
- <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 SaleInvoice.*,a.Name_User As Creator
- ,b.Name_User As Assessor,c.Name_User As LastModUser
- ,Customer.No_Customer,Customer.ShortName_Customer
- ,Customer.RevenueRegisterNo_Customer,Customer.Bank_Customer
- ,Customer.Account_Customer,Customer.GetMethod_Customer
- ,Customer.Company_Customer
- ,convert(nvarchar(64),'') As TypeName
- ,Convert(DateTime,getdate()) as StartDate
- ,Convert(DateTime,getdate()) as EndDate
- ,Convert(bit,0) as ckRtn
- FROM SaleInvoice
- LEFT JOIN AppUser a ON SaleInvoice.ID_Creator=a.ID_User
- LEFT JOIN AppUser b ON SaleInvoice.ID_Assessor=b.ID_User
- LEFT JOIN AppUser c ON SaleInvoice.LastModUser_SaleInvoice=c.ID_User
- Left JOIN Customer On Customer.ID_Customer=SaleInvoice.ID_Customer
- ">
- </GetSchema>
- <New CmdType="Text" CmdText=" INSERT INTO SaleInvoice(ID_SaleInvoice
- ,No_SaleInvoice
- ,Date_SaleInvoice
- ,Type_SaleInvoice
- ,PayDate_SaleInvoice
- ,InvoiceDate_SaleInvoice
- ,No_Invoice
- ,ID_Customer
- ,InvoiceAddress_SaleInvoice
- ,InvoiceTitle_SaleInvoice
- ,Bank_SaleInvoice
- ,Account_SaleInvoice
- ,Currency_SaleInvoice
- ,ID_Creator
- ,CreateDate_SaleInvoice
- ,LastModUser_SaleInvoice
- ,LastModDate_SaleInvoice
- ,ID_Assessor
- ,AssessDate_SaleInvoice
- ,Amount_SaleInvoice
- ,IncludeTax_SaleInvoice
- ,GoodsAmount_SaleInvoice
- ,TaxAmount_SaleInvoice
- )
-
- VALUES(@ID_SaleInvoice
- ,@No_SaleInvoice
- ,@Date_SaleInvoice
- ,@Type_SaleInvoice
- ,@PayDate_SaleInvoice
- ,@InvoiceDate_SaleInvoice
- ,@No_Invoice
- ,@ID_Customer
- ,@InvoiceAddress_SaleInvoice
- ,@InvoiceTitle_SaleInvoice
- ,@Bank_SaleInvoice
- ,@Account_SaleInvoice
- ,@Currency_SaleInvoice
- ,@ID_Creator
- ,@CreateDate_SaleInvoice
- ,@LastModUser_SaleInvoice
- ,@LastModDate_SaleInvoice
- ,@ID_Assessor
- ,@AssessDate_SaleInvoice
- ,@Amount_SaleInvoice
- ,@IncludeTax_SaleInvoice
- ,@GoodsAmount_SaleInvoice
- ,@TaxAmount_SaleInvoice
- )
- ">
- <Params>
- <Param name="@ID_SaleInvoice" type="SaleInvoice.ID_SaleInvoice" sourceColumn="ID_SaleInvoice" />
- <Param name="@No_SaleInvoice" type="SaleInvoice.No_SaleInvoice" sourceColumn="No_SaleInvoice" />
- <Param name="@Date_SaleInvoice" type="SaleInvoice.Date_SaleInvoice" sourceColumn="Date_SaleInvoice" />
- <Param name="@Type_SaleInvoice" type="SaleInvoice.Type_SaleInvoice" sourceColumn="Type_SaleInvoice" />
- <Param name="@PayDate_SaleInvoice" type="SaleInvoice.PayDate_SaleInvoice" sourceColumn="PayDate_SaleInvoice" />
- <Param name="@InvoiceDate_SaleInvoice" type="SaleInvoice.InvoiceDate_SaleInvoice" sourceColumn="InvoiceDate_SaleInvoice" />
- <Param name="@No_Invoice" type="SaleInvoice.No_Invoice" sourceColumn="No_Invoice" />
- <Param name="@ID_Customer" type="SaleInvoice.ID_Customer" sourceColumn="ID_Customer" />
- <Param name="@InvoiceAddress_SaleInvoice" type="SaleInvoice.InvoiceAddress_SaleInvoice" sourceColumn="InvoiceAddress_SaleInvoice" />
- <Param name="@InvoiceTitle_SaleInvoice" type="SaleInvoice.InvoiceTitle_SaleInvoice" sourceColumn="InvoiceTitle_SaleInvoice" />
- <Param name="@Bank_SaleInvoice" type="SaleInvoice.Bank_SaleInvoice" sourceColumn="Bank_SaleInvoice" />
- <Param name="@Account_SaleInvoice" type="SaleInvoice.Account_SaleInvoice" sourceColumn="Account_SaleInvoice" />
- <Param name="@Currency_SaleInvoice" type="SaleInvoice.Currency_SaleInvoice" sourceColumn="Currency_SaleInvoice" />
- <Param name="@ID_Creator" type="SaleInvoice.ID_Creator" sourceColumn="ID_Creator" />
- <Param name="@CreateDate_SaleInvoice" type="SaleInvoice.CreateDate_SaleInvoice" sourceColumn="CreateDate_SaleInvoice" />
- <Param name="@LastModUser_SaleInvoice" type="SaleInvoice.LastModUser_SaleInvoice" sourceColumn="LastModUser_SaleInvoice" />
- <Param name="@LastModDate_SaleInvoice" type="SaleInvoice.LastModDate_SaleInvoice" sourceColumn="LastModDate_SaleInvoice" />
- <Param name="@ID_Assessor" type="SaleInvoice.ID_Assessor" sourceColumn="ID_Assessor" />
- <Param name="@AssessDate_SaleInvoice" type="SaleInvoice.AssessDate_SaleInvoice" sourceColumn="AssessDate_SaleInvoice" />
- <Param name="@Amount_SaleInvoice" type="SaleInvoice.Amount_SaleInvoice" sourceColumn="Amount_SaleInvoice" />
- <Param name="@IncludeTax_SaleInvoice" type="SaleInvoice.IncludeTax_SaleInvoice" sourceColumn="IncludeTax_SaleInvoice" />
- <Param name="@GoodsAmount_SaleInvoice" type="SaleInvoice.GoodsAmount_SaleInvoice" sourceColumn="GoodsAmount_SaleInvoice" />
- <Param name="@TaxAmount_SaleInvoice" type="SaleInvoice.TaxAmount_SaleInvoice" sourceColumn="TaxAmount_SaleInvoice" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText=" UPDATE SaleInvoice
- SET No_SaleInvoice=@No_SaleInvoice
- ,Date_SaleInvoice=@Date_SaleInvoice
- ,Type_SaleInvoice=@Type_SaleInvoice
- ,PayDate_SaleInvoice=@PayDate_SaleInvoice
- ,InvoiceDate_SaleInvoice=@InvoiceDate_SaleInvoice
- ,No_Invoice=@No_Invoice
- ,ID_Customer=@ID_Customer
- ,InvoiceAddress_SaleInvoice=@InvoiceAddress_SaleInvoice
- ,InvoiceTitle_SaleInvoice=@InvoiceTitle_SaleInvoice
- ,Bank_SaleInvoice=@Bank_SaleInvoice
- ,Account_SaleInvoice=@Account_SaleInvoice
- ,Currency_SaleInvoice=@Currency_SaleInvoice
- ,ID_Creator=@ID_Creator
- ,CreateDate_SaleInvoice=@CreateDate_SaleInvoice
- ,LastModUser_SaleInvoice=@LastModUser_SaleInvoice
- ,LastModDate_SaleInvoice=@LastModDate_SaleInvoice
- ,ID_Assessor=@ID_Assessor
- ,AssessDate_SaleInvoice=@AssessDate_SaleInvoice
- ,Amount_SaleInvoice=@Amount_SaleInvoice
- ,IncludeTax_SaleInvoice=@IncludeTax_SaleInvoice
- ,GoodsAmount_SaleInvoice=@GoodsAmount_SaleInvoice
- ,TaxAmount_SaleInvoice=@TaxAmount_SaleInvoice
- WHERE ID_SaleInvoice=@ID_SaleInvoice
- ">
- <Params>
- <Param name="@ID_SaleInvoice" type="SaleInvoice.ID_SaleInvoice" sourceColumn="ID_SaleInvoice" />
- <Param name="@No_SaleInvoice" type="SaleInvoice.No_SaleInvoice" sourceColumn="No_SaleInvoice" />
- <Param name="@Date_SaleInvoice" type="SaleInvoice.Date_SaleInvoice" sourceColumn="Date_SaleInvoice" />
- <Param name="@Type_SaleInvoice" type="SaleInvoice.Type_SaleInvoice" sourceColumn="Type_SaleInvoice" />
- <Param name="@PayDate_SaleInvoice" type="SaleInvoice.PayDate_SaleInvoice" sourceColumn="PayDate_SaleInvoice" />
- <Param name="@InvoiceDate_SaleInvoice" type="SaleInvoice.InvoiceDate_SaleInvoice" sourceColumn="InvoiceDate_SaleInvoice" />
- <Param name="@No_Invoice" type="SaleInvoice.No_Invoice" sourceColumn="No_Invoice" />
- <Param name="@ID_Customer" type="SaleInvoice.ID_Customer" sourceColumn="ID_Customer" />
- <Param name="@InvoiceAddress_SaleInvoice" type="SaleInvoice.InvoiceAddress_SaleInvoice" sourceColumn="InvoiceAddress_SaleInvoice" />
- <Param name="@InvoiceTitle_SaleInvoice" type="SaleInvoice.InvoiceTitle_SaleInvoice" sourceColumn="InvoiceTitle_SaleInvoice" />
- <Param name="@Bank_SaleInvoice" type="SaleInvoice.Bank_SaleInvoice" sourceColumn="Bank_SaleInvoice" />
- <Param name="@Account_SaleInvoice" type="SaleInvoice.Account_SaleInvoice" sourceColumn="Account_SaleInvoice" />
- <Param name="@Currency_SaleInvoice" type="SaleInvoice.Currency_SaleInvoice" sourceColumn="Currency_SaleInvoice" />
- <Param name="@ID_Creator" type="SaleInvoice.ID_Creator" sourceColumn="ID_Creator" />
- <Param name="@CreateDate_SaleInvoice" type="SaleInvoice.CreateDate_SaleInvoice" sourceColumn="CreateDate_SaleInvoice" />
- <Param name="@LastModUser_SaleInvoice" type="SaleInvoice.LastModUser_SaleInvoice" sourceColumn="LastModUser_SaleInvoice" />
- <Param name="@LastModDate_SaleInvoice" type="SaleInvoice.LastModDate_SaleInvoice" sourceColumn="LastModDate_SaleInvoice" />
- <Param name="@ID_Assessor" type="SaleInvoice.ID_Assessor" sourceColumn="ID_Assessor" />
- <Param name="@AssessDate_SaleInvoice" type="SaleInvoice.AssessDate_SaleInvoice" sourceColumn="AssessDate_SaleInvoice" />
- <Param name="@Amount_SaleInvoice" type="SaleInvoice.Amount_SaleInvoice" sourceColumn="Amount_SaleInvoice" />
- <Param name="@IncludeTax_SaleInvoice" type="SaleInvoice.IncludeTax_SaleInvoice" sourceColumn="IncludeTax_SaleInvoice" />
- <Param name="@GoodsAmount_SaleInvoice" type="SaleInvoice.GoodsAmount_SaleInvoice" sourceColumn="GoodsAmount_SaleInvoice" />
- <Param name="@TaxAmount_SaleInvoice" type="SaleInvoice.TaxAmount_SaleInvoice" sourceColumn="TaxAmount_SaleInvoice" />
- </Params>
- </Update>
- <Delete CmdType="Text" CmdText=" DELETE FROM SaleInvoiceProduct WHERE ID_SaleInvoice=@ID_SaleInvoice
- DELETE FROM SaleInvoice WHERE ID_SaleInvoice=@ID_SaleInvoice
- ">
- <Params>
- <Param name="@ID_SaleInvoice" type="SaleInvoice.ID_SaleInvoice" sourceColumn="ID_SaleInvoice" />
- </Params>
- </Delete>
- <Audit CmdType="Text" CmdText=" UPDATE Customer
- SET Customer.ToGetBalance_Customer = Customer.ToGetBalance_Customer+@Amount_SaleInvoice
- WHERE Customer.ID_Customer=@ID_Customer
- DECLARE @No_SaleBill NVARCHAR(64)
- DECLARE CUR CURSOR
- FOR
- SELECT No_FromBill
- FROM SaleInvoiceProduct
- WHERE ID_SaleInvoice=@ID_SaleInvoice
- OPEN CUR
- FETCH NEXT FROM CUR INTO @No_SaleBill
- WHILE @@FETCH_STATUS=0
- BEGIN
- UPDATE SaleBill SET Assess_SaleBill=1 WHERE No_SaleBill=@No_SaleBill
- UPDATE SaleRtnBill SET Assess_SaleRtnBill=1 WHERE No_SaleRtnBill=@No_SaleBill
- FETCH NEXT FROM CUR INTO @No_SaleBill
- END
- DEALLOCATE CUR
-
- UPDATE SaleInvoice SET ID_Assessor=@ID_Assessor,AssessDate_SaleInvoice=@AssessDate_SaleInvoice WHERE ID_SaleInvoice=@ID_SaleInvoice
-
- ">
- <Params>
- <Param name="@ID_SaleInvoice" type="SaleInvoice.ID_SaleInvoice" sourceColumn="ID_SaleInvoice"/>
- <Param name="@ID_Assessor" type="SaleInvoice.ID_Assessor" sourceColumn="ID_Assessor"/>
- <Param name="@ID_Customer" type="SaleInvoice.ID_Customer" sourceColumn="ID_Customer"/>
- <Param name="@AssessDate_SaleInvoice" type="SaleInvoice.AssessDate_SaleInvoice" sourceColumn="AssessDate_SaleInvoice"/>
- <Param name="@Amount_SaleInvoice" type="SaleInvoice.Amount_SaleInvoice" sourceColumn="Amount_SaleInvoice" />
- </Params>
- </Audit>
- <Blank CmdType="Text" CmdText="
- UPDATE Customer
- SET ToGetBalance_Customer = ToGetBalance_Customer-@Amount_SaleInvoice
- WHERE ID_Customer=@ID_Customer
-
- DECLARE @No_SaleBill NVARCHAR(64)
- DECLARE CUR CURSOR
- FOR
- SELECT No_FromBill
- FROM SaleInvoiceProduct
- WHERE ID_SaleInvoice=@ID_SaleInvoice
- OPEN CUR
- FETCH NEXT FROM CUR INTO @No_SaleBill
- WHILE @@FETCH_STATUS=0
- BEGIN
- UPDATE SaleBill SET Assess_SaleBill=0 WHERE No_SaleBill=@No_SaleBill
- UPDATE SaleRtnBill SET Assess_SaleRtnBill=0 WHERE No_SaleRtnBill=@No_SaleBill
- FETCH NEXT FROM CUR INTO @No_SaleBill
- END
- DEALLOCATE CUR
-
- UPDATE SaleInvoice
- SET Disable_SaleInvoice=@Disable_SaleInvoice
- Where ID_SaleInvoice=@ID_SaleInvoice
- ">
- <Params>
- <Param name="@ID_SaleInvoice" type="SaleInvoice.ID_SaleInvoice" sourceColumn="ID_SaleInvoice" />
- <Param name="@No_SaleInvoice" type="SaleInvoice.No_SaleInvoice" sourceColumn="No_SaleInvoice" />
- <Param name="@ID_Customer" type="SaleInvoice.ID_Customer" sourceColumn="ID_Customer"/>
- <Param name="@Disable_SaleInvoice" type="SaleInvoice.Disable_SaleInvoice" sourceColumn="Disable_SaleInvoice"/>
- <Param name="@Amount_SaleInvoice" type="SaleInvoice.Amount_SaleInvoice" sourceColumn="Amount_SaleInvoice" />
- <Param name="@StrikedAmount_SaleInvoice" type="SaleInvoice.StrikedAmount_SaleInvoice" sourceColumn="StrikedAmount_SaleInvoice" />
- </Params>
- </Blank>
- </Table>
- <Table name="SaleInvoiceProduct" Type="Child">
- <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 SaleInvoiceProduct.*,
- convert(nvarchar(64),'') As Name_BillType
- ,Product.No_Product
- ,Product.Name_Product
- ,Product.InvoiceName_Product
- ,Product.Unit_Product
- ,convert(bit,0) AS Negative
- ,Convert(nvarchar(64),'') As No_Customer
- ,Convert(nvarchar(64),'') As ShortName_Customer
- FROM SaleInvoiceProduct
- LEFT JOIN Product On Product.ID_Product=SaleInvoiceProduct.ID_Product
- ">
- </GetSchema>
- <New CmdType="Text" CmdText=" INSERT INTO SaleInvoiceProduct(ID_SaleInvoiceProduct
- ,ID_SaleInvoice
- ,Type_FromBill
- ,No_FromBill
- ,No_FromBillProduct
- ,ID_Product
- ,Quantity_SaleInvoiceProduct
- ,UnitPrice_SaleInvoiceProduct
- ,TaxRate_SaleInvoiceProduct
- ,Comment_SaleInvoiceProduct
- ,Amount_SaleInvoiceProduct
- ,TaxAmount_SaleInvoiceProduct
- ,GoodsAmount_SaleInvoiceProduct
- ,TaxCurrency_SaleInvoiceProduct)
-
- Values(@ID_SaleInvoiceProduct
- ,@ID_SaleInvoice
- ,@Type_FromBill
- ,@No_FromBill
- ,@No_FromBillProduct
- ,@ID_Product
- ,@Quantity_SaleInvoiceProduct
- ,@UnitPrice_SaleInvoiceProduct
- ,@TaxRate_SaleInvoiceProduct
- ,@Comment_SaleInvoiceProduct
- ,@Amount_SaleInvoiceProduct
- ,@TaxAmount_SaleInvoiceProduct
- ,@GoodsAmount_SaleInvoiceProduct
- ,@TaxCurrency_SaleInvoiceProduct)
- ">
- <Params>
- <Param name="@ID_SaleInvoiceProduct" type="SaleInvoiceProduct.ID_SaleInvoiceProduct" sourceColumn="ID_SaleInvoiceProduct" />
- <Param name="@ID_SaleInvoice" type="SaleInvoiceProduct.ID_SaleInvoice" sourceColumn="ID_SaleInvoice" />
- <Param name="@Type_FromBill" type="SaleInvoiceProduct.Type_FromBill" sourceColumn="Type_FromBill" />
- <Param name="@No_FromBill" type="SaleInvoiceProduct.No_FromBill" sourceColumn="No_FromBill" />
- <Param name="@No_FromBillProduct" type="SaleInvoiceProduct.No_FromBillProduct" sourceColumn="No_FromBillProduct" />
- <Param name="@ID_Product" type="SaleInvoiceProduct.ID_Product" sourceColumn="ID_Product" />
- <Param name="@Quantity_SaleInvoiceProduct" type="SaleInvoiceProduct.Quantity_SaleInvoiceProduct" sourceColumn="Quantity_SaleInvoiceProduct" />
- <Param name="@UnitPrice_SaleInvoiceProduct" type="SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct" sourceColumn="UnitPrice_SaleInvoiceProduct" />
- <Param name="@TaxRate_SaleInvoiceProduct" type="SaleInvoiceProduct.TaxRate_SaleInvoiceProduct" sourceColumn="TaxRate_SaleInvoiceProduct" />
- <Param name="@Comment_SaleInvoiceProduct" type="SaleInvoiceProduct.Comment_SaleInvoiceProduct" sourceColumn="Comment_SaleInvoiceProduct" />
- <Param name="@Amount_SaleInvoiceProduct" type="SaleInvoiceProduct.Amount_SaleInvoiceProduct" sourceColumn="Amount_SaleInvoiceProduct" />
- <Param name="@TaxAmount_SaleInvoiceProduct" type="SaleInvoiceProduct.TaxAmount_SaleInvoiceProduct" sourceColumn="TaxAmount_SaleInvoiceProduct" />
- <Param name="@GoodsAmount_SaleInvoiceProduct" type="SaleInvoiceProduct.GoodsAmount_SaleInvoiceProduct" sourceColumn="GoodsAmount_SaleInvoiceProduct" />
- <Param name="@TaxCurrency_SaleInvoiceProduct" type="SaleInvoiceProduct.TaxCurrency_SaleInvoiceProduct" sourceColumn="TaxCurrency_SaleInvoiceProduct" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText=" UPDATE SaleInvoiceProduct
- SET ID_SaleInvoice=@ID_SaleInvoice
- ,Type_FromBill=@Type_FromBill
- ,No_FromBill=@No_FromBill
- ,No_FromBillProduct=@No_FromBillProduct
- ,ID_Product=@ID_Product
- ,Quantity_SaleInvoiceProduct=@Quantity_SaleInvoiceProduct
- ,UnitPrice_SaleInvoiceProduct=@UnitPrice_SaleInvoiceProduct
- ,TaxRate_SaleInvoiceProduct=@TaxRate_SaleInvoiceProduct
- ,Comment_SaleInvoiceProduct=@Comment_SaleInvoiceProduct
- ,Amount_SaleInvoiceProduct=@Amount_SaleInvoiceProduct
- ,TaxAmount_SaleInvoiceProduct=@TaxAmount_SaleInvoiceProduct
- ,GoodsAmount_SaleInvoiceProduct=@GoodsAmount_SaleInvoiceProduct
- ,TaxCurrency_SaleInvoiceProduct=@TaxCurrency_SaleInvoiceProduct
- WHERE ID_SaleInvoiceProduct=@ID_SaleInvoiceProduct
- ">
- <Params>
- <Param name="@ID_SaleInvoiceProduct" type="SaleInvoiceProduct.ID_SaleInvoiceProduct" sourceColumn="ID_SaleInvoiceProduct" />
- <Param name="@ID_SaleInvoice" type="SaleInvoiceProduct.ID_SaleInvoice" sourceColumn="ID_SaleInvoice" />
- <Param name="@Type_FromBill" type="SaleInvoiceProduct.Type_FromBill" sourceColumn="Type_FromBill" />
- <Param name="@No_FromBill" type="SaleInvoiceProduct.No_FromBill" sourceColumn="No_FromBill" />
- <Param name="@No_FromBillProduct" type="SaleInvoiceProduct.No_FromBillProduct" sourceColumn="No_FromBillProduct" />
- <Param name="@ID_Product" type="SaleInvoiceProduct.ID_Product" sourceColumn="ID_Product" />
- <Param name="@Quantity_SaleInvoiceProduct" type="SaleInvoiceProduct.Quantity_SaleInvoiceProduct" sourceColumn="Quantity_SaleInvoiceProduct" />
- <Param name="@UnitPrice_SaleInvoiceProduct" type="SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct" sourceColumn="UnitPrice_SaleInvoiceProduct" />
- <Param name="@TaxRate_SaleInvoiceProduct" type="SaleInvoiceProduct.TaxRate_SaleInvoiceProduct" sourceColumn="TaxRate_SaleInvoiceProduct" />
- <Param name="@Comment_SaleInvoiceProduct" type="SaleInvoiceProduct.Comment_SaleInvoiceProduct" sourceColumn="Comment_SaleInvoiceProduct" />
- <Param name="@Amount_SaleInvoiceProduct" type="SaleInvoiceProduct.Amount_SaleInvoiceProduct" sourceColumn="Amount_SaleInvoiceProduct" />
- <Param name="@TaxAmount_SaleInvoiceProduct" type="SaleInvoiceProduct.TaxAmount_SaleInvoiceProduct" sourceColumn="TaxAmount_SaleInvoiceProduct" />
- <Param name="@GoodsAmount_SaleInvoiceProduct" type="SaleInvoiceProduct.GoodsAmount_SaleInvoiceProduct" sourceColumn="GoodsAmount_SaleInvoiceProduct" />
- <Param name="@TaxCurrency_SaleInvoiceProduct" type="SaleInvoiceProduct.TaxCurrency_SaleInvoiceProduct" sourceColumn="TaxCurrency_SaleInvoiceProduct" />
- </Params>
- </Update>
- <Delete CmdType="Text" CmdText=" DELETE FROM SaleInvoiceProduct WHERE ID_SaleInvoiceProduct=@ID_SaleInvoiceProduct">
- <Params>
- <Param name="@ID_SaleInvoiceProduct" type="SaleInvoiceProduct.ID_SaleInvoiceProduct" sourceColumn="ID_SaleInvoiceProduct" />
- </Params>
- </Delete>
- </Table>
- </Tables>
- <Search>
- <SearchAllBill CmdType="Text" CmdText="
- SELECT [ID_SaleInvoice]
- ,[No_SaleInvoice]
- ,[Date_SaleInvoice]
- ,[Type_SaleInvoice]
- ,[InvoiceDate_SaleInvoice]
- ,[No_Invoice]
- ,SaleInvoice.[ID_Customer]
- ,[InvoiceAddress_SaleInvoice]
- ,[InvoiceTitle_SaleInvoice]
- ,[Bank_SaleInvoice]
- ,[Account_SaleInvoice]
- ,[Currency_SaleInvoice]
- ,[PayDate_SaleInvoice]
- ,SaleInvoice.[ID_Creator]
- ,[CreateDate_SaleInvoice]
- ,[LastModDate_SaleInvoice]
- ,[LastModUser_SaleInvoice]
- ,[ID_Assessor]
- ,[AssessDate_SaleInvoice]
- ,case [Disable_SaleInvoice] when 1 then '是' when 0 then '否' end as [Disable_SaleInvoice]
- ,[Amount_SaleInvoice]
- ,[IncludeTax_SaleInvoice]
- ,[GoodsAmount_SaleInvoice]
- ,[TaxAmount_SaleInvoice]
- ,[StrikedAmount_SaleInvoice]
- ,[DiscountAmount_SaleInvoice]
- ,[Company_SaleInvoice],
- (GoodsAmount_SaleInvoice + TaxAmount_SaleInvoice ) as AllAmount
- ,a.Name_User As Creator ,b.Name_User As Assessor
- ,c.Name_User As LastModUser,Customer.No_Customer,Customer.ShortName_Customer
- ,Customer.RevenueRegisterNo_Customer,Customer.Bank_Customer,Customer.Account_Customer
- ,Customer.GetMethod_Customer,convert(nvarchar(64),'') As TypeName,Customer.Company_Customer
- FROM SaleInvoice
-
- LEFT JOIN AppUser a ON SaleInvoice.ID_Creator=a.ID_User
- LEFT JOIN AppUser b ON SaleInvoice.ID_Assessor=b.ID_User
- LEFT JOIN AppUser c ON SaleInvoice.LastModUser_SaleInvoice=c.ID_User
- Left JOIN Customer On Customer.ID_Customer=SaleInvoice.ID_Customer">
- <Tables>
- <Table name="AllBill" />
- </Tables>
- </SearchAllBill>
- <SearchAllCustomer CmdType="Text" CmdText="SELECT Customer.No_Customer,Customer.ShortName_Customer
- ,Customer.Type_Customer,Customer.Level_Customer,Customer.IsGeneric_Customer
- FROM Customer ">
- <Tables>
- <Table name="AllCustomer" />
- </Tables>
- </SearchAllCustomer>
- <SearchAllProduct CmdType="Text" CmdText="SELECT Product.No_Product,Product.Name_Product FROM Product ">
- <Tables>
- <Table name="AllProduct" />
- </Tables>
- </SearchAllProduct>
- <SearchCustomer CmdType="Text" CmdText=" SELECT Top 1 Customer.ID_Customer,ShortName_Customer,RevenueRegisterNo_Customer
- ,Bank_Customer,Account_Customer,GetMethod_Customer,SuspendDate_Customer
- ,DunDate_Customer,Title_Invoice ,Address_Invoice,Company_Customer
- From Customer
- Left Join Invoice On Invoice.ID_Customer = Customer.ID_Customer And Invoice.Common_Invoice = 1
- WHERE No_Customer=@No_Customer
- And IsCustomersCustomer_Customer = 0
- ">
- <Params>
- <Param name="@No_Customer" type="Customer.No_Customer" Index="0" />
- </Params>
- <Tables>
- <Table name="Customer"/>
- </Tables>
- </SearchCustomer>
- <SearchInvoiceTitle CmdType="Text" CmdText=" SELECT Title_Invoice FROM Invoice WHERE ID_Customer=@ID_Customer">
- <Params>
- <Param name="@ID_Customer" type="Customer.ID_Customer" Index="0" />
- </Params>
- <Tables>
- <Table name="InvoiceTitle"/>
- </Tables>
- </SearchInvoiceTitle>
- <SearchInvoiceAddress CmdType="Text" CmdText=" SELECT Address_Invoice FROM Invoice WHERE ID_Customer=@ID_Customer">
- <Params>
- <Param name="@ID_Customer" type="Customer.ID_Customer" Index="0" />
- </Params>
- <Tables>
- <Table name="InvoiceAddress"/>
- </Tables>
- </SearchInvoiceAddress>
- <SearchBank CmdType="Text" CmdText="SELECT Name_TypeDef FROM TypeDef WHERE Type_TypeDef = 6">
- <Tables>
- <Table name="Bank" />
- </Tables>
- </SearchBank>
- <SearchCompany CmdType="Text" CmdText="SELECT Name_TypeDef FROM TypeDef WHERE Type_TypeDef = 30">
- <Tables>
- <Table name="Company" />
- </Tables>
- </SearchCompany>
- <SearchSaleBill CmdType="Text" CmdText="SELECT SaleBill.InvoiceAddress_Company,SaleBill.InvoiceTitle_Company
- ,ID_Assessor,ID_Customer,ID_Product,TaxCurrency_SaleBill
- FROM SaleBill
- Join SaleBillProduct On SaleBillProduct.ID_SaleBill=SaleBill.ID_SaleBill
- WHERE No_SaleBill=@No_SaleBill AND No_SaleBillProduct=@No_SaleBillProduct
- ">
- <Params>
- <Param name="@No_SaleBill" type="SaleBill.No_SaleBill" Index="0" />
- <Param name="@No_SaleBillProduct" type="SaleBillProduct.No_SaleBillProduct" Index="1" />
- </Params>
- <Tables>
- <Table name="SaleBill"/>
- </Tables>
- </SearchSaleBill>
- <SearchSaleRtnBill CmdType="Text" CmdText=" SELECT ID_Assessor,ID_Customer,ID_Product,SaleRtnBill.TaxCurrency_SaleRtnBill
- FROM SaleRtnBillProduct
- LEFT JOIN SaleRtnBill On SaleRtnBill.ID_SaleRtnBill=SaleRtnBillProduct.ID_SaleRtnBill
- WHERE No_SaleRtnBill=@No_SaleRtnBill AND No_SaleRtnBillProduct=@No_SaleRtnBillProduct
- ">
- <Params>
- <Param name="@No_SaleRtnBill" type="SaleRtnBill.No_SaleRtnBill" Index="0" />
- <Param name="@No_SaleRtnBillProduct" type="SaleRtnBillProduct.No_SaleRtnBillProduct" Index="1" />
- </Params>
- <Tables>
- <Table name="SaleRtnBill"/>
- </Tables>
- </SearchSaleRtnBill>
- <SearchSaleBillProduct CmdType="Text" CmdText="SELECT SaleBill.TaxCurrency_SaleBill
- ,SaleBillProduct.ID_Product
- ,SaleBillProduct.Quantity_SaleBillProduct
- ,SaleBillProduct.UnitPrice_SaleBillProduct
- ,SaleBillProduct.Discount_SaleBillProduct
- ,Product.No_Product
- ,Product.Name_Product
- ,Product.InvoiceName_Product
- ,Product.Unit_Product
- ,Customer.No_Customer
- ,Customer.ShortName_Customer
- FROM SaleBillProduct
-
- LEFT JOIN SaleBill On SaleBill.ID_SaleBill=SaleBillProduct.ID_SaleBill
- LEFT JOIN Product On Product.ID_Product=SaleBillProduct.ID_Product
- Left join Customer on Customer.ID_Customer = SaleBill.ID_Customer
- WHERE No_SaleBill=@No_SaleBill
- AND No_SaleBillProduct=@No_SaleBillProduct
- ">
- <Params>
- <Param name="@No_SaleBill" type="SaleBill.No_SaleBill" Index="0" />
- <Param name="@No_SaleBillProduct" type="SaleBillProduct.No_SaleBillProduct" Index="1" />
- </Params>
- <Tables>
- <Table name="SaleBillProduct"/>
- </Tables>
- </SearchSaleBillProduct>
- <SearchSaleRtnBillProduct CmdType="Text" CmdText=" SELECT SaleRtnBill.TaxCurrency_SaleRtnBill
- ,SaleRtnBillProduct.ID_Product
- ,SaleRtnBillProduct.Quantity_SaleRtnBillProduct
- ,SaleRtnBillProduct.UnitPrice_SaleRtnBillProduct
- ,Product.No_Product
- ,Product.Name_Product
- ,Product.InvoiceName_Product
- ,Product.Unit_Product
- ,Customer.No_Customer
- ,Customer.ShortName_Customer
- FROM SaleRtnBillProduct
-
- LEFT JOIN SaleRtnBill On SaleRtnBill.ID_SaleRtnBill=SaleRtnBillProduct.ID_SaleRtnBill
- LEFT JOIN Product On Product.ID_Product=SaleRtnBillProduct.ID_Product
- Left join Customer on Customer.ID_Customer = SaleRtnBill.ID_Customer
- WHERE No_SaleRtnBill=@No_SaleRtnBill AND No_SaleRtnBillProduct=@No_SaleRtnBillProduct
- ">
- <Params>
- <Param name="@No_SaleRtnBill" type="SaleRtnBill.No_SaleRtnBill" Index="0" />
- <Param name="@No_SaleRtnBillProduct" type="SaleRtnBillProduct.No_SaleRtnBillProduct" Index="1" />
- </Params>
- <Tables>
- <Table name="SaleRtnBillProduct"/>
- </Tables>
- </SearchSaleRtnBillProduct>
- <SearchProduct CmdType="Text" CmdText=" SELECT Product.ID_Product,Product.Name_Product,Product.InvoiceName_Product
- ,Product.Unit_Product,Product.Price_Product
- FROM Product
- WHERE No_Product=@No_Product
- ">
- <Params>
- <Param name="@No_Product" type="Product.No_Product" Index="0" />
- </Params>
- <Tables>
- <Table name="Product"/>
- </Tables>
- </SearchProduct>
- <SearchCessOut CmdType="Text" CmdText="SELECT CessOut_SystemSetting,SysCurrency_SystemSetting,PriceDecimal_SystemSetting From SystemSetting">
- <Tables>
- <Table name="SystemSetting"/>
- </Tables>
- </SearchCessOut>
- <SearchSaleInvoiceWithNo CmdType="Text" CmdText=" SELECT SaleInvoice.*,a.Name_User As Creator ,b.Name_User As Assessor,c.Name_User As LastModUser
- ,Customer.No_Customer,Customer.ShortName_Customer,Customer.RevenueRegisterNo_Customer
- ,Customer.Bank_Customer,Customer.Account_Customer,Customer.GetMethod_Customer
- ,Customer.Company_Customer
- ,TypeName=CASE Type_SaleInvoice When 0 Then '普通发票' ELSE '增值税发票' End
- ,Convert(DateTime,getdate()) as StartDate
- ,Convert(DateTime,getdate()) as EndDate
- ,Convert(bit,0) as ckRtn
- FROM SaleInvoice
- LEFT JOIN AppUser a ON SaleInvoice.ID_Creator=a.ID_User
- LEFT JOIN AppUser b ON SaleInvoice.ID_Assessor=b.ID_User
- LEFT JOIN AppUser c ON SaleInvoice.LastModUser_SaleInvoice=c.ID_User
- Left JOIN Customer On Customer.ID_Customer=SaleInvoice.ID_Customer
- WHERE No_SaleInvoice=@No_SaleInvoice
-
- SELECT SaleInvoiceProduct.*
- ,Product.No_Product,Product.Name_Product
- ,Product.InvoiceName_Product
- ,Product.Unit_Product,BillType.Name_BillType
- ,A.No_Customer As No_Customer
- ,A.ShortName_Customer As ShortName_Customer
- FROM SaleInvoiceProduct
-
- LEFT JOIN Product On Product.ID_Product=SaleInvoiceProduct.ID_Product
- LEFT JOIN SaleInvoice On SaleInvoice.ID_SaleInvoice=SaleInvoiceProduct.ID_SaleInvoice
- LEFT JOIN BillType On BillType.Value_BillType=SaleInvoiceProduct.Type_FromBill
- Left Join (select No_SaleBill As No_Bill
- ,Customer.No_Customer As No_Customer
- ,Customer.ShortName_Customer As ShortName_Customer
- From SaleBill
- Left join Customer on Customer.ID_Customer=SaleBill.ID_Customer
- Where ID_Assessor Is Not Null
- Union All
- select No_SaleRtnBill As No_Bill
- ,Customer.No_Customer As No_Customer
- ,Customer.ShortName_Customer As ShortName_Customer
- From SaleRtnBill
- Left join Customer on Customer.ID_Customer=SaleRtnBill.ID_Customer
- Where ID_Assessor Is Not Null) A On A.No_Bill = SaleInvoiceProduct.No_FromBill
- WHERE No_SaleInvoice=@No_SaleInvoice
- ">
- <Params>
- <Param name="@No_SaleInvoice" type="SaleInvoice.No_SaleInvoice" Index="0" />
- </Params>
- <Tables>
- <Table name="SaleInvoice"/>
- <Table name="SaleInvoiceProduct"/>
- </Tables>
- </SearchSaleInvoiceWithNo>
- <SearchInvoiceNo CmdType="Text" CmdText="Select * From SaleInvoice Where No_Invoice=@No_Invoice And No_SaleInvoice!=@No_SaleInvoice">
- <Params>
- <Param name="@No_Invoice" type="SaleInvoice.No_Invoice" Index="0" />
- <Param name="@No_SaleInvoice" type="SaleInvoice.No_SaleInvoice" Index="1" />
- </Params>
- <Tables>
- <Table name="SaleInvoiceNo"/>
- </Tables>
- </SearchInvoiceNo>
- <SearchBillType CmdType="Text" CmdText=" SELECT * FROM BillType WHERE Value_BillType = 21 OR Value_BillType = 0 OR Value_BillType = 22 ORDER BY Value_BillType">
- <Tables>
- <Table name="BillType" />
- </Tables>
- </SearchBillType>
-
- <SearchCurrency CmdType="Text" CmdText=" CREATE TABLE GetTaxCurrency
- (
- [Type] nvarchar(64)
- )
- INSERT INTO GetTaxCurrency VALUES ('外加')
- INSERT INTO GetTaxCurrency VALUES ('内含')
- SELECT Type AS TaxCurrency_SaleInvoiceProduct FROM GetTaxCurrency
- DROP TABLE GetTaxCurrency
- ">
- <Tables>
- <Table name="GetTaxCurrency" />
- </Tables>
- </SearchCurrency>
- <SearchSaleInvoiceFirst CmdType="Text" CmdText="DECLARE @ID_SaleInvoice UNIQUEIDENTIFIER
- SELECT TOP 1 @ID_SaleInvoice=ID_SaleInvoice
- FROM SaleInvoice ORDER BY No_SaleInvoice
- SELECT SaleInvoice.*,a.Name_User As Creator ,b.Name_User As Assessor
- ,c.Name_User As LastModUser,Customer.No_Customer,Customer.ShortName_Customer
- ,Customer.RevenueRegisterNo_Customer,Customer.Bank_Customer
- ,Customer.Account_Customer,Customer.GetMethod_Customer
- ,Customer.Company_Customer
- ,TypeName=CASE Type_SaleInvoice When 0 Then '普通发票' ELSE '增值税发票' End
- FROM SaleInvoice
- LEFT JOIN AppUser a ON SaleInvoice.ID_Creator=a.ID_User
- LEFT JOIN AppUser b ON SaleInvoice.ID_Assessor=b.ID_User
- LEFT JOIN AppUser c ON SaleInvoice.LastModUser_SaleInvoice=c.ID_User
- Left JOIN Customer On Customer.ID_Customer=SaleInvoice.ID_Customer
- WHERE ID_SaleInvoice=@ID_SaleInvoice
- SELECT SaleInvoiceProduct.*
- ,Product.No_Product,Product.Name_Product
- ,Product.InvoiceName_Product
- ,Product.Unit_Product,BillType.Name_BillType
- ,A.No_Customer As No_Customer
- ,A.ShortName_Customer As ShortName_Customer
- FROM SaleInvoiceProduct
- LEFT JOIN Product On Product.ID_Product=SaleInvoiceProduct.ID_Product
- LEFT JOIN BillType On BillType.Value_BillType=SaleInvoiceProduct.Type_FromBill
- Left Join (select No_SaleBill As No_Bill
- ,Customer.No_Customer As No_Customer
- ,Customer.ShortName_Customer As ShortName_Customer
- From SaleBill
- Left join Customer on Customer.ID_Customer=SaleBill.ID_Customer
- Where ID_Assessor Is Not Null
- Union All
- select No_SaleRtnBill As No_Bill
- ,Customer.No_Customer As No_Customer
- ,Customer.ShortName_Customer As ShortName_Customer
- From SaleRtnBill
- Left join Customer on Customer.ID_Customer=SaleRtnBill.ID_Customer
- Where ID_Assessor Is Not Null) A On A.No_Bill = SaleInvoiceProduct.No_FromBill
- WHERE ID_SaleInvoice=@ID_SaleInvoice
- ">
- <Tables>
- <Table name="SaleInvoice"/>
- <Table name="SaleInvoiceProduct"/>
- </Tables>
- </SearchSaleInvoiceFirst>
- <SearchSaleInvoiceLast CmdType="Text" CmdText=" DECLARE @ID_SaleInvoice UNIQUEIDENTIFIER
- SELECT TOP 1 @ID_SaleInvoice=ID_SaleInvoice
- FROM SaleInvoice ORDER BY No_SaleInvoice DESC
- SELECT SaleInvoice.*,a.Name_User As Creator ,b.Name_User As Assessor
- ,c.Name_User As LastModUser,Customer.No_Customer,Customer.ShortName_Customer
- ,Customer.RevenueRegisterNo_Customer,Customer.Bank_Customer
- ,Customer.Account_Customer,Customer.GetMethod_Customer
- ,Customer.Company_Customer
- ,TypeName=CASE Type_SaleInvoice When 0 Then '普通发票' ELSE '增值税发票' End
- FROM SaleInvoice
- LEFT JOIN AppUser a ON SaleInvoice.ID_Creator=a.ID_User
- LEFT JOIN AppUser b ON SaleInvoice.ID_Assessor=b.ID_User
- LEFT JOIN AppUser c ON SaleInvoice.LastModUser_SaleInvoice=c.ID_User
- Left JOIN Customer On Customer.ID_Customer=SaleInvoice.ID_Customer
- WHERE ID_SaleInvoice=@ID_SaleInvoice
- SELECT SaleInvoiceProduct.*
- ,Product.No_Product,Product.Name_Product
- ,Product.InvoiceName_Product
- ,Product.Unit_Product,BillType.Name_BillType
- ,A.No_Customer As No_Customer
- ,A.ShortName_Customer As ShortName_Customer
- FROM SaleInvoiceProduct
- LEFT JOIN Product On Product.ID_Product=SaleInvoiceProduct.ID_Product
- LEFT JOIN BillType On BillType.Value_BillType=SaleInvoiceProduct.Type_FromBill
- Left Join (select No_SaleBill As No_Bill
- ,Customer.No_Customer As No_Customer
- ,Customer.ShortName_Customer As ShortName_Customer
- From SaleBill
- Left join Customer on Customer.ID_Customer=SaleBill.ID_Customer
- Where ID_Assessor Is Not Null
- Union All
- select No_SaleRtnBill As No_Bill
- ,Customer.No_Customer As No_Customer
- ,Customer.ShortName_Customer As ShortName_Customer
- From SaleRtnBill
- Left join Customer on Customer.ID_Customer=SaleRtnBill.ID_Customer
- Where ID_Assessor Is Not Null) A On A.No_Bill = SaleInvoiceProduct.No_FromBill
- WHERE ID_SaleInvoice=@ID_SaleInvoice
- ">
- <Tables>
- <Table name="SaleInvoice"/>
- <Table name="SaleInvoiceProduct"/>
- </Tables>
- </SearchSaleInvoiceLast>
- <SearchSaleInvoicePrevious CmdType="Text" CmdText=" DECLARE @ID_SaleInvoice UNIQUEIDENTIFIER
- SELECT TOP 1 @ID_SaleInvoice=ID_SaleInvoice FROM SaleInvoice
- WHERE No_SaleInvoice < @No_SaleInvoice
- ORDER BY No_SaleInvoice DESC
- SELECT SaleInvoice.*,a.Name_User As Creator ,b.Name_User As Assessor
- ,c.Name_User As LastModUser,Customer.No_Customer,Customer.ShortName_Customer
- ,Customer.RevenueRegisterNo_Customer,Customer.Bank_Customer
- ,Customer.Account_Customer,Customer.GetMethod_Customer
- ,Customer.Company_Customer
- ,TypeName=CASE Type_SaleInvoice When 0 Then '普通发票' ELSE '增值税发票' End
- FROM SaleInvoice
- LEFT JOIN AppUser a ON SaleInvoice.ID_Creator=a.ID_User
- LEFT JOIN AppUser b ON SaleInvoice.ID_Assessor=b.ID_User
- LEFT JOIN AppUser c ON SaleInvoice.LastModUser_SaleInvoice=c.ID_User
- Left JOIN Customer On Customer.ID_Customer=SaleInvoice.ID_Customer
- WHERE ID_SaleInvoice=@ID_SaleInvoice
- SELECT SaleInvoiceProduct.*
- ,Product.No_Product,Product.Name_Product
- ,Product.InvoiceName_Product
- ,Product.Unit_Product,BillType.Name_BillType
- ,A.No_Customer As No_Customer
- ,A.ShortName_Customer As ShortName_Customer
- FROM SaleInvoiceProduct
- LEFT JOIN Product On Product.ID_Product=SaleInvoiceProduct.ID_Product
- LEFT JOIN BillType On BillType.Value_BillType=SaleInvoiceProduct.Type_FromBill
- Left Join (select No_SaleBill As No_Bill
- ,Customer.No_Customer As No_Customer
- ,Customer.ShortName_Customer As ShortName_Customer
- From SaleBill
- Left join Customer on Customer.ID_Customer=SaleBill.ID_Customer
- Where ID_Assessor Is Not Null
- Union All
- select No_SaleRtnBill As No_Bill
- ,Customer.No_Customer As No_Customer
- ,Customer.ShortName_Customer As ShortName_Customer
- From SaleRtnBill
- Left join Customer on Customer.ID_Customer=SaleRtnBill.ID_Customer
- Where ID_Assessor Is Not Null) A On A.No_Bill = SaleInvoiceProduct.No_FromBill
- WHERE ID_SaleInvoice=@ID_SaleInvoice
- ">
- <Params>
- <Param name="@No_SaleInvoice" type="SaleInvoice.No_SaleInvoice" Index="0" />
- </Params>
- <Tables>
- <Table name="SaleInvoice"/>
- <Table name="SaleInvoiceProduct"/>
- </Tables>
- </SearchSaleInvoicePrevious>
- <SearchSaleInvoiceNext CmdType="Text" CmdText=" DECLARE @ID_SaleInvoice UNIQUEIDENTIFIER
- SELECT TOP 1 @ID_SaleInvoice=ID_SaleInvoice FROM SaleInvoice
- WHERE No_SaleInvoice > @No_SaleInvoice
- ORDER BY No_SaleInvoice
- SELECT SaleInvoice.*,a.Name_User As Creator ,b.Name_User As Assessor
- ,c.Name_User As LastModUser,Customer.No_Customer,Customer.ShortName_Customer
- ,Customer.RevenueRegisterNo_Customer,Customer.Bank_Customer
- ,Customer.Account_Customer,Customer.GetMethod_Customer
- ,Customer.Company_Customer
- ,TypeName=CASE Type_SaleInvoice When 0 Then '普通发票' ELSE '增值税发票' End
- FROM SaleInvoice
- LEFT JOIN AppUser a ON SaleInvoice.ID_Creator=a.ID_User
- LEFT JOIN AppUser b ON SaleInvoice.ID_Assessor=b.ID_User
- LEFT JOIN AppUser c ON SaleInvoice.LastModUser_SaleInvoice=c.ID_User
- Left JOIN Customer On Customer.ID_Customer=SaleInvoice.ID_Customer
- WHERE ID_SaleInvoice=@ID_SaleInvoice
- SELECT SaleInvoiceProduct.*
- ,Product.No_Product,Product.Name_Product
- ,Product.InvoiceName_Product
- ,Product.Unit_Product,BillType.Name_BillType
- ,A.No_Customer As No_Customer
- ,A.ShortName_Customer As ShortName_Customer
- FROM SaleInvoiceProduct
- LEFT JOIN Product On Product.ID_Product=SaleInvoiceProduct.ID_Product
- LEFT JOIN BillType On BillType.Value_BillType=SaleInvoiceProduct.Type_FromBill
- Left Join (select No_SaleBill As No_Bill
- ,Customer.No_Customer As No_Customer
- ,Customer.ShortName_Customer As ShortName_Customer
- From SaleBill
- Left join Customer on Customer.ID_Customer=SaleBill.ID_Customer
- Where ID_Assessor Is Not Null
- Union All
- select No_SaleRtnBill As No_Bill
- ,Customer.No_Customer As No_Customer
- ,Customer.ShortName_Customer As ShortName_Customer
- From SaleRtnBill
- Left join Customer on Customer.ID_Customer=SaleRtnBill.ID_Customer
- Where ID_Assessor Is Not Null) A On A.No_Bill = SaleInvoiceProduct.No_FromBill
- WHERE ID_SaleInvoice=@ID_SaleInvoice
- ">
- <Params>
- <Param name="@No_SaleInvoice" type="SaleInvoice.No_SaleInvoice" Index="0" />
- </Params>
- <Tables>
- <Table name="SaleInvoice"/>
- <Table name="SaleInvoiceProduct"/>
- </Tables>
- </SearchSaleInvoiceNext>
- <SearchContrSOB CmdType="Text" CmdText=" SELECT SystemSetting.SaleAndOutDepot_SystemSetting,SystemSetting.OutDepotAndSaleBack_SystemSetting
- FROM SystemSetting
- WHERE SystemSetting.OutDepotAndSaleBack_SystemSetting = 1
- And SystemSetting.SaleAndOutDepot_SystemSetting=1">
- <Tables>
- <Table name="SystemOutIn" />
- </Tables>
- </SearchContrSOB>
- <SearchContr CmdType="Text" CmdText=" SELECT SystemSetting.SaleBackAndInDepot_SystemSetting
- FROM SystemSetting
- WHERE SystemSetting.SaleBackAndInDepot_SystemSetting = 1">
- <Tables>
- <Table name="SystemSaleAndOutDepot" />
- </Tables>
- </SearchContr>
- <SearchAllSaleBill CmdType="Text" CmdText="Select SaleBill.Currency_SaleBill ,SaleBill.TaxCurrency_SaleBill
- ,SaleBill.ID_SaleBill,SaleBill.No_SaleBill,SaleBill.Date_SaleBill
- ,Customer.No_Customer,Customer.ShortName_Customer
- ,Case When SaleBill.ID_Assessor is null Then '未审核' Else '已审核' End As State_SaleBill
- ,Location.Name_Location,SaleBill.InvoiceAddress_Company,SaleBill.InvoiceTitle_Company
- From SaleBill
- Inner Join Customer On SaleBill.ID_Customer = Customer.ID_Customer
- Inner Join Location On Location.ID_Location = SaleBill.ID_Location" >
- <Tables>
- <Table name="AllSaleBill" />
- </Tables>
- </SearchAllSaleBill>
- <SearchAllSaleBillProduct CmdType="Text" CmdText="Select SaleBill.No_SaleBill,Product.No_Product,SaleBillProduct.No_SaleBillProduct
- ,Product.Name_Product,SaleBillProduct.Quantity_SaleBillProduct
- ,SaleBillProduct.UnitPrice_SaleBillProduct,SaleBill.TaxCurrency_SaleBill
- From SaleBillProduct
- Inner Join Product On Product.ID_Product = SaleBillProduct.ID_Product
- Inner Join SaleBill On SaleBill.ID_SaleBill =SaleBillProduct.ID_SaleBill" >
- <Tables>
- <Table name="AllSaleBillProduct" />
- </Tables>
- </SearchAllSaleBillProduct>
- <SearchAllSaleRtnBill CmdType="Text" CmdText="Select SaleRtnBill.ID_SaleRtnBill,SaleRtnBill.No_SaleRtnBill
- ,SaleRtnBill.Date_SaleRtnBill,Customer.No_Customer,Customer.ShortName_Customer
- ,Case When SaleRtnBill.ID_Assessor is null Then '未审核' Else '已审核' End As State_SaleRtnBill
- ,Location.Name_Location
- From SaleRtnBill
- Inner Join Customer On SaleRtnBill.ID_Customer = Customer.ID_Customer
- Inner Join Location On Location.ID_Location = SaleRtnBill.ID_Location">
- <Tables>
- <Table name="AllSaleRtnBill" />
- </Tables>
- </SearchAllSaleRtnBill>
- <SearchAllSaleRtnBillProduct CmdType="Text" CmdText="Select SaleRtnBill.No_SaleRtnBill,Product.No_Product
- ,SaleRtnBillProduct.No_SaleRtnBillProduct,Product.Name_Product
- ,SaleRtnBillProduct.Quantity_SaleRtnBillProduct
- ,SaleRtnBillProduct.UnitPrice_SaleRtnBillProduct
- ,SaleRtnBill.TaxCurrency_SaleRtnBill
- From SaleRtnBillProduct
- Inner Join Product On Product.ID_Product = SaleRtnBillProduct.ID_Product
- Inner Join SaleRtnBill On SaleRtnBill.ID_SaleRtnBill = SaleRtnBillProduct.ID_SaleRtnBill">
- <Tables>
- <Table name="AllSaleRtnBillProduct" />
- </Tables>
- </SearchAllSaleRtnBillProduct>
- <SearchAllSaleAndRtnBill CmdType="Text" CmdText=" Declare @ID_Customer Uniqueidentifier
- Declare @CessOut decimal(5,2)
- Select @ID_Customer = ID_Customer
- From Customer
- Where No_Customer = @No_Customer
- select @CessOut = CessOut_SystemSetting/100
- from SystemSetting
-
- Declare @Customer Table(ID_Customer Uniqueidentifier)
- Insert Into @Customer Values(@ID_Customer)
- Insert Into @Customer
- Select ID_Customer
- From Customer
- Where CustomerID_Customer = @ID_Customer
- SELECT '销货单' as Name_BillType
- ,No_SaleBill As No_FromBill
- ,No_SaleBillProduct As No_FromBillProduct
- ,Customer.No_Customer as No_Customer
- ,Customer.ShortName_customer as ShortName_customer
- ,SaleBillProduct.ID_Product
- ,isnull(SaleBillProduct.Quantity_SaleBillProduct,0) As Quantity_SaleInvoiceProduct
- ,isnull(SaleBillProduct.UnitPrice_SaleBillProduct,0) As UnitPrice_SaleInvoiceProduct
- ,Product.No_Product
- ,Product.Name_Product
- ,Product.InvoiceName_Product
- ,Product.Unit_Product
- ,Amount_SaleInvoiceProduct = isnull(SaleBillProduct.Quantity_SaleBillProduct,0)*isnull(SaleBillProduct.UnitPrice_SaleBillProduct,0)
- ,TaxAmount_SaleInvoiceProduct=case SaleBill.TaxCurrency_SaleBill when '外加'
- then Convert(decimal(18,2),Convert(decimal(18,2),isnull(SaleBillProduct.UnitPrice_SaleBillProduct,0)*isnull(SaleBillProduct.Quantity_SaleBillProduct,0))*@CessOut)
- when '内含'
- then Convert(decimal(18,2),(Convert(decimal(18,2),isnull(SaleBillProduct.UnitPrice_SaleBillProduct,0)*isnull(SaleBillProduct.Quantity_SaleBillProduct,0))*@CessOut)/(1+@CessOut))
- else 0 end
- ,Type_FromBill = 21
- ,SaleBill.TaxCurrency_SaleBill As TaxCurrency_SaleInvoiceProduct
- ,GoodsAmount_SaleInvoiceProduct=case SaleBill.TaxCurrency_SaleBill When '内含'
- Then (isnull(Quantity_SaleBillProduct,0)*isnull(UnitPrice_SaleBillProduct,0))/(1+@CessOut)
- else (isnull(Quantity_SaleBillProduct,0)*isnull(UnitPrice_SaleBillProduct,0)) end
- FROM SaleBillProduct
- LEFT JOIN SaleBill On SaleBill.ID_SaleBill=SaleBillProduct.ID_SaleBill
- LEFT JOIN Product On Product.ID_Product=SaleBillProduct.ID_Product
- LEFT JOIN Customer on Customer.ID_Customer=SaleBill.ID_Customer
- WHERE SaleBillProduct.Quantity_SaleBillProduct > 0
- AND SaleBillProduct.ID_SaleBill in (Select ID_SaleBill From SaleBill)
- And SaleBill.ID_Customer in (Select ID_Customer From @Customer)
- And Date_SaleBill Between isnull(DateAdd(day,DateDiff(day,0,@StartDate),0),Date_SaleBill) AND Isnull(DateAdd(day,DateDiff(day,0,@EndDate),1),Date_SaleBill)
- And SaleBill.ID_Assessor is not null
- And Assess_SaleBill = 0
- And SaleBill.Disable_SaleBill = 0
- And @ckRtn =1
- Union All
- SELECT '销售退货单' as Name_BillType
- ,No_SaleRtnBill As No_FromBill
- ,No_SaleRtnBillProduct As No_FromBillProduct
- ,Customer.No_Customer as No_Customer
- ,Customer.ShortName_customer as ShortName_customer
- ,SaleRtnBillProduct.ID_Product
- ,isnull(SaleRtnBillProduct.Quantity_SaleRtnBillProduct,0) As Quantity_SaleInvoiceProduct
- ,isnull(SaleRtnBillProduct.UnitPrice_SaleRtnBillProduct,0) As UnitPrice_SaleInvoiceProduct
- ,Product.No_Product,Product.Name_Product
- ,Product.InvoiceName_Product
- ,Product.Unit_Product
- ,Amount_SaleInvoiceProduct=isnull(SaleRtnBillProduct.Quantity_SaleRtnBillProduct,0)*isnull(SaleRtnBillProduct.UnitPrice_SaleRtnBillProduct,0)
- ,TaxAmount_SaleInvoiceProduct=case SaleRtnBill.TaxCurrency_SaleRtnBill
- when '外加'
- then Convert(decimal(18,2)
- ,Convert(decimal(18,2)
- ,isnull(SaleRtnBillProduct.UnitPrice_SaleRtnBillProduct,0)*isnull(SaleRtnBillProduct.Quantity_SaleRtnBillProduct,0)
- )*@CessOut
- )
- when '内含'
- then Convert(decimal(18,2)
- ,(Convert(decimal(18,2)
- ,isnull(SaleRtnBillProduct.UnitPrice_SaleRtnBillProduct,0)*isnull(SaleRtnBillProduct.Quantity_SaleRtnBillProduct,0) )*@CessOut
- )/(1+@CessOut)
- ) else 0 end
- ,Type_FromBill = 22
- ,SaleRtnBill.TaxCurrency_SaleRtnBill As TaxCurrency_SaleInvoiceProduct
- ,GoodsAmount_SaleInvoiceProduct=case SaleRtnBill.TaxCurrency_SaleRtnBill
- When '内含'
- Then (isnull(Quantity_SaleRtnBillProduct,0)*isnull(UnitPrice_SaleRtnBillProduct,0))/(1+@CessOut)
- else (isnull(Quantity_SaleRtnBillProduct,0)*isnull(UnitPrice_SaleRtnBillProduct,0)) end
- FROM SaleRtnBillProduct
- LEFT JOIN SaleRtnBill On SaleRtnBill.ID_SaleRtnBill=SaleRtnBillProduct.ID_SaleRtnBill
- LEFT JOIN Product On Product.ID_Product=SaleRtnBillProduct.ID_Product
- LEFT JOIN Customer on Customer.ID_Customer=SaleRtnBill.ID_Customer
- Where SaleRtnBill.ID_Assessor Is Not Null
- And SaleRtnBill.ID_Customer in (Select ID_Customer From @Customer)
- And @ckRtn =1
- And No_FromBill in (Select No_SaleBill From SaleBill
- Where Date_SaleBill Between isnull(DateAdd(day,DateDiff(day,0,@StartDate),0),Date_SaleBill)
- AND Isnull(DateAdd(day,DateDiff(day,0,@EndDate),1),Date_SaleBill)
- And SaleBill.ID_Assessor is not null
- And SaleBill.Assess_SaleBill = 0
- And SaleBill.Disable_SaleBill = 0
- )
- And Assess_SaleRtnBill = 0
- And Disable_SaleRtnBill = 0
- ">
- <Params>
- <Param name="@No_Customer" type="Customer.No_Customer" Index="0" />
- <Param name="@StartDate" type="Customer.BeginDate_Customer" Index="1" />
- <Param name="@EndDate" type="Customer.BeginDate_Customer" Index="2" />
- <Param name="@ckRtn" type="Customer.IsCustomersCustomer_Customer" Index="3" />
- </Params>
- <Tables>
- <Table name="SaleInvoiceProduct1"/>
- </Tables>
- </SearchAllSaleAndRtnBill>
- <SearchAllSale CmdType="Text" CmdText=" Declare @ID_Customer Uniqueidentifier
- Declare @CessOut decimal(5,2)
- Select @ID_Customer = ID_Customer
- From Customer
- Where No_Customer = @No_Customer
- select @CessOut = CessOut_SystemSetting/100 from SystemSetting
-
- Declare @Customer Table(ID_Customer Uniqueidentifier)
- Insert Into @Customer Values(@ID_Customer)
- Insert Into @Customer
- Select ID_Customer
- From Customer
- Where CustomerID_Customer = @ID_Customer
- SELECT '销货单' as Name_BillType
- ,No_SaleBill As No_FromBill
- ,No_SaleBillProduct As No_FromBillProduct
- ,Customer.No_Customer as No_Customer
- ,Customer.ShortName_customer as ShortName_customer
- ,SaleBillProduct.ID_Product
- ,isnull(SaleBillProduct.Quantity_SaleBillProduct,0) As Quantity_SaleInvoiceProduct
- ,isnull(SaleBillProduct.UnitPrice_SaleBillProduct,0) As UnitPrice_SaleInvoiceProduct
- ,Product.No_Product
- ,Product.Name_Product
- ,Product.InvoiceName_Product
- ,Product.Unit_Product
- ,Amount_SaleInvoiceProduct = isnull(SaleBillProduct.Quantity_SaleBillProduct,0)*isnull(SaleBillProduct.UnitPrice_SaleBillProduct,0)
- ,case SaleBill.TaxCurrency_SaleBill when '外加'
- then Convert(decimal(18,2),Convert(decimal(18,2),isnull(SaleBillProduct.UnitPrice_SaleBillProduct,0)*isnull(SaleBillProduct.Quantity_SaleBillProduct,0))*@CessOut)
- when '内含'
- then Convert(decimal(18,2),(Convert(decimal(18,2),isnull(SaleBillProduct.UnitPrice_SaleBillProduct,0)*isnull(SaleBillProduct.Quantity_SaleBillProduct,0))*@CessOut)/(1+@CessOut))
- else 0 end as TaxAmount_SaleInvoiceProduct
-
- ,Type_FromBill = 21
- ,SaleBill.TaxCurrency_SaleBill As TaxCurrency_SaleInvoiceProduct
- ,GoodsAmount_SaleInvoiceProduct=case SaleBill.TaxCurrency_SaleBill When '内含'
- Then (isnull(Quantity_SaleBillProduct,0)*isnull(UnitPrice_SaleBillProduct,0))/(1+@CessOut)
- else (isnull(Quantity_SaleBillProduct,0)*isnull(UnitPrice_SaleBillProduct,0)) end
- FROM SaleBillProduct
- LEFT JOIN SaleBill On SaleBill.ID_SaleBill=SaleBillProduct.ID_SaleBill
- LEFT JOIN Product On Product.ID_Product=SaleBillProduct.ID_Product
- LEFT JOIN Customer on Customer.ID_Customer=SaleBill.ID_Customer
- WHERE SaleBillProduct.Quantity_SaleBillProduct > 0
- AND SaleBillProduct.ID_SaleBill in (Select ID_SaleBill From SaleBill)
- And SaleBill.ID_Customer in (Select ID_Customer From @Customer)
- And Date_SaleBill Between isnull(DateAdd(day,DateDiff(day,0,@StartDate),0),Date_SaleBill) AND Isnull(DateAdd(day,DateDiff(day,0,@EndDate),1),Date_SaleBill)
- And SaleBill.ID_Assessor is not null
- And Assess_SaleBill = 0
- And SaleBill.Disable_SaleBill = 0
- And @ckRtn =0
- ">
- <Params>
- <Param name="@No_Customer" type="Customer.No_Customer" Index="0" />
- <Param name="@StartDate" type="Customer.BeginDate_Customer" Index="1" />
- <Param name="@EndDate" type="Customer.BeginDate_Customer" Index="2" />
- <Param name="@ckRtn" type="Customer.IsCustomersCustomer_Customer" Index="3" />
- </Params>
- <Tables>
- <Table name="SaleInvoiceProduct2"/>
- </Tables>
- </SearchAllSale>
- <SearchCustomerRelation CmdType="Text" CmdText ="if (@CustomerIDSaleInvoice = @CustomerIDBill)
- Begin
- select *
- from Customer
- where id_customer = @CustomerIDSaleInvoice
- End
- else
- Begin
- select *
- from Customer
- where id_customer =@CustomerIDBill
- and CustomerID_Customer = @CustomerIDSaleInvoice
- End">
- <Params>
- <Param name="@CustomerIDSaleInvoice" type="Customer.ID_Customer" Index="0" />
- <Param name="@CustomerIDBill" type="Customer.ID_Customer" Index="1" />
- </Params>
- <Tables>
- <Table name="CustomerRelation"/>
- </Tables>
- </SearchCustomerRelation>
- <SearchTemp CmdType="Text" CmdText="SELECT TOP 0 SaleInvoiceProduct.*,
- convert(nvarchar(64),'') As Name_BillType
- ,Product.No_Product
- ,Product.Name_Product
- ,Product.InvoiceName_Product
- ,Product.Unit_Product
- ,convert(bit,0) AS Negative
- ,Convert(nvarchar(64),'') As No_Customer
- ,Convert(nvarchar(64),'') As ShortName_Customer
- FROM SaleInvoiceProduct
- LEFT JOIN Product On Product.ID_Product=SaleInvoiceProduct.ID_Product">
- <Tables>
- <Table name="Temp"/>
- </Tables>
- </SearchTemp>
- <DeleteRow CmdType="Text" CmdText=" Delete SaleInvoiceProduct Where ID_SaleInvoiceProduct = @ID_SaleInvoiceProduct
- Select 1
- ">
- <Params>
- <Param name="@ID_SaleInvoiceProduct" type="SaleInvoiceProduct.ID_SaleInvoiceProduct" Index="0" />
- </Params>
- <Tables>
- <Table name="delete"/>
- </Tables>
- </DeleteRow>
- <SearchPayDate CmdType="Text" CmdText=" select dateadd(month,datediff(month,0,@date)+2,0)-1+ @DunDate as NextEndDate
- ">
- <Params>
- <Param name="@date" type="SaleInvoice.PayDate_SaleInvoice" Index="0" />
- <Param name="@DunDate" type="Customer.DunDate_Customer" Index="1" />
- </Params>
- <Tables>
- <Table name="PayDate"/>
- </Tables>
- </SearchPayDate>
- <SearchPayDate2 CmdType="Text" CmdText=" select dateadd(month,datediff(month,0,@date)+3,0)-1+ @DunDate as NextEndDate
- ">
- <Params>
- <Param name="@date" type="SaleInvoice.PayDate_SaleInvoice" Index="0" />
- <Param name="@DunDate" type="Customer.DunDate_Customer" Index="1" />
- </Params>
- <Tables>
- <Table name="PayDate2"/>
- </Tables>
- </SearchPayDate2>
- <SearchPayDate3 CmdType="Text" CmdText=" select dateadd(month,datediff(month,0,@date)+4,0)-1+ @DunDate as NextEndDate
- ">
- <Params>
- <Param name="@date" type="SaleInvoice.PayDate_SaleInvoice" Index="0" />
- <Param name="@DunDate" type="Customer.DunDate_Customer" Index="1" />
- </Params>
- <Tables>
- <Table name="PayDate3"/>
- </Tables>
- </SearchPayDate3>
- <SearchPayDate4 CmdType="Text" CmdText=" select dateadd(month,datediff(month,0,@date)+5,0)-1+ @DunDate as NextEndDate
- ">
- <Params>
- <Param name="@date" type="SaleInvoice.PayDate_SaleInvoice" Index="0" />
- <Param name="@DunDate" type="Customer.DunDate_Customer" Index="1" />
- </Params>
- <Tables>
- <Table name="PayDate4"/>
- </Tables>
- </SearchPayDate4>
- <SearchPayDate5 CmdType="Text" CmdText=" select dateadd(month,datediff(month,0,@date)+1,10)-1+ @DunDate as NextEndDate
- ">
- <Params>
- <Param name="@date" type="SaleInvoice.PayDate_SaleInvoice" Index="0" />
- <Param name="@DunDate" type="Customer.DunDate_Customer" Index="1" />
- </Params>
- <Tables>
- <Table name="PayDate5"/>
- </Tables>
- </SearchPayDate5>
- </Search>
- </Server>
- <Lables>
- <Search>
- Empty();
- NewInstance();
- tbNo.ReadOnly=false;
- dtDate.Enabled=false;
- cbType.Enabled=false;
- dtInvoiceDate.Enabled=false;
- txtInvoiceNo.ReadOnly=true;
- btnModify.Enabled=false;
- tbCustomerNo.ReadOnly=true;
- cbInvoiceTitle.Enabled=false;
- cbInvoiceAddress.Enabled=false;
- cbBank.Enabled=false;
- txtAccount.ReadOnly=true;
- dtPayDate.Enabled=false;
- dgProduct.ReadOnly=true;
- txtMoneySum.CValue=0.00;
- txtTaxSum.CValue=0.00;
- txtSum.CValue=0.00;
- dtStart.Enabled = false;
- dtEnd.Enabled = false;
- ckRtn.Enabled = false;
- btnSearch.Enabled=false;
- #SaleInvoice.Creator=DBNull();
- #SaleInvoice.ID_Creator=DBNull();
- #SaleInvoice.Assessor=DBNull();
- #SaleInvoice.ID_Assessor=DBNull();
- #SaleInvoice.AssessDate_SaleInvoice=DBNull();
- #SaleInvoice.LastModUser_SaleInvoice=DBNull();
- #SaleInvoice.LastModUser=DBNull();
- #SaleInvoice.LastModDate_SaleInvoice=DBNull();
- toolBar.EnableSubmit=false;
- toolBar.EnableModify=false;
- toolBar.EnableDelete=false;
- toolBar.EnableAudit=false;
- toolBar.EnableNew=GetRight(@Title,"新增");
- toolBar.EnablePrint=false;
- toolBar.EnableBlank=false;
- toolBar.EnableImport = false;
- OperateControlEvent("dtInvoiceDate","ValueChanged",false);
- UpdateForm(true,"");
- OperateControlEvent("dtInvoiceDate","ValueChanged",true);
- tbNo.Focus();
- cbType.Text="";
- @Status=0;
- </Search>
- <New>
- Empty();
- NewInstance();
- tbNo.ReadOnly=true;
- dtDate.Enabled=true;
- cbType.Enabled=true;
- dtInvoiceDate.Enabled=true;
- txtInvoiceNo.ReadOnly=false;
- btnModify.Enabled=false;
- tbCustomerNo.ReadOnly=false;
- cbInvoiceTitle.Enabled=true;
- cbInvoiceAddress.Enabled=true;
- cbBank.Enabled=true;
- txtAccount.ReadOnly=false;
- dtPayDate.Enabled=false;
- dgProduct.ReadOnly=false;
- txtMoneySum.CValue=0.00;
- txtTaxSum.CValue=0.00;
- txtSum.CValue=0.00;
- dtStart.Enabled = true;
- dtEnd.Enabled = true;
- ckRtn.Enabled = true;
- btnSearch.Enabled=true;
- dtDate.Focus();
- #SaleInvoice.TypeName="增值税发票";
- #SaleInvoice.Currency_SaleInvoice= @SysCurrency;
- #SaleInvoice.ID_SaleInvoice=NewGuid();
- #SaleInvoice.Creator=GetCurrentUser();
- #SaleInvoice.ID_Creator=GetLoginUserID();
- #SaleInvoice.Assessor=DBNull();
- #SaleInvoice.ID_Assessor=DBNull();
- #SaleInvoice.AssessDate_SaleInvoice=DBNull();
- #SaleInvoice.LastModUser_SaleInvoice=DBNull();
- #SaleInvoice.LastModUser=DBNull();
- #SaleInvoice.LastModDate_SaleInvoice=DBNull();
- toolBar.EnableSubmit=GetRight(@Title,"新增");
- toolBar.EnableModify=false;
- toolBar.EnableDelete=false;
- toolBar.EnableAudit=false;
- toolBar.EnableNew=false;
- toolBar.EnablePrint=false;
- toolBar.EnableBlank=false;
- toolBar.EnableImport = true;
- OperateControlEvent("dtInvoiceDate","ValueChanged",false);
- UpdateForm(true,"");
- OperateControlEvent("dtInvoiceDate","ValueChanged",true);
- <!--cbType.SelectedIndex=1;-->
- @Status=1;
- </New>
- <View>
- tbNo.ReadOnly=true;
- dtDate.Enabled=false;
- cbType.Enabled=false;
- dtInvoiceDate.Enabled=false;
- txtInvoiceNo.ReadOnly=true;
- if(!Equals(#SaleInvoice.ID_Assessor,DBNull())&&#SaleInvoice.Disable_SaleInvoice==false)
- btnModify.Enabled=true;
- else
- btnModify.Enabled=false;
- tbCustomerNo.ReadOnly=true;
- cbInvoiceTitle.Enabled=false;
- cbInvoiceAddress.Enabled=false;
- cbBank.Enabled=false;
- txtAccount.ReadOnly=true;
- dtPayDate.Enabled=false;
- dgProduct.ReadOnly=true;
- dtStart.Enabled = false;
- dtEnd.Enabled = false;
- ckRtn.Enabled = false;
- btnSearch.Enabled=false;
- toolBar.EnableSubmit=false;
- toolBar.EnableNew=GetRight(@Title,"新增");
- if(Equals(#SaleInvoice.ID_Assessor, DBNull()))
- {
- toolBar.EnableAudit=GetRight(@Title,"审核");
- toolBar.EnableModify=GetRight(@Title,"修改");
- toolBar.EnableDelete=GetRight(@Title,"删除");
- toolBar.EnableBlank=false;
- }
- else
- {
- toolBar.EnableAudit=false;
- toolBar.EnableModify=false;
- toolBar.EnableDelete=false;
- if(#SaleInvoice.Disable_SaleInvoice==false)
- toolBar.EnableBlank=GetRight(@Title,"审核");
- else
- toolBar.EnableBlank=false;
- }
- toolBar.EnablePrint=GetRight(@Title,"打印");
- toolBar.EnableImport = false;
- OperateControlEvent("dtInvoiceDate","ValueChanged",false);
- UpdateForm(true,"");
- OperateControlEvent("dtInvoiceDate","ValueChanged",true);
- <!--if(#SaleInvoice.Disable_SaleInvoice==true)
- ikGradualLabel1.Text=ikGradualLabel1.Text+"(已作废)";-->
- @Status=2;
- </View>
- <Modify>
- tbNo.ReadOnly=true;
- dtDate.Enabled=false;
- cbType.Enabled=true;
- dtInvoiceDate.Enabled=true;
- txtInvoiceNo.ReadOnly=false;
- btnModify.Enabled=false;
- tbCustomerNo.ReadOnly=false;
- cbInvoiceTitle.Enabled=true;
- cbInvoiceAddress.Enabled=true;
- cbBank.Enabled=true;
- txtAccount.ReadOnly=false;
- dtPayDate.Enabled=false;
- dgProduct.ReadOnly=false;
- dtStart.Enabled = true;
- dtEnd.Enabled = true;
- ckRtn.Enabled = true;
- btnSearch.Enabled=true;
- #SaleInvoice.LastModUser=GetCurrentUser();
- #SaleInvoice.LastModUser_SaleInvoice=GetLoginUserID();
- #SaleInvoice.LastModDate_SaleInvoice=GetCurrentTime();
- toolBar.EnableSubmit=GetRight(@Title,"修改");
- toolBar.EnableModify=false;
- toolBar.EnableDelete=false;
- toolBar.EnableAudit=false;
- toolBar.EnableNew=false;
- toolBar.EnablePrint=false;
- toolBar.EnableImport = true;
- OperateControlEvent("dtInvoiceDate","ValueChanged",false);
- UpdateForm(true,"");
- OperateControlEvent("dtInvoiceDate","ValueChanged",true);
- @Status=3;
- </Modify>
- <SubmitButtonClick>
- <![CDATA[
- if(cbType.Text==StringEmpty())
- {
- MessageBox("请输入有效的发票种类!",@Title);
- tbDetail.SelectedIndex = 0;
- cbType.Focus();
- return;
- }
- if(!Equals(txtInvoiceNo.CValue,""))
- {
- if(Search("SearchInvoiceNo",txtInvoiceNo.CValue,tbNo.CValue))
- {
- MessageBox("该发票号码已存在!",@Title);
- tbDetail.SelectedIndex = 0;
- txtInvoiceNo.Focus();
- return;
- }
- }
- if(!Search("SearchCustomer",tbCustomerNo.CValue)|| !Equals(#SaleInvoice.ID_Customer,#Customer.ID_Customer))
- {
- MessageBox("请输入有效客户,回车以示确认!",@Title);
- tbDetail.SelectedIndex = 0;
- tbCustomerNo.Focus();
- return;
- }
- if(!cbInvoiceTitle.CheckSelectedItem())
- {
- MessageBox("请输入有效的发票抬头!",@Title);
- tbDetail.SelectedIndex = 0;
- cbInvoiceTitle.Focus();
- return;
- }
- if(!cbInvoiceAddress.CheckSelectedItem())
- {
- MessageBox("请输入有效的发票地址!",@Title);
- tbDetail.SelectedIndex = 0;
- cbInvoiceAddress.Focus();
- return;
- }
- if(!cbBank.CheckSelectedItem())
- {
- MessageBox("请输入有效的开户行!",@Title);
- tbDetail.SelectedIndex = 0;
- cbBank.Focus();
- return;
- }
-
- if(txtAccount.CValue==StringEmpty())
- {
- MessageBox("请输入有效的银行帐号!",@Title);
- tbDetail.SelectedIndex = 0;
- txtAccount.Focus();
- return;
- }
- if(RowCount("SaleInvoiceProduct")==0)
- {
- MessageBox("请输入销项发票产品!",@Title);
- tbDetail.SelectedIndex = 1;
- dgProduct.Focus();
- return;
- }
- UpdateForm(false, "");
- SuspendLayout();
- for(@index=0;@index<RowCount("#Temp");@index=@index+1)
- {
- SetPosition("#Temp",@index);
- Search("DeleteRow",#Temp.ID_SaleInvoiceProduct);
- }
-
- for(@i=0;@i<RowCount("#SaleInvoiceProduct");@i=@i+1)
- {
- SetPosition("#SaleInvoiceProduct",@i);
-
- if (Equals(#SaleInvoiceProduct.Name_BillType,"销货单"))
- {
- if(Search("SearchSaleBill",#SaleInvoiceProduct.No_FromBill,#SaleInvoiceProduct.No_FromBillProduct))
- {
- if (Equals(#SaleBill.ID_Assessor,DBNull()))
- {
- tbDetail.SelectedIndex = 1;
- dgProduct.CurrentRowIndex = @i;
- MessageBox("该来源单据未经审核,提交失败!",@Title);
- dgProduct.Focus();
- ResumeLayout();
- return;
- }
-
- if (!Search("SearchCustomerRelation",#SaleInvoice.ID_Customer,#SaleBill.ID_Customer))
- {
- tbDetail.SelectedIndex = 1;
- dgProduct.CurrentRowIndex = @i;
- MessageBox("该来源单据的客户与本销项发票的客户或下级客户不一致,提交失败!",@Title);
- dgProduct.Focus();
- ResumeLayout();
- return;
- }
- if(#SaleBill.InvoiceAddress_Company!=#SaleInvoice.InvoiceAddress_SaleInvoice||#SaleBill.InvoiceTitle_Company!=#SaleInvoice.InvoiceTitle_SaleInvoice)
- {
- tbDetail.SelectedIndex = 1;
- dgProduct.CurrentRowIndex=@i;
- @ClickResult = MessageBox("销货单中的发票抬头(发票地址)与页面不一致,是否继续?",@Title,MB_OKCANCEL);
- if (@ClickResult == DialogResult("CANCEL"))
- {
- dgProduct.Focus();
- ResumeLayout();
- return;
- }
- }
- if(!Equals(#SaleInvoiceProduct.ID_Product,#SaleBill.ID_Product))
- {
- tbDetail.SelectedIndex = 1;
- dgProduct.CurrentRowIndex = @i;
- MessageBox("该来源单据产品单中指定的产品与后改写的产品不匹配!",@Title);
- dgProduct.Focus();
- ResumeLayout();
- return;
- }
- }
-
- }
- if (Equals(#SaleInvoiceProduct.Name_BillType,"销售退货单"))
- {
- if(Search("SearchSaleRtnBill",#SaleInvoiceProduct.No_FromBill,#SaleInvoiceProduct.No_FromBillProduct))
- {
- if (Equals(#SaleRtnBill.ID_Assessor,DBNull()))
- {
- tbDetail.SelectedIndex = 1;
- dgProduct.CurrentRowIndex = @i;
- MessageBox("该来源单据未经审核,提交失败!",@Title);
- dgProduct.Focus();
- ResumeLayout();
- return;
- }
- if (!Search("SearchCustomerRelation",#SaleInvoice.ID_Customer,#SaleRtnBill.ID_Customer))
- {
- tbDetail.SelectedIndex = 1;
- dgProduct.CurrentRowIndex = @i;
- MessageBox("该来源单据的客户与本销项发票的客户或下级不一致,提交失败!",@Title);
- dgProduct.Focus();
- ResumeLayout();
- return;
- }
- if(!Equals(#SaleInvoiceProduct.ID_Product,#SaleRtnBill.ID_Product))
- {
- tbDetail.SelectedIndex = 1;
- dgProduct.CurrentRowIndex = @i;
- MessageBox("该来源单据产品单中指定的产品与后改写的产品不匹配!",@Title);
- dgProduct.Focus();
- ResumeLayout();
- return;
- }
- }
- }
- if(Equals(#SaleInvoiceProduct.No_Product,""))
- {
- tbDetail.SelectedIndex = 1;
- dgProduct.CurrentRowIndex=@i;
- MessageBox("请输入产品编号!",@Title);
- ResumeLayout();
- return;
- }
- if(Equals(#SaleInvoiceProduct.ID_Product,GuidEmpty()))
- {
- tbDetail.SelectedIndex = 1;
- dgProduct.CurrentRowIndex=@i;
- MessageBox("该产品不存在!",@Title);
- ResumeLayout();
- return;
- }
- if(#SaleInvoiceProduct.Quantity_SaleInvoiceProduct<=0)
- {
- tbDetail.SelectedIndex = 1;
- dgProduct.CurrentRowIndex=@i;
- MessageBox("数量不得小于等于0!",@Title);
- ResumeLayout();
- return;
- }
- if(Equals(#SaleInvoiceProduct.TaxCurrency_SaleInvoiceProduct,""))
- {
- tbDetail.SelectedIndex = 1;
- dgProduct.CurrentRowIndex=@i;
- MessageBox("请输入税别!",@Title);
- ResumeLayout();
- return;
- }
- if(Equals(#SaleInvoiceProduct.ID_SaleInvoiceProduct,GuidEmpty()))
- {
- #SaleInvoiceProduct.ID_SaleInvoiceProduct=NewGuid();
- }
- #SaleInvoiceProduct.ID_SaleInvoice=#SaleInvoice.ID_SaleInvoice;
- }
- ResumeLayout();
- if(@Status==1)
- { #SaleInvoice.CreateDate_SaleInvoice=GetCurrentTime();
- #SaleInvoice.No_SaleInvoice = New("#SaleInvoice.No_SaleInvoice", dtDate.CValue);
- }
- else if(@Status==3)
- {
- #SaleInvoice.LastModUser=GetCurrentUser();
- #SaleInvoice.LastModUser_SaleInvoice=GetLoginUserID();
- #SaleInvoice.LastModDate_SaleInvoice=GetCurrentTime();
- Update();
- }
- ChangeMode("View",#SaleInvoice.ID_Assessor);
- ]]>
- </SubmitButtonClick>
- <CountSum>
- <![CDATA[
- if (RowCount("#SaleInvoiceProduct") == 0)
- {
- txtMoneySum.CValue=0;
- txtTaxSum.CValue=0;
- txtSum.CValue=0;
- }
- else
- {
- @txtMoneySumTemp=0;
- @txtTaxSumTemp=0;
- SuspendLayout();
- for(@i=0;@i<RowCount("#SaleInvoiceProduct");@i++)
- {
- SetPosition("#SaleInvoiceProduct",@i);
- if(#SaleInvoiceProduct.Type_FromBill==22)
- {
- @txtMoneySumTemp=FormatNumber(@txtMoneySumTemp-#SaleInvoiceProduct.GoodsAmount_SaleInvoiceProduct,@PriceDecimal);
- @txtTaxSumTemp=FormatNumber(@txtTaxSumTemp-#SaleInvoiceProduct.TaxAmount_SaleInvoiceProduct,@PriceDecimal);
- }
- else
- {
- @txtMoneySumTemp=FormatNumber(@txtMoneySumTemp+#SaleInvoiceProduct.GoodsAmount_SaleInvoiceProduct,@PriceDecimal);
- @txtTaxSumTemp=FormatNumber(@txtTaxSumTemp+#SaleInvoiceProduct.TaxAmount_SaleInvoiceProduct,@PriceDecimal);
- }
- }
- ResumeLayout();
- txtMoneySum.CValue=@txtMoneySumTemp;
- txtTaxSum.CValue=@txtTaxSumTemp;
- txtSum.CValue=txtMoneySum.CValue+txtTaxSum.CValue;
- }
- UpdateForm(false,"txtSum");
- UpdateForm(false,"txtMoneySum");
- UpdateForm(false,"txtTaxSum");
- ]]>
- </CountSum>
- <FromBillChange>
- if(!Equals(#SaleInvoiceProduct.Name_BillType,"")&&!Equals(#SaleInvoiceProduct.No_FromBill,"")&& !Equals(#SaleInvoiceProduct.No_FromBillProduct,""))
- {
- if(Equals(#SaleInvoiceProduct.Name_BillType,"销货单")&&Search("SearchSaleBillProduct",#SaleInvoiceProduct.No_FromBill,#SaleInvoiceProduct.No_FromBillProduct))
- {
- #SaleInvoiceProduct.ID_Product=#SaleBillProduct.ID_Product;
- #SaleInvoiceProduct.No_Product=#SaleBillProduct.No_Product;
- #SaleInvoiceProduct.Name_Product=#SaleBillProduct.Name_Product;
- #SaleInvoiceProduct.Unit_Product=#SaleBillProduct.Unit_Product;
- #SaleInvoiceProduct.Quantity_SaleInvoiceProduct=#SaleBillProduct.Quantity_SaleBillProduct;
- #SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct=#SaleBillProduct.UnitPrice_SaleBillProduct;
- #SaleInvoiceProduct.InvoiceName_Product=#SaleBillProduct.InvoiceName_Product;
- #SaleInvoiceProduct.Amount_SaleInvoiceProduct=FormatNumber(#SaleInvoiceProduct.Quantity_SaleInvoiceProduct*#SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct,@PriceDecimal);
- #SaleInvoiceProduct.TaxCurrency_SaleInvoiceProduct=#SaleBillProduct.TaxCurrency_SaleBill;
- if(Equals(#SaleInvoiceProduct.TaxCurrency_SaleInvoiceProduct,"内含"))
- {
- #SaleInvoiceProduct.GoodsAmount_SaleInvoiceProduct = FormatNumber((#SaleInvoiceProduct.Quantity_SaleInvoiceProduct*#SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct)/(1+#SaleInvoiceProduct.TaxRate_SaleInvoiceProduct),@PriceDecimal);
- }
- else
- {
- #SaleInvoiceProduct.GoodsAmount_SaleInvoiceProduct = FormatNumber(#SaleInvoiceProduct.Quantity_SaleInvoiceProduct*#SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct,@PriceDecimal);
- }
- #SaleInvoiceProduct.No_Customer=#SaleBillProduct.No_Customer;
- #SaleInvoiceProduct.ShortName_Customer=#SaleBillProduct.ShortName_Customer;
- #SaleInvoiceProduct.TaxAmount_SaleInvoiceProduct=FormatNumber(#SaleInvoiceProduct.Amount_SaleInvoiceProduct*#SaleInvoiceProduct.TaxRate_SaleInvoiceProduct,@PriceDecimal);
- }
- if(Equals(#SaleInvoiceProduct.Name_BillType,"销售退货单")&&Search("SearchSaleRtnBillProduct",#SaleInvoiceProduct.No_FromBill,#SaleInvoiceProduct.No_FromBillProduct))
- {
- #SaleInvoiceProduct.ID_Product=#SaleRtnBillProduct.ID_Product;
- #SaleInvoiceProduct.No_Product=#SaleRtnBillProduct.No_Product;
- #SaleInvoiceProduct.Name_Product=#SaleRtnBillProduct.Name_Product;
- #SaleInvoiceProduct.Unit_Product=#SaleRtnBillProduct.Unit_Product;
- #SaleInvoiceProduct.Quantity_SaleInvoiceProduct=#SaleRtnBillProduct.Quantity_SaleRtnBillProduct;
- #SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct=#SaleRtnBillProduct.UnitPrice_SaleRtnBillProduct;
- #SaleInvoiceProduct.InvoiceName_Product=#SaleRtnBillProduct.InvoiceName_Product;
- #SaleInvoiceProduct.Amount_SaleInvoiceProduct=FormatNumber(#SaleInvoiceProduct.Quantity_SaleInvoiceProduct*#SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct,@PriceDecimal);
- #SaleInvoiceProduct.TaxCurrency_SaleInvoiceProduct=#SaleRtnBillProduct.TaxCurrency_SaleRtnBill;
- if(Equals(#SaleInvoiceProduct.TaxCurrency_SaleInvoiceProduct,"内含"))
- {
- #SaleInvoiceProduct.GoodsAmount_SaleInvoiceProduct = FormatNumber((#SaleInvoiceProduct.Quantity_SaleInvoiceProduct*#SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct)/(1+#SaleInvoiceProduct.TaxRate_SaleInvoiceProduct),@PriceDecimal);
- }
- else
- {
- #SaleInvoiceProduct.GoodsAmount_SaleInvoiceProduct = FormatNumber(#SaleInvoiceProduct.Quantity_SaleInvoiceProduct*#SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct,@PriceDecimal);
- }
- #SaleInvoiceProduct.No_Customer=#SaleRtnBillProduct.No_Customer;
- #SaleInvoiceProduct.ShortName_Customer=#SaleRtnBillProduct.ShortName_Customer;
- #SaleInvoiceProduct.TaxAmount_SaleInvoiceProduct=FormatNumber(#SaleInvoiceProduct.Amount_SaleInvoiceProduct*#SaleInvoiceProduct.TaxRate_SaleInvoiceProduct,@PriceDecimal);
- }
- dgProduct.SetColumnReadOnly(14, true);
- }
- </FromBillChange>
- <CountAmount>
- if(Equals(#SaleInvoiceProduct.Name_BillType,"销货单")&&Search("SearchSaleBillProduct",#SaleInvoiceProduct.No_FromBill,#SaleInvoiceProduct.No_FromBillProduct))
- {
- dgProduct.SetColumnReadOnly(14,true);
- if(Equals(#SaleInvoiceProduct.TaxCurrency_SaleInvoiceProduct,"内含"))
- {
- #SaleInvoiceProduct.GoodsAmount_SaleInvoiceProduct = FormatNumber((#SaleInvoiceProduct.Quantity_SaleInvoiceProduct*#SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct)/(1+#SaleInvoiceProduct.TaxRate_SaleInvoiceProduct),@PriceDecimal);
- }
- else
- {
- #SaleInvoiceProduct.GoodsAmount_SaleInvoiceProduct = FormatNumber(#SaleInvoiceProduct.Quantity_SaleInvoiceProduct*#SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct,@PriceDecimal);
- }
- }
- if(Equals(#SaleInvoiceProduct.Name_BillType,"销售退货单")&&Search("SearchSaleRtnBillProduct",#SaleInvoiceProduct.No_FromBill,#SaleInvoiceProduct.No_FromBillProduct))
- {
- dgProduct.SetColumnReadOnly(14,true);
- if(Equals(#SaleInvoiceProduct.TaxCurrency_SaleInvoiceProduct,"内含"))
- {
- #SaleInvoiceProduct.GoodsAmount_SaleInvoiceProduct = FormatNumber((#SaleInvoiceProduct.Quantity_SaleInvoiceProduct*#SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct)/(1+#SaleInvoiceProduct.TaxRate_SaleInvoiceProduct),@PriceDecimal);
- }
- else
- {
- #SaleInvoiceProduct.GoodsAmount_SaleInvoiceProduct = FormatNumber(#SaleInvoiceProduct.Quantity_SaleInvoiceProduct*#SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct,@PriceDecimal);
- }
- }
- if(Equals(#SaleInvoiceProduct.Name_BillType,"")&&Equals(#SaleInvoiceProduct.No_FromBill,"")&&Equals(#SaleInvoiceProduct.No_FromBillProduct,""))
- {
- if(!Equals(#SaleInvoiceProduct.No_Product,"")&&!Equals(#SaleInvoiceProduct.Quantity_SaleInvoiceProduct,"")&&!Equals(#SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct,""))
- {
- dgProduct.SetColumnReadOnly(14, false);
- if(!Equals(#SaleInvoiceProduct.TaxCurrency_SaleInvoiceProduct,""))
- {
- if(Equals(#SaleInvoiceProduct.TaxCurrency_SaleInvoiceProduct,"内含"))
- {
- #SaleInvoiceProduct.GoodsAmount_SaleInvoiceProduct=FormatNumber((#SaleInvoiceProduct.Quantity_SaleInvoiceProduct*#SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct)/(1+#SaleInvoiceProduct.TaxRate_SaleInvoiceProduct),@PriceDecimal);
- }
- else if(Equals(#SaleInvoiceProduct.TaxCurrency_SaleInvoiceProduct,"外加"))
- {
- #SaleInvoiceProduct.GoodsAmount_SaleInvoiceProduct = FormatNumber(#SaleInvoiceProduct.Quantity_SaleInvoiceProduct*#SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct,@PriceDecimal);
- }
- else if(Equals(#SaleInvoiceProduct.TaxCurrency_SaleInvoiceProduct,"零税"))
- {
- #SaleInvoiceProduct.TaxRate_SaleInvoiceProduct = 0.00;
- #SaleInvoiceProduct.TaxAmount_SaleInvoiceProduct = 0.00;
- #SaleInvoiceProduct.GoodsAmount_SaleInvoiceProduct = FormatNumber(#SaleInvoiceProduct.Quantity_SaleInvoiceProduct*#SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct,@PriceDecimal);
- }
- else if(Equals(#SaleInvoiceProduct.TaxCurrency_SaleInvoiceProduct,"免税"))
- {
- #SaleInvoiceProduct.TaxRate_SaleInvoiceProduct = 0.00;
- #SaleInvoiceProduct.TaxAmount_SaleInvoiceProduct = 0.00;
- #SaleInvoiceProduct.GoodsAmount_SaleInvoiceProduct = FormatNumber(#SaleInvoiceProduct.Quantity_SaleInvoiceProduct*#SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct,@PriceDecimal);
- }
- else if(!Equals(#SaleInvoiceProduct.TaxCurrency_SaleInvoiceProduct,"免税")||!Equals(#SaleInvoiceProduct.TaxCurrency_SaleInvoiceProduct,"零税")||!Equals(#SaleInvoiceProduct.TaxCurrency_SaleInvoiceProduct,"内含")||!Equals(#SaleInvoiceProduct.TaxCurrency_SaleInvoiceProduct,"外加"))
- {
- MessageBox("您输入的税别不正确,请重新输入!",@Title);
- return;
- }
- }
- }
- }
- #SaleInvoiceProduct.Amount_SaleInvoiceProduct=FormatNumber(#SaleInvoiceProduct.Quantity_SaleInvoiceProduct*#SaleInvoiceProduct.UnitPrice_SaleInvoiceProduct,@PriceDecimal);
- #SaleInvoiceProduct.TaxAmount_SaleInvoiceProduct=FormatNumber(#SaleInvoiceProduct.Amount_SaleInvoiceProduct*#SaleInvoiceProduct.TaxRate_SaleInvoiceProduct,@PriceDecimal);
- </CountAmount>
- </Lables>
- </Form>
- </Forms>
|