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

📄 ar_enter_noinvoiceshiporder_d.pas

📁 一个MRPII系统源代码版本
💻 PAS
📖 第 1 页 / 共 3 页
字号:
begin
  inherited;
  if key = 120 then
  CommOnHint(Sender,AdoQry_Tmp,'WhName','仓库名称','WhCode',
             '仓库代码',' Warehouse ');

end;

procedure TFrm_Ar_Enter_NoInvoiceShipOrder_D.Edt_WhCodeExit(
  Sender: TObject);
begin
  inherited;
  ExecuteSql(AdoQry_Tmp,'Select * from Warehouse '
            +'  where WhCode='+QuotedStr(Edt_WhCode.Text),0);
  if AdoQry_Tmp.RecordCount=0 then 
  begin
    DispInfo('仓库代码错误!',3);
    Edt_WhCode.SetFocus;
    abort;
  end;    
  Edt_WhName.Text := AdoQry_Tmp.fieldbyname('WhName').AsString;

end;

procedure TFrm_Ar_Enter_NoInvoiceShipOrder_D.Edt_WhCodeButtonClick(
  Sender: TObject);
begin
  inherited;
  CommOnHint(Sender,AdoQry_Tmp,'WhName','仓库名称','WhCode',
             '仓库代码',' Warehouse ');

end;

procedure TFrm_Ar_Enter_NoInvoiceShipOrder_D.Edt_WhPositionCodeKeyDown(
  Sender: TObject; var Key: Word; Shift: TShiftState);
begin
  inherited;
  if key<>120 then exit;
  if Trim(Edt_WhCode.Text)='' then
  begin
    DispInfo('请先输入仓库代码!',3);
    Edt_WhCode.SetFocus;
    Abort;
  end
  else 
  CommOnHint(Sender,AdoQry_Tmp,'WhPositionName','货位名称','WhPositionCode',
             '货位代码',' WhPosition ',' WhCode='+Quotedstr(Edt_WhCode.Text));

end;

procedure TFrm_Ar_Enter_NoInvoiceShipOrder_D.Edt_WhPositionCodeExit(
  Sender: TObject);
begin
  inherited;
  ExecuteSql(AdoQry_Tmp,'Select * from WhPosition '
            +'  where WhCode='+QuotedStr(Edt_WhCode.Text)
            +'    and WhPositionCode='+QuotedStr(Edt_WhPositionCode.Text),0);
  if AdoQry_Tmp.RecordCount=0 then 
  begin
    DispInfo('货位代码错误!',3);
    Edt_WhPositionCode.SetFocus;
    abort;
  end;
  Edt_WhPositionName.Text := AdoQry_Tmp.fieldbyname('WhPositionName').AsString;

end;

procedure TFrm_Ar_Enter_NoInvoiceShipOrder_D.Edt_WhPositionCodeButtonClick(
  Sender: TObject);
begin
  inherited;
  if Trim(Edt_WhCode.Text)='' then
  begin
    DispInfo('请先输入仓库代码!',3);
    Edt_WhCode.SetFocus;
    Abort;
  end
  else 
  CommOnHint(Sender,AdoQry_Tmp,'WhPositionName','货位名称','WhPositionCode',
             '货位代码',' WhPosition ',' WhCode='+Quotedstr(Edt_WhCode.Text));

end;

procedure TFrm_Ar_Enter_NoInvoiceShipOrder_D.Edt_SaleTypeCodeKeyDown(
  Sender: TObject; var Key: Word; Shift: TShiftState);
begin
  inherited;
  If key = 120 then 
  CommOnHint(Sender,AdoQry_Tmp,'SaleTypeName','销售类型名称','SaleTypeCode',
             '销售类型代码',' SaleType ');
end;

procedure TFrm_Ar_Enter_NoInvoiceShipOrder_D.Edt_SaleTypeCodeButtonClick(
  Sender: TObject);
begin
  inherited;
  CommOnHint(Sender,AdoQry_Tmp,'SaleTypeName','销售类型名称','SaleTypeCode',
             '销售类型代码',' SaleType ');

end;

procedure TFrm_Ar_Enter_NoInvoiceShipOrder_D.Edt_SaleTypeCodeExit(
  Sender: TObject);
begin
  inherited;
  ExecuteSql(AdoQry_Tmp,'select * from SaleType where SaleTypeCode='+QuotedStr(Edt_SaleTypeCode.Text),0);
  Edt_SaleTypeName.Text := AdoQry_Tmp.fieldbyname('SaleTypeName').AsString;
end;

procedure TFrm_Ar_Enter_NoInvoiceShipOrder_D.Edt_ShipAddresSCodeKeyDown(
  Sender: TObject; var Key: Word; Shift: TShiftState);
begin
  inherited;
   If key=120 Then
  CommOnHint(Sender,AdoQry_Tmp,'ShipAddressName','发货地址名称','ShipAddresSCode',
             '发货地址代号',' CustomerShipAddress ',' CustomerCode= '''+Edt_CustomerCode.Text+'''');

end;

procedure TFrm_Ar_Enter_NoInvoiceShipOrder_D.Edt_ShipAddresSCodeButtonClick(
  Sender: TObject);
begin
  inherited;
  CommOnHint(Sender,AdoQry_Tmp,'ShipAddressName','发货地址名称','ShipAddresSCode',
             '发货地址代号',' CustomerShipAddress ',' CustomerCode= '''+Edt_CustomerCode.Text+'''');

end;

procedure TFrm_Ar_Enter_NoInvoiceShipOrder_D.Edt_ShipAddresSCodeExit(
  Sender: TObject);
begin
  inherited;
  if  Trim(Edt_CustomerCode.Text) <> '' then
    begin
    If Trim(Edt_ShipAddresSCode.text)='' then
    begin
      Edt_ShipAddressName.Text:='';
    end
    else
    begin
      AdoQry_Tmp.Close;
      AdoQry_Tmp.SQL.clear;
      AdoQry_Tmp.SQL.Text:=' Select * from CustomerShipAddress '
                          +' where (CustomerCode='''+Trim(Edt_CustomerCode.text)+''') '
                          +' And (ShipAddresSCode='''+Trim(Edt_ShipAddresSCode.text)+''')' ;
      AdoQry_Tmp.Open;
      if AdoQry_Tmp.Eof then
      begin
        DispInfo('发货地址与客户不匹配!',3);
        Edt_ShipAddresSCode.SetFocus;
        Abort;
      end
      else
         Edt_ShipAddressName.Text:=AdoQry_Tmp.fieldbyname('ShipAddressName').AsString ;
    end;
  end;

end;

procedure TFrm_Ar_Enter_NoInvoiceShipOrder_D.Edt_PayTermCodeKeyDown(
  Sender: TObject; var Key: Word; Shift: TShiftState);
begin
  inherited;
  If key=120 Then
  CommOnHint(Sender,AdoQry_Tmp,'PayTermName','付款条款名称','PayTermCode',
             '付款条款代号',' PayTerm ');
end;

procedure TFrm_Ar_Enter_NoInvoiceShipOrder_D.Edt_PayTermCodeExit(
  Sender: TObject);
begin
  inherited;
  If Trim(Edt_PayTermCode.text)='' then
  begin
  end
  else
  begin                                  
    AdoQry_Tmp.Close;
    AdoQry_Tmp.SQL.clear;
    AdoQry_Tmp.SQL.Text:=' Select * from PayTerm where PayTermCode='''+Trim(Edt_PayTermCode.text)+''' ';
    AdoQry_Tmp.Open;
    if AdoQry_Tmp.Eof then
    begin
      DispInfo('付款条款输入错误!',3);
      Edt_PayTermCode.SetFocus;
      Abort;
    end
    else
     Edt_PayTermName.Text :=AdoQry_Tmp.fieldbyname('PayTermName').AsString;
  end;

end;

procedure TFrm_Ar_Enter_NoInvoiceShipOrder_D.Edt_ShipModeCodeKeyDown(
  Sender: TObject; var Key: Word; Shift: TShiftState);
begin
  inherited;
  If key=120 Then
  CommOnHint(Sender,AdoQry_Tmp,'ShipModeName','发货方式名称','ShipModeCode',
             '发货方式代号',' ShipMode ');
end;

procedure TFrm_Ar_Enter_NoInvoiceShipOrder_D.Edt_ShipModeCodeExit(
  Sender: TObject);
begin
  inherited;
  If Trim(Edt_ShipModeCode.text)='' then
  begin
    {DispInfo('发货方式不能为空!',3);
    Edt_ShipModeCode.SetFocus;
    Abort;}
    Edt_ShipModeName.Text:='';
  end
  else
  begin
    AdoQry_Tmp.Close;
    AdoQry_Tmp.SQL.clear;
    AdoQry_Tmp.SQL.Text:=' Select * From ShipMode '
                        +' Where ShipModeCode='''+Trim(Edt_ShipModeCode.text)+''' ';
    AdoQry_Tmp.Open;
    if AdoQry_Tmp.Eof then
    begin
      DispInfo('发货方式输入错误!',3);
      Edt_ShipModeCode.SetFocus;
      Abort;
    end
    else Edt_ShipModeName.Text:=AdoQry_Tmp.fieldbyname('ShipModeName').AsString ;
  end;
end;

procedure TFrm_Ar_Enter_NoInvoiceShipOrder_D.Edt_PayTermCodeButtonClick(
  Sender: TObject);
begin
  inherited;
  CommOnHint(Sender,AdoQry_Tmp,'PayTermName','付款条款名称','PayTermCode',
             '付款条款代号',' PayTerm ');

end;

procedure TFrm_Ar_Enter_NoInvoiceShipOrder_D.Edt_ShipModeCodeButtonClick(
  Sender: TObject);
begin
  inherited;
  CommOnHint(Sender,AdoQry_Tmp,'ShipModeName','发货方式名称','ShipModeCode',
             '发货方式代号',' ShipMode ');

end;

procedure TFrm_Ar_Enter_NoInvoiceShipOrder_D.Edt_InvBillNoTaxAmountExit(
  Sender: TObject);
begin
  inherited;
  FloatCheck(Edt_InvBillNoTaxAmount);
  Edt_InvBillAmount.Text := FloatToStr(StrToFloat(Edt_InvBillNoTaxAmount.Text) *(1+StrToFloat(Edt_Rate.Text)/100));
  Edt_InvBillNoTaxAmountC.Text := FloatToStr(StrToFloat(Edt_InvBillNoTaxAmount.Text)*ExchRate); 
  Edt_InvBillAmountC.Text := FloatToStr(StrToFloat(Edt_InvBillAmount.Text) *ExchRate);
end;

procedure TFrm_Ar_Enter_NoInvoiceShipOrder_D.Edt_InvBillNoTaxAmountCExit(
  Sender: TObject);
begin
  inherited;
  FloatCheck(Edt_InvBillNoTaxAmountC);
  Edt_InvBillAmountC.Text := FloatToStr(StrToFloat(Edt_InvBillNoTaxAmountC.Text) *(1+StrToFloat(Edt_Rate.Text)/100));

end;

procedure TFrm_Ar_Enter_NoInvoiceShipOrder_D.btn_okClick(Sender: TObject);
begin
  if Add then
  begin
{    if Trim(Edt_CustomerCode.Text)='' then
    begin
      DispInfo('客户代码不能为空!',3);
      if Edt_CustomerCode.CanFocus then 
      Edt_CustomerCode.SetFocus;
      ModalResult := MrNone;
      abort;
    end;
}
    if Trim(Edt_WhCode.Text)='' then
    begin
      DispInfo('仓库代码不能为空!',3);
      if Edt_WhCode.CanFocus then 
      Edt_WhCode.SetFocus;
      ModalResult := MrNone;
      abort;
    end;
    if Trim(Edt_InvBillNoTaxAmount.Text)='' then
    begin
      DispInfo('未税金额不能为0!',3);
      if Edt_InvBillNoTaxAmount.CanFocus then
      Edt_InvBillNoTaxAmount.SetFocus;
      ModalResult :=  MrNone;
      abort;
    end; 
    if Not (strtodatetime(Medt_InvBillDate.Text)<=strtodatetime(GetServerDateTime(dbconnect))) then
    begin
      DispInfo('单据日期必须小于当前日期!',3);
      if Medt_InvBillDate.CanFocus then
      Medt_InvBillDate.SetFocus;
      ModalResult := MrNone;
      abort;      
    end;    
    if Not (strtodatetime(Medt_InvBillMonth.Text+'.01')<=strtodatetime(GetServerDateTime(dbconnect))) then
    begin
      DispInfo('单据月份必须小于当前月份!',3);
      if Medt_InvBillMonth.CanFocus then
      Medt_InvBillMonth.SetFocus;
      ModalResult := MrNone;
      abort;      
    end;    
    if Trim(Edt_CurrencyCode.Text)='' then
    begin
      DispInfo('货币代码不能为空!',3);
      if Edt_CurrencyCode.CanFocus then 
      Edt_CurrencyCode.SetFocus;
      ModalResult := MrNone;
      abort;
    end;
    Edt_CurrencyCode.OnExit(Edt_CurrencyCode);
  end;
  If Add then
  begin
    ExecuteSql(AdoQry_Tmp,'select InvBillNo from InvOutBill where InvBillNo='+QuotedStr(Edt_InvBillNo.Text),0)  ;
    if AdoQry_Tmp.RecordCount>0 then
    begin
      DispInfo('单据号重复!',3);
      if Edt_InvBillNo.CanFocus then
      Edt_InvBillNo.SetFocus;
      ModalResult := MrNone;
      abort;
    end;
  end;
  inherited;
end;

procedure TFrm_Ar_Enter_NoInvoiceShipOrder_D.medt_InvBillDateExit(
  Sender: TObject);
begin
  inherited;
  DateCheck(sender);
  Medt_InvBillMonth.Text := Copy(Medt_InvBillDate.Text,1,7);
end;

end.

⌨️ 快捷键说明

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