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

📄 maprsh.cpp

📁 科思ERP部分源码及控件
💻 CPP
字号:
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop
#include "mAprsh.h"

//---------------------------------------------------------------------------

#pragma package(smart_init)
TKSAprsh *sdAprsh;
//---------------------------------------------------------------------------
__fastcall TKSAprsh::TKSAprsh()
  :TKSMidBase()
{
}
//---------------------------------------------------------------------------
void __fastcall TKSAprsh::ValidHeadValues()
{
  //应付红冲单号
      ValidAprshCode();
  //日期
      ValidAprshDate();
  //单据类型
      ValidAprshDocType();
  //单据号
      ValidAprshDocCode();
  //操作员
      ValidAprshUser();
  //审核标志
      ValidAprshCheck();
  //审核人
      ValidAprshChecker();
  //审核日期
      ValidAprshCheckDate();
  //备注
      ValidAprshDesc();
  //系统日期
      ValidAprshSysDate();
}
//---------------------------------------------------------------------------
void __fastcall TKSAprsh::ValidAprshCode()  //应付红冲单号
{
}
//---------------------------------------------------------------------------
void __fastcall TKSAprsh::ValidAprshDate()  //日期
{
}
//---------------------------------------------------------------------------
void __fastcall TKSAprsh::ValidAprshDocType()  //单据类型
{
   int m_AprshDocType;
   m_AprshDocType=GetMasterValue("AprshDocType");
    if (m_AprshDocType!=1 && m_AprshDocType!=2&& m_AprshDocType!=3)
        throw Exception("单据类型只能取值: 1-退款单 2-红字应付单 3-票据退回!");
}

//---------------------------------------------------------------------------
void __fastcall TKSAprsh::ValidAprshDocCode()  //单据号
{
}

//---------------------------------------------------------------------------
void __fastcall TKSAprsh::ValidAprshUser()  //操作员
{
/*
   AnsiString  m_AprshUser;
   AnsiString  b_AprshUser;
   m_AprshUser=GetMasterValue("AprshUser");
   b_AprshUser=GetMasterOldValue("AprshUser");
    if(m_AprshUser.IsEmpty())
      throw Exception("操作员不能为空!");
    if(m_AprshUser.Length()>18)
      throw Exception("操作员长度不能大于18!");
    if(m_AprshUser!=b_AprshUser)
    {
      Query->Close();
      Query->SQL->Clear();
      Query->SQL->Add("select usercode from sduser where usercode='"+m_AprshUser+"'");
      Query->Open();
      if(Query->RecordCount<=0)
      {
        Query->Close();
        throw Exception("操作员:"+m_AprshUser+"未定义!");
      }
      Query->Close();
    }
 */
}
//---------------------------------------------------------------------------
void __fastcall TKSAprsh::ValidAprshCheck()  //审核标志
{
   int m_AprshCheck;
   m_AprshCheck=GetMasterValue("AprshCheck");
    if(m_AprshCheck!=0 && m_AprshCheck!=1)
       throw Exception("审核标志只能取值: 0-未审核 1-已审核!");
}

//---------------------------------------------------------------------------
void __fastcall TKSAprsh::ValidAprshChecker()  //审核人
{
/*
   AnsiString  m_AprshChecker;
   int  m_AprshCheck;
   m_AprshChecker=GetMasterValue("AprshChecker");
   m_AprshCheck=GetMasterValue("AprshCheck");
    if(m_AprshCheck==1)
    {
      if(m_AprshChecker.IsEmpty())
        throw Exception("审核员编码不能为空!");
      if(m_AprshChecker.Length()>18)
        throw Exception("审核员长度不能大于18!");
        Query->Close();
        Query->SQL->Clear();
        Query->SQL->Add("select purserCode from sdpurser where purserCheck=1 and pursercode='"+m_AprshChecker+"'");
        Query->Open();
        if(Query->RecordCount<=0)
        {
          Query->Close();
          throw Exception("审核员:"+m_AprshChecker+"未定义或没有审核权限!");
        }
        Query->Close();
      }
 */
}
//---------------------------------------------------------------------------
void __fastcall TKSAprsh::ValidAprshCheckDate()  //审核日期
{
}
//---------------------------------------------------------------------------
void __fastcall TKSAprsh::ValidAprshDesc()  //备注
{
}

//---------------------------------------------------------------------------
void __fastcall TKSAprsh::ValidAprshSysDate()  //系统日期
{
}

//---------------------------------------------------------------------------
void __fastcall TKSAprsh::ValidItemValues()
{
      ValidAprsdCode();
      ValidAprsdLine();
      ValidAprsdCavCode();
      ValidAprsdCavLine();
      ValidAprsdConv();
      ValidAprsdRAmt();
      ValidAprsdCAmt();
      ValidAprsdDesc();
}
//---------------------------------------------------------------------------
void __fastcall TKSAprsh::ValidAprsdCode()
{
}

//---------------------------------------------------------------------------
void __fastcall TKSAprsh::ValidAprsdLine()
{
   int m_AprsdLine;
   m_AprsdLine=GetDetailValue("AprsdLine");
   AnsiString  m_AprsdCode;
   m_AprsdCode=GetDetailValue("AprsdCode");
    if(m_AprsdLine<=0)
      throw Exception("行号必须大于零");
}
//---------------------------------------------------------------------------
void __fastcall TKSAprsh::ValidAprsdCavCode()
{
}
//---------------------------------------------------------------------------
void __fastcall TKSAprsh::ValidAprsdCavLine()
{
}
//---------------------------------------------------------------------------
void __fastcall TKSAprsh::ValidAprsdConv()
{
  double m_AprsdConv;
   m_AprsdConv=GetDetailValue("AprsdConv");
    if(m_AprsdConv<=0)
      throw Exception("换算系数不能小于等于零!");
}

//---------------------------------------------------------------------------
void __fastcall TKSAprsh::ValidAprsdRAmt()
{
  double m_AprsdRAmt;
   m_AprsdRAmt=GetDetailValue("AprsdRAmt");
   if(m_AprsdRAmt<=0)
      throw Exception("红冲金额不能小于等于零!");
}

//---------------------------------------------------------------------------
void __fastcall TKSAprsh::ValidAprsdCAmt()
{
  double m_AprsdCAmt;
   m_AprsdCAmt=GetDetailValue("AprsdCAmt");
   if(m_AprsdCAmt<=0)
      throw Exception("核销金额不能小于等于零!");
}

//---------------------------------------------------------------------------
void __fastcall TKSAprsh::ValidAprsdDesc()
{
}
//---------------------------------------------------------------------------
void __fastcall TKSAprsh::CmdExec(AnsiString Param)
{

}
//---------------------------------------------------------------------------

⌨️ 快捷键说明

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