⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 curr.cpp

📁 销售分析,JUSCO,日月周查询,待完善.
💻 CPP
📖 第 1 页 / 共 2 页
字号:
 suiDBComboBox3->Items->Add(dm->artcode->FieldByName("article_code")->AsString);
 dm->artcode->Next();
}
dm->dept->Active=false;
   dm->sect->Active=false;
   dm->artcode->Active=false;
   suiButton2->Enabled=false;
   suiComboBox1->Text=store;        
}
//---------------------------------------------------------------------------

void __fastcall Tcurren::suiDBComboBox2DblClick(TObject *Sender)
{
AnsiString str ;
suiButton2->Enabled=true;
str="select store,TIME ,itmaster.dept_code,itmaster.section_code,itmaster.article_code,itmaster.vendor_code,currentemp.item_code,itmaster.item_desc ,itmaster.stock_onhand, points as quantity, customs,round((netamt/points),2) as price , netamt   FROM CURRENTEMP left join itmaster on CURRENTEMP.item_code=itmaster.item_code" ;

 str=str+" where  points<>0 and customs>0 ";

 if (!suiComboBox1->Text.IsEmpty()){
 str=str+" and store='"+ Trim(suiComboBox1->Text)+"'";
 }
  if (!suiDBComboBox2->Text.IsEmpty()){
 str=str+" and itmaster.section_code='"+ Trim(suiDBComboBox2->Text)+"'";
 }else
 return;

 try{
dm->dayseq->Active=false;
dm->dayseq->SQL->Clear();
dm->dayseq->SQL->Add(str);
dm->dayseq->Active=true;

}
catch(...){
}
if (!suiComboBox1->Text.IsEmpty()){
 str="select store,sum(points) as customs from currentemp where item_code like 'SEC"+Trim(suiDBComboBox2->Text)+"%' and store='"+Trim(suiComboBox1->Text)+"' group by store,item_code";
}else {
str="select sum(points) as customs from currentemp where item_code like 'SEC"+Trim(suiDBComboBox2->Text)+"%' group by item_code";
 }
try{
dm->tmp->Active=false;
dm->tmp->SQL->Clear();
dm->tmp->SQL->Add(str);
dm->tmp->Active=true;

}catch(...){
dm->tmp->Active=false;
}
if  (suiComboBox1->Text.IsEmpty()){
suiStatusBar1->SimpleText="店铺:各店铺  组别"+suiDBComboBox1->Text+" 即时客数为"+dm->tmp->FieldByName("customs")->AsInteger;;
}else
suiStatusBar1->SimpleText="店铺:"+Trim(suiComboBox1->Text)+" 组别"+suiDBComboBox2->Text+" 即时客数为"+dm->tmp->FieldByName("customs")->AsInteger;

if  (suiComboBox1->Text.IsEmpty()){
str="select sum(netamt) as netamts FROM CURRENTEMP left join itmaster on CURRENTEMP.item_code=itmaster.item_code  where  points<>0 and customs>0 and section_code='"+Trim(suiDBComboBox2->Text)+"' group by section_code";
 }else {
 str= "select sum(netamt) as netamts FROM CURRENTEMP left join itmaster on CURRENTEMP.item_code=itmaster.item_code  where  points<>0 and customs>0 and section_code='"+Trim(suiDBComboBox2->Text)+"' and store='"+Trim(suiComboBox1->Text)+"' group by store,section_code";
}
try{
dm->tmp->Active=false;
dm->tmp->SQL->Clear();
dm->tmp->SQL->Add(str);
dm->tmp->Active=true;

}catch(...){
dm->tmp->Active=false;
}



suiStatusBar1->SimpleText=suiStatusBar1->SimpleText+"  总金额为"+dm->tmp->FieldByName("netamts")->AsFloat;

}
//---------------------------------------------------------------------------

void __fastcall Tcurren::suiDBComboBox3DblClick(TObject *Sender)
{
  AnsiString str ;
suiButton2->Enabled=true;
str="select store,TIME ,itmaster.dept_code,itmaster.section_code,itmaster.article_code,itmaster.vendor_code,currentemp.item_code,itmaster.item_desc ,itmaster.stock_onhand, points as quantity, customs,round((netamt/points),2) as price , netamt   FROM CURRENTEMP left join itmaster on CURRENTEMP.item_code=itmaster.item_code" ;

 str=str+" where  points<>0 and customs>0 ";

 if (!suiComboBox1->Text.IsEmpty()){
 str=str+" and store='"+ Trim(suiComboBox1->Text)+"'";
 }
  if (!suiDBComboBox3->Text.IsEmpty()){
 str=str+" and itmaster.article_code='"+ Trim(suiDBComboBox3->Text)+"'";
 }else
 return;

 try{
dm->dayseq->Active=false;
dm->dayseq->SQL->Clear();
dm->dayseq->SQL->Add(str);
dm->dayseq->Active=true;

}
catch(...){
}
if (!suiComboBox1->Text.IsEmpty()){
 str="select store,sum(points) as customs from currentemp where item_code like 'art"+Trim(suiDBComboBox3->Text)+"%' and store='"+Trim(suiComboBox1->Text)+"' group by store,item_code";
}else {
str="select sum(points) as customs from currentemp where item_code like 'art"+Trim(suiDBComboBox3->Text)+"%' group by item_code";
 }
try{
dm->tmp->Active=false;
dm->tmp->SQL->Clear();
dm->tmp->SQL->Add(str);
dm->tmp->Active=true;

}catch(...){
dm->tmp->Active=false;
}
if  (suiComboBox1->Text.IsEmpty()){
suiStatusBar1->SimpleText="店铺:各店铺  小组别"+suiDBComboBox3->Text+" 即时客数为"+dm->tmp->FieldByName("customs")->AsInteger;;
}else
suiStatusBar1->SimpleText="店铺:"+Trim(suiComboBox1->Text)+" 小组别"+suiDBComboBox3->Text+" 即时客数为"+dm->tmp->FieldByName("customs")->AsInteger;

if  (suiComboBox1->Text.IsEmpty()){
str="select sum(netamt) as netamts FROM CURRENTEMP left join itmaster on CURRENTEMP.item_code=itmaster.item_code  where  points<>0 and customs>0 and article_code='"+Trim(suiDBComboBox3->Text)+"' group by article_code";
 }else {
 str= "select sum(netamt) as netamts FROM CURRENTEMP left join itmaster on CURRENTEMP.item_code=itmaster.item_code  where  points<>0 and customs>0 and article_code='"+Trim(suiDBComboBox3->Text)+"' and store='"+Trim(suiComboBox1->Text)+"' group by store,article_code";
}
try{
dm->tmp->Active=false;
dm->tmp->SQL->Clear();
dm->tmp->SQL->Add(str);
dm->tmp->Active=true;

}catch(...){
dm->tmp->Active=false;
}



suiStatusBar1->SimpleText=suiStatusBar1->SimpleText+"  总金额为"+dm->tmp->FieldByName("netamts")->AsFloat;

}
//---------------------------------------------------------------------------


