123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407 |
- <?xml version="1.0" encoding="UTF-8"?>
- <Forms>
- <Form Name="FrmPurchaseInvoice">
- <Client>
- <Events>
- <Load>
- <![CDATA[
- @Title="进项发票";
- GetSchema();
- Search("SearchCessIn");
-
- Search("SearchPurchaseOrderBillProduct","p","p");
- Search("SearchPurchaseInDepotBillProduct","p","p");
- Search("SearchProduct","p");
-
- @CessIn=#SystemSetting.CessIn_SystemSetting/100;
- @PriceDecimal=#SystemSetting.PriceDecimal_SystemSetting;
- SetColumnDefaultValue("PurchaseInvoiceProduct", "TaxRate_PurchaseInvoiceProduct",@CessIn);
- ChangeMode("Search");
- Search("SearchBillType");
- ]]>
- </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="PurchaseInvoice.No_PurchaseInvoice">
- <Events>
- <Enter>
- if(tbNo.ReadOnly == false)
- {
- if(tbNo.CValue != StringEmpty())
- {
- UpdateForm(false, "");
- if(Search("SearchPurchaseInvoiceWithNo", tbNo.CValue))
- {
- ChangeMode("View",#PurchaseInvoice.ID_Assessor);
- if(#PurchaseInvoice.Disable_PurchaseInvoice==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="PurchaseInvoice.Date_PurchaseInvoice" />
- <IKCheckBox name="ckIncludeTax" DataSource="PurchaseInvoice.IncludeTax_PurchaseInvoice" >
- <Events>
- <CheckedChanged>
- if(RowCount("#PurchaseInvoiceProduct") > 0)
- {
- SuspendLayout();
- for(@j=0;@j < RowCount("#PurchaseInvoiceProduct");@j++)
- {
- SetPosition("#PurchaseInvoiceProduct",@j);
- <Lable name="CountAmount"/>
- }
- ResumeLayout();
- }
- <Lable name="CountSum"/>
- </CheckedChanged>
- </Events>
- </IKCheckBox>
- <IKComboBoxEx name="cbType" DisplaySource="PurchaseInvoice.TypeName">
- <Events>
- <SelectedIndexChanged>
- #PurchaseInvoice.Type_PurchaseInvoice=cbType.SelectedIndex;
- </SelectedIndexChanged>
- </Events>
- </IKComboBoxEx>
- <IKDataTimePicker name="dtInvoiceDate" DataSource="PurchaseInvoice.InvoiceDate_PurchaseInvoice" />
- <IKTextBox name="txtInvoiceNo" DataSource="PurchaseInvoice.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,#PurchaseInvoice.No_PurchaseInvoice))
- {
- MessageBox("此发票号码已存在,请重新填入发票编号!",@Title);
- txtInvoiceNo.Focus();
- return;
- }
- else
- {
- #PurchaseInvoice.LastModUser=GetCurrentUser();
- #PurchaseInvoice.LastModUser_PurchaseInvoice=GetLoginUserID();
- #PurchaseInvoice.LastModDate_PurchaseInvoice=GetCurrentTime();
- UpdateForm(false,"");
- #PurchaseInvoice.Type_PurchaseInvoice=cbType.SelectedIndex;
- Update();
- txtInvoiceNo.ReadOnly=true;
- btnModify.Text="修改";
- }
- }
- }
- </Click>
- </Events>
- </IKButton>
- <IKTextBox name="txtMaker" DataSource="PurchaseInvoice.Creator" />
- <IKTextButton name="tbSupplierNo" DataSource="PurchaseInvoice.No_Supplier" >
- <Events>
- <Enter>
- UpdateForm(false,"");
- if(tbSupplierNo.CValue!=StringEmpty())
- {
- if(!Search("SearchSupplier",tbSupplierNo.CValue))
- {
- MessageBox("该供应商不存在!",@Title);
- @temp = ShowSearchBox("SupplierSearch","INFOMATION",tbSupplierNo.CValue);
- if(@temp != "")
- {
- tbSupplierNo.CValue = @temp;
- ActiveControlEvent("tbSupplierNo", "Enter");
- }
- }
- else
- {
- if(!Equals(#Supplier.SuspendDate_Supplier,DBNull()))
- {
- MessageBox("该供应商已暂停!",@Title);
- }
- #PurchaseInvoice.ID_Supplier=#Supplier.ID_Supplier;
- #PurchaseInvoice.ShortName_Supplier=#Supplier.ShortName_Supplier;
- }
-
- }
- else
- {
- MessageBox("请输入供应商编号!",@Title);
- #PurchaseInvoice.ID_Supplier=GuidEmpty();
- #PurchaseInvoice.ShortName_Supplier="";
- tbSupplierNo.Focus();
- }
- UpdateForm(true,"");
- </Enter>
- <Click>
- <![CDATA[
- if (tbSupplierNo.ReadOnly == false)
- {
- @temp = ShowSearchBox("SupplierSearch","INFOMATION",tbSupplierNo.CValue);
- if( @temp == "" )
- return;
- tbSupplierNo.CValue = @temp;
- ActiveControlEvent("tbSupplierNo", "Enter");
- }
- ]]>
- </Click>
- </Events>
- </IKTextButton>
- <IKTextBox name="txtSupplierName" DataSource="PurchaseInvoice.ShortName_Supplier"/>
- <IKDataTimePicker name="dtPayDate" DataSource="PurchaseInvoice.PayDate_PurchaseInvoice" />
- <IKTextBox name="txtAssessor" DataSource="PurchaseInvoice.Assessor" />
- <IKDateTimeText name="dtAssessDate" DataSource="PurchaseInvoice.AssessDate_PurchaseInvoice" />
- <IKTextBox name="txtLastModUser" DataSource="PurchaseInvoice.LastModUser"/>
- <IKDateTimeText name="dtLastModDate" DataSource="PurchaseInvoice.LastModDate_PurchaseInvoice"/>
- <IKTextBox name="txtComment" DataSource="PurchaseInvoice.Comment_PurchaseInvoice"/>
- <IKNumericTextBox name="txtSum" DataSource="PurchaseInvoice.Amount_PurchaseInvoice"/>
- <IKNumericTextBox name="txtMoneySum" DataSource="PurchaseInvoice.GoodsAmount_PurchaseInvoice"/>
- <IKNumericTextBox name="txtTaxSum" DataSource="PurchaseInvoice.TaxAmount_PurchaseInvoice"/>
-
- <IKDataGridEx name="dgProduct" DataSource="PurchaseInvoiceProduct" TableStyleIndex="0">
- <DataColumn Index="0" DataSource="PurchaseInvoiceProduct.Name_BillType" >
- <IKDataGridComboBoxColumn DisplaySourceEx="PurchaseInvoiceProduct.Name_BillType" ValueSourceEx="PurchaseInvoiceProduct.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="PurchaseInvoiceProduct.No_FromBill" />
- <DataColumn Index="2" DataSource="PurchaseInvoiceProduct.No_FromBillProduct" />
- <DataColumn Index="3" DataSource="PurchaseInvoiceProduct.No_Product">
- <IKDataGridTextButtonColumn>
- <Events>
- <Click>
- ShowSearchBox("ProductSearch","INFOMATION",#PurchaseInvoiceProduct.No_Product);
- </Click>
- </Events>
- </IKDataGridTextButtonColumn>
- </DataColumn>
- <DataColumn Index="4" DataSource="PurchaseInvoiceProduct.Name_Product" />
- <DataColumn Index="5" DataSource="PurchaseInvoiceProduct.InvoiceName_Product" />
- <DataColumn Index="6" DataSource="PurchaseInvoiceProduct.Unit_Product" />
- <DataColumn Index="7" DataSource="PurchaseInvoiceProduct.Quantity_PurchaseInvoiceProduct" />
- <DataColumn Index="8" DataSource="PurchaseInvoiceProduct.UnitPrice_PurchaseInvoiceProduct" />
- <DataColumn Index="9" DataSource="PurchaseInvoiceProduct.Amount_PurchaseInvoiceProduct" />
- <DataColumn Index="10" DataSource="PurchaseInvoiceProduct.TaxRate_PurchaseInvoiceProduct" />
- <DataColumn Index="11" DataSource="PurchaseInvoiceProduct.TaxAmount_PurchaseInvoiceProduct" />
- <DataColumn Index="12" DataSource="PurchaseInvoiceProduct.Comment_PurchaseInvoiceProduct" />
- </IKDataGridEx>
- <IKFormToolBar name="toolBar">
- <Events>
- <ClickFirst>
- if(Search("SearchPurchaseInvoiceFirst"))
- {
- ChangeMode("View",#PurchaseInvoice.ID_Assessor);
- if(#PurchaseInvoice.Disable_PurchaseInvoice==true)
- ikGradualLabel1.Text=ikGradualLabel1.Text+"(已作废)";
- <Lable name="CountSum"/>
- }
- </ClickFirst>
- <ClickPrev>
- if(Search("SearchPurchaseInvoicePrevious", tbNo.CValue))
- {
- ChangeMode("View",#PurchaseInvoice.ID_Assessor);
- if(#PurchaseInvoice.Disable_PurchaseInvoice==true)
- ikGradualLabel1.Text=ikGradualLabel1.Text+"(已作废)";
- <Lable name="CountSum"/>
- }
- </ClickPrev>
- <ClickNext>
- if(Search("SearchPurchaseInvoiceNext",tbNo.CValue))
- {
- ChangeMode("View",#PurchaseInvoice.ID_Assessor);
- if(#PurchaseInvoice.Disable_PurchaseInvoice==true)
- ikGradualLabel1.Text=ikGradualLabel1.Text+"(已作废)";
- <Lable name="CountSum"/>
- }
- </ClickNext>
- <ClickLast>
- if(Search("SearchPurchaseInvoiceLast"))
- {
- ChangeMode("View",#PurchaseInvoice.ID_Assessor);
- if(#PurchaseInvoice.Disable_PurchaseInvoice==true)
- ikGradualLabel1.Text=ikGradualLabel1.Text+"(已作废)";
- <Lable name="CountSum"/>
- }
- </ClickLast>
- <ClickNew>
- <![CDATA[
- @NextNo = GetNextAutoNumber(true);
- if (!Equals(@NextNo, ""))
- {
- ChangeMode("New");
- #PurchaseInvoice.No_PurchaseInvoice= @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();
- #PurchaseInvoice.Disable_PurchaseInvoice=true;
- Blank();
- EndBlank();
- ChangeMode("View",#PurchaseInvoice.ID_Assessor);
- if(#PurchaseInvoice.Disable_PurchaseInvoice==true)
- ikGradualLabel1.Text=ikGradualLabel1.Text+"(已作废)";
- <Lable name="CountSum"/>
- </ClickBlank>
- <ClickPrint>
- ShowPrintBox("BillSearch",#PurchaseInvoice.No_PurchaseInvoice,#PurchaseInvoice.No_PurchaseInvoice);
- </ClickPrint>
- <ClickAudit>
- <![CDATA[
-
- SuspendLayout();
- for (@i=0;@i<RowCount("#PurchaseInvoiceProduct");@i=@i+1)
- {
- SetPosition("#PurchaseInvoiceProduct", @i);
- if(Equals(#PurchaseInvoiceProduct.Name_BillType,"采购入库单"))
- {
- if(Search("SearchPurchaseInDepotBill",#PurchaseInvoiceProduct.No_FromBill,#PurchaseInvoiceProduct.No_FromBillProduct))
- {
- if(Equals(#PurchaseInDepotBill.ID_Assessor,DBNull()))
- {
- tbDetail.SelectedIndex = 1;
- dgProduct.CurrentRowIndex=@i;
- MessageBox("该来源单据未经审核,提交失败!",@Title);
- ResumeLayout();
- return;
- }
- if(!Equals(#PurchaseInDepotBill.ID_Supplier,#PurchaseInvoice.ID_Supplier))
- {
- tbDetail.SelectedIndex = 1;
- dgProduct.CurrentRowIndex=@i;
- MessageBox("该来源单据的供应商与本进项发票的供应商不一致,提交失败!",@Title);
- ResumeLayout();
- return;
- }
- }
-
- }
- if(Equals(#PurchaseInvoiceProduct.Name_BillType,"采购订单"))
- {
- if(Search("SearchPurchaseOrderBill",#PurchaseInvoiceProduct.No_FromBill,#PurchaseInvoiceProduct.No_FromBillProduct))
- {
- if(Equals(#PurchaseOrderBill.ID_Assessor,DBNull()))
- {
- tbDetail.SelectedIndex = 1;
- dgProduct.CurrentRowIndex=@i;
- MessageBox("该来源单据未经审核,提交失败!",@Title);
- ResumeLayout();
- return;
- }
- if(!Equals(#PurchaseOrderBill.ID_Supplier,#PurchaseInvoice.ID_Supplier))
- {
- tbDetail.SelectedIndex = 1;
- dgProduct.CurrentRowIndex=@i;
- MessageBox("该来源单据的供应商与本进项发票的供应商不一致,提交失败!",@Title);
- ResumeLayout();
- return;
- }
- }
-
- }
- }
- ResumeLayout();
- ]]>
- BeginAudit();
- #PurchaseInvoice.ID_Assessor=GetLoginUserID();
- #PurchaseInvoice.Assessor=GetCurrentUser();
- #PurchaseInvoice.AssessDate_PurchaseInvoice=DateTimeNow();
- Audit();
- ChangeMode("View",#PurchaseInvoice.ID_Assessor);
- EndAudit();
- <Lable name="CountSum"/>
- </ClickAudit>
- <ClickUnAudit>
- BeginUnAudit();
- #PurchaseInvoice.ID_Assessor=DBNull();
- #PurchaseInvoice.Assessor=DBNull();
- #PurchaseInvoice.AssessDate_PurchaseInvoice=DataTimeNow();
- UnAudit();
- ChangeMode("View",#PurchaseInvoice.ID_Assessor);
- EndUnAudit();
- <Lable name="CountSum"/>
- </ClickUnAudit>
- <ClickImportItem>
- <![CDATA[
- if((@Status == 1 || @Status == 3) && toolBar.MenuItemText=="采购订单")
- {
- if(Search("SearchContr"))
- {
- ShowSearchBox("ImportPurchaseOrderBillControl","BILLCONVERTEX","#PurchaseInvoiceProduct.Type_FromBill",41,"#PurchaseInvoiceProduct.Name_BillType","采购订单");
- }
- else
- {
- ShowSearchBox("ImportPurchaseOrderBillUnControl","BILLCONVERTEX");
- }
- }
- else if((@Status == 1 || @Status == 3) && toolBar.MenuItemText=="采购入库单")
- {
- ShowSearchBox("ImportPurchaseInDepotBill","BILLCONVERTEX","#PurchaseInvoiceProduct.Type_FromBill",1,"#PurchaseInvoiceProduct.Name_BillType","采购入库单");
-
- }
- ]]>
- <!--使用前先访问ToolBar的MenuItemText属性以确定选中的是那一项-->
- </ClickImportItem>
- <ClickExport>
- ;
- </ClickExport>
- <ClickClose>
- ;
- </ClickClose>
- <ClickExpand>
- ;
- </ClickExpand>
- </Events>
- </IKFormToolBar>
- </Controls>
- <Tables>
- <Table name="PurchaseInvoiceProduct">
- <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(#PurchaseInvoiceProduct.No_Product,"") || !Search("SearchProduct",#PurchaseInvoiceProduct.No_Product))
- {
- if(!Equals(#PurchaseInvoiceProduct.No_Product,""))
- MessageBox("该产品不存在!",@Title);
- #PurchaseInvoiceProduct.ID_Product=GuidEmpty();
- #PurchaseInvoiceProduct.Name_Product="";
- #PurchaseInvoiceProduct.Unit_Product="";
- #PurchaseInvoiceProduct.UnitPrice_PurchaseInvoiceProduct=0.00;
- #PurchaseInvoiceProduct.InvoiceName_Product="";
- @temp = ShowSearchBox("InputSearchProduct","INFOMATION",#PurchaseInvoiceProduct.No_Product);
- if(@temp != "")
- {
- ResumeColumnEvent("#PurchaseInvoiceProduct.No_Product");
- #PurchaseInvoiceProduct.No_Product = @temp;
- ClearColumnEvent();
-
- }
- }
- else
- {
- #PurchaseInvoiceProduct.ID_Product=#Product.ID_Product;
- #PurchaseInvoiceProduct.Name_Product=#Product.Name_Product;
- #PurchaseInvoiceProduct.Unit_Product=#Product.Unit_Product;
- #PurchaseInvoiceProduct.UnitPrice_PurchaseInvoiceProduct=#Product.Price_Product;
- #PurchaseInvoiceProduct.InvoiceName_Product=#Product.InvoiceName_Product;
- }
- <Lable name="CountAmount"/>
- <Lable name="CountSum"/>
- </No_Product>
- <Quantity_PurchaseInvoiceProduct>
- <Lable name="CountAmount"/>
- <Lable name="CountSum"/>
- </Quantity_PurchaseInvoiceProduct>
- <UnitPrice_PurchaseInvoiceProduct>
- <Lable name="CountAmount"/>
- <Lable name="CountSum"/>
- </UnitPrice_PurchaseInvoiceProduct>
- <TaxRate_PurchaseInvoiceProduct>
- <Lable name="CountAmount"/>
- <Lable name="CountSum"/>
- </TaxRate_PurchaseInvoiceProduct>
- </ColumnsChanged>
- <RowDeleted>
- <Lable name="CountSum"/>
- </RowDeleted>
- </Events>
- </Table>
- </Tables>
- <LockInfomation LockID="ID_PurchaseInvoice" LockNO="No_PurchaseInvoice" LockSearchFunction="SearchPurchaseInvoiceWithNo" LockAudit="ID_Assessor" LockBlank="Disable_PurchaseInvoice"/>
- <LogInfomation LogNO="#PurchaseInvoice.No_PurchaseInvoice" RecordFormField="发票号码:#PurchaseInvoice.No_Invoice,供应商编号:#PurchaseInvoice.No_Supplier" RecordDataGridField="#PurchaseInvoiceProduct.No_Product,#PurchaseInvoiceProduct.Quantity_PurchaseInvoiceProduct,#PurchaseInvoiceProduct.Amount_PurchaseInvoiceProduct"/>
- <ChildForms>
- <ChildForm name="BillSearch" DataSource="PurchaseInvoice" SearchFunction="SearchAllBill" SearchFunctionByNo="SearchPurchaseInvoiceWithNo">
- <DataColumn Index="0" MappingName="#PurchaseInvoice.No_PurchaseInvoice" HeaderText="进项发票单号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="1" MappingName="#PurchaseInvoice.Date_PurchaseInvoice" HeaderText="制单日期" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="2" MappingName="#PurchaseInvoice.ShortName_Supplier" HeaderText="供应商简称" Width="75" ColumnType="IKDataGridTextBoxColumn"/>
- </ChildForm>
- <ChildForm name="SupplierSearch" DataSource="Supplier" SearchFunction="SearchAllSupplier" SearchFunctionByNo="" MappingName="供应商">
- <DataColumn Index="0" MappingName="#Supplier.No_Supplier" HeaderText="供应商编号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="1" MappingName="#Supplier.ShortName_Supplier" HeaderText="供应商简称" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- </ChildForm>
- <ChildForm name="ProductSearch" DataSource="Product" SearchFunction="SearchAllProduct" SearchFunctionByNo="" MappingName="产品" ReturnDataSource="PurchaseInvoiceProduct" ShowCheckBox="true">
- <DataColumn Index="0" MappingName="#Product.No_Product" HeaderText="产品编号" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnMappingName="#PurchaseInvoiceProduct.No_Product"/>
- <DataColumn Index="1" MappingName="#Product.Name_Product" HeaderText="产品简称" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- </ChildForm>
- <ChildForm name="InputSearchProduct" DataSource="Product" SearchFunction="SearchAllProduct" SearchFunctionByNo="" MappingName="产品">
- <DataColumn Index="0" MappingName="#Product.No_Product" HeaderText="产品编号" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- <DataColumn Index="1" MappingName="#Product.Name_Product" HeaderText="产品简称" Width="90" ColumnType="IKDataGridTextBoxColumn"/>
- </ChildForm>
- <ChildForm name="ImportPurchaseOrderBillControl" >
- <DataGridIndex DataSource="PurchaseOrderBill" SearchFunction="SearchAllPurchaseOrderBill" SearchFunctionStandby="SearchAllPurchaseOrderBillProduct" SearchFunctionByNo="" MappingName="" ReturnDataSource="PurchaseInvoiceProduct">
- <DataColumn Index="0" MappingName="#PurchaseOrderBill.No_PurchaseOrderBill" HeaderText="单据编号" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="child" ReturnMappingName="#PurchaseInvoiceProduct.No_FromBill"/>
- <DataColumn Index="1" MappingName="#PurchaseOrderBill.Date_PurchaseOrderBill" HeaderText="制单日期" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="child"/>
- <DataColumn Index="2" MappingName="#PurchaseOrderBill.No_Supplier" HeaderText="供应商编号" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="parent" ReturnMappingName="#PurchaseInvoice.No_Supplier"/>
- <DataColumn Index="3" MappingName="#PurchaseOrderBill.ShortName_Supplier" HeaderText="供应商简称" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="child"/>
- <DataColumn Index="4" MappingName="#PurchaseOrderBill.State_PurchaseOrderBill" HeaderText="单据状态" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="child"/>
- <DataColumn Index="5" MappingName="#PurchaseOrderBill.Name_Location" HeaderText="到货仓库" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="parent"/>
- </DataGridIndex>
- <ReturnFieldMapping>
- <DataColumn Index="0" MappingName="#PurchaseOrderBillProduct.No_PurchaseOrderBillProduct" ReturnPath="child" ReturnMappingName="#PurchaseInvoiceProduct.No_FromBillProduct"/>
- </ReturnFieldMapping>
- </ChildForm>
- <ChildForm name="ImportPurchaseOrderBillUnControl" >
- <DataGridIndex DataSource="PurchaseOrderBill" SearchFunction="SearchAllPurchaseOrderBill" SearchFunctionStandby="SearchAllPurchaseOrderBillProduct" SearchFunctionByNo="" MappingName="" ReturnDataSource="PurchaseInvoiceProduct">
- <DataColumn Index="0" MappingName="#PurchaseOrderBill.No_PurchaseOrderBill" HeaderText="单据编号" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="child" ReturnMappingName="#PurchaseInvoiceProduct.Comment_PurchaseInvoiceProduct"/>
- <DataColumn Index="1" MappingName="#PurchaseOrderBill.Date_PurchaseOrderBill" HeaderText="制单日期" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="child"/>
- <DataColumn Index="2" MappingName="#PurchaseOrderBill.No_Supplier" HeaderText="供应商编号" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="parent" ReturnMappingName="#PurchaseInvoice.No_Supplier"/>
- <DataColumn Index="3" MappingName="#PurchaseOrderBill.ShortName_Supplier" HeaderText="供应商简称" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="child"/>
- <DataColumn Index="4" MappingName="#PurchaseOrderBill.State_PurchaseOrderBill" HeaderText="单据状态" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="child"/>
- <DataColumn Index="5" MappingName="#PurchaseOrderBill.Name_Location" HeaderText="到货仓库" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="parent"/>
- </DataGridIndex>
- <ReturnFieldMapping>
- <DataColumn Index="0" MappingName="#PurchaseOrderBillProduct.No_Product" ReturnPath="child" ReturnMappingName="#PurchaseInvoiceProduct.No_Product"/>
- </ReturnFieldMapping>
- </ChildForm>
- <ChildForm name="ImportPurchaseInDepotBill" >
- <DataGridIndex DataSource="PurchaseInDepotBill" SearchFunction="SearchAllPurchaseInDepotBill" SearchFunctionStandby="SearchAllPurchaseInDepotBillProduct" SearchFunctionByNo="" MappingName="" ReturnDataSource="PurchaseInvoiceProduct">
- <DataColumn Index="0" MappingName="#PurchaseInDepotBill.No_PurchaseInDepotBill" HeaderText="单据编号" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="child" ReturnMappingName="#PurchaseInvoiceProduct.No_FromBill"/>
- <DataColumn Index="1" MappingName="#PurchaseInDepotBill.Date_PurchaseInDepotBill" HeaderText="制单日期" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="child"/>
- <DataColumn Index="2" MappingName="#PurchaseInDepotBill.No_Supplier" HeaderText="供应商编号" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="parent" ReturnMappingName="#PurchaseInvoice.No_Supplier"/>
- <DataColumn Index="3" MappingName="#PurchaseInDepotBill.ShortName_Supplier" HeaderText="供应商简称" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="child"/>
- <DataColumn Index="4" MappingName="#PurchaseInDepotBill.State_PurchaseInDepotBill" HeaderText="单据状态" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="child"/>
- <DataColumn Index="5" MappingName="#PurchaseInDepotBill.Name_Location" HeaderText="到货仓库" Width="90" ColumnType="IKDataGridTextBoxColumn" ReturnPath="parent"/>
- </DataGridIndex>
- <ReturnFieldMapping>
- <DataColumn Index="0" MappingName="#PurchaseInDepotBillProduct.No_PurchaseInDepotBillProduct" ReturnPath="child" ReturnMappingName="#PurchaseInvoiceProduct.No_FromBillProduct"/>
- </ReturnFieldMapping>
- </ChildForm>
- </ChildForms>
- <ImportedInfo>
- UpdateForm(true, "tbSupplierNo");
- ActiveControlEvent("tbSupplierNo", "Enter");
- </ImportedInfo>
- </Client>
- <Server>
- <Tables>
- <Table name="PurchaseInvoice" Type="Parent">
- <GetSchema CmdType="Text" CmdText="
- SELECT TOP 0 PurchaseInvoice.*,a.Name_User As Creator ,b.Name_User As Assessor,c.Name_User As LastModUser,Supplier.No_Supplier,Supplier.ShortName_Supplier,convert(nvarchar(64),'') As TypeName
- FROM PurchaseInvoice
- LEFT JOIN AppUser a ON PurchaseInvoice.ID_Creator=a.ID_User
- LEFT JOIN AppUser b ON PurchaseInvoice.ID_Assessor=b.ID_User
- LEFT JOIN AppUser c ON PurchaseInvoice.LastModUser_PurchaseInvoice=c.ID_User
- Left JOIN Supplier On Supplier.ID_Supplier=PurchaseInvoice.ID_Supplier
- ">
- </GetSchema>
- <New CmdType="Text" CmdText="
- INSERT INTO PurchaseInvoice(ID_PurchaseInvoice,No_PurchaseInvoice,Date_PurchaseInvoice,Type_PurchaseInvoice,PayDate_PurchaseInvoice,InvoiceDate_PurchaseInvoice,No_Invoice,ID_Supplier,
- ID_Creator,CreateDate_PurchaseInvoice,LastModUser_PurchaseInvoice,LastModDate_PurchaseInvoice,ID_Assessor,AssessDate_PurchaseInvoice,Comment_PurchaseInvoice,Amount_PurchaseInvoice,GoodsAmount_PurchaseInvoice,TaxAmount_PurchaseInvoice,IncludeTax_PurchaseInvoice) VALUES(@ID_PurchaseInvoice,@No_PurchaseInvoice,@Date_PurchaseInvoice,@Type_PurchaseInvoice,@PayDate_PurchaseInvoice,@InvoiceDate_PurchaseInvoice,@No_Invoice,@ID_Supplier,
- @ID_Creator,@CreateDate_PurchaseInvoice,@LastModUser_PurchaseInvoice,@LastModDate_PurchaseInvoice,@ID_Assessor,@AssessDate_PurchaseInvoice,@Comment_PurchaseInvoice,@Amount_PurchaseInvoice,@GoodsAmount_PurchaseInvoice,@TaxAmount_PurchaseInvoice,@IncludeTax_PurchaseInvoice)
- ">
- <Params>
- <Param name="@ID_PurchaseInvoice" type="PurchaseInvoice.ID_PurchaseInvoice" sourceColumn="ID_PurchaseInvoice" />
- <Param name="@No_PurchaseInvoice" type="PurchaseInvoice.No_PurchaseInvoice" sourceColumn="No_PurchaseInvoice" />
- <Param name="@Date_PurchaseInvoice" type="PurchaseInvoice.Date_PurchaseInvoice" sourceColumn="Date_PurchaseInvoice" />
- <Param name="@Type_PurchaseInvoice" type="PurchaseInvoice.Type_PurchaseInvoice" sourceColumn="Type_PurchaseInvoice" />
- <Param name="@PayDate_PurchaseInvoice" type="PurchaseInvoice.PayDate_PurchaseInvoice" sourceColumn="PayDate_PurchaseInvoice" />
- <Param name="@InvoiceDate_PurchaseInvoice" type="PurchaseInvoice.InvoiceDate_PurchaseInvoice" sourceColumn="InvoiceDate_PurchaseInvoice" />
- <Param name="@No_Invoice" type="PurchaseInvoice.No_Invoice" sourceColumn="No_Invoice" />
- <Param name="@ID_Supplier" type="PurchaseInvoice.ID_Supplier" sourceColumn="ID_Supplier" />
- <Param name="@ID_Creator" type="PurchaseInvoice.ID_Creator" sourceColumn="ID_Creator" />
- <Param name="@CreateDate_PurchaseInvoice" type="PurchaseInvoice.CreateDate_PurchaseInvoice" sourceColumn="CreateDate_PurchaseInvoice" />
- <Param name="@LastModUser_PurchaseInvoice" type="PurchaseInvoice.LastModUser_PurchaseInvoice" sourceColumn="LastModUser_PurchaseInvoice" />
- <Param name="@LastModDate_PurchaseInvoice" type="PurchaseInvoice.LastModDate_PurchaseInvoice" sourceColumn="LastModDate_PurchaseInvoice" />
- <Param name="@ID_Assessor" type="PurchaseInvoice.ID_Assessor" sourceColumn="ID_Assessor" />
- <Param name="@AssessDate_PurchaseInvoice" type="PurchaseInvoice.AssessDate_PurchaseInvoice" sourceColumn="AssessDate_PurchaseInvoice" />
- <Param name="@Comment_PurchaseInvoice" type="PurchaseInvoice.Comment_PurchaseInvoice" sourceColumn="Comment_PurchaseInvoice" />
- <Param name="@Amount_PurchaseInvoice" type="PurchaseInvoice.Amount_PurchaseInvoice" sourceColumn="Amount_PurchaseInvoice" />
- <Param name="@GoodsAmount_PurchaseInvoice" type="PurchaseInvoice.GoodsAmount_PurchaseInvoice" sourceColumn="GoodsAmount_PurchaseInvoice" />
- <Param name="@TaxAmount_PurchaseInvoice" type="PurchaseInvoice.TaxAmount_PurchaseInvoice" sourceColumn="TaxAmount_PurchaseInvoice" />
- <Param name="@IncludeTax_PurchaseInvoice" type="PurchaseInvoice.IncludeTax_PurchaseInvoice" sourceColumn="IncludeTax_PurchaseInvoice" />
- </Params>
- </New>
- <Update CmdType="Text" CmdText="
- UPDATE PurchaseInvoice
- SET No_PurchaseInvoice=@No_PurchaseInvoice,Date_PurchaseInvoice=@Date_PurchaseInvoice,Type_PurchaseInvoice=@Type_PurchaseInvoice,
- PayDate_PurchaseInvoice=@PayDate_PurchaseInvoice,InvoiceDate_PurchaseInvoice=@InvoiceDate_PurchaseInvoice,No_Invoice=@No_Invoice,
- ID_Supplier=@ID_Supplier,ID_Creator=@ID_Creator,CreateDate_PurchaseInvoice=@CreateDate_PurchaseInvoice,LastModUser_PurchaseInvoice=@LastModUser_PurchaseInvoice,
- LastModDate_PurchaseInvoice=@LastModDate_PurchaseInvoice,ID_Assessor=@ID_Assessor,AssessDate_PurchaseInvoice=@AssessDate_PurchaseInvoice,Comment_PurchaseInvoice=@Comment_PurchaseInvoice,Amount_PurchaseInvoice=@Amount_PurchaseInvoice,
- GoodsAmount_PurchaseInvoice=@GoodsAmount_PurchaseInvoice,TaxAmount_PurchaseInvoice=@TaxAmount_PurchaseInvoice,IncludeTax_PurchaseInvoice=@IncludeTax_PurchaseInvoice
- WHERE ID_PurchaseInvoice=@ID_PurchaseInvoice
- ">
-
-
- <Params>
- <Param name="@ID_PurchaseInvoice" type="PurchaseInvoice.ID_PurchaseInvoice" sourceColumn="ID_PurchaseInvoice" />
- <Param name="@No_PurchaseInvoice" type="PurchaseInvoice.No_PurchaseInvoice" sourceColumn="No_PurchaseInvoice" />
- <Param name="@Date_PurchaseInvoice" type="PurchaseInvoice.Date_PurchaseInvoice" sourceColumn="Date_PurchaseInvoice" />
- <Param name="@Type_PurchaseInvoice" type="PurchaseInvoice.Type_PurchaseInvoice" sourceColumn="Type_PurchaseInvoice" />
- <Param name="@PayDate_PurchaseInvoice" type="PurchaseInvoice.PayDate_PurchaseInvoice" sourceColumn="PayDate_PurchaseInvoice" />
- <Param name="@InvoiceDate_PurchaseInvoice" type="PurchaseInvoice.InvoiceDate_PurchaseInvoice" sourceColumn="InvoiceDate_PurchaseInvoice" />
- <Param name="@No_Invoice" type="PurchaseInvoice.No_Invoice" sourceColumn="No_Invoice" />
- <Param name="@ID_Supplier" type="PurchaseInvoice.ID_Supplier" sourceColumn="ID_Supplier" />
- <Param name="@ID_Creator" type="PurchaseInvoice.ID_Creator" sourceColumn="ID_Creator" />
- <Param name="@CreateDate_PurchaseInvoice" type="PurchaseInvoice.CreateDate_PurchaseInvoice" sourceColumn="CreateDate_PurchaseInvoice" />
- <Param name="@LastModUser_PurchaseInvoice" type="PurchaseInvoice.LastModUser_PurchaseInvoice" sourceColumn="LastModUser_PurchaseInvoice" />
- <Param name="@LastModDate_PurchaseInvoice" type="PurchaseInvoice.LastModDate_PurchaseInvoice" sourceColumn="LastModDate_PurchaseInvoice" />
- <Param name="@ID_Assessor" type="PurchaseInvoice.ID_Assessor" sourceColumn="ID_Assessor" />
- <Param name="@AssessDate_PurchaseInvoice" type="PurchaseInvoice.AssessDate_PurchaseInvoice" sourceColumn="AssessDate_PurchaseInvoice" />
- <Param name="@Comment_PurchaseInvoice" type="PurchaseInvoice.Comment_PurchaseInvoice" sourceColumn="Comment_PurchaseInvoice" />
- <Param name="@Amount_PurchaseInvoice" type="PurchaseInvoice.Amount_PurchaseInvoice" sourceColumn="Amount_PurchaseInvoice" />
- <Param name="@GoodsAmount_PurchaseInvoice" type="PurchaseInvoice.GoodsAmount_PurchaseInvoice" sourceColumn="GoodsAmount_PurchaseInvoice" />
- <Param name="@TaxAmount_PurchaseInvoice" type="PurchaseInvoice.TaxAmount_PurchaseInvoice" sourceColumn="TaxAmount_PurchaseInvoice" />
- <Param name="@IncludeTax_PurchaseInvoice" type="PurchaseInvoice.IncludeTax_PurchaseInvoice" sourceColumn="IncludeTax_PurchaseInvoice" />
- </Params>
- </Update>
- <Delete CmdType="Text" CmdText="
- DELETE FROM PurchaseInvoiceProduct WHERE ID_PurchaseInvoice=@ID_PurchaseInvoice
- DELETE FROM PurchaseInvoice WHERE ID_PurchaseInvoice=@ID_PurchaseInvoice
- ">
- <Params>
- <Param name="@ID_PurchaseInvoice" type="PurchaseInvoice.ID_PurchaseInvoice" sourceColumn="ID_PurchaseInvoice" />
- </Params>
- </Delete>
- <Audit CmdType="Text" CmdText="
- UPDATE Supplier
- SET ToPayBalance_Supplier = ToPayBalance_Supplier+@Amount_PurchaseInvoice
- WHERE ID_Supplier=@ID_Supplier
-
- UPDATE PurchaseInvoice SET ID_Assessor=@ID_Assessor,AssessDate_PurchaseInvoice=@AssessDate_PurchaseInvoice WHERE ID_PurchaseInvoice=@ID_PurchaseInvoice
-
- ">
- <Params>
- <Param name="@ID_PurchaseInvoice" type="PurchaseInvoice.ID_PurchaseInvoice" sourceColumn="ID_PurchaseInvoice"/>
- <Param name="@ID_Assessor" type="PurchaseInvoice.ID_Assessor" sourceColumn="ID_Assessor"/>
- <Param name="@AssessDate_PurchaseInvoice" type="PurchaseInvoice.AssessDate_PurchaseInvoice" sourceColumn="AssessDate_PurchaseInvoice"/>
- <Param name="@ID_Supplier" type="PurchaseInvoice.ID_Supplier" sourceColumn="ID_Supplier"/>
- <Param name="@Amount_PurchaseInvoice" type="PurchaseInvoice.Amount_PurchaseInvoice" sourceColumn="Amount_PurchaseInvoice" />
-
- </Params>
- </Audit>
- <Blank CmdType="Text" CmdText="
- IF (@StrikedAmount_PurchaseInvoice!=0)
- BEGIN
- Raiserror('该单据已被冲帐,作废失败!',16,1)
- return
- END
- UPDATE Supplier
- SET ToPayBalance_Supplier = ToPayBalance_Supplier-@Amount_PurchaseInvoice
- WHERE ID_Supplier=@ID_Supplier
-
- UPDATE PurchaseInvoice
- SET Disable_PurchaseInvoice=@Disable_PurchaseInvoice
- Where ID_PurchaseInvoice=@ID_PurchaseInvoice
- ">
- <Params>
- <Param name="@ID_PurchaseInvoice" type="PurchaseInvoice.ID_PurchaseInvoice" sourceColumn="ID_PurchaseInvoice" />
- <Param name="@No_PurchaseInvoice" type="PurchaseInvoice.No_PurchaseInvoice" sourceColumn="No_PurchaseInvoice" />
- <Param name="@ID_Supplier" type="PurchaseInvoice.ID_Supplier" sourceColumn="ID_Supplier"/>
- <Param name="@Disable_PurchaseInvoice" type="PurchaseInvoice.Disable_PurchaseInvoice" sourceColumn="Disable_PurchaseInvoice"/>
- <Param name="@Amount_PurchaseInvoice" type="PurchaseInvoice.Amount_PurchaseInvoice" sourceColumn="Amount_PurchaseInvoice" />
- <Param name="@StrikedAmount_PurchaseInvoice" type="PurchaseInvoice.StrikedAmount_PurchaseInvoice" sourceColumn="StrikedAmount_PurchaseInvoice" />
- </Params>
- </Blank>
- </Table>
- <Table name="PurchaseInvoiceProduct" Type="Child">
- <GetSchema CmdType="Text" CmdText="
- SELECT TOP 0 PurchaseInvoiceProduct.*,
- convert(nvarchar(64),'') As Name_BillType,
- Product.No_Product,Product.Name_Product,Product.InvoiceName_Product,Product.Unit_Product
- FROM PurchaseInvoiceProduct
- LEFT JOIN Product On Product.ID_Product=PurchaseInvoiceProduct.ID_Product
- ">
- </GetSchema>
- <New CmdType="Text" CmdText="
- INSERT INTO PurchaseInvoiceProduct(ID_PurchaseInvoiceProduct,ID_PurchaseInvoice,Type_FromBill,No_FromBill,No_FromBillProduct,ID_Product,Quantity_PurchaseInvoiceProduct,UnitPrice_PurchaseInvoiceProduct,TaxRate_PurchaseInvoiceProduct,Comment_PurchaseInvoiceProduct,Amount_PurchaseInvoiceProduct,TaxAmount_PurchaseInvoiceProduct)
- Values(@ID_PurchaseInvoiceProduct,@ID_PurchaseInvoice,@Type_FromBill,@No_FromBill,@No_FromBillProduct,@ID_Product,@Quantity_PurchaseInvoiceProduct,@UnitPrice_PurchaseInvoiceProduct,@TaxRate_PurchaseInvoiceProduct,@Comment_PurchaseInvoiceProduct,@Amount_PurchaseInvoiceProduct,@TaxAmount_PurchaseInvoiceProduct)
- ">
- <Params>
- <Param name="@ID_PurchaseInvoiceProduct" type="PurchaseInvoiceProduct.ID_PurchaseInvoiceProduct" sourceColumn="ID_PurchaseInvoiceProduct" />
- <Param name="@ID_PurchaseInvoice" type="PurchaseInvoiceProduct.ID_PurchaseInvoice" sourceColumn="ID_PurchaseInvoice" />
- <Param name="@Type_FromBill" type="PurchaseInvoiceProduct.Type_FromBill" sourceColumn="Type_FromBill" />
- <Param name="@No_FromBill" type="PurchaseInvoiceProduct.No_FromBill" sourceColumn="No_FromBill" />
- <Param name="@No_FromBillProduct" type="PurchaseInvoiceProduct.No_FromBillProduct" sourceColumn="No_FromBillProduct" />
- <Param name="@ID_Product" type="PurchaseInvoiceProduct.ID_Product" sourceColumn="ID_Product" />
- <Param name="@Quantity_PurchaseInvoiceProduct" type="PurchaseInvoiceProduct.Quantity_PurchaseInvoiceProduct" sourceColumn="Quantity_PurchaseInvoiceProduct" />
- <Param name="@UnitPrice_PurchaseInvoiceProduct" type="PurchaseInvoiceProduct.UnitPrice_PurchaseInvoiceProduct" sourceColumn="UnitPrice_PurchaseInvoiceProduct" />
- <Param name="@TaxRate_PurchaseInvoiceProduct" type="PurchaseInvoiceProduct.TaxRate_PurchaseInvoiceProduct" sourceColumn="TaxRate_PurchaseInvoiceProduct" />
- <Param name="@Comment_PurchaseInvoiceProduct" type="PurchaseInvoiceProduct.Comment_PurchaseInvoiceProduct" sourceColumn="Comment_PurchaseInvoiceProduct" />
- <Param name="@Amount_PurchaseInvoiceProduct" type="PurchaseInvoiceProduct.Amount_PurchaseInvoiceProduct" sourceColumn="Amount_PurchaseInvoiceProduct" />
- <Param name="@TaxAmount_PurchaseInvoiceProduct" type="PurchaseInvoiceProduct.TaxAmount_PurchaseInvoiceProduct" sourceColumn="TaxAmount_PurchaseInvoiceProduct" />
- </Params>
-
- </New>
- <Update CmdType="Text" CmdText="
- UPDATE PurchaseInvoiceProduct
- SET ID_PurchaseInvoice=@ID_PurchaseInvoice,Type_FromBill=@Type_FromBill,No_FromBill=@No_FromBill,No_FromBillProduct=@No_FromBillProduct,ID_Product=@ID_Product,
- Quantity_PurchaseInvoiceProduct=@Quantity_PurchaseInvoiceProduct,UnitPrice_PurchaseInvoiceProduct=@UnitPrice_PurchaseInvoiceProduct,TaxRate_PurchaseInvoiceProduct=@TaxRate_PurchaseInvoiceProduct,Comment_PurchaseInvoiceProduct=@Comment_PurchaseInvoiceProduct,
- Amount_PurchaseInvoiceProduct=@Amount_PurchaseInvoiceProduct,TaxAmount_PurchaseInvoiceProduct=@TaxAmount_PurchaseInvoiceProduct
- WHERE ID_PurchaseInvoiceProduct=@ID_PurchaseInvoiceProduct
- ">
- <Params>
- <Param name="@ID_PurchaseInvoiceProduct" type="PurchaseInvoiceProduct.ID_PurchaseInvoiceProduct" sourceColumn="ID_PurchaseInvoiceProduct" />
- <Param name="@ID_PurchaseInvoice" type="PurchaseInvoiceProduct.ID_PurchaseInvoice" sourceColumn="ID_PurchaseInvoice" />
- <Param name="@Type_FromBill" type="PurchaseInvoiceProduct.Type_FromBill" sourceColumn="Type_FromBill" />
- <Param name="@No_FromBill" type="PurchaseInvoiceProduct.No_FromBill" sourceColumn="No_FromBill" />
- <Param name="@No_FromBillProduct" type="PurchaseInvoiceProduct.No_FromBillProduct" sourceColumn="No_FromBillProduct" />
- <Param name="@ID_Product" type="PurchaseInvoiceProduct.ID_Product" sourceColumn="ID_Product" />
- <Param name="@Quantity_PurchaseInvoiceProduct" type="PurchaseInvoiceProduct.Quantity_PurchaseInvoiceProduct" sourceColumn="Quantity_PurchaseInvoiceProduct" />
- <Param name="@UnitPrice_PurchaseInvoiceProduct" type="PurchaseInvoiceProduct.UnitPrice_PurchaseInvoiceProduct" sourceColumn="UnitPrice_PurchaseInvoiceProduct" />
- <Param name="@TaxRate_PurchaseInvoiceProduct" type="PurchaseInvoiceProduct.TaxRate_PurchaseInvoiceProduct" sourceColumn="TaxRate_PurchaseInvoiceProduct" />
- <Param name="@Comment_PurchaseInvoiceProduct" type="PurchaseInvoiceProduct.Comment_PurchaseInvoiceProduct" sourceColumn="Comment_PurchaseInvoiceProduct" />
- <Param name="@Amount_PurchaseInvoiceProduct" type="PurchaseInvoiceProduct.Amount_PurchaseInvoiceProduct" sourceColumn="Amount_PurchaseInvoiceProduct" />
- <Param name="@TaxAmount_PurchaseInvoiceProduct" type="PurchaseInvoiceProduct.TaxAmount_PurchaseInvoiceProduct" sourceColumn="TaxAmount_PurchaseInvoiceProduct" />
- </Params>
- </Update>
- <Delete CmdType="Text" CmdText="
- DELETE FROM PurchaseInvoiceProduct WHERE ID_PurchaseInvoiceProduct=@ID_PurchaseInvoiceProduct
- ">
- <Params>
- <Param name="@ID_PurchaseInvoiceProduct" type="PurchaseInvoiceProduct.ID_PurchaseInvoiceProduct" sourceColumn="ID_PurchaseInvoiceProduct" />
- </Params>
- </Delete>
-
- </Table>
- </Tables>
- <Search>
- <SearchAllBill CmdType="Text" CmdText=" SELECT PurchaseInvoice.No_PurchaseInvoice,PurchaseInvoice.Date_PurchaseInvoice,Supplier.ShortName_Supplier
- FROM PurchaseInvoice
- Left JOIN Supplier On Supplier.ID_Supplier=PurchaseInvoice.ID_Supplier">
- <Tables>
- <Table name="AllBill" />
- </Tables>
- </SearchAllBill>
- <SearchAllSupplier CmdType="Text" CmdText="SELECT Supplier.No_Supplier,Supplier.ShortName_Supplier FROM Supplier ">
- <Tables>
- <Table name="AllSupplier" />
- </Tables>
- </SearchAllSupplier>
- <SearchSupplier CmdType="Text" CmdText="
- SELECT ID_Supplier,ShortName_Supplier,SuspendDate_Supplier
- From Supplier
- WHERE No_Supplier=@No_Supplier
- ">
- <Params>
- <Param name="@No_Supplier" type="Supplier.No_Supplier" Index="0" />
- </Params>
- <Tables>
- <Table name="Supplier"/>
- </Tables>
- </SearchSupplier>
- <SearchAllProduct CmdType="Text" CmdText="SELECT Product.No_Product,Product.Name_Product FROM Product ">
- <Tables>
- <Table name="AllProduct" />
- </Tables>
- </SearchAllProduct>
- <SearchPurchaseOrderBillProduct CmdType="Text" CmdText="
- SELECT PurchaseOrderBillProduct.ID_Product,PurchaseOrderBillProduct.Quantity_PurchaseOrderBillProduct,PurchaseOrderBillProduct.UnitPrice_PurchaseOrderBillProduct,PurchaseOrderBill.TaxCurrency_PurchaseOrderBill,Product.No_Product,Product.Name_Product,Product.InvoiceName_Product,Product.Unit_Product
- FROM PurchaseOrderBillProduct
- LEFT JOIN PurchaseOrderBill On PurchaseOrderBill.ID_PurchaseOrderBill=PurchaseOrderBillProduct.ID_PurchaseOrderBill
- LEFT JOIN Product On Product.ID_Product=PurchaseOrderBillProduct.ID_Product
- WHERE No_PurchaseOrderBill=@No_PurchaseOrderBill AND No_PurchaseOrderBillProduct=@No_PurchaseOrderBillProduct
- ">
- <Params>
- <Param name="@No_PurchaseOrderBill" type="PurchaseOrderBill.No_PurchaseOrderBill" Index="0" />
- <Param name="@No_PurchaseOrderBillProduct" type="PurchaseOrderBillProduct.No_PurchaseOrderBillProduct" Index="1" />
- </Params>
- <Tables>
- <Table name="PurchaseOrderBillProduct"/>
- </Tables>
- </SearchPurchaseOrderBillProduct>
-
- <SearchPurchaseOrderBill CmdType="Text" CmdText="
- SELECT ID_Assessor,ID_Supplier,ID_Product
- FROM PurchaseOrderBillProduct
- LEFT JOIN PurchaseOrderBill On PurchaseOrderBill.ID_PurchaseOrderBill=PurchaseOrderBillProduct.ID_PurchaseOrderBill
- WHERE No_PurchaseOrderBill=@No_PurchaseOrderBill AND No_PurchaseOrderBillProduct=@No_PurchaseOrderBillProduct
- ">
- <Params>
- <Param name="@No_PurchaseOrderBill" type="PurchaseOrderBill.No_PurchaseOrderBill" Index="0" />
- <Param name="@No_PurchaseOrderBillProduct" type="PurchaseOrderBillProduct.No_PurchaseOrderBillProduct" Index="1" />
- </Params>
- <Tables>
- <Table name="PurchaseOrderBill"/>
- </Tables>
- </SearchPurchaseOrderBill>
- <SearchPurchaseInDepotBillProduct CmdType="Text" CmdText="
- SELECT PurchaseInDepotBillProduct.ID_Product,PurchaseInDepotBillProduct.Quantity_PurchaseInDepotBillProduct,Product.Price_Product,Product.No_Product,Product.Name_Product,Product.InvoiceName_Product,Product.Unit_Product
- FROM PurchaseInDepotBillProduct
- LEFT JOIN PurchaseInDepotBill On PurchaseInDepotBillProduct.ID_PurchaseInDepotBill=PurchaseInDepotBill.ID_PurchaseInDepotBill
- LEFT JOIN Product On Product.ID_Product=PurchaseInDepotBillProduct.ID_Product
- WHERE No_PurchaseInDepotBill=@No_PurchaseInDepotBill AND No_PurchaseInDepotBillProduct=@No_PurchaseInDepotBillProduct
- ">
- <Params>
- <Param name="@No_PurchaseInDepotBill" type="PurchaseInDepotBill.No_PurchaseInDepotBill" Index="0" />
- <Param name="@No_PurchaseInDepotBillProduct" type="PurchaseInDepotBillProduct.No_PurchaseInDepotBillProduct" Index="1" />
- </Params>
- <Tables>
- <Table name="PurchaseInDepotBillProduct"/>
- </Tables>
- </SearchPurchaseInDepotBillProduct>
-
- <SearchPurchaseInDepotBill CmdType="Text" CmdText="
- SELECT ID_Assessor,ID_Supplier,ID_Product
- FROM PurchaseInDepotBillProduct
- LEFT JOIN PurchaseInDepotBill On PurchaseInDepotBillProduct.ID_PurchaseInDepotBill=PurchaseInDepotBill.ID_PurchaseInDepotBill
- WHERE No_PurchaseInDepotBill=@No_PurchaseInDepotBill AND No_PurchaseInDepotBillProduct=@No_PurchaseInDepotBillProduct
- ">
- <Params>
- <Param name="@No_PurchaseInDepotBill" type="PurchaseInDepotBill.No_PurchaseInDepotBill" Index="0" />
- <Param name="@No_PurchaseInDepotBillProduct" type="PurchaseInDepotBillProduct.No_PurchaseInDepotBillProduct" Index="1" />
- </Params>
- <Tables>
- <Table name="PurchaseInDepotBill"/>
- </Tables>
- </SearchPurchaseInDepotBill>
- <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>
- <SearchCessIn CmdType="Text" CmdText="SELECT CessIn_SystemSetting,PriceDecimal_SystemSetting From SystemSetting">
- <Tables>
- <Table name="SystemSetting"/>
- </Tables>
- </SearchCessIn>
- <SearchPurchaseInvoiceWithNo CmdType="Text" CmdText="
- SELECT PurchaseInvoice.*,a.Name_User As Creator ,b.Name_User As Assessor,c.Name_User As LastModUser,Supplier.No_Supplier,Supplier.ShortName_Supplier,TypeName=CASE Type_PurchaseInvoice When 0 Then '普通发票' ELSE '增值税发票' End
- FROM PurchaseInvoice
- LEFT JOIN AppUser a ON PurchaseInvoice.ID_Creator=a.ID_User
- LEFT JOIN AppUser b ON PurchaseInvoice.ID_Assessor=b.ID_User
- LEFT JOIN AppUser c ON PurchaseInvoice.LastModUser_PurchaseInvoice=c.ID_User
- Left JOIN Supplier On Supplier.ID_Supplier=PurchaseInvoice.ID_Supplier
- WHERE No_PurchaseInvoice=@No_PurchaseInvoice
-
- SELECT PurchaseInvoiceProduct.*,
- Product.No_Product,Product.Name_Product,Product.InvoiceName_Product,Product.Unit_Product,BillType.Name_BillType
- FROM PurchaseInvoiceProduct
- LEFT JOIN Product On Product.ID_Product=PurchaseInvoiceProduct.ID_Product
- LEFT JOIN PurchaseInvoice On PurchaseInvoice.ID_PurchaseInvoice=PurchaseInvoiceProduct.ID_PurchaseInvoice
- LEFT JOIN BillType On BillType.Value_BillType=PurchaseInvoiceProduct.Type_FromBill
- WHERE No_PurchaseInvoice=@No_PurchaseInvoice
- ">
- <Params>
- <Param name="@No_PurchaseInvoice" type="PurchaseInvoice.No_PurchaseInvoice" Index="0" />
- </Params>
- <Tables>
- <Table name="PurchaseInvoice"/>
- <Table name="PurchaseInvoiceProduct"/>
- </Tables>
- </SearchPurchaseInvoiceWithNo>
- <SearchBillType CmdType="Text" CmdText=" SELECT * FROM BillType WHERE Value_BillType = 41 OR Value_BillType = 0 OR Value_BillType = 1 ORDER BY Value_BillType">
- <Tables>
- <Table name="BillType" />
- </Tables>
- </SearchBillType>
- <SearchPurchaseInvoiceFirst CmdType="Text" CmdText="
- DECLARE @ID_PurchaseInvoice UNIQUEIDENTIFIER
- SELECT TOP 1 @ID_PurchaseInvoice=ID_PurchaseInvoice FROM PurchaseInvoice ORDER BY No_PurchaseInvoice
- SELECT PurchaseInvoice.*,a.Name_User As Creator ,b.Name_User As Assessor,c.Name_User As LastModUser,Supplier.No_Supplier,Supplier.ShortName_Supplier,TypeName=CASE Type_PurchaseInvoice When 0 Then '普通发票' ELSE '增值税发票' End
- FROM PurchaseInvoice
- LEFT JOIN AppUser a ON PurchaseInvoice.ID_Creator=a.ID_User
- LEFT JOIN AppUser b ON PurchaseInvoice.ID_Assessor=b.ID_User
- LEFT JOIN AppUser c ON PurchaseInvoice.LastModUser_PurchaseInvoice=c.ID_User
- Left JOIN Supplier On Supplier.ID_Supplier=PurchaseInvoice.ID_Supplier
- WHERE ID_PurchaseInvoice=@ID_PurchaseInvoice
- SELECT PurchaseInvoiceProduct.*,
- Product.No_Product,Product.Name_Product,Product.InvoiceName_Product,Product.Unit_Product,BillType.Name_BillType
- FROM PurchaseInvoiceProduct
- LEFT JOIN Product On Product.ID_Product=PurchaseInvoiceProduct.ID_Product
- LEFT JOIN BillType On BillType.Value_BillType=PurchaseInvoiceProduct.Type_FromBill
- WHERE ID_PurchaseInvoice=@ID_PurchaseInvoice
- ">
- <Tables>
- <Table name="PurchaseInvoice"/>
- <Table name="PurchaseInvoiceProduct"/>
- </Tables>
- </SearchPurchaseInvoiceFirst>
-
- <SearchPurchaseInvoiceLast CmdType="Text" CmdText="
- DECLARE @ID_PurchaseInvoice UNIQUEIDENTIFIER
- SELECT TOP 1 @ID_PurchaseInvoice=ID_PurchaseInvoice FROM PurchaseInvoice ORDER BY No_PurchaseInvoice DESC
- SELECT PurchaseInvoice.*,a.Name_User As Creator ,b.Name_User As Assessor,c.Name_User As LastModUser,Supplier.No_Supplier,Supplier.ShortName_Supplier,TypeName=CASE Type_PurchaseInvoice When 0 Then '普通发票' ELSE '增值税发票' End
- FROM PurchaseInvoice
- LEFT JOIN AppUser a ON PurchaseInvoice.ID_Creator=a.ID_User
- LEFT JOIN AppUser b ON PurchaseInvoice.ID_Assessor=b.ID_User
- LEFT JOIN AppUser c ON PurchaseInvoice.LastModUser_PurchaseInvoice=c.ID_User
- Left JOIN Supplier On Supplier.ID_Supplier=PurchaseInvoice.ID_Supplier
- WHERE ID_PurchaseInvoice=@ID_PurchaseInvoice
- SELECT PurchaseInvoiceProduct.*,
- Product.No_Product,Product.Name_Product,Product.InvoiceName_Product,Product.Unit_Product,BillType.Name_BillType
- FROM PurchaseInvoiceProduct
- LEFT JOIN Product On Product.ID_Product=PurchaseInvoiceProduct.ID_Product
- LEFT JOIN BillType On BillType.Value_BillType=PurchaseInvoiceProduct.Type_FromBill
- WHERE ID_PurchaseInvoice=@ID_PurchaseInvoice
- ">
- <Tables>
- <Table name="PurchaseInvoice"/>
- <Table name="PurchaseInvoiceProduct"/>
- </Tables>
- </SearchPurchaseInvoiceLast>
-
- <SearchPurchaseInvoicePrevious CmdType="Text" CmdText="
- DECLARE @ID_PurchaseInvoice UNIQUEIDENTIFIER
- SELECT TOP 1 @ID_PurchaseInvoice=ID_PurchaseInvoice FROM PurchaseInvoice
- WHERE No_PurchaseInvoice < @No_PurchaseInvoice
- ORDER BY No_PurchaseInvoice DESC
- SELECT PurchaseInvoice.*,a.Name_User As Creator ,b.Name_User As Assessor,c.Name_User As LastModUser,Supplier.No_Supplier,Supplier.ShortName_Supplier,TypeName=CASE Type_PurchaseInvoice When 0 Then '普通发票' ELSE '增值税发票' End FROM PurchaseInvoice
- LEFT JOIN AppUser a ON PurchaseInvoice.ID_Creator=a.ID_User
- LEFT JOIN AppUser b ON PurchaseInvoice.ID_Assessor=b.ID_User
- LEFT JOIN AppUser c ON PurchaseInvoice.LastModUser_PurchaseInvoice=c.ID_User
- Left JOIN Supplier On Supplier.ID_Supplier=PurchaseInvoice.ID_Supplier
- WHERE ID_PurchaseInvoice=@ID_PurchaseInvoice
- SELECT PurchaseInvoiceProduct.*,
- Product.No_Product,Product.Name_Product,Product.InvoiceName_Product,Product.Unit_Product,BillType.Name_BillType
- FROM PurchaseInvoiceProduct
- LEFT JOIN Product On Product.ID_Product=PurchaseInvoiceProduct.ID_Product
- LEFT JOIN BillType On BillType.Value_BillType=PurchaseInvoiceProduct.Type_FromBill
- WHERE ID_PurchaseInvoice=@ID_PurchaseInvoice
- ">
- <Params>
- <Param name="@No_PurchaseInvoice" type="PurchaseInvoice.No_PurchaseInvoice" Index="0" />
- </Params>
- <Tables>
- <Table name="PurchaseInvoice"/>
- <Table name="PurchaseInvoiceProduct"/>
- </Tables>
- </SearchPurchaseInvoicePrevious>
-
- <SearchPurchaseInvoiceNext CmdType="Text" CmdText="
- DECLARE @ID_PurchaseInvoice UNIQUEIDENTIFIER
- SELECT TOP 1 @ID_PurchaseInvoice=ID_PurchaseInvoice FROM PurchaseInvoice
- WHERE No_PurchaseInvoice > @No_PurchaseInvoice
- ORDER BY No_PurchaseInvoice
- SELECT PurchaseInvoice.*,a.Name_User As Creator ,b.Name_User As Assessor,c.Name_User As LastModUser,Supplier.No_Supplier,Supplier.ShortName_Supplier,TypeName=CASE Type_PurchaseInvoice When 0 Then '普通发票' ELSE '增值税发票' End
- FROM PurchaseInvoice
- LEFT JOIN AppUser a ON PurchaseInvoice.ID_Creator=a.ID_User
- LEFT JOIN AppUser b ON PurchaseInvoice.ID_Assessor=b.ID_User
- LEFT JOIN AppUser c ON PurchaseInvoice.LastModUser_PurchaseInvoice=c.ID_User
- Left JOIN Supplier On Supplier.ID_Supplier=PurchaseInvoice.ID_Supplier
- WHERE ID_PurchaseInvoice=@ID_PurchaseInvoice
- SELECT PurchaseInvoiceProduct.*,
- Product.No_Product,Product.Name_Product,Product.InvoiceName_Product,Product.Unit_Product,BillType.Name_BillType
- FROM PurchaseInvoiceProduct
- LEFT JOIN Product On Product.ID_Product=PurchaseInvoiceProduct.ID_Product
- LEFT JOIN BillType On BillType.Value_BillType=PurchaseInvoiceProduct.Type_FromBill
- WHERE ID_PurchaseInvoice=@ID_PurchaseInvoice
- ">
- <Params>
- <Param name="@No_PurchaseInvoice" type="PurchaseInvoice.No_PurchaseInvoice" Index="0" />
- </Params>
- <Tables>
- <Table name="PurchaseInvoice"/>
- <Table name="PurchaseInvoiceProduct"/>
- </Tables>
- </SearchPurchaseInvoiceNext>
- <SearchContr CmdType="Text" CmdText=" SELECT SystemSetting.StockAndInDepot_SystemSetting FROM SystemSetting WHERE SystemSetting.StockAndInDepot_SystemSetting = 1">
- <Tables>
- <Table name="SystemOutIn" />
- </Tables>
- </SearchContr>
- <SearchAllPurchaseOrderBill CmdType="Text" CmdText="Select PurchaseOrderBill.ID_PurchaseOrderBill,PurchaseOrderBill.No_PurchaseOrderBill,PurchaseOrderBill.Date_PurchaseOrderBill,Supplier.No_Supplier,Supplier.ShortName_Supplier,Case When PurchaseOrderBill.ID_Assessor is null Then '未审核' Else '已审核' End As State_PurchaseOrderBill,Location.Name_Location From PurchaseOrderBill
- Inner Join Supplier On PurchaseOrderBill.ID_Supplier = Supplier.ID_Supplier
- Inner Join Location On Location.ID_Location = PurchaseOrderBill.ID_Location" >
- <Tables>
- <Table name="AllSaleOutDepotBill" />
- </Tables>
- </SearchAllPurchaseOrderBill>
- <SearchAllPurchaseOrderBillProduct CmdType="Text" CmdText="Select PurchaseOrderBill.No_PurchaseOrderBill, Product.No_Product,PurchaseOrderBillProduct.No_PurchaseOrderBillProduct,Product.Name_Product,PurchaseOrderBillProduct.Quantity_PurchaseOrderBillProduct,PurchaseOrderBillProduct.UnitPrice_PurchaseOrderBillProduct From PurchaseOrderBillProduct
- Inner Join Product On Product.ID_Product = PurchaseOrderBillProduct.ID_Product
- Inner Join PurchaseOrderBill On PurchaseOrderBill.ID_PurchaseOrderBill = PurchaseOrderBillProduct.ID_PurchaseOrderBill" >
- <Tables>
- <Table name="AllSaleOutDepotBillProduct" />
- </Tables>
- </SearchAllPurchaseOrderBillProduct>
-
- <SearchAllPurchaseInDepotBill CmdType="Text" CmdText="Select PurchaseInDepotBill.ID_PurchaseInDepotBill,PurchaseInDepotBill.No_PurchaseInDepotBill,PurchaseInDepotBill.Date_PurchaseInDepotBill,Supplier.No_Supplier,Supplier.ShortName_Supplier,Case When PurchaseInDepotBill.ID_Assessor is null Then '未审核' Else '已审核' End As State_PurchaseInDepotBill,Location.Name_Location From PurchaseInDepotBill
- Inner Join Supplier On PurchaseInDepotBill.ID_Supplier = Supplier.ID_Supplier
- Inner Join Location On Location.ID_Location = PurchaseInDepotBill.ID_Location" >
- <Tables>
- <Table name="AllSaleOutDepotBill" />
- </Tables>
- </SearchAllPurchaseInDepotBill>
- <SearchAllPurchaseInDepotBillProduct CmdType="Text" CmdText="Select PurchaseInDepotBill.No_PurchaseInDepotBill,Product.No_Product,PurchaseInDepotBillProduct.No_PurchaseInDepotBillProduct,Product.Name_Product,PurchaseInDepotBillProduct.Quantity_PurchaseInDepotBillProduct,PurchaseInDepotBillProduct.Cost_PurchaseInDepotBillProduct From PurchaseInDepotBillProduct
- Inner Join Product On Product.ID_Product = PurchaseInDepotBillProduct.ID_Product
- Inner Join PurchaseInDepotBill On PurchaseInDepotBill.ID_PurchaseInDepotBill = PurchaseInDepotBillProduct.ID_PurchaseInDepotBill" >
- <Tables>
- <Table name="AllSaleOutDepotBillProduct" />
- </Tables>
- </SearchAllPurchaseInDepotBillProduct>
- <SearchInvoiceNo CmdType="Text" CmdText="
- Select * From PurchaseInvoice Where No_Invoice=@No_Invoice And No_PurchaseInvoice!=@No_PurchaseInvoice
- ">
- <Params>
- <Param name="@No_Invoice" type="PurchaseInvoice.No_Invoice" Index="0" />
- <Param name="@No_PurchaseInvoice" type="PurchaseInvoice.No_PurchaseInvoice" Index="1" />
- </Params>
- <Tables>
- <Table name="PurchaseInvoiceNo"/>
- </Tables>
- </SearchInvoiceNo>
- </Search>
- </Server>
- <Lables>
- <Search>
- Empty();
- NewInstance();
- tbNo.ReadOnly=false;
- dtDate.Enabled=false;
- cbType.Enabled=false;
- dtInvoiceDate.Enabled=false;
- txtInvoiceNo.ReadOnly=true;
- tbSupplierNo.ReadOnly=true;
- dtPayDate.Enabled=false;
- txtComment.ReadOnly=true;
- dgProduct.ReadOnly=true;
- txtMoneySum.CValue=0.00;
- txtTaxSum.CValue=0.00;
- txtSum.CValue=0.00;
- ckIncludeTax.Enabled=false;
- btnModify.Enabled=false;
- tbNo.Focus();
- #PurchaseInvoice.Creator=DBNull();
- #PurchaseInvoice.ID_Creator=DBNull();
- #PurchaseInvoice.Assessor=DBNull();
- #PurchaseInvoice.ID_Assessor=DBNull();
- #PurchaseInvoice.AssessDate_PurchaseInvoice=DBNull();
- #PurchaseInvoice.LastModUser_PurchaseInvoice=DBNull();
- #PurchaseInvoice.LastModUser=DBNull();
- #PurchaseInvoice.LastModDate_PurchaseInvoice=DBNull();
- toolBar.EnableSubmit=false;
- toolBar.EnableModify=false;
- toolBar.EnableDelete=false;
- toolBar.EnableAudit=false;
- toolBar.EnableNew=GetRight(@Title,"新增");
- toolBar.EnableImport = false;
- toolBar.EnablePrint=false;
- toolBar.EnableBlank=false;
- UpdateForm(true,"");
- tbNo.Focus();
- cbType.Text="";
- @Status=0;
- </Search>
- <New>
- Empty();
- NewInstance();
- tbNo.ReadOnly=true;
- dtDate.Enabled=true;
- cbType.Enabled=true;
- ckIncludeTax.Enabled=true;
- dtInvoiceDate.Enabled=true;
- txtInvoiceNo.ReadOnly=false;
- tbSupplierNo.ReadOnly=false;
- dtPayDate.Enabled=true;
- txtComment.ReadOnly=false;
- dgProduct.ReadOnly=false;
- btnModify.Enabled=false;
- txtMoneySum.CValue=0.00;
- txtTaxSum.CValue=0.00;
- txtSum.CValue=0.00;
- dtDate.Focus();
- #PurchaseInvoice.TypeName="增值税发票";
- #PurchaseInvoice.ID_PurchaseInvoice=NewGuid();
- #PurchaseInvoice.Creator=GetCurrentUser();
- #PurchaseInvoice.ID_Creator=GetLoginUserID();
- #PurchaseInvoice.Assessor=DBNull();
- #PurchaseInvoice.ID_Assessor=DBNull();
- #PurchaseInvoice.AssessDate_PurchaseInvoice=DBNull();
- #PurchaseInvoice.LastModUser_PurchaseInvoice=DBNull();
- #PurchaseInvoice.LastModUser=DBNull();
- #PurchaseInvoice.LastModDate_PurchaseInvoice=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;
- UpdateForm(true,"");
- <!--cbType.Text="增值税发票";-->
- <!--cbType.SelectedIndex=1;-->
- @Status=1;
- </New>
- <View>
- tbNo.ReadOnly=true;
- dtDate.Enabled=false;
- cbType.Enabled=false;
- ckIncludeTax.Enabled=false;
- dtInvoiceDate.Enabled=false;
- txtInvoiceNo.ReadOnly=true;
- tbSupplierNo.ReadOnly=true;
- txtComment.ReadOnly=true;
- dtPayDate.Enabled=false;
- dgProduct.ReadOnly=true;
- if(!Equals(#PurchaseInvoice.ID_Assessor,DBNull())&&#PurchaseInvoice.Disable_PurchaseInvoice==false)
- btnModify.Enabled=true;
- else
- btnModify.Enabled=false;
- toolBar.EnableSubmit=false;
- toolBar.EnableNew=GetRight(@Title,"新增");
- if(Equals(#PurchaseInvoice.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(#PurchaseInvoice.Disable_PurchaseInvoice==false)
- toolBar.EnableBlank=GetRight(@Title,"审核");
- else
- toolBar.EnableBlank=false;
- }
- toolBar.EnablePrint=GetRight(@Title,"打印");
- toolBar.EnableImport = false;
- UpdateForm(true, "");
- @Status=2;
- </View>
- <Modify>
- tbNo.ReadOnly=true;
- dtDate.Enabled=false;
- cbType.Enabled=true;
- ckIncludeTax.Enabled=true;
- dtInvoiceDate.Enabled=true;
- txtInvoiceNo.ReadOnly=false;
- tbSupplierNo.ReadOnly=false;
- dtPayDate.Enabled=true;
- txtComment.ReadOnly=false;
- btnModify.Enabled=false;
- dgProduct.ReadOnly=false;
- #PurchaseInvoice.LastModUser=GetCurrentUser();
- #PurchaseInvoice.LastModUser_PurchaseInvoice=GetLoginUserID();
- #PurchaseInvoice.LastModDate_PurchaseInvoice=GetCurrentTime();
- 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;
- UpdateForm(true, "");
- @Status=3;
- </Modify>
- <SubmitButtonClick>
- <![CDATA[
- if(cbType.Text==StringEmpty())
- {
- MessageBox("请输入有效的发票种类!",@Title);
- tbDetail.SelectedIndex = 0;
- cbType.Focus();
- return;
- }
- if(!Search("SearchSupplier",tbSupplierNo.CValue)|| !Equals(#PurchaseInvoice.ID_Supplier,#Supplier.ID_Supplier))
- {
- MessageBox("请输入有效供应商,回车以示确认!",@Title);
- tbDetail.SelectedIndex = 0;
- tbSupplierNo.Focus();
- return;
- }
- if(RowCount("PurchaseInvoiceProduct")==0)
- {
- MessageBox("请输入进项发票产品!",@Title);
- tbDetail.SelectedIndex = 1;
- dgProduct.Focus();
- return;
- }
- UpdateForm(false, "");
- SuspendLayout();
- for(@i=0;@i<RowCount("#PurchaseInvoiceProduct");@i=@i+1)
- {
- SetPosition("#PurchaseInvoiceProduct",@i);
-
- if(Equals(#PurchaseInvoiceProduct.Name_BillType,"采购订单"))
- {
- if(Search("SearchPurchaseOrderBill",#PurchaseInvoiceProduct.No_FromBill,#PurchaseInvoiceProduct.No_FromBillProduct))
- {
- if(Equals(#PurchaseOrderBill.ID_Assessor,DBNull()))
- {
- tbDetail.SelectedIndex = 1;
- dgProduct.CurrentRowIndex=@i;
- MessageBox("该来源单据未经审核,提交失败!",@Title);
- ResumeLayout();
- return;
- }
- if(!Equals(#PurchaseOrderBill.ID_Supplier,#PurchaseInvoice.ID_Supplier))
- {
- tbDetail.SelectedIndex = 1;
- dgProduct.CurrentRowIndex=@i;
- MessageBox("该来源单据的供应商与本进项发票的供应商不一致,提交失败!",@Title);
- ResumeLayout();
- return;
- }
- if(!Equals(#PurchaseInvoiceProduct.ID_Product,#PurchaseOrderBill.ID_Product))
- {
- tbDetail.SelectedIndex = 1;
- dgProduct.CurrentRowIndex = @i;
- MessageBox("该来源单据产品单中指定的产品与后改写的产品不匹配!",@Title);
- dgProduct.Focus();
- ResumeLayout();
- return;
- }
- }
-
- }
- if(Equals(#PurchaseInvoiceProduct.Name_BillType,"采购入库单"))
- {
- if(Search("SearchPurchaseInDepotBill",#PurchaseInvoiceProduct.No_FromBill,#PurchaseInvoiceProduct.No_FromBillProduct))
- {
- if(Equals(#PurchaseInDepotBill.ID_Assessor,DBNull()))
- {
- tbDetail.SelectedIndex = 1;
- dgProduct.CurrentRowIndex=@i;
- MessageBox("该来源单据未经审核,提交失败!",@Title);
- ResumeLayout();
- return;
- }
- if(!Equals(#PurchaseInDepotBill.ID_Supplier,#PurchaseInvoice.ID_Supplier))
- {
- tbDetail.SelectedIndex = 1;
- dgProduct.CurrentRowIndex=@i;
- MessageBox("该来源单据的供应商与本进项发票的供应商不一致,提交失败!",@Title);
- ResumeLayout();
- return;
- }
- if(!Equals(#PurchaseInvoiceProduct.ID_Product,#PurchaseInDepotBill.ID_Product))
- {
- tbDetail.SelectedIndex = 1;
- dgProduct.CurrentRowIndex = @i;
- MessageBox("该来源单据产品单中指定的产品与后改写的产品不匹配!",@Title);
- dgProduct.Focus();
- ResumeLayout();
- return;
- }
- }
-
- }
- if(Equals(#PurchaseInvoiceProduct.No_Product,""))
- {
- tbDetail.SelectedIndex = 1;
- dgProduct.CurrentRowIndex=@i;
- MessageBox("请输入产品编号!",@Title);
- ResumeLayout();
- return;
- }
- if(Equals(#PurchaseInvoiceProduct.ID_Product,GuidEmpty()))
- {
- tbDetail.SelectedIndex = 1;
- dgProduct.CurrentRowIndex=@i;
- MessageBox("该产品不存在!",@Title);
- ResumeLayout();
- return;
- }
- if(#PurchaseInvoiceProduct.Quantity_PurchaseInvoiceProduct<=0)
- {
- tbDetail.SelectedIndex = 1;
- dgProduct.CurrentRowIndex=@i;
- MessageBox("数量不得小于等于0!",@Title);
- ResumeLayout();
- return;
- }
- if(#PurchaseInvoiceProduct.UnitPrice_PurchaseInvoiceProduct<0)
- {
- tbDetail.SelectedIndex = 1;
- dgProduct.CurrentRowIndex=@i;
- MessageBox("单价不得小于0!",@Title);
- ResumeLayout();
- return;
- }
- if(Equals(#PurchaseInvoiceProduct.ID_PurchaseInvoiceProduct,GuidEmpty()))
- {
- #PurchaseInvoiceProduct.ID_PurchaseInvoiceProduct=NewGuid();
- }
- #PurchaseInvoiceProduct.ID_PurchaseInvoice=#PurchaseInvoice.ID_PurchaseInvoice;
- }
- ResumeLayout();
- if(@Status==1)
- { #PurchaseInvoice.CreateDate_PurchaseInvoice=GetCurrentTime();
- #PurchaseInvoice.No_PurchaseInvoice = New("#PurchaseInvoice.No_PurchaseInvoice", dtDate.CValue);
- }
- else if(@Status==3)
- {
- #PurchaseInvoice.LastModUser=GetCurrentUser();
- #PurchaseInvoice.LastModUser_PurchaseInvoice=GetLoginUserID();
- #PurchaseInvoice.LastModDate_PurchaseInvoice=GetCurrentTime();
- Update();
- }
- ChangeMode("View",#PurchaseInvoice.ID_Assessor);
- ]]>
- </SubmitButtonClick>
- <CountSum>
- <![CDATA[
- if (RowCount("#PurchaseInvoiceProduct") == 0)
- {
- txtMoneySum.CValue=0;;
- txtTaxSum.CValue=0;
- txtSum.CValue=0;
- }
- else
- {
- if(!ckIncludeTax.Checked)
- {
- txtMoneySum.CValue=SumOfCol("#PurchaseInvoiceProduct.Amount_PurchaseInvoiceProduct");
- txtTaxSum.CValue=SumOfCol("#PurchaseInvoiceProduct.TaxAmount_PurchaseInvoiceProduct");
- txtSum.CValue=txtMoneySum.CValue+txtTaxSum.CValue;
- }
- else
- {
- txtSum.CValue=SumOfCol("#PurchaseInvoiceProduct.Amount_PurchaseInvoiceProduct");
- txtTaxSum.CValue=SumOfCol("#PurchaseInvoiceProduct.TaxAmount_PurchaseInvoiceProduct");
- txtMoneySum.CValue=txtSum.CValue-txtTaxSum.CValue;
- }
- }
- UpdateForm(false,"txtSum");
- UpdateForm(false,"txtTaxSum");
- UpdateForm(false,"txtMoneySum");
- ]]>
- </CountSum>
- <FromBillChange>
- if (!Equals(#PurchaseInvoiceProduct.Name_BillType,"")&&!Equals(#PurchaseInvoiceProduct.No_FromBill,"")&& !Equals(#PurchaseInvoiceProduct.No_FromBillProduct,""))
- {
- if(Equals(#PurchaseInvoiceProduct.Name_BillType,"采购订单")&&Search("SearchPurchaseOrderBillProduct",#PurchaseInvoiceProduct.No_FromBill,#PurchaseInvoiceProduct.No_FromBillProduct))
- {
- #PurchaseInvoiceProduct.ID_Product=#PurchaseOrderBillProduct.ID_Product;
- #PurchaseInvoiceProduct.No_Product=#PurchaseOrderBillProduct.No_Product;
- #PurchaseInvoiceProduct.Name_Product=#PurchaseOrderBillProduct.Name_Product;
- #PurchaseInvoiceProduct.Unit_Product=#PurchaseOrderBillProduct.Unit_Product;
- #PurchaseInvoiceProduct.Quantity_PurchaseInvoiceProduct=#PurchaseOrderBillProduct.Quantity_PurchaseOrderBillProduct;
- #PurchaseInvoiceProduct.UnitPrice_PurchaseInvoiceProduct=#PurchaseOrderBillProduct.UnitPrice_PurchaseOrderBillProduct;
- #PurchaseInvoiceProduct.InvoiceName_Product=#PurchaseOrderBillProduct.InvoiceName_Product;
- #PurchaseInvoiceProduct.Amount_PurchaseInvoiceProduct=FormatNumber(#PurchaseInvoiceProduct.Quantity_PurchaseInvoiceProduct*#PurchaseInvoiceProduct.UnitPrice_PurchaseInvoiceProduct,@PriceDecimal);
- if(ckIncludeTax.Checked)
- {
- #PurchaseInvoiceProduct.TaxAmount_PurchaseInvoiceProduct=FormatNumber(#PurchaseInvoiceProduct.Amount_PurchaseInvoiceProduct*#PurchaseInvoiceProduct.TaxRate_PurchaseInvoiceProduct/(1+#PurchaseInvoiceProduct.TaxRate_PurchaseInvoiceProduct),@PriceDecimal);
- }
- else
- {
- #PurchaseInvoiceProduct.TaxAmount_PurchaseInvoiceProduct=FormatNumber(#PurchaseInvoiceProduct.Amount_PurchaseInvoiceProduct*#PurchaseInvoiceProduct.TaxRate_PurchaseInvoiceProduct,@PriceDecimal);
- }
- }
- if(Equals(#PurchaseInvoiceProduct.Name_BillType,"采购入库单")&&Search("SearchPurchaseInDepotBillProduct",#PurchaseInvoiceProduct.No_FromBill,#PurchaseInvoiceProduct.No_FromBillProduct))
- {
- #PurchaseInvoiceProduct.ID_Product=#PurchaseInDepotBillProduct.ID_Product;
- #PurchaseInvoiceProduct.No_Product=#PurchaseInDepotBillProduct.No_Product;
- #PurchaseInvoiceProduct.Name_Product=#PurchaseInDepotBillProduct.Name_Product;
- #PurchaseInvoiceProduct.Unit_Product=#PurchaseInDepotBillProduct.Unit_Product;
- #PurchaseInvoiceProduct.Quantity_PurchaseInvoiceProduct=#PurchaseInDepotBillProduct.Quantity_PurchaseInDepotBillProduct;
- #PurchaseInvoiceProduct.InvoiceName_Product=#PurchaseInDepotBillProduct.InvoiceName_Product;
- #PurchaseInvoiceProduct.Amount_PurchaseInvoiceProduct=FormatNumber(#PurchaseInvoiceProduct.Quantity_PurchaseInvoiceProduct*#PurchaseInvoiceProduct.UnitPrice_PurchaseInvoiceProduct,@PriceDecimal);
- if(ckIncludeTax.Checked)
- {
- #PurchaseInvoiceProduct.TaxAmount_PurchaseInvoiceProduct=FormatNumber(#PurchaseInvoiceProduct.Amount_PurchaseInvoiceProduct*#PurchaseInvoiceProduct.TaxRate_PurchaseInvoiceProduct/(1+#PurchaseInvoiceProduct.TaxRate_PurchaseInvoiceProduct),@PriceDecimal);
- }
- else
- {
- #PurchaseInvoiceProduct.TaxAmount_PurchaseInvoiceProduct=FormatNumber(#PurchaseInvoiceProduct.Amount_PurchaseInvoiceProduct*#PurchaseInvoiceProduct.TaxRate_PurchaseInvoiceProduct,@PriceDecimal);
- }
- }
- }
- </FromBillChange>
- <CountAmount>
- #PurchaseInvoiceProduct.Amount_PurchaseInvoiceProduct=FormatNumber(#PurchaseInvoiceProduct.Quantity_PurchaseInvoiceProduct*#PurchaseInvoiceProduct.UnitPrice_PurchaseInvoiceProduct,@PriceDecimal);
- if(ckIncludeTax.Checked)
- {
- #PurchaseInvoiceProduct.TaxAmount_PurchaseInvoiceProduct=FormatNumber(#PurchaseInvoiceProduct.Amount_PurchaseInvoiceProduct*#PurchaseInvoiceProduct.TaxRate_PurchaseInvoiceProduct/(1+#PurchaseInvoiceProduct.TaxRate_PurchaseInvoiceProduct),@PriceDecimal);
- }
- else
- {
- #PurchaseInvoiceProduct.TaxAmount_PurchaseInvoiceProduct=FormatNumber(#PurchaseInvoiceProduct.Amount_PurchaseInvoiceProduct*#PurchaseInvoiceProduct.TaxRate_PurchaseInvoiceProduct,@PriceDecimal);
- }
- </CountAmount>
- </Lables>
- </Form>
- </Forms>
|