invalid argument是什么問題
procedure TPayApplyHeadForm.btnAddItemClick(Sender: TObject);
{begin
inherited;
dgDetail.RowProps[dgDetail.Row].Checked := true;
end;}
var
Item : TPay_Apply_Head ;
iRow,i :Integer;
Amount :Double;
begin
Item := TPay_Apply_Head.Create;
Item.Search_Flag := 6; //查詢引數對應的物料
msgbox('1111111111');
try
if CommonSearchObj(TBizObject(Item), '') then
begin
msgbox('qqqqqqq');
iRow := dgDetail.GetFirstEmptyRow;
if iRow = -1 then
begin
msgbox('uuuuuuu');
dgDetail.RowCount := dgDetail.RowCount + 1;
iRow := dgDetail.RowCount - 1;
end;
if(Item.pay_type='質保金')then
begin
msgbox('yyyyyy');
for i := 1 to dgDetail.RowCount - 1 do
begin
msgbox('eeeeeeeee');
if not dgDetail.RowProps[i].Checked then
begin
msgbox('pppppp');
Continue;
end;
if(dgDetail.CellByField2['pay_type',i]='月結款')or(dgDetail.CellByField2['pay_type',i]='預付款')
or(dgDetail.CellByField2['pay_type',i]='退貨款') then
Amount:=Amount+StrToFloatDef(dgDetail.CellByField2['Pay_Amount', i], 0);
end;
Amount:=-1*Amount*strtofloatdef(BedtASSURE_PERCENTAGE.text,0)/100;
dgDetail.CellByField2['Pay_Amount',iRow] := Format('%0.2f',[Amount]);
dgDetail.CellLocked[dgDetail.GetFieldIndex('Pay_Amount'),irow]:=true;
end;
if ( (Item.pay_type='訂單補差價') or (Item.pay_type='無外箱') ) then
begin
msgbox('nnnnnnnnn');
dgDetail.CellLocked[dgDetail.GetFieldIndex('item_code'),iRow]:=False;
dgDetail.Columns[dgDetail.GetFieldIndex('item_code')].ReadOnly:=False;
end;
dgDetail.CellByField2['source_id',iRow] := IntToStr(Item.Pay_Apply_Head_Id);
dgDetail.CellByField2['bill_no',iRow] := Item.Bill_No;
dgDetail.CellByField2['date_invbill',iRow] := Item.Date_Invbill;
dgDetail.CellByField2['pay_type',iRow] := Item.pay_type;
dgDetail.CellByField2['source_line_id',iRow] :=IntToStr(Item.pay_apply_line_id);
//dgDetail.CellLocked[dgDetail.GetFieldIndex('Qty_Match'),iRow] :=True;
//dgDetail.CellLocked[dgDetail.GetFieldIndex('Price_NoTax_Fact'),iRow] :=True;
dgDetail.CellLocked[dgDetail.GetFieldIndex('pay_qty'),iRow]:=true;
dgDetail.CellLocked[dgDetail.GetFieldIndex('Pay_Percent'),iRow]:=true;
dgDetail.RowProps[iRow].Checked := True;
dgDetail.CellByField2['Pay_Type_Id',iRow] := IntToStr(Item.Pay_Type_Id);
end;
finally
msgbox('mmmmmmmmmmm');
Item.Free;
end;
end;
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/70457.html
標籤:數據庫相關
上一篇:delphi 考驗總結問題
下一篇:Android做事實監控視頻后臺