void __fastcall Tcurren::suiButton2Click(TObject *Sender)
{
 if (dm->dayseq->RecordCount==0)
     return;

if (dm->dayseq->Active){
SaveDialog1->Filter = "EXCEL files (*.xls)|*.XLS";
  if(SaveDialog1->Execute()){
    dm->LOCAL->DatabaseName=SaveDialog1->InitialDir;
    dm->LOCAL->TableName=SaveDialog1->FileName;

   // SaveDialog1->FileName;
   try{
   dm->TOEXCEL->Source=dm->dayseq;
dm->TOEXCEL->Execute() ;
}catch(...){
}
}
 }       
}
//---------------------------------------------------------------------------

void __fastcall Tcurren::suiEdit1DblClick(TObject *Sender)
{
 AnsiString str ;
suiButton2->Enabled=true;
str="select store,TIME ,itmaster.dept_code,itmaster.section_code,itmaster.article_code,itmaster.vendor_code,currentemp.item_code,itmaster.item_desc ,itmaster.stock_onhand, points as quantity, customs,round((netamt/points),2) as price , netamt   FROM CURRENTEMP left join itmaster on CURRENTEMP.item_code=itmaster.item_code" ;

 str=str+" where  points<>0 and customs>0 ";

 if (!suiComboBox1->Text.IsEmpty()){
 str=str+" and store='"+ Trim(suiComboBox1->Text)+"'";
 }
  if (!suiDBComboBox3->Text.IsEmpty()){
 str=str+" and currentemp.item_code='"+ Trim(suiEdit1->Text)+"'";
 }else
 return;

 try{
dm->dayseq->Active=false;
dm->dayseq->SQL->Clear();
dm->dayseq->SQL->Add(str);
dm->dayseq->Active=true;

}
catch(...){
}
if (!suiComboBox1->Text.IsEmpty()){
 str="select store,sum(points) as customs from currentemp where item_code like '"+Trim(suiEdit1->Text)+"%' and store='"+Trim(suiComboBox1->Text)+"' group by store,item_code";
}else {
str="select sum(points) as customs from currentemp where item_code like '"+Trim(suiEdit1->Text)+"%' group by item_code";
 }
try{
dm->tmp->Active=false;
dm->tmp->SQL->Clear();
dm->tmp->SQL->Add(str);
dm->tmp->Active=true;

}catch(...){
dm->tmp->Active=false;
}
if  (suiComboBox1->Text.IsEmpty()){
suiStatusBar1->SimpleText="店铺:各店铺  item_code"+suiEdit1->Text+" 即时客数为"+dm->tmp->FieldByName("customs")->AsInteger;;
}else
suiStatusBar1->SimpleText="店铺:"+Trim(suiComboBox1->Text)+" item_code"+suiEdit1->Text+" 即时客数为"+dm->tmp->FieldByName("customs")->AsInteger;

if  (suiComboBox1->Text.IsEmpty()){
str="select sum(netamt) as netamts FROM CURRENTEMP left join itmaster on CURRENTEMP.item_code=itmaster.item_code  where  points<>0 and customs>0 and currentemp.item_code='"+Trim(suiDBComboBox3->Text)+"' group by currentemp.item_code";
 }else {
 str= "select sum(netamt) as netamts FROM CURRENTEMP left join itmaster on CURRENTEMP.item_code=itmaster.item_code  where  points<>0 and customs>0 and currentemp.item_code='"+Trim(suiDBComboBox3->Text)+"' and store='"+Trim(suiComboBox1->Text)+"' group by store,currentemp.item_code";
}
try{
dm->tmp->Active=false;
dm->tmp->SQL->Clear();
dm->tmp->SQL->Add(str);
dm->tmp->Active=true;

}catch(...){
dm->tmp->Active=false;
}



suiStatusBar1->SimpleText=suiStatusBar1->SimpleText+"  总金额为"+dm->tmp->FieldByName("netamts")->AsFloat;

}
//---------------------------------------------------------------------------











⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -