?? demand_enter.pas
字號:
begin
tempstr:=ExamineMan1;
tt:=0;
while pos(',',tempstr)>0 do //取得逗號的位置
begin
temppos:=pos(',',tempstr); //取得逗號的位置
ss:=copy(tempstr,1,temppos-1);
tempstr:=copy(tempstr,temppos+1,length(tempstr)-temppos);
if ss=Handle_Man then
begin
P1.Visible:=True; L1.Caption:=LevelName1+':'+ss;
if ee1='' then
begin
L1.Caption:=LevelName1+':'+ss;
Flag1:=1;
end;
if ee1<>'' then
begin
L1.Caption:=LevelName1+':';
Flag1:=2;
end;
end;
end;
Next;
end;
if Trim(ExamineMan2)<>'' then
begin
tempstr:=ExamineMan2;
tt:=0;
while pos(',',tempstr)>0 do //取得逗號的位置
begin
temppos:=pos(',',tempstr); //取得逗號的位置
ss:=copy(tempstr,1,temppos-1);
tempstr:=copy(tempstr,temppos+1,length(tempstr)-temppos);
if ss=Handle_Man then
begin
P2.Visible:=True; L2.Caption:=LevelName2+':'+ss;
if ee2='' then
begin
L2.Caption:=LevelName2+':'+ss;
Flag2:=1;
end;
if ee2<>'' then
begin
L2.Caption:=LevelName2+':';
Flag2:=2;
end;
end;
end;
Next;
end;
if Trim(ExamineMan3)<>'' then
begin
tempstr:=ExamineMan3;
tt:=0;
while pos(',',tempstr)>0 do //取得逗號的位置
begin
temppos:=pos(',',tempstr); //取得逗號的位置
ss:=copy(tempstr,1,temppos-1);
tempstr:=copy(tempstr,temppos+1,length(tempstr)-temppos);
if ss=Handle_Man then
begin
P3.Visible:=True; L3.Caption:=LevelName3+':'+ss;
if ee3='' then
begin
L3.Caption:=LevelName3+':'+ss;
Flag3:=1;
end;
if ee3<>'' then
begin
L3.Caption:=LevelName3+':';
Flag3:=2;
end;
end;
end;
Next;
end;
if Trim(ExamineMan4)<>'' then
begin
tempstr:=ExamineMan4;
tt:=0;
while pos(',',tempstr)>0 do //取得逗號的位置
begin
temppos:=pos(',',tempstr); //取得逗號的位置
ss:=copy(tempstr,1,temppos-1);
tempstr:=copy(tempstr,temppos+1,length(tempstr)-temppos);
if ss=Handle_Man then
begin
P4.Visible:=True; L4.Caption:=LevelName4+':'+ss;
if ee4='' then
begin
L4.Caption:=LevelName4+':'+ss;
Flag4:=1;
end;
if ee1<>'' then
begin
L4.Caption:=LevelName4+':';
Flag4:=2;
end;
end;
end;
Next;
end;
if Trim(ExamineMan5)<>'' then
begin
tempstr:=ExamineMan5;
tt:=0;
while pos(',',tempstr)>0 do //取得逗號的位置
begin
temppos:=pos(',',tempstr); //取得逗號的位置
ss:=copy(tempstr,1,temppos-1);
tempstr:=copy(tempstr,temppos+1,length(tempstr)-temppos);
if ss=Handle_Man then
begin
P5.Visible:=True; L5.Caption:=LevelName5+':'+ss;
if ee1='' then
begin
L5.Caption:=LevelName5+':'+ss;
Flag5:=1;
end;
if ee5<>'' then
begin
L5.Caption:=LevelName5+':';
Flag5:=2;
end;
end;
end;
Next;
end;
with frm_data.ClientDataSet_Submit_adopt_detail do
begin
Close;
CommandText:='';
CommandText:='Select * from [V_Submit_adopt_View] where Receipt_No='''+List_No+'''';
Open;
k:=frm_data.ClientDataSet_Submit_adopt_detail.RecordCount;
StringGrid1.RowCount:=k+1;
//自動加載STRINGGRID的行數
for K:=1 to StringGrid1.RowCount do
begin
StringGrid1.Cells[0,K]:=IntTostr(k); //表示第0列第i行的名稱
end;
//******************
Edit_Copy_Date.Text:=ForMatDateTime('yyyy''-''mm''-''dd',frm_data.ClientDataSet_Submit_adopt_detail.FieldByName('Copy_Date').AsDateTime);
Edit_Submit_adopt_NO.Text:=frm_data.ClientDataSet_Submit_adopt_detail.FieldByName('Receipt_No').AsString;
Edit_Give_Name.Text:=frm_data.ClientDataSet_Submit_adopt_detail.FieldByName('Give_Name').AsString;
Edit_Storage_NO.Text:=frm_data.ClientDataSet_Submit_adopt_detail.FieldByName('Storage_NO').AsString;
Edit_Shop_NO.Text:=frm_data.ClientDataSet_Submit_adopt_detail.FieldByName('Shop_NO').AsString;
Edit_Transactor.Text:=frm_data.ClientDataSet_Submit_adopt_detail.FieldByName('Transactor').AsString;
Edit_Proposer.Text:=frm_data.ClientDataSet_Submit_adopt_detail.FieldByName('Proposer').AsString;
Edit_Condense.Text:=frm_data.ClientDataSet_Submit_adopt_detail.FieldByName('Condense').AsString;
Edit_Submit_Remark.Text:=frm_data.ClientDataSet_Submit_adopt_detail.FieldByName('Submit_Remark').AsString;
for k:=1 to k do
begin
StringGrid1.Cells[1,k]:=frm_data.ClientDataSet_Submit_adopt_detail.FieldValues['Goods_NO'];//商品編號
StringGrid1.Cells[2,k]:=frm_data.ClientDataSet_Submit_adopt_detail.FieldValues['Goods_Name'];//商品名稱
StringGrid1.Cells[3,k]:=frm_data.ClientDataSet_Submit_adopt_detail.FieldValues['Submit_amount'];//數量
StringGrid1.Cells[4,k]:=frm_data.ClientDataSet_Submit_adopt_detail.FieldValues['Submit_price'];//單價
StringGrid1.Cells[5,k]:=frm_data.ClientDataSet_Submit_adopt_detail.FieldValues['Submit_money'];//金額
StringGrid1.Cells[6,k]:=frm_data.ClientDataSet_Submit_adopt_detail.FieldValues['Submit_Detail_Remark'];//類別編號
StringGrid1.Cells[7,k]:=frm_data.ClientDataSet_Submit_adopt_detail.FieldValues['Base_Monad'];//
StringGrid1.Cells[8,k]:=frm_data.ClientDataSet_Submit_adopt_detail.FieldValues['Goods_Modal'];//
StringGrid1.Cells[9,k]:=frm_data.ClientDataSet_Submit_adopt_detail.FieldValues['Goods_Cards'];//
StringGrid1.Cells[10,k]:=frm_data.ClientDataSet_Submit_adopt_detail.FieldValues['Goods_Brand'];//
StringGrid1.Cells[11,k]:=frm_data.ClientDataSet_Submit_adopt_detail.FieldValues['Norms_Type'];//
StringGrid1.Cells[12,k]:=frm_data.ClientDataSet_Submit_adopt_detail.FieldValues['Goods_Sphere'];//
StringGrid1.Cells[13,k]:=frm_data.ClientDataSet_Submit_adopt_detail.FieldValues['Goods_Column'];//
StringGrid1.Cells[14,k]:=frm_data.ClientDataSet_Submit_adopt_detail.FieldValues['Goods_Color'];//
StringGrid1.Cells[15,k]:=frm_data.ClientDataSet_Submit_adopt_detail.FieldValues['Goods_Coding'];//
StringGrid1.Cells[16,k]:=frm_data.ClientDataSet_Submit_adopt_detail.FieldValues['Enroll_Brand'];//
StringGrid1.Cells[17,k]:=frm_data.ClientDataSet_Submit_adopt_detail.FieldValues['Factory']; //
StringGrid1.Cells[18,k]:=frm_data.ClientDataSet_Submit_adopt_detail.FieldValues['Valid_Month']; //
StringGrid1.Cells[19,k]:=frm_data.ClientDataSet_Submit_adopt_detail.FieldValues['Remark']; //
Next;
end;
end;
end;
end;
procedure Tfrm_Demand_Enter.SpeedButton4Click(Sender: TObject);
var
i,j,icol:integer;
Check_Flag:string;
begin
frm_Public_Don:=Tfrm_Public_Don.Create(self);
frm_Public_Don.ShowModal;
//直接操作入庫界面
if Public_Do='Demand_Enter_Str' then
begin
//直接過帳
if Public_Do_Result='01' then
begin
with frm_data.ClientDataSet_Submit_adopt do
begin
Close;
CommandText:='';
Commandtext:='Select * from [V_Submit_adopt_View] where Receipt_No='''+Trim(Edit_Submit_adopt_NO.Text)+'''';
try
Open;
if frm_data.ClientDataSet_Submit_adopt.RecordCount>0 then
begin
Check_Flag:=frm_data.ClientDataSet_Submit_adopt.FieldByName('Check_Result').AsString;
if Check_Flag='0' then //單據沒有完全審核
begin
Application.MessageBox('單據還沒有完全審核,不能過帳',pchar(application.Title),mb_iconwarning);
Exit;
end;
if Check_Flag='1' then //單據完全審核
begin
with frm_data.ClientDataSet_Submit_adopt do
begin
Close;
CommandText:='';
CommandText:='Update [Submit_adopt] set Give_Name='''+Trim(Edit_Give_Name.Text)+''',Storage_NO='''+Trim(Edit_Storage_NO.Text)+''',Transactor='''+Trim(Edit_Transactor.Text)+''',Shop_NO='''+Trim(Edit_Shop_NO.Text)+''',Submit_Remark='''+Trim(Edit_Submit_Remark.Text)+''',Condense='''+Trim(Edit_Condense.Text)+''' where Submit_adopt_NO='''+Trim(Edit_Submit_adopt_NO.Text)+'''';
try
Execute;
try
for i:=1 to StringGrid1.RowCount-1 do
begin
with frm_data.ClientDataSet_Submit_adopt_detail do
begin
Close;
frm_data.ClientDataSet_Add.CommandText:='';
CommandText:='update [Submit_adopt_detail] set Submit_amount='''+Trim(StringGrid1.Cells[3,i])+''',Submit_price='''+Trim(StringGrid1.Cells[4,i])+''',Submit_money='''+Trim(StringGrid1.Cells[5,i])+''',Submit_Detail_Remark='''+Trim(StringGrid1.Cells[6,i])+''' where Submit_adopt_NO='''+Trim(Edit_Submit_adopt_NO.Text)+''' and Goods_NO='''+Trim(StringGrid1.Cells[1,i])+'''';
try
Execute;
except
Application.MessageBox('保存【受托代銷入庫明細】時連接服務器失敗,不能過帳,請確認!',pchar(application.Title),mb_iconwarning);
Exit;
end;
end;
end;
with frm_data.ClientDataSet_Receipt do
begin
Close;
Commandtext:='';
Commandtext:='Update [Receipt] set Flag_sign=''單據'' where Receipt_No='''+Trim(Edit_Submit_adopt_NO.Text)+'''';
try
Execute;
Application.MessageBox('恭喜你!【受托代銷入庫】直接單據過帳操作成功!請確認!',pchar(application.Title),mb_iconwarning);
except
Application.MessageBox('保存【受托代銷入庫審核表】時失敗,不能過帳,請確認!',pchar(application.Title),mb_iconwarning);
Exit;
end;
end;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -