12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838 |
- <?xml version="1.0" encoding="UTF-8"?>
- <Forms>
- <Form Name="FrmBonusPerformanceTables">
- <Client>
- <Events>
- <Load>
- <![CDATA[
- @Title="业绩奖金统计表";
- GetSchema();
- txtCoNo.CValue=GetCurrentCompanyNo();
- txtCoName.CValue=GetCurrentCompanyShortName();
- Empty();
- NewInstance();
- dtStart.CValue=GetCurrentTime();
- dtEnd.CValue=GetCurrentTime();
- dtFileDate.CValue=GetCurrentTime();
- dtEndFileDate.CValue=GetCurrentTime();
- if(dtFileDate.Checked==true)
- dtFileDate.Checked=false;
- else
- dtFileDate.Checked=true;
-
- if(dtEndFileDate.Checked==true)
- dtEndFileDate.Checked=false;
- else
- dtEndFileDate.Checked=true;
-
-
- ]]>
- </Load>
- <Closing>
- ;
- </Closing>
- <Closed>
- ;
- </Closed>
- </Events>
- <Mode>
- <Search>
- <Lable name="Search"/>
- </Search>
- </Mode>
- <Controls>
- <IKDateTimePicker name = "dtStart">
- <Events>
- <CheckedChanged>
- dtEnd.Checked = dtStart.Checked;
- </CheckedChanged>
- <ValueChanged>
- dtEnd.CValue = dtStart.CValue;
- </ValueChanged>
- </Events>
- </IKDateTimePicker>
- <IKTextButton name="tbSaleBillNo1" >
- <Events>
- <Click>
- ShowSearchBox("BillSearch","HAVEDEPOT", "tbSaleBillNo1",tbSaleBillNo1.CValue);
- </Click>
- <TextBoxButtonTextChanged>
- tbSaleBillNo2.CValue = tbSaleBillNo1.CValue;
- </TextBoxButtonTextChanged>
- </Events>
- </IKTextButton>
- <IKTextButton name="tbSaleBillNo2" >
- <Events>
- <Click>
- ShowSearchBox("BillSearch","HAVEDEPOT", "tbSaleBillNo2",tbSaleBillNo2.CValue);
- </Click>
- </Events>
- </IKTextButton>
- <IKTextButton name="tbCustomerNo1" >
- <Events>
- <Click>
- <![CDATA[
- @temp = ShowSearchBox("CustomerSearch","INFOMATION",tbCustomerNo1.CValue);
- if( @temp == "" )
- return;
- tbCustomerNo1.CValue = @temp;
- ]]>
- </Click>
- <TextBoxButtonTextChanged>
- tbCustomerNo2.CValue = tbCustomerNo1.CValue;
- </TextBoxButtonTextChanged>
- </Events>
- </IKTextButton>
- <IKTextButton name="tbCustomerNo2" >
- <Events>
- <Click>
- <![CDATA[
- @temp = ShowSearchBox("CustomerSearch","INFOMATION",tbCustomerNo2.CValue);
- if( @temp == "" )
- return;
- tbCustomerNo2.CValue = @temp;
- ]]>
- </Click>
- </Events>
- </IKTextButton>
- <IKComboBoxEx name="cbPrincipal1" DataSource="Principal" DisplayMember="Name_Employee" NoMember="No_Employee">
- <Events>
- <Reload>
- UpdateForm(false, "cbPrincipal1");
- Search("SearchPrincipal");
- UpdateForm(true, "cbPrincipal1");
- </Reload>
- <TextChanged>
- cbPrincipal2.SelectedName = cbPrincipal1.SelectedName;
- cbPrincipal2.SelectedNo=cbPrincipal1.SelectedNo;
- </TextChanged>
- </Events>
- </IKComboBoxEx>
- <IKComboBoxEx name="cbPrincipal2" DataSource="Principal" DisplayMember="Name_Employee" NoMember="No_Employee">
- <Events>
- <Reload>
- UpdateForm(false, "cbPrincipal2");
- Search("SearchPrincipal");
- UpdateForm(true, "cbPrincipal2");
- </Reload>
- </Events>
- </IKComboBoxEx>
- <IKComboBoxEx name="cbLocation1" DataSource="Location" DisplayMember="Name_Location" NoMember="No_Location" >
- <Events>
- <Reload>
- UpdateForm(false, "cbLocation1");
- Search("SearchLocation");
- UpdateForm(true, "cbLocation1");
- </Reload>
- <TextChanged>
- cbLocation2.SelectedName = cbLocation1.SelectedName;
- cbLocation2.SelectedNo = cbLocation1.SelectedNo;
- </TextChanged>
- </Events>
- </IKComboBoxEx>
- <IKComboBoxEx name="cbLocation2" DataSource="Location" DisplayMember="Name_Location" NoMember="No_Location">
- <Events>
- <Reload>
- UpdateForm(false, "cbLocation2");
- Search("SearchLocation");
- UpdateForm(true, "cbLocation2");
- </Reload>
- </Events>
- </IKComboBoxEx>
- <IKTextButton name="tbProduct1" >
- <Events>
- <Click>
- <![CDATA[
- @temp = ShowSearchBox("ProductSearch","INFOMATION",tbProduct1.CValue);
- if( @temp == "" )
- return;
- tbProduct1.CValue = @temp;
- ]]>
- </Click>
- <TextBoxButtonTextChanged>
- tbProduct2.CValue = tbProduct1.CValue;
- </TextBoxButtonTextChanged>
- </Events>
- </IKTextButton>
- <IKTextButton name="tbProduct2" >
- <Events>
- <Click>
- <![CDATA[
- @temp = ShowSearchBox("ProductSearch","INFOMATION",tbProduct2.CValue);
- if( @temp == "" )
- return;
- tbProduct2.CValue = @temp;
- ]]>
- </Click>
- </Events>
- </IKTextButton>
- <IKComboBoxEx name="cbType1" DataSource="Type" DisplayMember="Type_Product" >
- <Events>
- <Reload>
- UpdateForm(false, "cbType1");
- Search("SearchType");
- UpdateForm(true, "cbType1");
- </Reload>
- <TextChanged>
- cbType2.Text = cbType1.Text;
- </TextChanged>
- </Events>
- </IKComboBoxEx>
- <IKComboBoxEx name="cbType2" DataSource="Type" DisplayMember="Type_Product" >
- <Events>
- <Reload>
- UpdateForm(false, "cbType2");
- Search("SearchType");
- UpdateForm(true, "cbType2");
- </Reload>
- </Events>
- </IKComboBoxEx>
-
- <IKComboBoxEx name="cbCustomerType1" DataSource="CustomerType" DisplayMember="Type_Customer" >
- <Events>
- <Reload>
- UpdateForm(false, "cbCustomerType1");
- Search("SearchCustomerType");
- UpdateForm(true, "cbCustomerType1");
- </Reload>
- <TextChanged>
- cbCustomerType2.Text = cbCustomerType1.Text;
- </TextChanged>
- </Events>
- </IKComboBoxEx>
- <IKComboBoxEx name="cbCustomerType2" DataSource="CustomerType" DisplayMember="Type_Customer" >
- <Events>
- <Reload>
- UpdateForm(false, "cbCustomerType2");
- Search("SearchCustomerType");
- UpdateForm(true, "cbCustomerType2");
- </Reload>
- </Events>
- </IKComboBoxEx>
- <IKNumericTextBox name="txtSalesDiscount1" DataSource="SaleBillProduct.Discount_SaleBillProduct" />
- <IKNumericTextBox name="txtSalesDiscount2" DataSource="SaleBillProduct.Discount_SaleBillProduct"/>
- <IKDateTimePicker name = "dtFileDate">
- <Events>
- <CheckedChanged>
- dtEndFileDate.Checked = dtFileDate.Checked;
- </CheckedChanged>
- <ValueChanged>
- dtEndFileDate.CValue = dtFileDate.CValue;
- </ValueChanged>
- </Events>
- </IKDateTimePicker>
- <IKButton name="btnView">
- <Events>
- <Click>
- <![CDATA[
- if(ikRadioButton1.Checked==false && ikRadioButton2.Checked==false && ikRadioButton3.Checked==false && ikRadioButton4.Checked==false && ikRadioButton5.Checked==false)
- {
- MessageBox("请选择格式!",@Title);
- return;
- }
- Empty();
- Empty("#FrmLocationList");
- Empty("#FrmProductList");
- Empty("#FrmSalesListPrinciPalSingleProductOf");
- Empty("#FrmCustomerList");
- Empty("#FrmDateList");
- @Company=GetCurrentCompanyNo();
- @Name_Create = GetCurrentUser();
- @StartDate = DBNull();
- @EndDate = DBNull();
- @StartNo_SaleBill = DBNull();
- @EndNo_SaleBill = DBNull();
- @StartNo_Customer = DBNull();
- @EndNo_Customer = DBNull();
- @StartNo_Principal = DBNull();
- @EndNo_Principal = DBNull();
- @StartNo_Location = DBNull();
- @EndNo_Location = DBNull();
- @StartNo_Product = DBNull();
- @EndNo_Product = DBNull();
- @StartType_Product = DBNull();
- @EndType_Product = DBNull();
- @StartType_Customer = DBNull();
- @EndType_Customer = DBNull();
- @StartFileDate = DBNull();
- @EndFileDate = DBNull();
- @StartDiscount_SaleBill = DBNull();
- @EndDiscount_SaleBill = DBNull();
- @Rtn = 0;
- if(ikRtnCheck.Checked)
- {
- @Rtn = 1;
- }
- if(dtStart.Checked==true)
- @StartDate = dtStart.CValue;
- if(dtEnd.Checked==true)
- @EndDate = dtEnd.CValue;
- if(tbSaleBillNo1.CValue != "")
- {@StartNo_SaleBill = tbSaleBillNo1.CValue;
- }
- if(tbSaleBillNo2.CValue != "")
- {@EndNo_SaleBill = tbSaleBillNo2.CValue;
- }
- if(tbCustomerNo1.CValue != "")
- {@StartNo_Customer = tbCustomerNo1.CValue;
- }
- if(tbCustomerNo2.CValue != "")
- {@EndNo_Customer = tbCustomerNo2.CValue;
- }
- if(cbPrincipal1.Text!="")
- {
- if(!cbPrincipal1.CheckSelectedItem())
- {
- MessageBox("请选择有效的业务负责人!",@Title);
- cbPrincipal1.Focus();
- return;
- }
- else
- {
- @StartNo_Principal = cbPrincipal1.SelectedNo;
- }
- }
- if(cbPrincipal2.Text!="")
- {
- if(!cbPrincipal2.CheckSelectedItem())
- {
- MessageBox("请选择有效的业务负责人!",@Title);
- cbPrincipal2.Focus();
- return;
- }
- else
- {
- @EndNo_Principal = cbPrincipal2.SelectedNo;
- }
- }
- if(cbLocation1.Text!="")
- {
- if(!cbLocation1.CheckSelectedItem())
- {
- MessageBox("请选择有效的仓库!",@Title);
- cbLocation1.Focus();
- return;
- }
- else
- {
- @StartNo_Location = cbLocation1.SelectedNo;
- }
- }
- if(cbLocation2.Text!="")
- {
- if(!cbLocation2.CheckSelectedItem())
- {
- MessageBox("请选择有效的仓库!",@Title);
- cbLocation2.Focus();
- return;
- }
- else
- {
- @EndNo_Location = cbLocation2.SelectedNo;
- }
- }
- if(tbProduct1.CValue != "")
- @StartNo_Product = tbProduct1.CValue;
-
- if(tbProduct2.CValue != "")
- @EndNo_Product = tbProduct2.CValue;
-
- if(cbType1.Text != "")
- @StartType_Product = cbType1.Text;
-
- if(cbType2.Text != "")
- @EndType_Product = cbType2.Text;
-
- if(cbCustomerType1.Text != "")
- @StartType_Customer = cbCustomerType1.Text;
-
- if(cbCustomerType2.Text != "")
- @EndType_Customer = cbCustomerType2.Text;
-
- if(dtFileDate.Checked==true)
- @StartFileDate = dtFileDate.CValue;
-
- if(dtEndFileDate.Checked==true)
- @EndFileDate = dtEndFileDate.CValue;
-
- if(txtSalesDiscount1.CValue != "")
- @StartDiscount_SaleBill=txtSalesDiscount1.CValue;
-
- if(txtSalesDiscount2.CValue != "")
- @EndDiscount_SaleBill=txtSalesDiscount2.CValue;
- if(ikRadioButton4.Checked)
- {
- Search("SearchFrmSalesListLocation",@StartDate,@EndDate,@StartNo_SaleBill,@EndNo_SaleBill,@StartNo_Customer,
- @EndNo_Customer,@StartNo_Principal,@EndNo_Principal,@StartNo_Location,@EndNo_Location,
- @StartNo_Product,@EndNo_Product,@StartType_Product,@EndType_Product,
- @Company,@Name_Create,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),@Rtn,GetFieldRight("销货单","特价单","查看"),
- @StartType_Customer,@EndType_Customer,@StartFileDate,@EndFileDate,@StartDiscount_SaleBill,@EndDiscount_SaleBill);
- if(RowCount("#FrmLocationList")==0)
- {
- MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title);
- }
- else
- {
- PrintReport("GetFrmLocationList","Get","FrmLocationList");
- }
- }
- if(ikRadioButton2.Checked)
- {
- Search("SearchFrmSalesList",@StartDate,@EndDate,@StartNo_SaleBill,@EndNo_SaleBill,@StartNo_Customer,
- @EndNo_Customer,@StartNo_Principal,@EndNo_Principal,@StartNo_Location,@EndNo_Location,
- @StartNo_Product,@EndNo_Product,@StartType_Product,@EndType_Product,
- @Company,@Name_Create,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),@Rtn,GetFieldRight("销货单","特价单","查看"),
- @StartType_Customer,@EndType_Customer,@StartFileDate,@EndFileDate,@StartDiscount_SaleBill,@EndDiscount_SaleBill);
- if(RowCount("#FrmSalesListPrinciPalSingleProductOf") ==0)
- {
- MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title);
- }
- else
- {
- MergeTable("#FrmSalesListPrinciPalSingleProductOf","FrmProductList");
- PrintReport("GetFrmProductList","Get","FrmProductList");
- }
- }
- if(ikRadioButton1.Checked)
- {
-
- Search("SearchFrmSalesList",@StartDate,@EndDate,@StartNo_SaleBill,@EndNo_SaleBill,@StartNo_Customer,
- @EndNo_Customer,@StartNo_Principal,@EndNo_Principal,@StartNo_Location,@EndNo_Location,
- @StartNo_Product,@EndNo_Product,@StartType_Product,@EndType_Product,
- @Company,@Name_Create,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),@Rtn,GetFieldRight("销货单","特价单","查看"),
- @StartType_Customer,@EndType_Customer,@StartFileDate,@EndFileDate,@StartDiscount_SaleBill,@EndDiscount_SaleBill);
-
- if(RowCount("#FrmSalesListPrinciPalSingleProductOf") ==0)
- {
- MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title);
- }
- else
- {
-
- PrintReport("GetFrmSalesListPrinciPalSingleProductOf","Get","FrmSalesListPrinciPalSingleProductOf");
-
- }
- }
- if(ikRadioButton3.Checked)
- {
- Search("SearchFrmSalesList",@StartDate,@EndDate,@StartNo_SaleBill, @EndNo_SaleBill,@StartNo_Customer,
- @EndNo_Customer,@StartNo_Principal,@EndNo_Principal,@StartNo_Location,@EndNo_Location,
- @StartNo_Product,@EndNo_Product,@StartType_Product,@EndType_Product,
- @Company,@Name_Create,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),@Rtn,GetFieldRight("销货单","特价单","查看"),
- @StartType_Customer,@EndType_Customer,@StartFileDate,@EndFileDate,@StartDiscount_SaleBill,@EndDiscount_SaleBill);
- if(RowCount("#FrmSalesListPrinciPalSingleProductOf") ==0)
- {
- MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title);
- }
- else
- {
- MergeTable("#FrmSalesListPrinciPalSingleProductOf","FrmCustomerList");
- PrintReport("GetFrmCustomerList","Get","FrmCustomerList");
- }
- }
- if(ikRadioButton5.Checked)
- {
- Search("SearchFrmSalesList",@StartDate,@EndDate,@StartNo_SaleBill, @EndNo_SaleBill,@StartNo_Customer,
- @EndNo_Customer,@StartNo_Principal,@EndNo_Principal,@StartNo_Location,@EndNo_Location,
- @StartNo_Product,@EndNo_Product,@StartType_Product,@EndType_Product,
- @Company,@Name_Create,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),@Rtn,GetFieldRight("销货单","特价单","查看"),
- @StartType_Customer,@EndType_Customer,@StartFileDate,@EndFileDate,@StartDiscount_SaleBill,@EndDiscount_SaleBill);
- if(RowCount("#FrmSalesListPrinciPalSingleProductOf") ==0)
- {
- MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title);
- }
- else
- {
- MergeTable("#FrmSalesListPrinciPalSingleProductOf","FrmDateList");
- PrintReport("GetFrmDateList","Get","FrmDateList");
- }
- }
- ]]>
- </Click>
- </Events>
- </IKButton>
- <IKButton name="btnExcel">
- <Events>
- <Click>
- <![CDATA[
- if(ikRadioButton1.Checked==false && ikRadioButton2.Checked==false && ikRadioButton3.Checked==false && ikRadioButton4.Checked==false && ikRadioButton5.Checked==false)
- {
- MessageBox("请选择格式!",@Title);
- return;
- }
- Empty();
- Empty("#FrmLocationList");
- Empty("#FrmProductList");
- Empty("#FrmSalesListPrinciPalSingleProductOf");
- Empty("#FrmCustomerList");
- Empty("#FrmDateList");
- @Company=GetCurrentCompanyNo();
- @Name_Create = GetCurrentUser();
- @StartDate = DBNull();
- @EndDate = DBNull();
- @StartNo_SaleBill = DBNull();
- @EndNo_SaleBill = DBNull();
- @StartNo_Customer = DBNull();
- @EndNo_Customer = DBNull();
- @StartNo_Principal = DBNull();
- @EndNo_Principal = DBNull();
- @StartNo_Location = DBNull();
- @EndNo_Location = DBNull();
- @StartNo_Product = DBNull();
- @EndNo_Product = DBNull();
- @StartType_Product = DBNull();
- @EndType_Product = DBNull();
- @StartType_Customer = DBNull();
- @EndType_Customer = DBNull();
- @StartFileDate = DBNull();
- @EndFileDate = DBNull();
- @StartDiscount_SaleBill = DBNull();
- @EndDiscount_SaleBill = DBNull();
- @Rtn = 0;
- if(ikRtnCheck.Checked)
- {
- @Rtn = 1;
- }
- if(dtStart.Checked==true)
- @StartDate = dtStart.CValue;
- if(dtEnd.Checked==true)
- @EndDate = dtEnd.CValue;
- if(tbSaleBillNo1.CValue != "")
- {@StartNo_SaleBill = tbSaleBillNo1.CValue;
- }
- if(tbSaleBillNo2.CValue != "")
- {@EndNo_SaleBill = tbSaleBillNo2.CValue;
- }
- if(tbCustomerNo1.CValue != "")
- {@StartNo_Customer = tbCustomerNo1.CValue;
- }
- if(tbCustomerNo2.CValue != "")
- {@EndNo_Customer = tbCustomerNo2.CValue;
- }
- if(cbPrincipal1.Text!="")
- {
- if(!cbPrincipal1.CheckSelectedItem())
- {
- MessageBox("请选择有效的业务负责人!",@Title);
- cbPrincipal1.Focus();
- return;
- }
- else
- {
- @StartNo_Principal = cbPrincipal1.SelectedNo;
- }
- }
- if(cbPrincipal2.Text!="")
- {
- if(!cbPrincipal2.CheckSelectedItem())
- {
- MessageBox("请选择有效的业务负责人!",@Title);
- cbPrincipal2.Focus();
- return;
- }
- else
- {
- @EndNo_Principal = cbPrincipal2.SelectedNo;
- }
- }
- if(cbLocation1.Text!="")
- {
- if(!cbLocation1.CheckSelectedItem())
- {
- MessageBox("请选择有效的仓库!",@Title);
- cbLocation1.Focus();
- return;
- }
- else
- {
- @StartNo_Location = cbLocation1.SelectedNo;
- }
- }
- if(cbLocation2.Text!="")
- {
- if(!cbLocation2.CheckSelectedItem())
- {
- MessageBox("请选择有效的仓库!",@Title);
- cbLocation2.Focus();
- return;
- }
- else
- {
- @EndNo_Location = cbLocation2.SelectedNo;
- }
- }
- if(tbProduct1.CValue != "")
- @StartNo_Product = tbProduct1.CValue;
- if(tbProduct2.CValue != "")
- @EndNo_Product = tbProduct2.CValue;
- if(cbType1.Text != "")
- @StartType_Product = cbType1.Text;
- if(cbType2.Text != "")
- @EndType_Product = cbType2.Text;
-
- if(cbCustomerType1.Text != "")
- @StartType_Customer = cbCustomerType1.Text;
-
- if(cbCustomerType2.Text != "")
- @EndType_Customer = cbCustomerType2.Text;
-
- if(dtFileDate.Checked==true)
- @StartFileDate = dtFileDate.CValue;
- if(dtEndFileDate.Checked==true)
- @EndFileDate = dtEndFileDate.CValue;
- if(txtSalesDiscount1.CValue != "")
- @StartDiscount_SaleBill=txtSalesDiscount1.CValue;
- if(txtSalesDiscount2.CValue != "")
- @EndDiscount_SaleBill=txtSalesDiscount2.CValue;
- if(ikRadioButton4.Checked)
- {
- Search("SearchFrmSalesListLocation",@StartDate,@EndDate,@StartNo_SaleBill,@EndNo_SaleBill,@StartNo_Customer,
- @EndNo_Customer,@StartNo_Principal,@EndNo_Principal,@StartNo_Location,@EndNo_Location,
- @StartNo_Product,@EndNo_Product,@StartType_Product,@EndType_Product,
- @Company,@Name_Create,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),@Rtn,GetFieldRight("销货单","特价单","查看"),
- @StartType_Customer,@EndType_Customer,@StartFileDate,@EndFileDate,@StartDiscount_SaleBill,@EndDiscount_SaleBill);
- if(RowCount("#FrmLocationList")==0)
- {
- MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title);
- }
- else
- {
- ExportReport("Excel","GetFrmLocationList","Get","FrmLocationList");
- }
- }
- if(ikRadioButton2.Checked)
- {
- Search("SearchFrmSalesList",@StartDate,@EndDate,@StartNo_SaleBill,@EndNo_SaleBill,@StartNo_Customer,
- @EndNo_Customer,@StartNo_Principal,@EndNo_Principal,@StartNo_Location,@EndNo_Location,
- @StartNo_Product,@EndNo_Product,@StartType_Product,@EndType_Product,
- @Company,@Name_Create,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),@Rtn,GetFieldRight("销货单","特价单","查看"),
- @StartType_Customer,@EndType_Customer,@StartFileDate,@EndFileDate,@StartDiscount_SaleBill,@EndDiscount_SaleBill);
- if(RowCount("#FrmSalesListPrinciPalSingleProductOf") ==0)
- {
- MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title);
- }
- else
- {
- MergeTable("#FrmSalesListPrinciPalSingleProductOf","FrmProductList");
- ExportReport("Excel","GetFrmProductList","Get","FrmProductList");
- }
- }
- if(ikRadioButton1.Checked)
- {
- Search("SearchFrmSalesList",@StartDate,@EndDate,@StartNo_SaleBill, @EndNo_SaleBill,@StartNo_Customer,
- @EndNo_Customer,@StartNo_Principal,@EndNo_Principal,@StartNo_Location,@EndNo_Location,
- @StartNo_Product,@EndNo_Product,@StartType_Product,@EndType_Product,
- @Company,@Name_Create,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),@Rtn,GetFieldRight("销货单","特价单","查看"),
- @StartType_Customer,@EndType_Customer,@StartFileDate,@EndFileDate,@StartDiscount_SaleBill,@EndDiscount_SaleBill);
- if(RowCount("#FrmSalesListPrinciPalSingleProductOf") ==0)
- {
- MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title);
- }
- else
- {
- ExportReport("Excel","GetFrmSalesListPrinciPalSingleProductOf","Get","FrmSalesListPrinciPalSingleProductOf");
- }
- }
- if(ikRadioButton3.Checked)
- {
- Search("SearchFrmSalesList",@StartDate,@EndDate,@StartNo_SaleBill, @EndNo_SaleBill,@StartNo_Customer,
- @EndNo_Customer,@StartNo_Principal,@EndNo_Principal,@StartNo_Location,@EndNo_Location,
- @StartNo_Product,@EndNo_Product,@StartType_Product,@EndType_Product,
- @Company,@Name_Create,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),@Rtn,GetFieldRight("销货单","特价单","查看"),
- @StartType_Customer,@EndType_Customer,@StartFileDate,@EndFileDate,@StartDiscount_SaleBill,@EndDiscount_SaleBill);
- if(RowCount("#FrmSalesListPrinciPalSingleProductOf") ==0)
- {
- MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title);
- }
- else
- {
- MergeTable("#FrmSalesListPrinciPalSingleProductOf","FrmCustomerList");
- ExportReport("Excel","GetFrmCustomerList","Get","FrmCustomerList");
- }
- }
- if(ikRadioButton5.Checked)
- {
- Search("SearchFrmSalesList",@StartDate,@EndDate,@StartNo_SaleBill, @EndNo_SaleBill,@StartNo_Customer,
- @EndNo_Customer,@StartNo_Principal,@EndNo_Principal,@StartNo_Location,@EndNo_Location,
- @StartNo_Product,@EndNo_Product,@StartType_Product,@EndType_Product,
- @Company,@Name_Create,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),@Rtn,GetFieldRight("销货单","特价单","查看"),
- @StartType_Customer,@EndType_Customer,@StartFileDate,@EndFileDate,@StartDiscount_SaleBill,@EndDiscount_SaleBill);
- if(RowCount("#FrmSalesListPrinciPalSingleProductOf") ==0)
- {
- MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title);
- }
- else
- {
- MergeTable("#FrmSalesListPrinciPalSingleProductOf","FrmDateList");
- ExportReport("Excel","GetFrmDateList","Get","FrmDateList");
- }
- }
- ]]>
- </Click>
- </Events>
- </IKButton>
- <IKButton name="btnWord">
- <Events>
- <Click>
- <![CDATA[
- if(ikRadioButton1.Checked==false && ikRadioButton2.Checked==false && ikRadioButton3.Checked==false && ikRadioButton4.Checked==false && ikRadioButton5.Checked==false)
- {
- MessageBox("请选择格式!",@Title);
- return;
- }
- Empty();
- Empty("#FrmLocationList");
- Empty("#FrmProductList");
- Empty("#FrmSalesListPrinciPalSingleProductOf");
- Empty("#FrmCustomerList");
- Empty("#FrmDateList");
- @Company=GetCurrentCompanyNo();
- @Name_Create = GetCurrentUser();
- @StartDate = DBNull();
- @EndDate = DBNull();
- @StartNo_SaleBill = DBNull();
- @EndNo_SaleBill = DBNull();
- @StartNo_Customer = DBNull();
- @EndNo_Customer = DBNull();
- @StartNo_Principal = DBNull();
- @EndNo_Principal = DBNull();
- @StartNo_Location = DBNull();
- @EndNo_Location = DBNull();
- @StartNo_Product = DBNull();
- @EndNo_Product = DBNull();
- @StartType_Product = DBNull();
- @EndType_Product = DBNull();
- @StartType_Customer = DBNull();
- @EndType_Customer = DBNull();
- @StartFileDate = DBNull();
- @EndFileDate = DBNull();
- @StartDiscount_SaleBill = DBNull();
- @EndDiscount_SaleBill = DBNull();
- @Rtn = 0;
- if(ikRtnCheck.Checked)
- {
- @Rtn = 1;
- }
- if(dtStart.Checked==true)
- @StartDate = dtStart.CValue;
- if(dtEnd.Checked==true)
- @EndDate = dtEnd.CValue;
- if(tbSaleBillNo1.CValue != "")
- {@StartNo_SaleBill = tbSaleBillNo1.CValue;
- }
- if(tbSaleBillNo2.CValue != "")
- {@EndNo_SaleBill = tbSaleBillNo2.CValue;
- }
- if(tbCustomerNo1.CValue != "")
- {@StartNo_Customer = tbCustomerNo1.CValue;
- }
- if(tbCustomerNo2.CValue != "")
- {@EndNo_Customer = tbCustomerNo2.CValue;
- }
- if(cbPrincipal1.Text!="")
- {
- if(!cbPrincipal1.CheckSelectedItem())
- {
- MessageBox("请选择有效的业务负责人!",@Title);
- cbPrincipal1.Focus();
- return;
- }
- else
- {
- @StartNo_Principal = cbPrincipal1.SelectedNo;
- }
- }
- if(cbPrincipal2.Text!="")
- {
- if(!cbPrincipal2.CheckSelectedItem())
- {
- MessageBox("请选择有效的业务负责人!",@Title);
- cbPrincipal2.Focus();
- return;
- }
- else
- {
- @EndNo_Principal = cbPrincipal2.SelectedNo;
- }
- }
- if(cbLocation1.Text!="")
- {
- if(!cbLocation1.CheckSelectedItem())
- {
- MessageBox("请选择有效的仓库!",@Title);
- cbLocation1.Focus();
- return;
- }
- else
- {
- @StartNo_Location = cbLocation1.SelectedNo;
- }
- }
- if(cbLocation2.Text!="")
- {
- if(!cbLocation2.CheckSelectedItem())
- {
- MessageBox("请选择有效的仓库!",@Title);
- cbLocation2.Focus();
- return;
- }
- else
- {
- @EndNo_Location = cbLocation2.SelectedNo;
- }
- }
- if(tbProduct1.CValue != "")
- @StartNo_Product = tbProduct1.CValue;
- if(tbProduct2.CValue != "")
- @EndNo_Product = tbProduct2.CValue;
- if(cbType1.Text != "")
- @StartType_Product = cbType1.Text;
- if(cbType2.Text != "")
- @EndType_Product = cbType2.Text;
-
- if(cbCustomerType1.Text != "")
- @StartType_Customer = cbCustomerType1.Text;
-
- if(cbCustomerType2.Text != "")
- @EndType_Customer = cbCustomerType2.Text;
-
- if(dtFileDate.Checked==true)
- @StartFileDate = dtFileDate.CValue;
- if(dtEndFileDate.Checked==true)
- @EndFileDate = dtEndFileDate.CValue;
- if(txtSalesDiscount1.CValue != "")
- @StartDiscount_SaleBill=txtSalesDiscount1.CValue;
- if(txtSalesDiscount2.CValue != "")
- @EndDiscount_SaleBill=txtSalesDiscount2.CValue;
- if(ikRadioButton4.Checked)
- {
- Search("SearchFrmSalesListLocation",@StartDate,@EndDate,@StartNo_SaleBill,@EndNo_SaleBill,@StartNo_Customer,
- @EndNo_Customer,@StartNo_Principal,@EndNo_Principal,@StartNo_Location,@EndNo_Location,
- @StartNo_Product,@EndNo_Product,@StartType_Product,@EndType_Product,
- @Company,@Name_Create,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),@Rtn,GetFieldRight("销货单","特价单","查看"),
- @StartType_Customer,@EndType_Customer,@StartFileDate,@EndFileDate,@StartDiscount_SaleBill,@EndDiscount_SaleBill);
- if(RowCount("#FrmLocationList")==0)
- {
- MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title);
- }
- else
- {
- ExportReport("Word","GetFrmLocationList","Get","FrmLocationList");
- }
- }
- if(ikRadioButton2.Checked)
- {
- Search("SearchFrmSalesList",@StartDate,@EndDate,@StartNo_SaleBill,@EndNo_SaleBill,@StartNo_Customer,
- @EndNo_Customer,@StartNo_Principal,@EndNo_Principal,@StartNo_Location,@EndNo_Location,
- @StartNo_Product,@EndNo_Product,@StartType_Product,@EndType_Product,
- @Company,@Name_Create,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),@Rtn,GetFieldRight("销货单","特价单","查看"),
- @StartType_Customer,@EndType_Customer,@StartFileDate,@EndFileDate,@StartDiscount_SaleBill,@EndDiscount_SaleBill);
- if(RowCount("#FrmSalesListPrinciPalSingleProductOf") ==0)
- {
- MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title);
- }
- else
- {
- MergeTable("#FrmSalesListPrinciPalSingleProductOf","FrmProductList");
- ExportReport("Word","GetFrmProductList","Get","FrmProductList");
- }
- }
- if(ikRadioButton1.Checked)
- {
- Search("SearchFrmSalesList",@StartDate,@EndDate,@StartNo_SaleBill, @EndNo_SaleBill,@StartNo_Customer,
- @EndNo_Customer,@StartNo_Principal,@EndNo_Principal,@StartNo_Location,@EndNo_Location,
- @StartNo_Product,@EndNo_Product,@StartType_Product,@EndType_Product,
- @Company,@Name_Create,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),@Rtn,GetFieldRight("销货单","特价单","查看"),
- @StartType_Customer,@EndType_Customer,@StartFileDate,@EndFileDate,@StartDiscount_SaleBill,@EndDiscount_SaleBill);
- if(RowCount("#FrmSalesListPrinciPalSingleProductOf") ==0)
- {
- MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title);
- }
- else
- {
- ExportReport("Word","GetFrmSalesListPrinciPalSingleProductOf","Get","FrmSalesListPrinciPalSingleProductOf");
- }
- }
- if(ikRadioButton3.Checked)
- {
- Search("SearchFrmSalesList",@StartDate,@EndDate,@StartNo_SaleBill, @EndNo_SaleBill,@StartNo_Customer,
- @EndNo_Customer,@StartNo_Principal,@EndNo_Principal,@StartNo_Location,@EndNo_Location,
- @StartNo_Product,@EndNo_Product,@StartType_Product,@EndType_Product,
- @Company,@Name_Create,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),@Rtn,GetFieldRight("销货单","特价单","查看"),
- @StartType_Customer,@EndType_Customer,@StartFileDate,@EndFileDate,@StartDiscount_SaleBill,@EndDiscount_SaleBill);
- if(RowCount("#FrmSalesListPrinciPalSingleProductOf") ==0)
- {
- MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title);
- }
- else
- {
- MergeTable("#FrmSalesListPrinciPalSingleProductOf","FrmCustomerList");
- ExportReport("Word","GetFrmCustomerList","Get","FrmCustomerList");
- }
- }
- if(ikRadioButton5.Checked)
- {
- Search("SearchFrmSalesList",@StartDate,@EndDate,@StartNo_SaleBill, @EndNo_SaleBill,@StartNo_Customer,
- @EndNo_Customer,@StartNo_Principal,@EndNo_Principal,@StartNo_Location,@EndNo_Location,
- @StartNo_Product,@EndNo_Product,@StartType_Product,@EndType_Product,
- @Company,@Name_Create,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),@Rtn,GetFieldRight("销货单","特价单","查看"),
- @StartType_Customer,@EndType_Customer,@StartFileDate,@EndFileDate,@StartDiscount_SaleBill,@EndDiscount_SaleBill);
- if(RowCount("#FrmSalesListPrinciPalSingleProductOf") ==0)
- {
- MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title);
- }
- else
- {
- MergeTable("#FrmSalesListPrinciPalSingleProductOf","FrmDateList");
- ExportReport("Word","GetFrmDateList","Get","FrmDateList");
- }
- }
- ]]>
- </Click>
- </Events>
- </IKButton>
- <IKButton name="btnPrint">
- <Events>
- <Click>
- <![CDATA[
- if(ikRadioButton1.Checked==false && ikRadioButton2.Checked==false && ikRadioButton3.Checked==false && ikRadioButton4.Checked==false && ikRadioButton5.Checked==false)
- {
- MessageBox("请选择格式!",@Title);
- return;
- }
- Empty();
- Empty("#FrmLocationList");
- Empty("#FrmProductList");
- Empty("#FrmSalesListPrinciPalSingleProductOf");
- Empty("#FrmCustomerList");
- Empty("#FrmDateList");
- @Company=GetCurrentCompanyNo();
- @Name_Create = GetCurrentUser();
- @StartDate = DBNull();
- @EndDate = DBNull();
- @StartNo_SaleBill = DBNull();
- @EndNo_SaleBill = DBNull();
- @StartNo_Customer = DBNull();
- @EndNo_Customer = DBNull();
- @StartNo_Principal = DBNull();
- @EndNo_Principal = DBNull();
- @StartNo_Location = DBNull();
- @EndNo_Location = DBNull();
- @StartNo_Product = DBNull();
- @EndNo_Product = DBNull();
- @StartType_Product = DBNull();
- @EndType_Product = DBNull();
- @StartType_Customer = DBNull();
- @EndType_Customer = DBNull();
- @StartFileDate = DBNull();
- @EndFileDate = DBNull();
- @StartDiscount_SaleBill = DBNull();
- @EndDiscount_SaleBill = DBNull();
- @Rtn = 0;
- if(ikRtnCheck.Checked)
- {
- @Rtn = 1;
- }
- if(dtStart.Checked==true)
- @StartDate = dtStart.CValue;
- if(dtEnd.Checked==true)
- @EndDate = dtEnd.CValue;
- if(tbSaleBillNo1.CValue != "")
- {@StartNo_SaleBill = tbSaleBillNo1.CValue;
- }
- if(tbSaleBillNo2.CValue != "")
- {@EndNo_SaleBill = tbSaleBillNo2.CValue;
- }
- if(tbCustomerNo1.CValue != "")
- {@StartNo_Customer = tbCustomerNo1.CValue;
- }
- if(tbCustomerNo2.CValue != "")
- {@EndNo_Customer = tbCustomerNo2.CValue;
- }
- if(cbPrincipal1.Text!="")
- {
- if(!cbPrincipal1.CheckSelectedItem())
- {
- MessageBox("请选择有效的业务负责人!",@Title);
- cbPrincipal1.Focus();
- return;
- }
- else
- {
- @StartNo_Principal = cbPrincipal1.SelectedNo;
- }
- }
- if(cbPrincipal2.Text!="")
- {
- if(!cbPrincipal2.CheckSelectedItem())
- {
- MessageBox("请选择有效的业务负责人!",@Title);
- cbPrincipal2.Focus();
- return;
- }
- else
- {
- @EndNo_Principal = cbPrincipal2.SelectedNo;
- }
- }
- if(cbLocation1.Text!="")
- {
- if(!cbLocation1.CheckSelectedItem())
- {
- MessageBox("请选择有效的仓库!",@Title);
- cbLocation1.Focus();
- return;
- }
- else
- {
- @StartNo_Location = cbLocation1.SelectedNo;
- }
- }
- if(cbLocation2.Text!="")
- {
- if(!cbLocation2.CheckSelectedItem())
- {
- MessageBox("请选择有效的仓库!",@Title);
- cbLocation2.Focus();
- return;
- }
- else
- {
- @EndNo_Location = cbLocation2.SelectedNo;
- }
- }
- if(tbProduct1.CValue != "")
- @StartNo_Product = tbProduct1.CValue;
- if(tbProduct2.CValue != "")
- @EndNo_Product = tbProduct2.CValue;
- if(cbType1.Text != "")
- @StartType_Product = cbType1.Text;
- if(cbType2.Text != "")
- @EndType_Product = cbType2.Text;
- if(cbCustomerType1.Text != "")
- @StartType_Customer = cbCustomerType1.Text;
- if(cbCustomerType2.Text != "")
- @EndType_Customer = cbCustomerType2.Text;
- if(dtFileDate.Checked==true)
- @StartFileDate = dtFileDate.CValue;
- if(dtEndFileDate.Checked==true)
- @EndFileDate = dtEndFileDate.CValue;
- if(txtSalesDiscount1.CValue != "")
- @StartDiscount_SaleBill=txtSalesDiscount1.CValue;
- if(txtSalesDiscount2.CValue != "")
- @EndDiscount_SaleBill=txtSalesDiscount2.CValue;
- if(ikRadioButton4.Checked)
- {
- Search("SearchFrmSalesListLocation",@StartDate,@EndDate,@StartNo_SaleBill,@EndNo_SaleBill,@StartNo_Customer,
- @EndNo_Customer,@StartNo_Principal,@EndNo_Principal,@StartNo_Location,@EndNo_Location,
- @StartNo_Product,@EndNo_Product,@StartType_Product,@EndType_Product,
- @Company,@Name_Create,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),@Rtn,GetFieldRight("销货单","特价单","查看"),
- @StartType_Customer,@EndType_Customer,@StartFileDate,@EndFileDate,@StartDiscount_SaleBill,@EndDiscount_SaleBill);
- if(RowCount("#FrmLocationList")==0)
- {
- MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title);
- }
- else
- {
- ExportReport("PrintToPrinter","GetFrmLocationList","Get","FrmLocationList");
- }
- }
- if(ikRadioButton2.Checked)
- {
- Search("SearchFrmSalesList",@StartDate,@EndDate,@StartNo_SaleBill,@EndNo_SaleBill,@StartNo_Customer,
- @EndNo_Customer,@StartNo_Principal,@EndNo_Principal,@StartNo_Location,@EndNo_Location,
- @StartNo_Product,@EndNo_Product,@StartType_Product,@EndType_Product,
- @Company,@Name_Create,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),@Rtn,GetFieldRight("销货单","特价单","查看"),
- @StartType_Customer,@EndType_Customer,@StartFileDate,@EndFileDate,@StartDiscount_SaleBill,@EndDiscount_SaleBill);
- if(RowCount("#FrmSalesListPrinciPalSingleProductOf") ==0)
- {
- MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title);
- }
- else
- {
- MergeTable("#FrmSalesListPrinciPalSingleProductOf","FrmProductList");
- ExportReport("PrintToPrinter","GetFrmProductList","Get","FrmProductList");
- }
- }
- if(ikRadioButton1.Checked)
- {
- Search("SearchFrmSalesList",@StartDate,@EndDate,@StartNo_SaleBill, @EndNo_SaleBill,@StartNo_Customer,
- @EndNo_Customer,@StartNo_Principal,@EndNo_Principal,@StartNo_Location,@EndNo_Location,
- @StartNo_Product,@EndNo_Product,@StartType_Product,@EndType_Product,
- @Company,@Name_Create,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),@Rtn,GetFieldRight("销货单","特价单","查看"),
- @StartType_Customer,@EndType_Customer,@StartFileDate,@EndFileDate,@StartDiscount_SaleBill,@EndDiscount_SaleBill);
- if(RowCount("#FrmSalesListPrinciPalSingleProductOf") ==0)
- {
- MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title);
- }
- else
- {
- ExportReport("PrintToPrinter","GetFrmSalesListPrinciPalSingleProductOf","Get","FrmSalesListPrinciPalSingleProductOf");
- }
- }
- if(ikRadioButton3.Checked)
- {
- Search("SearchFrmSalesList",@StartDate,@EndDate,@StartNo_SaleBill, @EndNo_SaleBill,@StartNo_Customer,
- @EndNo_Customer,@StartNo_Principal,@EndNo_Principal,@StartNo_Location,@EndNo_Location,
- @StartNo_Product,@EndNo_Product,@StartType_Product,@EndType_Product,
- @Company,@Name_Create,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),@Rtn,GetFieldRight("销货单","特价单","查看"),
- @StartType_Customer,@EndType_Customer,@StartFileDate,@EndFileDate,@StartDiscount_SaleBill,@EndDiscount_SaleBill);
- if(RowCount("#FrmSalesListPrinciPalSingleProductOf") ==0)
- {
- MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title);
- }
- else
- {
- MergeTable("#FrmSalesListPrinciPalSingleProductOf","FrmCustomerList");
- ExportReport("PrintToPrinter","GetFrmCustomerList","Get","FrmCustomerList");
- }
- }
- if(ikRadioButton5.Checked)
- {
- Search("SearchFrmSalesList",@StartDate,@EndDate,@StartNo_SaleBill, @EndNo_SaleBill,@StartNo_Customer,
- @EndNo_Customer,@StartNo_Principal,@EndNo_Principal,@StartNo_Location,@EndNo_Location,
- @StartNo_Product,@EndNo_Product,@StartType_Product,@EndType_Product,
- @Company,@Name_Create,GetRight("客户基本资料","全权查看")?DBNull():GetLoginUserID(),@Rtn,GetFieldRight("销货单","特价单","查看"),
- @StartType_Customer,@EndType_Customer,@StartFileDate,@EndFileDate,@StartDiscount_SaleBill,@EndDiscount_SaleBill);
- if(RowCount("#FrmSalesListPrinciPalSingleProductOf") ==0)
- {
- MessageBox("没有查找到与此相匹配的纪录,未产生报表!",@Title);
- }
- else
- {
- MergeTable("#FrmSalesListPrinciPalSingleProductOf","FrmDateList");
- ExportReport("PrintToPrinter","GetFrmDateList","Get","FrmDateList");
- }
- }
- ]]>
- </Click>
- </Events>
- </IKButton>
- </Controls>
- <ChildForms>
- <ChildForm name="BillSearch" DataSource="SaleBill" SearchFunction="SearchAllBill" SearchFunctionCondition="SearchBillCondition" SearchFunctionByNo="">
- <DataColumn Index="0" MappingName="#SaleBill.No_SaleBill" HeaderText="销售单号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="1" MappingName="#SaleBill.Date_SaleBill" HeaderText="制单日期" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="2" MappingName="#SaleBill.Type_Customer" HeaderText="客户类型" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="3" MappingName="#SaleBill.ShortName_Customer" HeaderText="客户名称" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
- </ChildForm>
- <ChildForm name="CustomerSearch" DataSource="Customer" SearchFunction="SearchAllCustomer" SearchFunctionCondition="SearchCustomerCondition" SearchFunctionByNo="" MappingName="客户">
- <DataColumn Index="0" MappingName="#Customer.No_Customer" HeaderText="客户编号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="1" MappingName="#Customer.ShortName_Customer" HeaderText="客户简称" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="2" MappingName="#Customer.Type_Customer" HeaderText="客户类型" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="3" MappingName="#Customer.Level_Customer" HeaderText="客户等级" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="4" MappingName="#Customer.IsGeneric_Customer" HeaderText="一般客户" Width="75" ColumnType="IKDataGridBoolColumn"/>
- </ChildForm>
- <ChildForm name="ProductSearch" 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>
- </ChildForms>
- <FormatString>
- <Format name="SearchCustomerCondition">
- if(GetRight("客户基本资料","全权查看"))
- {
- FormatString("");
- }
- else
- {
- FormatString(" Customer.ID_Creator='{0}' ",GetLoginUserID());
- }
- </Format>
- <Format name="SearchBillCondition">
- if(GetRight("客户基本资料","全权查看"))
- {
- FormatString("");
- }
- else
- {
- FormatString(" Disable_SaleBill=0 and Customer.ID_Creator='{0}' ",GetLoginUserID());
- }
- </Format>
- </FormatString>
- </Client>
- <Server>
- <Tables>
- <Table name="SaleBill" Type="Parent">
- <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 SaleBill.* FROM SaleBill"/>
- </Table>
- <Table name="Get" Type="Other">
- <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 convert(datetime,0) as StartDate,
- convert(datetime,0) as EndDate ,
- convert(nvarchar(64),'') as StartNo_SaleBill ,
- convert(nvarchar(64),'') as EndNo_SaleBill ,
- convert(nvarchar(64),'') as StartNo_Customer ,
- convert(nvarchar(64),'') as EndNo_Customer ,
- convert(nvarchar(64),'') as StartNo_Principal ,
- convert(nvarchar(64),'') as EndNo_Principal ,
- convert(nvarchar(64),'') as StartNo_Location ,
- convert(nvarchar(64),'') as EndNo_Location ,
- convert(nvarchar(64),'') as StartNo_Product,
- convert(nvarchar(64),'') as EndNo_Product ,
- convert(nvarchar(64),'') as StartType_Product ,
- convert(nvarchar(64),'') as EndType_Product,
- convert(nvarchar(64),'') as Company ,
- convert(nvarchar(64),'') as Name_Create,
- convert(nvarchar(64),'') as StartType_Customer ,
- convert(nvarchar(64),'') as EndType_Customer,
- convert(datetime,0) as StartFileDate,
- convert(datetime,0) as EndFileDate ,
- convert(DECIMAL,0.00) as StartDiscount_SaleBill,
- convert(DECIMAL,0.00) as EndDiscount_SaleBill
- "/>
- </Table>
- <Table name="FrmLocationList" Type="Other">
- <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 CONVERT(NVARCHAR(64),'') AS Name_Location,
- CONVERT(NVARCHAR(64),'') AS No_Product,
- CONVERT(NVARCHAR(64),'') AS Name_Product,
- CONVERT(DATETIME,0) AS Date_SaleBill ,
- CONVERT(NVARCHAR(64),'') AS No_SaleBill,
- CONVERT(NVARCHAR(64),'') AS No_Customer,
- CONVERT(NVARCHAR(64),'') AS ShortName_Customer,
- CONVERT(NVARCHAR(64),'') AS Type_Customer,
- CONVERT(DATETIME,0) As CreateDate_Customer,
- CONVERT(NVARCHAR(64),'') AS Principal_SaleBill,
- CONVERT(NVARCHAR(64),'') AS Unit_Product,
- CONVERT(NVARCHAR(64),'') AS Currency_SaleBill,
- CONVERT(NVARCHAR(64),'') AS TaxCurrency_SaleBill,
- CONVERT(DECIMAL,0.00) AS Quantity,
- CONVERT(DECIMAL,0.00) AS MoneySum,
- CONVERT(DECIMAL,0.00) AS Amount,
- CONVERT(DECIMAL,0.00) AS CurrencyAmount,
- CONVERT(DECIMAL,0.00) AS Price_Product,
- CONVERT(DECIMAL,0.00) AS Discount_SaleBillProduct,
- CONVERT(NVARCHAR(64),'') AS BillType,
- CONVERT(DECIMAL,0.00) AS OrderPrice_SaleBillProduct
- "/>
- </Table>
- <Table name="FrmProductList" Type="Other">
- <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 CONVERT(NVARCHAR(64),'') AS No_Product,
- CONVERT(NVARCHAR(64),'') AS Name_Product,
- CONVERT(NVARCHAR(64),'') AS No_SaleBill,
- CONVERT(DATETIME,0) AS Date_SaleBill,
- CONVERT(NVARCHAR(64),'') AS ShortName_Customer,
- CONVERT(NVARCHAR(64),'') AS Type_Customer,
- CONVERT(DATETIME,0) As CreateDate_Customer,
- CONVERT(NVARCHAR(64),'') AS Principal_SaleBill,
- CONVERT(NVARCHAR(64),'') AS Currency_SaleBill,
- CONVERT(NVARCHAR(64),'') AS Name_Location,
- CONVERT(DECIMAL,0.00) AS Quantity_SaleBillProduct,
- CONVERT(NVARCHAR(64),'') AS TaxCurrency_SaleBill,
- CONVERT(DECIMAL,0.00) AS Price_Product,
- CONVERT(NVARCHAR(64),'') AS Unit_Product,
- CONVERT(DECIMAL,0.00) AS Quantity,
- CONVERT(DECIMAL,0.00) AS MoneySum,
- CONVERT(DECIMAL,0.00) AS Amount,
- CONVERT(DECIMAL,0.00) AS CurrencyAmount,
- CONVERT(DECIMAL,0.00) AS Discount_SaleBillProduct,
- CONVERT(NVARCHAR(64),'') AS BillType,
- CONVERT(NVARCHAR(64),'') AS No_Customer,
- CONVERT(DECIMAL,0.00) AS OrderPrice_SaleBillProduct
- "/>
- </Table>
- <Table name="FrmSalesListPrinciPalSingleProductOf" Type="Other">
- <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 CONVERT(NVARCHAR(64),'') AS Principal_SaleBill,
- CONVERT(DATETIME,0) AS Date_SaleBill,
- CONVERT(NVARCHAR(64),'') AS No_SaleBill,
- CONVERT(NVARCHAR(64),'') AS No_Customer,
- CONVERT(NVARCHAR(64),'') AS ShortName_Customer,
- CONVERT(NVARCHAR(64),'') AS Type_Customer,
- CONVERT(DATETIME,0) As CreateDate_Customer,
- CONVERT(NVARCHAR(64),'') AS Name_Location,
- CONVERT(NVARCHAR(64),'') AS Currency_SaleBill,
- CONVERT(DECIMAL,0.00) AS MoneySum,
- CONVERT(DECIMAL,0.00) AS TaxAmount,
- CONVERT(DECIMAL,0.00) AS Amount,
- CONVERT(DECIMAL,0.00) AS CurrencyAmount,
- CONVERT(NVARCHAR(64),'') AS TaxCurrency_SaleBill,
- CONVERT(DECIMAL,0.00) AS Quantity,
- CONVERT(DECIMAL,0.00) AS Discount_SaleBillProduct,
- CONVERT(NVARCHAR(64),'') AS No_Product,
- CONVERT(NVARCHAR(64),'') AS Name_Product,
- CONVERT(DECIMAL,0.00) AS Quantity_SaleBillProduct,
- CONVERT(DECIMAL,0.00) AS Price_Product,
- CONVERT(DECIMAL,0.00) AS ProductMoney,
- CONVERT(NVARCHAR(64),'') AS BillType,
- CONVERT(DECIMAL,0.00) AS OrderPrice_SaleBillProduct
- "/>
- </Table>
- <Table name="SingleProductOfP" Type="Other">
- <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 CONVERT(NVARCHAR(64),'') AS No_SaleBill,
- CONVERT(NVARCHAR(64),'') AS No_Product,
- CONVERT(NVARCHAR(64),'') AS Name_Product,
- CONVERT(DECIMAL,0.00) AS Quantity_SaleBillProduct,
- CONVERT(DECIMAL,0.00) AS Price_Product,
- CONVERT(DECIMAL,0.00) AS ProductMoney,
- CONVERT(DECIMAL,0.00) AS OrderPrice_SaleBillProduct
- "/>
- </Table>
- <Table name="SumProductOfP" Type="Other">
- <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 CONVERT(NVARCHAR(64),'') AS Principal_SaleBill,
- CONVERT(NVARCHAR(64),'') AS No_Product,
- CONVERT(NVARCHAR(64),'') AS Name_Product,
- CONVERT(NVARCHAR(64),'') AS Unit_Product,
- CONVERT(NVARCHAR(64),'') AS Currency_SaleBill,
- CONVERT(DECIMAL,0.00) AS Quantity,
- CONVERT(DECIMAL,0.00) AS AVGPrice_Product,
- CONVERT(DECIMAL,0.00) AS NOTexMoney
- "/>
- </Table>
- <Table name="FrmCustomerList" Type="Other">
- <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 CONVERT(NVARCHAR(64),'') AS No_Customer,
- CONVERT(NVARCHAR(64),'') AS ShortName_Customer,
- CONVERT(NVARCHAR(64),'') AS Type_Customer,
- CONVERT(DATETIME,0) AS CreateDate_Customer,
- CONVERT(NVARCHAR(64),'') AS No_SaleBill,
- CONVERT(DATETIME,0) AS Date_SaleBill,
- CONVERT(NVARCHAR(64),'') AS Principal_SaleBill,
- CONVERT(NVARCHAR(64),'') AS Name_Location,
- CONVERT(NVARCHAR(64),'') AS TaxCurrency_SaleBill,
- CONVERT(NVARCHAR(64),'') AS Currency_SaleBill,
- CONVERT(DECIMAL,0.00) AS TaxAmount,
- CONVERT(DECIMAL,0.00) AS Quantity,
- CONVERT(DECIMAL,0.00) AS MoneySum,
- CONVERT(DECIMAL,0.00) AS Amount,
- CONVERT(DECIMAL,0.00) AS CurrencyAmount,
- CONVERT(DECIMAL,0.00) AS Discount_SaleBillProduct,
- CONVERT(NVARCHAR(64),'') AS No_Product,
- CONVERT(NVARCHAR(64),'') AS Name_Product,
- CONVERT(DECIMAL,0.00) AS Quantity_SaleBillProduct,
- CONVERT(DECIMAL,0.00) AS Price_Product,
- CONVERT(DECIMAL,0.00) AS ProductMoney,
- CONVERT(NVARCHAR(64),'') AS BillType,
- CONVERT(DECIMAL,0.00) AS OrderPrice_SaleBillProduct
- "/>
- </Table>
- <Table name="SingleProduct" Type="Other">
- <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 CONVERT(NVARCHAR(64),'') AS No_SaleBill,
- CONVERT(NVARCHAR(64),'') AS No_Product,
- CONVERT(NVARCHAR(64),'') AS Name_Product,
- CONVERT(DECIMAL,0.00) AS Quantity_SaleBillProduct,
- CONVERT(DECIMAL,0.00) AS Price_Product,
- CONVERT(DECIMAL,0.00) AS ProductMoney,
- CONVERT(DECIMAL,0.00) AS OrderPrice_SaleBillProduct
- "/>
- </Table>
- <Table name="SumProduct" Type="Other">
- <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 CONVERT(NVARCHAR(64),'') AS No_Product,
- CONVERT(NVARCHAR(64),'') AS Name_Product,
- CONVERT(NVARCHAR(64),'') AS Unit_Product,
- CONVERT(NVARCHAR(64),'') AS No_Customer,
- CONVERT(NVARCHAR(64),'') AS Currency_SaleBill,
- CONVERT(DECIMAL,0.00) AS Quantity,
- CONVERT(DECIMAL,0.00) AS AVGPrice_Product,
- CONVERT(DECIMAL,0.00) AS NOTexMoney
- "/>
- </Table>
- <Table name="FrmDateList" Type="Other">
- <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 CONVERT(NVARCHAR(64),'') AS Date_SaleBill,
- CONVERT(NVARCHAR(64),'') AS ShortName_Customer,
- CONVERT(NVARCHAR(64),'') AS Type_Customer,
- CONVERT(DATETIME,0) AS CreateDate_Customer,
- CONVERT(NVARCHAR(64),'') AS No_SaleBill,
- CONVERT(NVARCHAR(64),'') AS Principal_SaleBill,
- CONVERT(NVARCHAR(64),'') AS Name_Location,
- CONVERT(NVARCHAR(64),'') AS TaxCurrency_SaleBill,
- CONVERT(NVARCHAR(64),'') AS Currency_SaleBill,
- CONVERT(DECIMAL,0.00) AS TaxAmount,
- CONVERT(DECIMAL,0.00) AS Quantity,
- CONVERT(DECIMAL,0.00) AS MoneySum,
- CONVERT(DECIMAL,0.00) AS Amount,
- CONVERT(DECIMAL,0.00) AS CurrencyAmount,
- CONVERT(DECIMAL,0.00) AS Discount_SaleBillProduct,
- CONVERT(NVARCHAR(64),'') AS No_Product,
- CONVERT(NVARCHAR(64),'') AS Name_Product,
- CONVERT(DECIMAL,0.00) AS Quantity_SaleBillProduct,
- CONVERT(DECIMAL,0.00) AS Price_Product,
- CONVERT(DECIMAL,0.00) AS ProductMoney,
- CONVERT(NVARCHAR(64),'') AS BillType,
- CONVERT(NVARCHAR(64),'') AS No_Customer,
- CONVERT(DECIMAL,0.00) AS OrderPrice_SaleBillProduct
- "/>
- </Table>
- <Table name="SingleProductOfD" Type="Other">
- <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 CONVERT(NVARCHAR(64),'') AS No_SaleBill,
- CONVERT(NVARCHAR(64),'') AS No_Product,
- CONVERT(NVARCHAR(64),'') AS Name_Product,
- CONVERT(DECIMAL,0.00) AS Quantity_SaleBillProduct,
- CONVERT(DECIMAL,0.00) AS Price_Product,
- CONVERT(DECIMAL,0.00) AS ProductMoney,
- CONVERT(DECIMAL,0.00) AS OrderPrice_SaleBillProduct
- "/>
- </Table>
- <Table name="SumProductOfD" Type="Other">
- <GetSchema CmdType="Text" CmdText=" SELECT TOP 0 CONVERT(DATETIME,0) AS Date_SaleBill,
- CONVERT(NVARCHAR(64),'') AS No_Product,
- CONVERT(NVARCHAR(64),'') AS Name_Product,
- CONVERT(NVARCHAR(64),'') AS Unit_Product,
- CONVERT(NVARCHAR(64),'') AS Currency_SaleBill,
- CONVERT(DECIMAL,0.00) AS Quantity,
- CONVERT(DECIMAL,0.00) AS AVGPrice_Product,
- CONVERT(DECIMAL,0.00) AS NOTexMoney
- "/>
- </Table>
- </Tables>
- <Search>
- <SearchAllBill CmdType="Text" CmdText=" SELECT SaleBill.*, Customer.No_Customer, Customer.Name_Customer, Customer.ShortName_Customer,
- Customer.Type_Customer,Customer.CreateDate_Customer, Customer.LastDiscount_Customer, Customer.PostalCode_Customer, Customer.ID_Creator,
- a.Name_User AS Name_Creator, b.Name_User AS Name_Assessor, c.Name_User AS LastModUserName,
- Location.No_Location, Location.Name_Location, CONVERT(decimal(18,6), 0) AS NumSum, CONVERT(decimal(18,6), 0) AS MoneySum,
- CONVERT(decimal(18,6), 0) AS TaxSum, Employee.No_Employee AS No_Principal, Employee.Name_Employee AS Principal_SaleBill
- FROM SaleBill
- LEFT JOIN Customer ON Customer.ID_Customer = SaleBill.ID_Customer
- LEFT JOIN AppUser a ON a.ID_User = SaleBill.ID_Creator
- LEFT JOIN AppUser b ON b.ID_User = SaleBill.ID_Assessor
- LEFT JOIN AppUser c ON c.ID_User = SaleBill.LastModUser_SaleBill
- LEFT JOIN Location ON Location.ID_Location = SaleBill.ID_Location
- LEFT JOIN Employee ON Employee.ID_Employee = SaleBill.ID_Principal">
- <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>
- <SearchPrincipal CmdType="Text" CmdText="SELECT DISTINCT No_Employee,Name_Employee
- FROM Employee
- ORDER BY No_Employee">
- <Tables>
- <Table name="Principal" />
- </Tables>
- </SearchPrincipal>
- <SearchLocation CmdType="Text" CmdText=" SELECT Location.No_Location, Location.Name_Location FROM Location WHERE Location.Level_Location = 0 ORDER BY Location.No_Location">
- <Tables>
- <Table name="Location" />
- </Tables>
- </SearchLocation>
- <SearchType CmdType="Text" CmdText=" SELECT Name_TypeDef as Type_Product FROM TypeDef WHERE (Type_TypeDef = 8) ORDER BY Name_TypeDef">
- <Tables>
- <Table name="Type"/>
- </Tables>
- </SearchType>
- <SearchCustomerType CmdType="Text" CmdText="Select Name_TypeDef as Type_Customer From TypeDef Where (Type_TypeDef = 12) order by Name_TypeDef">
- <Tables>
- <Table name="CustomerType"/>
- </Tables>
- </SearchCustomerType>
- <SearchFrmSalesListLocation CmdType="Text" CmdText=" declare @cessIn decimal(14,4)
- declare @sqlCmd nvarchar(4000)
- Select @cessIn=CessIn_SystemSetting From SystemSetting
- CREATE TABLE Get
- (
- StartDate DATETIME,
- EndDate DATETIME,
- StartNo_SaleBill nvarchar(64),
- EndNo_SaleBill nvarchar(64),
- StartNo_Customer nvarchar(64),
- EndNo_Customer nvarchar(64),
- StartNo_Principal nvarchar(64),
- EndNo_Principal nvarchar(64),
- StartNo_Location nvarchar(64),
- EndNo_Location nvarchar(64),
- StartNo_Product nvarchar(64),
- EndNo_Product nvarchar(64),
- StartType_Product nvarchar(64),
- EndType_Product nvarchar(64),
- Company nvarchar(64),
- Name_Create nvarchar(64),
- StartType_Customer nvarchar(64),
- EndType_Customer nvarchar(64),
- StartFileDate DATETIME,
- EndFileDate DATETIME,
- StartDiscount_SaleBill decimal(14,2),
- EndDiscount_SaleBill decimal(14,2)
- )
- INSERT INTO Get(StartDate,EndDate,StartNo_SaleBill,EndNo_SaleBill,
- StartNo_Customer,EndNo_Customer,StartNo_Principal,EndNo_Principal,
- StartNo_Location,EndNo_Location,Company,Name_Create,
- StartNo_Product,EndNo_Product,StartType_Product,EndType_Product,
- StartType_Customer,EndType_Customer,StartFileDate,EndFileDate,
- StartDiscount_SaleBill,EndDiscount_SaleBill)
- VALUES (@StartDate,@EndDate,isnull(@StartNo_SaleBill,''), isnull(@EndNo_SaleBill,''),
- isnull(@StartNo_Customer,''),isnull(@EndNo_Customer,''),
- isnull(@StartNo_Principal,''),isnull(@EndNo_Principal,''),
- isnull(@StartNo_Location,''),isnull(@EndNo_Location,''),
- isnull(@Company,''),@Name_Create,
- isnull(@StartNo_Product,''),isnull(@EndNo_Product,''),
- isnull(@StartType_Product,''), isnull(@EndType_Product,''),
- isnull(@StartType_Customer,''), isnull(@EndType_Customer,''), @StartFileDate,@EndFileDate,
- @StartDiscount_SaleBill,@EndDiscount_SaleBill)
- SELECT * FROM Get
- DROP TABLE Get
-
- SELECT * FROM (
- select top 0 '' as sg,'' as Name_Location,'' as No_Product,'' as Name_Product,convert(datetime,'') as Date_SaleBill,'' as No_SaleBill,'' as No_Customer,
- '' as ShortName_Customer,'' as Type_Customer,convert(datetime,'') as CreateDate_Customer,'' as Principal_SaleBill,Convert(decimal(14,4),0) as Quantity,
- '' as Unit_Product,Convert(decimal(14,4),0) as Price_Product,'' as Currency_SaleBill,'' as TaxCurrency_SaleBill,
- Convert(DECIMAL(14,4),0) AS MoneySum,convert(decimal(14,4),0) as Amount,
- convert(decimal(14,4),0) as CurrencyAmount,CONVERT(Decimal(14,4),0) as TaxAmount,CONVERT(Decimal(14,2),0) as Discount_SaleBillProduct
- ,Convert(decimal(14,4),0) as OrderPrice_SaleBillProduct
- UNION ALL
- (
- SELECT sg=-1,Location.Name_Location,Product.No_Product,Product.Name_Product,SaleBill.Date_SaleBill,('销'+SaleBill.No_SaleBill) as No_SaleBill,
- Customer.No_Customer,Customer.ShortName_Customer,Customer.Type_Customer,Customer.CreateDate_Customer,Employee.Name_Employee as Principal_SaleBill,
- convert(DECIMAL(14,4),SUM(SaleBillProduct.Quantity_SaleBillProduct)) AS Quantity,Product.Unit_Product,
- (UnitPrice_SaleBillProduct) AS Price_Product, SaleBill.Currency_SaleBill,SaleBill.TaxCurrency_SaleBill,
- MoneySum = case SaleBill.TaxCurrency_SaleBill
- When '内含' Then convert(DECIMAL(14,4),sum( (Quantity_SaleBillProduct*UnitPrice_SaleBillProduct)/(1+@cessIn/100)))
- else convert(DECIMAL(14,4),SUM((Quantity_SaleBillProduct*UnitPrice_SaleBillProduct))) end,
- Amount=case SaleBill.TaxCurrency_SaleBill
- When '外加' Then convert(DECIMAL(14,4),sum((Quantity_SaleBillProduct*UnitPrice_SaleBillProduct)*(1+@cessIn/100)))
- else convert(DECIMAL(14,4),SUM((Quantity_SaleBillProduct*UnitPrice_SaleBillProduct))) end,
- CurrencyAmount=case SaleBill.TaxCurrency_SaleBill
- When '外加' Then convert(DECIMAL(14,4),SUM((Quantity_SaleBillProduct*UnitPrice_SaleBillProduct)*(1+@cessIn/100)))
- else convert(DECIMAL(14,4),SUM((Quantity_SaleBillProduct*UnitPrice_SaleBillProduct))) end,
- TaxAmount = case SaleBill.TaxCurrency_SaleBill
- When '外加' Then convert(DECIMAL(14,4),SUM((Quantity_SaleBillProduct*UnitPrice_SaleBillProduct)*(@cessIn/100)))
- When '内含' Then convert(DECIMAL(14,4),SUM((Quantity_SaleBillProduct*UnitPrice_SaleBillProduct)*((@cessIn/100)/(1+@cessIn/100))))
- When '零税' Then 0
- When '免税' Then 0 end,
- SaleBillProduct.Discount_SaleBillProduct
- ,SaleBillProduct.OrderPrice_SaleBillProduct
- FROM SaleBill
- LEFT JOIN SaleBillProduct ON SaleBillProduct.ID_SaleBill=SaleBill.ID_SaleBill
- LEFT JOIN Product ON Product.ID_Product = SaleBillProduct.ID_Product
- LEFT JOIN Location ON Location.ID_Location = SaleBill.ID_Location
- LEFT JOIN Customer ON Customer.ID_Customer = SaleBill.ID_Customer
- LEFT JOIN Employee ON Employee.ID_Employee = SaleBill.ID_Principal
- WHERE SaleBill.ID_Assessor IS NOT NULL
- AND SaleBill.Date_SaleBill Between isnull(DateAdd(day,DateDiff(day,0,@StartDate),0),SaleBill.Date_SaleBill) AND Isnull(DateAdd(day,DateDiff(day,0,@EndDate),1),SaleBill.Date_SaleBill)
- AND SaleBill.No_SaleBill BETWEEN ISNULL(@StartNo_SaleBill,SaleBill.No_SaleBill) AND ISNULL(@EndNo_SaleBill,SaleBill.No_SaleBill)
- AND No_Customer BETWEEN ISNULL(@StartNo_Customer,No_Customer) AND ISNULL(@EndNo_Customer,No_Customer)
- AND Employee.No_Employee BETWEEN ISNULL(@StartNo_Principal,No_Employee) AND ISNULL(@EndNo_Principal,No_Employee)
- AND Location.No_Location BETWEEN ISNULL(@StartNo_Location,Location.No_Location) AND ISNULL(@EndNo_Location,Location.No_Location)
- AND Product.Type_Product BETWEEN ISNULL(@StartType_Product,Product.Type_Product) AND ISNULL(@EndType_Product,Product.Type_Product)
- AND Product.No_Product BETWEEN ISNULL(@StartNo_Product,Product.No_Product) AND ISNULL(@EndNo_Product,Product.No_Product)
- AND Customer.Type_Customer BETWEEN ISNULL(@StartType_Customer,Customer.Type_Customer) AND ISNULL(@EndType_Customer,Customer.Type_Customer)
- AND Customer.CreateDate_Customer Between isnull(DateAdd(day,DateDiff(day,0,@StartFileDate),0),Customer.CreateDate_Customer) AND Isnull(DateAdd(day,DateDiff(day,0,@EndFileDate),1),Customer.CreateDate_Customer)
- AND Customer.No_Customer BETWEEN ISNULL(@StartNo_Customer,Customer.No_Customer) AND ISNULL(@EndNo_Customer,Customer.No_Customer)
- And Customer.ID_Creator = ISNULL(@Right,Customer.ID_Creator)
- and Special_SaleBill=case @Special when 1 then Special_SaleBill else 0 End
- And isnull(Discount_SaleBillProduct,0) between isnull(@StartDiscount_SaleBill,
- isnull(SaleBillProduct.Discount_SaleBillProduct,0)) And isnull(@EndDiscount_SaleBill,
- isnull(SaleBillProduct.Discount_SaleBillProduct,0))
-
- GROUP BY Product.No_Product,Product.Name_Product,SaleBill.No_SaleBill,SaleBill.Date_SaleBill,Customer.No_Customer,
- Customer.ShortName_Customer,Employee.Name_Employee,Location.Name_Location,Customer.Type_Customer,Customer.CreateDate_Customer,
- SaleBill.Currency_SaleBill,SaleBill.TaxCurrency_SaleBill,(UnitPrice_SaleBillProduct)
- ,Product.Unit_Product ,SaleBillProduct.Discount_SaleBillProduct
- ,SaleBillProduct.OrderPrice_SaleBillProduct
- )
- UNION ALL
- (
- SELECT sg=1,Location.Name_Location,Product.No_Product,Product.Name_Product,SaleRtnBill.Date_SaleRtnBill AS Date_SaleBill,('退'+SaleRtnBill.No_SaleRtnBill) as No_SaleBill,
- Customer.No_Customer,Customer.ShortName_Customer,Customer.Type_Customer,Customer.CreateDate_Customer,
- Employee.Name_Employee as Principal_SaleBill,convert(DECIMAL(14,2),-SUM(SaleRtnBillProduct.Quantity_SaleRtnBillProduct)) AS Quantity,Product.Unit_Product,
- (UnitPrice_SaleRtnBillProduct) AS Price_Product,
- SaleRtnBill.Currency_SaleRtnBill as Currency_SaleBill,SaleRtnBill.TaxCurrency_SaleRtnBill as TaxCurrency_SaleBill,
- MoneySum = CASE @Rtn WHEN 1 THEN (case SaleRtnBill.TaxCurrency_SaleRtnBill
- When '内含' Then convert(DECIMAL(14,4),-sum( (Quantity_SaleRtnBillProduct*UnitPrice_SaleRtnBillProduct)/(1+@cessIn/100)))
- else convert(DECIMAL(14,4),-SUM((Quantity_SaleRtnBillProduct*UnitPrice_SaleRtnBillProduct))) end) ELSE 0 END,
- Amount=CASE @Rtn WHEN 1 THEN (case SaleRtnBill.TaxCurrency_SaleRtnBill
- When '外加' Then convert(DECIMAL(14,4),-sum((Quantity_SaleRtnBillProduct*UnitPrice_SaleRtnBillProduct)*(1+@cessIn/100)))
- else convert(DECIMAL(14,4),-SUM((Quantity_SaleRtnBillProduct*UnitPrice_SaleRtnBillProduct))) end) ELSE 0 END,
- CurrencyAmount=CASE @Rtn WHEN 1 THEN (case SaleRtnBill.TaxCurrency_SaleRtnBill
- When '外加' Then convert(DECIMAL(14,4),-SUM((Quantity_SaleRtnBillProduct*UnitPrice_SaleRtnBillProduct)*(1+@cessIn/100)))
- else convert(DECIMAL(14,4),-SUM((Quantity_SaleRtnBillProduct*UnitPrice_SaleRtnBillProduct))) end) ELSE 0 END,
- TaxAmount = CASE @Rtn WHEN 1 THEN (case SaleRtnBill.TaxCurrency_SaleRtnBill
- When '外加' Then convert(DECIMAL(14,4),-SUM((Quantity_SaleRtnBillProduct*UnitPrice_SaleRtnBillProduct)*(@cessIn/100)))
- When '内含' Then convert(DECIMAL(14,4),-SUM((Quantity_SaleRtnBillProduct*UnitPrice_SaleRtnBillProduct)*((@cessIn/100)/(1+@cessIn/100))))
- When '零税' Then 0
- When '免税' Then 0 end) ELSE 0 END,
-
- SaleBillProduct.Discount_SaleBillProduct
- ,SaleBillProduct.OrderPrice_SaleBillProduct
- FROM SaleRtnBill
- LEFT JOIN SaleRtnBillProduct ON SaleRtnBill.ID_SaleRtnBill=SaleRtnBillProduct.ID_SaleRtnBill
- LEFT JOIN Product ON Product.ID_Product = SaleRtnBillProduct.ID_Product
- LEFT JOIN Location ON Location.ID_Location = SaleRtnBill.ID_Location
- LEFT JOIN Customer ON Customer.ID_Customer = SaleRtnBill.ID_Customer
- LEFT JOIN Employee ON Employee.ID_Employee = SaleRtnBill.ID_Principal
- Left join SaleBillProduct on SaleBillProduct.ID_SaleSourceBillProduct =SaleRtnBillProduct.ID_SaleSourceBillProduct
- WHERE SaleRtnBill.ID_Assessor IS NOT NULL
- AND SaleRtnBill.Date_SaleRtnBill Between isnull(DateAdd(day,DateDiff(day,0,@StartDate),0),SaleRtnBill.Date_SaleRtnBill) AND Isnull(DateAdd(day,DateDiff(day,0,@EndDate),1),SaleRtnBill.Date_SaleRtnBill)
- AND SaleRtnBill.No_SaleRtnBill BETWEEN ISNULL(@StartNo_SaleBill,SaleRtnBill.No_SaleRtnBill) AND ISNULL(@EndNo_SaleBill,SaleRtnBill.No_SaleRtnBill)
- AND No_Customer BETWEEN ISNULL(@StartNo_Customer,No_Customer) AND ISNULL(@EndNo_Customer,No_Customer)
- AND Employee.No_Employee BETWEEN ISNULL(@StartNo_Principal,No_Employee) AND ISNULL(@EndNo_Principal,No_Employee)
- AND Location.No_Location BETWEEN ISNULL(@StartNo_Location,Location.No_Location) AND ISNULL(@EndNo_Location,Location.No_Location)
- AND Product.Type_Product BETWEEN ISNULL(@StartType_Product,Product.Type_Product) AND ISNULL(@EndType_Product,Product.Type_Product)
- AND Product.No_Product BETWEEN ISNULL(@StartNo_Product,Product.No_Product) AND ISNULL(@EndNo_Product,Product.No_Product)
- AND Customer.Type_Customer BETWEEN ISNULL(@StartType_Customer,Customer.Type_Customer) AND ISNULL(@EndType_Customer,Customer.Type_Customer)
- AND Customer.CreateDate_Customer Between isnull(DateAdd(day,DateDiff(day,0,@StartFileDate),0),Customer.CreateDate_Customer) AND Isnull(DateAdd(day,DateDiff(day,0,@EndFileDate),1),Customer.CreateDate_Customer)
- AND Customer.No_Customer BETWEEN ISNULL(@StartNo_Customer,Customer.No_Customer) AND ISNULL(@EndNo_Customer,Customer.No_Customer)
- And Customer.ID_Creator = ISNULL(@Right,Customer.ID_Creator)
- And isnull(Discount_SaleBillProduct,0) between isnull(@StartDiscount_SaleBill,isnull(SaleBillProduct.Discount_SaleBillProduct,0))and isnull(@EndDiscount_SaleBill,isnull(SaleBillProduct.Discount_SaleBillProduct,0))
- GROUP BY Product.No_Product,Product.Name_Product,SaleRtnBill.No_SaleRtnBill,SaleRtnBill.Date_SaleRtnBill,Customer.No_Customer,
- Customer.ShortName_Customer,Employee.Name_Employee,Location.Name_Location,Customer.Type_Customer,Customer.CreateDate_Customer,
- SaleRtnBill.Currency_SaleRtnBill,SaleRtnBill.TaxCurrency_SaleRtnBill,(UnitPrice_SaleRtnBillProduct),Product.Unit_Product,SaleBillProduct.Discount_SaleBillProduct
- ,SaleBillProduct.OrderPrice_SaleBillProduct
- )
- )C
- WHERE MoneySum != 0 AND Amount != 0 AND CurrencyAmount != 0 AND TaxAmount != 0
- ORDER BY C.Name_Location,No_Product,sg,Date_SaleBill
- ">
- <Params>
- <Param name="@StartDate" type="SaleBill.Date_SaleBill" Index="0" />
- <Param name="@EndDate" type="SaleBill.Date_SaleBill" Index="1" />
- <Param name="@StartNo_SaleBill" type="SaleBill.No_SaleBill" Index="2" />
- <Param name="@EndNo_SaleBill" type="SaleBill.No_SaleBill" Index="3" />
- <Param name="@StartNo_Customer" type="SaleBill.No_Customer" Index="4" />
- <Param name="@EndNo_Customer" type="SaleBill.No_Customer" Index="5" />
- <Param name="@StartNo_Principal" type="SaleBill.No_Customer" Index="6" />
- <Param name="@EndNo_Principal" type="SaleBill.No_Customer" Index="7" />
- <Param name="@StartNo_Location" type="SaleBill.No_Location" Index="8" />
- <Param name="@EndNo_Location" type="SaleBill.No_Location" Index="9" />
- <Param name="@StartNo_Product" type="SaleBill.No_Product" Index="10" />
- <Param name="@EndNo_Product" type="SaleBill.No_Product" Index="11" />
- <Param name="@StartType_Product" type="SaleBill.Type_Product" Index="12" />
- <Param name="@EndType_Product" type="SaleBill.Type_Product" Index="13" />
- <Param name="@Company" type="SaleBill.Type_Product" Index="14" />
- <Param name="@Name_Create" type="SaleBill.Name_Location" Index="15" />
- <Param name="@Right" type="SaleBill.ID_Customer" Index="16" />
- <Param name="@Rtn" type="Product.No_Product" Index="17" />
- <Param name="@Special" type="SaleBill.Special_SaleBill" Index="18" />
- <Param name="@StartType_Customer" type="Customer.Type_Customer" Index="19" />
- <Param name="@EndType_Customer" type="Customer.Type_Customer" Index="20" />
- <Param name="@StartFileDate" type="Customer.CreateDate_Customer" Index="21" />
- <Param name="@EndFileDate" type="Customer.CreateDate_Customer" Index="22" />
- <Param name="@StartDiscount_SaleBill" type="SaleBillProduct.Discount_SaleBillProduct" Index="23" />
- <Param name="@EndDiscount_SaleBill" type="SaleBillProduct.Discount_SaleBillProduct" Index="24" />
- </Params>
- <Tables>
- <Table name="Get" />
- <Table name="FrmLocationList"/>
- </Tables>
- </SearchFrmSalesListLocation>
- <SearchFrmSalesList CmdType="Text" CmdText="declare @cessIn decimal(14,4)
- declare @sqlCmd nvarchar(4000)
- Select @cessIn=CessIn_SystemSetting From SystemSetting
- CREATE TABLE Get
- (
- StartDate DATETIME,
- EndDate DATETIME,
- StartNo_SaleBill nvarchar(64),
- EndNo_SaleBill nvarchar(64),
- StartNo_Customer nvarchar(64),
- EndNo_Customer nvarchar(64),
- StartNo_Principal nvarchar(64),
- EndNo_Principal nvarchar(64),
- StartNo_Location nvarchar(64),
- EndNo_Location nvarchar(64),
- StartNo_Product nvarchar(64),
- EndNo_Product nvarchar(64),
- StartType_Product nvarchar(64),
- EndType_Product nvarchar(64),
- Company nvarchar(64),
- Name_Create nvarchar(64),
- StartType_Customer nvarchar(64),
- EndType_Customer nvarchar(64),
- StartFileDate DATETIME,
- EndFileDate DATETIME,
- StartDiscount_SaleBill decimal(14,2),
- EndDiscount_SaleBill decimal(14,2)
- )
- INSERT INTO Get(StartDate,EndDate,StartNo_SaleBill,EndNo_SaleBill,
- StartNo_Customer,EndNo_Customer,StartNo_Principal,EndNo_Principal,
- StartNo_Location,EndNo_Location,Company,Name_Create,
- StartNo_Product,EndNo_Product,StartType_Product,EndType_Product,StartType_Customer,EndType_Customer,
- StartFileDate,EndFileDate, StartDiscount_SaleBill,EndDiscount_SaleBill)
- VALUES (@StartDate,@EndDate,isnull(@StartNo_SaleBill,''), isnull(@EndNo_SaleBill,''),
- isnull(@StartNo_Customer,''),isnull(@EndNo_Customer,''),
- isnull(@StartNo_Principal,''), isnull(@EndNo_Principal,''),
- isnull(@StartNo_Location,''),isnull(@EndNo_Location,''),
- isnull(@Company,''),@Name_Create,
- isnull(@StartNo_Product,''),isnull(@EndNo_Product,''),
- isnull(@StartType_Product,''),isnull(@EndType_Product,''),
- isnull(@StartType_Customer,''),isnull(@EndType_Customer,''),@StartFileDate,@EndFileDate,
- @StartDiscount_SaleBill,@EndDiscount_SaleBill)
- SELECT * FROM Get
- DROP TABLE Get
- select top 0 '' as BillType,'' as Principal_SaleBill,'' as ShortName_Customer,'' as Type_Customer,convert(datetime,'') as CreateDate_Customer,
- '' as No_SaleBill,convert(Datetime,'') as Date_SaleBill,'' as Name_Location,'' as Currency_SaleBill,
- '' as TaxCurrency_SaleBill,CONVERT(DECIMAL(14,4),0) AS MoneySum,CONVERT(DECIMAL(14,4),0) AS Amount,
- CONVERT(DECIMAL(14,4),0) AS CurrencyAmount,CONVERT(DECIMAL(14,4),0) AS TaxAmount,
- '' as No_Product,'' as Name_Product,CONVERT(DECIMAL(14,4),0) AS Quantity_SaleBillProduct,'' as Unit_Product,
- CONVERT(DECIMAL(14,4),0) AS Price_Product, CONVERT(DECIMAL(14,4),0) AS ProductMoney,
- '' as No_Customer
- ,CONVERT(DECIMAL(14,2),0) as Discount_SaleBillProduct
- ,CONVERT(DECIMAL(14,4),0) AS OrderPrice_SaleBillProduct
- union all
- (
- SELECT '销' as BillType,Employee.Name_Employee as Principal_SaleBill,Customer.ShortName_Customer,Customer.Type_Customer,CreateDate_Customer,
- (SaleBill.No_SaleBill) as No_SaleBill,SaleBill.Date_SaleBill,
- Location.Name_Location,SaleBill.Currency_SaleBill,SaleBill.TaxCurrency_SaleBill,
-
- MoneySum = case SaleBill.TaxCurrency_SaleBill
- When '内含' Then convert(decimal(14,4),(Quantity_SaleBillProduct*UnitPrice_SaleBillProduct)/(1+@cessIn/100))
- else convert(decimal(14,4),(Quantity_SaleBillProduct*UnitPrice_SaleBillProduct)) end,
-
- Amount=case SaleBill.TaxCurrency_SaleBill
- When '外加' Then convert(decimal(14,4),(Quantity_SaleBillProduct*UnitPrice_SaleBillProduct)*(1+@cessIn/100))
- else convert(decimal(14,4),(Quantity_SaleBillProduct*UnitPrice_SaleBillProduct)) end,
-
- CurrencyAmount=case SaleBill.TaxCurrency_SaleBill
- When '外加' Then convert(decimal(14,4),(Quantity_SaleBillProduct*UnitPrice_SaleBillProduct)*(1+@cessIn/100))
- else convert(decimal(14,4),(Quantity_SaleBillProduct*UnitPrice_SaleBillProduct)) end,
- TaxAmount = case SaleBill.TaxCurrency_SaleBill
- When '外加' Then convert(decimal(14,4),(Quantity_SaleBillProduct*UnitPrice_SaleBillProduct)*(@cessIn/100))
- When '内含' Then convert(decimal(14,4),(Quantity_SaleBillProduct*UnitPrice_SaleBillProduct)*((@cessIn/100)/(1+@cessIn/100)))
- When '零税' Then 0
- When '免税' Then 0 end,Product.No_Product,Product.Name_Product,SaleBillProduct.Quantity_SaleBillProduct,
- Product.Unit_Product,(UnitPrice_SaleBillProduct) AS Price_Product,
- (UnitPrice_SaleBillProduct*Quantity_SaleBillProduct) AS ProductMoney,No_Customer,
- SaleBillProduct.Discount_SaleBillProduct
- ,SaleBillProduct.OrderPrice_SaleBillProduct
- FROM SaleBill
-
- LEFT JOIN Location ON Location.ID_Location = SaleBill.ID_Location
- LEFT JOIN SaleBillProduct ON SaleBillProduct.ID_SaleBill= SaleBill.ID_SaleBill
- LEFT JOIN Customer ON Customer.ID_Customer = SaleBill.ID_Customer
- LEFT JOIN Employee ON Employee.ID_Employee = SaleBill.ID_Principal
- LEFT JOIN Product ON Product.ID_Product = SaleBillProduct.ID_Product
- WHERE SaleBill.ID_Assessor IS NOT NULL
- AND SaleBill.Date_SaleBill Between isnull(DateAdd(day,DateDiff(day,0,@StartDate),0),SaleBill.Date_SaleBill) AND Isnull(DateAdd(day,DateDiff(day,0,@EndDate),1),SaleBill.Date_SaleBill)
- AND SaleBill.No_SaleBill BETWEEN ISNULL(@StartNo_SaleBill,SaleBill.No_SaleBill) AND ISNULL(@EndNo_SaleBill,SaleBill.No_SaleBill)
- AND No_Customer BETWEEN ISNULL(@StartNo_Customer,No_Customer) AND ISNULL(@EndNo_Customer,No_Customer)
- AND Employee.No_Employee BETWEEN ISNULL(@StartNo_Principal,No_Employee) AND ISNULL(@EndNo_Principal,No_Employee)
- AND Location.No_Location BETWEEN ISNULL(@StartNo_Location,Location.No_Location) AND ISNULL(@EndNo_Location,Location.No_Location)
- AND Product.Type_Product BETWEEN ISNULL(@StartType_Product,Product.Type_Product) AND ISNULL(@EndType_Product,Product.Type_Product)
- AND Product.No_Product BETWEEN ISNULL(@StartNo_Product,Product.No_Product) AND ISNULL(@EndNo_Product,Product.No_Product)
- AND Customer.Type_Customer BETWEEN ISNULL(@StartType_Customer,Customer.Type_Customer) AND ISNULL(@EndType_Customer,Customer.Type_Customer)
- AND Customer.CreateDate_Customer Between isnull(DateAdd(day,DateDiff(day,0,@StartFileDate),0),Customer.CreateDate_Customer) AND Isnull(DateAdd(day,DateDiff(day,0,@EndFileDate),1),Customer.CreateDate_Customer)
- AND Customer.No_Customer BETWEEN ISNULL(@StartNo_Customer,Customer.No_Customer) AND ISNULL(@EndNo_Customer,Customer.No_Customer)
- And Customer.ID_Creator = ISNULL(@Right,Customer.ID_Creator)
- and Special_SaleBill=case @Special when 1 then Special_SaleBill else 0 End
- And isnull(Discount_SaleBillProduct,0) between isnull(@StartDiscount_SaleBill,
- isnull(SaleBillProduct.Discount_SaleBillProduct,0)) And isnull(@EndDiscount_SaleBill,
- isnull(SaleBillProduct.Discount_SaleBillProduct,0))
- )
- union all
- (
- SELECT '退' as BiiType,Employee.Name_Employee as Principal_SaleBill,Customer.ShortName_Customer,Customer.Type_Customer,CreateDate_Customer,(SaleRtnBill.No_SaleRtnBill) as No_SaleBill,(SaleRtnBill.Date_SaleRtnBill) as Date_SaleBill,
- Location.Name_Location,SaleRtnBill.Currency_SaleRtnBill,SaleRtnBill.TaxCurrency_SaleRtnBill,
- MoneySum = case SaleRtnBill.TaxCurrency_SaleRtnBill
- When '内含' Then convert(decimal(14,4),-(Quantity_SaleRtnBillProduct*UnitPrice_SaleRtnBillProduct)/(1+@cessIn/100))
- else convert(decimal(14,2),-(Quantity_SaleRtnBillProduct*UnitPrice_SaleRtnBillProduct)) end,
- Amount=case SaleRtnBill.TaxCurrency_SaleRtnBill
- When '外加' Then convert(decimal(14,4),-(Quantity_SaleRtnBillProduct*UnitPrice_SaleRtnBillProduct)*(1+@cessIn/100))
- else convert(decimal(14,4),-(Quantity_SaleRtnBillProduct*UnitPrice_SaleRtnBillProduct)) end,
- CurrencyAmount=case SaleRtnBill.TaxCurrency_SaleRtnBill
- When '外加' Then convert(decimal(14,4),-(Quantity_SaleRtnBillProduct*UnitPrice_SaleRtnBillProduct)*(1+@cessIn/100))
- else convert(decimal(14,2),-(Quantity_SaleRtnBillProduct*UnitPrice_SaleRtnBillProduct)) end,
- TaxAmount = case SaleRtnBill.TaxCurrency_SaleRtnBill
- When '外加' Then convert(decimal(14,4),-(Quantity_SaleRtnBillProduct*UnitPrice_SaleRtnBillProduct)*(@cessIn/100))
- When '内含' Then convert(decimal(14,4),-(Quantity_SaleRtnBillProduct*UnitPrice_SaleRtnBillProduct)*((@cessIn/100)/(1+@cessIn/100)))
- When '零税' Then 0
- When '免税' Then 0 end,Product.No_Product,Product.Name_Product,-SaleRtnBillProduct.Quantity_SaleRtnBillProduct as Quantity_SaleBillProduct,
- Product.Unit_Product,(UnitPrice_SaleRtnBillProduct) AS Price_Product,
- -(UnitPrice_SaleRtnBillProduct*Quantity_SaleRtnBillProduct) AS ProductMoney,No_Customer,
-
- SaleBillProduct.Discount_SaleBillProduct
- ,SaleBillProduct.OrderPrice_SaleBillProduct
-
- FROM SaleRtnBill
- LEFT JOIN Location ON Location.ID_Location = SaleRtnBill.ID_Location
- LEFT JOIN SaleRtnBillProduct ON SaleRtnBill.ID_SaleRtnBill=SaleRtnBillProduct.ID_SaleRtnBill
- LEFT JOIN Customer ON Customer.ID_Customer = SaleRtnBill.ID_Customer
- LEFT JOIN Employee ON Employee.ID_Employee = SaleRtnBill.ID_Principal
- LEFT JOIN Product ON Product.ID_Product = SaleRtnBillProduct.ID_Product
- Left join SaleBillProduct on SaleBillProduct.ID_SaleSourceBillProduct =SaleRtnBillProduct.ID_SaleSourceBillProduct
- WHERE SaleRtnBill.ID_Assessor IS NOT NULL
- AND SaleRtnBill.Date_SaleRtnBill Between isnull(DateAdd(day,DateDiff(day,0,@StartDate),0),SaleRtnBill.Date_SaleRtnBill) AND Isnull(DateAdd(day,DateDiff(day,0,@EndDate),1),SaleRtnBill.Date_SaleRtnBill)
- AND SaleRtnBill.No_SaleRtnBill BETWEEN ISNULL(@StartNo_SaleBill,SaleRtnBill.No_SaleRtnBill) AND ISNULL(@EndNo_SaleBill,SaleRtnBill.No_SaleRtnBill)
- AND No_Customer BETWEEN ISNULL(@StartNo_Customer,No_Customer) AND ISNULL(@EndNo_Customer,No_Customer)
- AND Employee.No_Employee BETWEEN ISNULL(@StartNo_Principal,No_Employee) AND ISNULL(@EndNo_Principal,No_Employee)
- AND Location.No_Location BETWEEN ISNULL(@StartNo_Location,Location.No_Location) AND ISNULL(@EndNo_Location,Location.No_Location)
- AND Product.Type_Product BETWEEN ISNULL(@StartType_Product,Product.Type_Product) AND ISNULL(@EndType_Product,Product.Type_Product)
- AND Product.No_Product BETWEEN ISNULL(@StartNo_Product,Product.No_Product) AND ISNULL(@EndNo_Product,Product.No_Product)
- AND Customer.Type_Customer BETWEEN ISNULL(@StartType_Customer,Customer.Type_Customer) AND ISNULL(@EndType_Customer,Customer.Type_Customer)
- AND Customer.CreateDate_Customer Between isnull(DateAdd(day,DateDiff(day,0,@StartFileDate),0),Customer.CreateDate_Customer) AND Isnull(DateAdd(day,DateDiff(day,0,@EndFileDate),1),Customer.CreateDate_Customer)
- AND Customer.No_Customer BETWEEN ISNULL(@StartNo_Customer,Customer.No_Customer) AND ISNULL(@EndNo_Customer,Customer.No_Customer)
- And Customer.ID_Creator = ISNULL(@Right,Customer.ID_Creator)
- And isnull(Discount_SaleBillProduct,0) between isnull(@StartDiscount_SaleBill,isnull(SaleBillProduct.Discount_SaleBillProduct,0))and isnull(@EndDiscount_SaleBill,isnull(SaleBillProduct.Discount_SaleBillProduct,0))
- And @Rtn =1
- )
- order by BillType desc,Date_SaleBill">
- <Params>
- <Param name="@StartDate" type="SaleBill.Date_SaleBill" Index="0" />
- <Param name="@EndDate" type="SaleBill.Date_SaleBill" Index="1" />
- <Param name="@StartNo_SaleBill" type="SaleBill.No_SaleBill" Index="2" />
- <Param name="@EndNo_SaleBill" type="SaleBill.No_SaleBill" Index="3" />
- <Param name="@StartNo_Customer" type="SaleBill.No_Customer" Index="4" />
- <Param name="@EndNo_Customer" type="SaleBill.No_Customer" Index="5" />
- <Param name="@StartNo_Principal" type="SaleBill.No_Customer" Index="6" />
- <Param name="@EndNo_Principal" type="SaleBill.No_Customer" Index="7" />
- <Param name="@StartNo_Location" type="SaleBill.No_Location" Index="8" />
- <Param name="@EndNo_Location" type="SaleBill.No_Location" Index="9" />
- <Param name="@StartNo_Product" type="SaleBill.No_Product" Index="10" />
- <Param name="@EndNo_Product" type="SaleBill.No_Product" Index="11" />
- <Param name="@StartType_Product" type="SaleBill.Type_Product" Index="12" />
- <Param name="@EndType_Product" type="SaleBill.Type_Product" Index="13" />
- <Param name="@Company" type="SaleBill.Type_Product" Index="14" />
- <Param name="@Name_Create" type="SaleBill.Name_Location" Index="15" />
- <Param name="@Right" type="SaleBill.ID_Customer" Index="16" />
- <Param name="@Rtn" type="Product.No_Product" Index="17" />
- <Param name="@Special" type="SaleBill.Special_SaleBill" Index="18" />
- <Param name="@StartType_Customer" type="Customer.Type_Customer" Index="19" />
- <Param name="@EndType_Customer" type="Customer.Type_Customer" Index="20" />
- <Param name="@StartFileDate" type="Customer.CreateDate_Customer" Index="21" />
- <Param name="@EndFileDate" type="Customer.CreateDate_Customer" Index="22" />
- <Param name="@StartDiscount_SaleBill" type="SaleBillProduct.Discount_SaleBillProduct" Index="23" />
- <Param name="@EndDiscount_SaleBill" type="SaleBillProduct.Discount_SaleBillProduct" Index="24" />
- </Params>
- <Tables>
- <Table name="Get" />
- <Table name="FrmSalesListPrinciPalSingleProductOf"/>
- </Tables>
- </SearchFrmSalesList>
- </Search>
- </Server>
- <Lables>
- <Search>
- </Search>
- </Lables>
- </Form>
- </Forms>
|