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

📄 gl_enter_accountparam.pas

📁 一个MRPII系统源代码版本
💻 PAS
📖 第 1 页 / 共 2 页
字号:
          Edt_KmLength3.SetFocus;
          Abort;
        end;

        if StrToInt(Edt_KmLength4.text)<>0 then
        begin
          DispInfo('四级会计科目长度应等于零!',1);
          Edt_KmLength4.SetFocus;
          Abort;
        end;
        if StrToInt(Edt_KmLength5.text)<>0 then
        begin
          DispInfo('五级会计科目长度应等于零!',1);
          Edt_KmLength5.SetFocus;
          Abort;
        end;
        if StrToInt(Edt_KmLength6.text)<>0 then
        begin
          DispInfo('六级会计科目长度应等于零!',1);
          Edt_KmLength6.SetFocus;
          Abort;
        end;
      end;
    4:begin
       if StrToInt(Edt_KmLength2.text)<=0 then
       begin
         DispInfo('二级会计科目长度应大于零!',1);
         Edt_KmLength2.SetFocus;
         Abort;
       end;

       if StrToInt(Edt_KmLength3.text)<=0 then
       begin
         DispInfo('三级会计科目长度应大于零!',1);
         Edt_KmLength3.SetFocus;
         Abort;
       end;

       if StrToInt(Edt_KmLength4.text)<=0 then
       begin
         DispInfo('四级会计科目长度应大于零!',1);
         Edt_KmLength4.SetFocus;
         Abort;
       end;
       if StrToInt(Edt_KmLength5.text)<>0 then
       begin
         DispInfo('五级会计科目长度应等于零!',1);
         Edt_KmLength5.SetFocus;
         Abort;
       end;
       if StrToInt(Edt_KmLength6.text)<>0 then
       begin
         DispInfo('六级会计科目长度应等于零!',1);
         Edt_KmLength6.SetFocus;
         Abort;
       end;
     end;
   5:begin
       if StrToInt(Edt_KmLength2.text)<=0 then
       begin
         DispInfo('二级会计科目长度应大于零!',1);
         Edt_KmLength2.SetFocus;
         Abort;
       end;

       if StrToInt(Edt_KmLength3.text)<=0 then
       begin
         DispInfo('三级会计科目长度应大于零!',1);
         Edt_KmLength3.SetFocus;
         Abort;
       end;

       if StrToInt(Edt_KmLength4.text)<=0 then
       begin
         DispInfo('四级会计科目长度应大于零!',1);
         Edt_KmLength4.SetFocus;
         Abort;
       end;
       if StrToInt(Edt_KmLength5.text)<=0 then
       begin
         DispInfo('五级会计科目长度应大于零!',1);
         Edt_KmLength5.SetFocus;
         Abort;
       end;
       if StrToInt(Edt_KmLength6.text)<>0 then
       begin
         DispInfo('六级会计科目长度应等于零!',1);
         Edt_KmLength6.SetFocus;
         Abort;
       end;
     end;
   6:begin
       if StrToInt(Edt_KmLength2.text)<=0 then
       begin
         DispInfo('二级会计科目长度应大于零!',1);
         Edt_KmLength2.SetFocus;
         Abort;
       end;

       if StrToInt(Edt_KmLength3.text)<=0 then
       begin
         DispInfo('三级会计科目长度应大于零!',1);
         Edt_KmLength3.SetFocus;
         Abort;
       end;

       if StrToInt(Edt_KmLength4.text)<=0 then
       begin
         DispInfo('四级会计科目长度应大于零!',1);
         Edt_KmLength4.SetFocus;
         Abort;
       end;
       if StrToInt(Edt_KmLength5.text)<=0 then
       begin
         DispInfo('五级会计科目长度应大于零!',1);
         Edt_KmLength5.SetFocus;
         Abort;
       end;
       if StrToInt(Edt_KmLength6.text)<=0 then
       begin
         DispInfo('六级会计科目长度应大于零!',1);
         Edt_KmLength6.SetFocus;
         Abort;
       end;
     end;
  end;
  if   StrToInt(Edt_KmLength1.text)+StrToInt(Edt_KmLength2.text)+StrToInt(Edt_KmLength3.text)
     +StrToInt(Edt_KmLength4.text)+StrToInt(Edt_KmLength5.text)
     +StrToInt(Edt_KmLength6.text)>15 then
  begin
    DispInfo('六级会计科目长度之和应小于等于15!',1);
    Edt_KmLength1.SetFocus;
    Abort;
  end;
  try
    Dbconnect.beginTrans;
    Executesql(AdoQry_tmp,'select * from Gl_AccountParam',0);
    if AdoQry_tmp.RecordCount<>0 then 
      begin
        sqltext:= ' UpDate Gl_AccountParam Set '//AccountCurrecyCode= '''+Trim(Edt_AccountCurrecyCode.Text) +''', '
                     +'        AccountKmLength = '''+Trim(Edt_AccountKmLength.Text) +''','
                     +'        EnterpriseType = '''+IntToStr(Cmb_EnterpriseType.ItemIndex) +''','
                     +'        CredenceType = '''+IntToStr(Cmb_CredenceType.ItemIndex) +''','
                     +'        ProduceCrendentNoWay = '+IntToSTr(Cmb_ProduceCrendentNoWay.ItemIndex+1)+','
                     +'        SysProduceCrendentNoWay = '+IntToSTr(Cmb_SysProduceCrendentNoWay.ItemIndex+1)+','
                     +'        KmLength1 = '''+Trim(Edt_KmLength1.Text) +''','
                     +'        KmLength2 = '''+Trim(Edt_KmLength2.Text) +''','
                     +'        KmLength3 = '''+Trim(Edt_KmLength3.Text) +''','
                     +'        KmLength4 = '''+Trim(Edt_KmLength4.Text) +''','
                     +'        KmLength5 = '''+Trim(Edt_KmLength5.Text) +''','
                     +'        KmLength6 = '''+Trim(Edt_KmLength6.Text) +''','
                     +'        AccountYearStArDate = '''+Trim(Edt_AccountYearStArDate.Text) +''','
                     +'        AccountYearStArMonth = '''+Trim(Edt_AccountYearStArMonth.Text) +''','
                     +'        AccountUseYear = '''+Trim(Edt_AccountUseYear.Text) +''','
                     +'        AccountUseMonth = '''+Trim(Edt_AccountUseMonth.Text) +''','
                     +'        AccountperiodAmount='+iifstring(medt_PeriodCounts.text='','0',medt_PeriodCounts.text);
        Executesql(AdoQry_tmp,sqltext,1);
      end
    else 
      begin
        sqltext:= ' insert into  Gl_AccountParam( '//AccountcurrecyCode, '
                     +'                          Accountkmlength,enterpriseType,'
                     +'                  ProduceCrendentNoWay,'
                     +'        SysProduceCrendentNoWay ,'
                     +'                          CredenceType,kmlength1,kmlength2, '
                     +'                          kmlength3,kmlength4,kmlength5, '
                     +'                          kmlength6,AccountYearstArdate, '
                     +'                          AccountYearstArMonth,AccountuseYear,AccountuseMonth, '
                     +'                          AccountperiodAmount)   '
                     +' Values('//+quotedstr(Trim(Edt_AccountCurrecyCode.Text)) +', '
                                +quotedstr(Trim(Edt_AccountKmLength.Text)) +','
                                +IntToStr(Cmb_EnterpriseType.ItemIndex) +','
                                +IntToSTr(Cmb_ProduceCrendentNoWay.ItemIndex+1)+','                                
                                +IntToSTr(Cmb_SysProduceCrendentNoWay.ItemIndex+1)+','                                
                                +IntToStr(Cmb_CredenceType.ItemIndex) +','
                                +quotedstr(Trim(Edt_KmLength1.Text) )+','
                                +Trim(Edt_KmLength2.Text) +','
                                +Trim(Edt_KmLength3.Text) +','
                                +Trim(Edt_KmLength4.Text) +','
                                +Trim(Edt_KmLength5.Text) +','
                                +Trim(Edt_KmLength6.Text) +','
                                +Trim(Edt_AccountYearStArDate.Text) +','
                                +Trim(Edt_AccountYearStArMonth.Text) +','
                                +Trim(Edt_AccountUseYear.Text) +','
                                +Trim(Edt_AccountUseMonth.Text) +','
                                +iifstring(medt_PeriodCounts.text='','0',medt_PeriodCounts.text)+')';
        Executesql(AdoQry_tmp,sqltext,1);

      end;
    SqlText := '';
    case Cmb_CredenceType.ItemIndex of
      1: SqlText := ' Insert Gl_CredenceType (CharacterNo,CharacterCode,CharacterName) '
                   +'        Values(''J'',''记'',''记账凭证'')';
      2: SqlText := ' Insert Gl_CredenceType (CharacterNo,CharacterCode,CharacterName) '
                   +'        Values(''S'',''收'',''收款'') '
                   +' Insert Gl_CredenceType (CharacterNo,CharacterCode,CharacterName) '
                   +'        Values(''F'',''付'',''付款'') '
                   +' Insert Gl_CredenceType (CharacterNo,CharacterCode,CharacterName) '
                   +'        Values(''Z'',''转'',''转账凭证'')';
      3: SqlText := ' Insert Gl_CredenceType (CharacterNo,CharacterCode,CharacterName) '
                   +'        Values(''X'',''现'',''现金'')'
                   +' Insert Gl_CredenceType (CharacterNo,CharacterCode,CharacterName) '
                   +'        Values(''Y'',''银'',''银行'')'
                   +' Insert Gl_CredenceType (CharacterNo,CharacterCode,CharacterName) '
                   +'        Values(''Z'',''转'',''转账凭证'')';
      4: SqlText := ' Insert Gl_CredenceType (CharacterNo,CharacterCode,CharacterName) '
                   +'        Values(''XS'',''01'',''现金收款'')'
                   +' Insert Gl_CredenceType (CharacterNo,CharacterCode,CharacterName) '
                   +'        Values(''XF'',''02'',''现金付款'')'
                   +' Insert Gl_CredenceType (CharacterNo,CharacterCode,CharacterName) '
                   +'        Values(''YS'',''03'',''银行收款'')'
                   +' Insert Gl_CredenceType (CharacterNo,CharacterCode,CharacterName) '
                   +'        Values(''YF'',''04'',''银行付款'')'
                   +' Insert Gl_CredenceType (CharacterNo,CharacterCode,CharacterName) '
                   +'        Values(''Z'',''05'',''转账凭证'')';
    end;
    if SqlText <> '' then
    begin
      SqlText := 'Delete Gl_CredenceType ' +SqlText;
      AdoQry_Tmp.Close;
      AdoQry_Tmp.SQL.clear;
      AdoQry_Tmp.Sql.Text := SqlText;
      AdoQry_Tmp.ExecSQL ;
    end;  
    if medt_PeriodCounts.Text<>'' then
     begin
      periodCount:=strtoint(Trim(medt_PeriodCounts.text)) ;
      Executesql(AdoQry_tmp,'delete from Gl_Accountperiod ',1);
            
      for i:=1 to periodCount do
       begin
        sqltext:='insert into Gl_Accountperiod(AccountperiodYear,AccountperiodMonth)'
                +'  Values('+Trim(edt_AccountuseYear.text)+','
                +inttostr(i)+')';
        Executesql(AdoQry_tmp,sqltext,1);
       end;
     end;
    DbConnect.CommitTrans;
  except
    DbConnect.RollBackTrans;
  end;
  inherited;
  Close;
end;

procedure TFrm_Gl_Enter_AccountParam.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  inherited;
  Action:=CaFree;
end;

procedure TFrm_Gl_Enter_AccountParam.btn_CancelClick(Sender: TObject);
begin
  inherited;
  Close;
end;

procedure TFrm_Gl_Enter_AccountParam.Edt_AccountCurrecyCodeExit(
  Sender: TObject);
begin
  inherited;
  CurrencyCodeCheck(Sender);
  AdoQry_Tmp.Close;
  AdoQry_Tmp.SQL.clear;
  AdoQry_Tmp.SQL.Text:=' Select CurrencyCode,CurrencyName from Currency '
                      +'          where CurrencyCode= '''+Edt_AccountCurrecyCode.Text+''' ';
  AdoQry_Tmp.Open;
  Edt_AccountCurrecyName.Text := AdoQry_Tmp.fieldbyname('CurrencyName').AsString;
end;

procedure TFrm_Gl_Enter_AccountParam.Edt_AccountCurrecyCodeChange(
  Sender: TObject);
begin
  inherited;
  if not FReadOnly then
    Btn_Ok.Enabled :=True;
end;

procedure TFrm_Gl_Enter_AccountParam.Cmb_CredenceTypeChange(
  Sender: TObject);
begin
  inherited;
  if not FReadOnly then
    Btn_Ok.Enabled := True;
end;

procedure TFrm_Gl_Enter_AccountParam.Cmb_EnterpriseTypeChange(
  Sender: TObject);
begin
  inherited;
  if not FReadOnly then
    Btn_Ok.Enabled := True;
end;

procedure TFrm_Gl_Enter_AccountParam.medt_PeriodCountSChange(
  Sender: TObject);
begin
  inherited;
  btn_ok.Enabled:=True;
end;

end.

⌨️ 快捷键说明

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