📄 inv_noorderopin_d.pas
字号:
if Vendortaxrate_Percent='' then
Vendortaxrate_Percent:='0';
{if oldPrice<>Extedt_Price.text then
begin}
//含税单价
InvBillPrice:=strtofloat(Extedt_Price.text);
//含税金额
InvBillAmount:=InvBillPrice*InvBillqty;
//不含税金额
InvBillnotaxAmount:=InvBillAmount/(1+strtofloat(Vendortaxrate_Percent)/100.00);
//不含税单价
InvBillnotaxPrice:=InvBillnotaxAmount/InvBillqty;
Extedt_Amount.text:=formatfloat('#.00',InvBillAmount);
Extedt_NotaxPrice.text:=floattostr(InvBillnotaxPrice);
Extedt_NotaxAmount.text:=formatfloat('#.00',InvBillnotaxAmount);
{oldPrice:=Extedt_Price.text;
oldAmount:=formatfloat('#.00',InvBillAmount);
oldnotaxPrice:=floattostr(InvBillnotaxPrice);
oldnotaxAmount:=formatfloat('#.00',InvBillnotaxAmount);
end;}
end;
procedure TFrm_Inv_NoOrderOpIn_D.Extedt_AmountExit(Sender: TObject);
var
InvBillqty,InvBillPrice,InvBillAmount,InvBillnotaxPrice,InvBillnotaxAmount:real;
begin
inherited;
if ActiveControl.Name='btn_Cancel' then
exit;
floatcheck(sender);
//数量
InvBillqty:=strtofloat(Extedt_InvBillqty.text);
//含税金额
{ 如果输入含税金额,则
含税单价=含税金额/数量
不含税金额=含税金额/(1+税率/100)
不含税单价=不含税金额/数量}
//if ActiveControl=ExtEdt_InvBillqty then
// Exit;
if InvBillqty=0.0 then
begin
DispInfo('数量不能为零!',1);
Extedt_InvBillqty.setfocus;
abort;
end;
if Vendortaxrate_Percent='' then
Vendortaxrate_Percent:='0';
{if oldAmount<>Extedt_Amount.text then
begin}
InvBillAmount:=strtofloat(Extedt_Amount.text);
//含税单价
InvBillPrice:=InvBillAmount/InvBillqty;
//不含税金额
InvBillnotaxAmount:=InvBillAmount/(1+strtofloat(Vendortaxrate_Percent)/100.00);
//不含税单价
InvBillnotaxPrice:=InvBillnotaxAmount/InvBillqty;
Extedt_Price.text:=floattostr(InvBillPrice);
Extedt_NotaxPrice.text:=floattostr(InvBillnotaxPrice);
Extedt_NotaxAmount.text:=formatfloat('#.00',InvBillnotaxAmount);
{oldAmount:=Extedt_Amount.text;
oldPrice:=floattostr(InvBillPrice);
oldnotaxPrice:=floattostr(InvBillnotaxPrice);
oldnotaxAmount:=formatfloat('#.00',InvBillnotaxAmount);
end;}
end;
procedure TFrm_Inv_NoOrderOpIn_D.Extedt_NotaxPriceExit(Sender: TObject);
var
InvBillqty,InvBillPrice,InvBillAmount,InvBillnotaxPrice,InvBillnotaxAmount:real;
begin
inherited;
if ActiveControl.Name='btn_Cancel' then
exit;
floatcheck(sender);
//数量
InvBillqty:=strtofloat(Extedt_InvBillqty.text);
{ 如果输入不含税单价,则
不含税金额=四舍五入保留两位小数(数量*不含税单价)
含税金额=不含税金额*(1+税率/100)
含税单价=含税金额/数量}
//不含税单价
// if ActiveControl=ExtEdt_InvBillqty then
// Exit;
if InvBillqty=0.0 then
begin
DispInfo('数量不能为零!',1);
Extedt_InvBillqty.setfocus;
abort;
end;
if Vendortaxrate_Percent='' then
Vendortaxrate_Percent:='0';
{if oldnotaxPrice<>Extedt_NotaxPrice.text then
begin}
InvBillnotaxPrice:=strtofloat(Extedt_NotaxPrice.text);
//不含税金额
InvBillnotaxAmount:=InvBillnotaxPrice*InvBillqty;
//含税金额
InvBillAmount:=InvBillnotaxAmount*(1+strtofloat(Vendortaxrate_Percent)/100.00);
//含税单价
InvBillPrice:=InvBillAmount/InvBillqty;
Extedt_Price.text:=floattostr(InvBillPrice);
Extedt_Amount.text:=formatfloat('#.00',InvBillAmount);
Extedt_NotaxAmount.text:=formatfloat('#.00',InvBillnotaxAmount);
{oldnotaxPrice:=Extedt_NotaxPrice.text;
oldPrice:=floattostr(InvBillPrice);
oldAmount:=formatfloat('#.00',InvBillAmount);
oldnotaxAmount:=formatfloat('#.00',InvBillnotaxAmount);
end;}
end;
procedure TFrm_Inv_NoOrderOpIn_D.Extedt_NotaxAmountExit(Sender: TObject);
var
InvBillqty,InvBillPrice,InvBillAmount,InvBillnotaxPrice,InvBillnotaxAmount:real;
begin
inherited;
if ActiveControl.Name='btn_Cancel' then
exit;
floatcheck(sender);
//数量
InvBillqty:=strtofloat(Extedt_InvBillqty.text);
{ 如果输入不含税金额,则
不含税单价=不含税金额/数量
含税金额=不含税金额*(1+税率/100)
含税单价=含税金额/数量}
//if ActiveControl=ExtEdt_InvBillqty then
// Exit;
if InvBillqty=0.0 then
begin
DispInfo('数量不能为零!',1);
Extedt_InvBillqty.setfocus;
abort;
end;
if Vendortaxrate_Percent='' then
Vendortaxrate_Percent:='0';
{if oldnotaxAmount<>Extedt_NotaxAmount.text then
begin}
//不含税金额
InvBillnotaxAmount:=strtofloat(Extedt_NotaxAmount.text);
//不含税单价
InvBillnotaxPrice:=InvBillnotaxAmount/InvBillqty;
//含税金额
InvBillAmount:=InvBillnotaxAmount*(1+strtofloat(Vendortaxrate_Percent)/100.00);
//含税单价
InvBillPrice:=InvBillAmount/InvBillqty;
Extedt_Price.text:=floattostr(InvBillPrice);
Extedt_Amount.text:=formatfloat('#.00',InvBillAmount);
Extedt_NotaxPrice.text:=floattostr(InvBillnotaxPrice);
{oldnotaxAmount:=Extedt_NotaxAmount.text;
oldPrice:=floattostr(InvBillPrice);
oldAmount:=formatfloat('#.00',InvBillAmount);
oldnotaxPrice:=floattostr(InvBillnotaxPrice);
end;}
end;
procedure TFrm_Inv_NoOrderOpIn_D.Extedt_NotaxPriceKeyDown(Sender: TObject;
var Key: Word; Shift: TShiftState);
begin
inherited;
if key=vk_F9 then
Extedt_NotaxPrice.text:=GetOtherPrice(Extedt_ItemCode.text,'NoTaxPrice',AdoQry_tmp.Connection);
end;
procedure TFrm_Inv_NoOrderOpIn_D.Extedt_PriceKeyDown(Sender: TObject;
var Key: Word; Shift: TShiftState);
begin
inherited;
if key=vk_F9 then
Extedt_Price.text:=GetOtherPrice(Extedt_ItemCode.text,'Price',AdoQry_tmp.Connection);
end;
procedure TFrm_Inv_NoOrderOpIn_D.Extedt_BatchnoExit(Sender: TObject);
var
tmp_OutCode:string;
begin
inherited;
if ActiveControl.Name='btn_Cancel' then
exit;
if (not BatchCtrl(AdoQry_tmp,Extedt_ItemCode.text)) then
begin
if Trim(Extedt_Batchno.text)<>'' then
begin
DispInfo('该物料不受批次控制,不能录入批次号',1);
twincontrol(sender).setfocus;
abort;
end
end;
if (BatchCtrl(AdoQry_tmp,Extedt_ItemCode.text)) then
begin
if (Extedt_Batchno.text='') then
begin
DispInfo('请录入批次号',1);
twincontrol(sender).setfocus;
abort;
end
else
begin
//如果是供应商,则把供应商代码传入BatchNOCHECK进行检验
if outType='供应商' then
tmp_OutCode:=outCode
else
tmp_OutCode:='';
if not BatchNoCheck(AdoQry_tmp,Extedt_Batchno.text,Extedt_ItemCode.text,tmp_OutCode,fdate) then
begin
twincontrol(sender).setfocus;
abort;
end
else
begin
if not BatchInvCheck(AdoQry_tmp,Extedt_Batchno.text,'R',fWhCode,fWhPositionCode,strtofloat(Extedt_InvBillqty.text)) then
begin
twincontrol(sender).setfocus;
abort;
end;
end;
end;
end
end;
procedure TFrm_Inv_NoOrderOpIn_D.Extedt_BatchnoKeyDown(Sender: TObject;
var Key: Word; Shift: TShiftState);
var
tmp_OutCode:string;
begin
inherited;
if (key=vk_F9) then
begin
if outType='供应商' then
tmp_OutCode:=outCode
else
tmp_OutCode:='';
Extedt_Batchno.text:=BatchHint(AdoQry_tmp.Connection,Extedt_ItemCode.text,tmp_OutCode,fwhCode,fWhPositionCode);
end;
end;
procedure TFrm_Inv_NoOrderOpIn_D.btn_okClick(Sender: TObject);
begin
if Trim(Extedt_ItemCode.text)='' then
begin
DispInfo('物料代码不能为空!',3);
Extedt_ItemCode.setfocus;
abort;
end;
if strtofloat(Extedt_InvBillqty.text)=0 then
begin
DispInfo('数量不能为零!',3);
Extedt_InvBillqty.setfocus;
abort;
end;
if strtofloat(Extedt_Price.text)=0 then
begin
DispInfo('含税价不能为零!',3);
Extedt_Price.setfocus;
abort;
end;
if strtofloat(Extedt_Amount.text)=0 then
begin
DispInfo('含税金额不能为零!',3);
Extedt_Amount.setfocus;
abort;
end;
if strtofloat(Extedt_NotaxPrice.text)=0 then
begin
DispInfo('未税价不能为零!',3);
Extedt_NotaxPrice.setfocus;
abort;
end;
if strtofloat(Extedt_NotaxAmount.text)=0 then
begin
DispInfo('未税金额不能为零!',3);
Extedt_NotaxAmount.setfocus;
abort;
end;
Extedt_InvBillqty.onExit(Extedt_InvBillqty);
Extedt_Price.onExit(Extedt_Price);
Extedt_Amount.onExit(Extedt_Amount);
Extedt_NotaxPrice.onExit(Extedt_NotaxPrice);
Extedt_NotaxAmount.onExit(Extedt_NotaxAmount);
inherited;
end;
procedure TFrm_Inv_NoOrderOpIn_D.Extedt_ItemCodeKeyDown(Sender: TObject;
var Key: Word; Shift: TShiftState);
begin
inherited;
if(Key=120)then
CommonHint(Sender,AdoQry_Tmp,'ItemName','物料名称','ItemCode',
'物料代码','Item','ItemUsable=1 and ItemType in (0,2) and PmCode=2');
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -