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

📄 mpdrh.cpp

📁 科思ERP部分源码及控件
💻 CPP
字号:
//---------------------------------------------------------------------------
#include <vcl.h>
#include "mPdrh.h"
//---------------------------------------------------------------------------
#pragma hdrstop
#pragma package(smart_init)

TKSPdrh *sdPdrh;
//---------------------------------------------------------------------------
__fastcall TKSPdrh::TKSPdrh()
  :TKSMidBase()
{
}
//---------------------------------------------------------------------------
void __fastcall TKSPdrh::ValidHeadValues()
{
  //工序日报单号
      ValidPdrhCode();
  //财务月份
      ValidPdrhFmonth();
  //日期
      ValidPdrhDate();
  //备注
      ValidPdrhDesc();
  //审核
      ValidPdrhCheck();
  //审核人
      ValidPdrhChecker();
  //审核日期
      ValidPdrhCheckDate();
  //操作员
      ValidPdrhUser();
  //系统日期
      ValidPdrhSysDate();
}
//---------------------------------------------------------------------------
void __fastcall TKSPdrh::ValidPdrhCode()  //工序日报单号
{

}
//---------------------------------------------------------------------------
void __fastcall TKSPdrh::ValidPdrhFmonth()  //财务月份
{
    AnsiString  m_PdrhFmonth;
    AnsiString  b_PdrhFmonth;
    m_PdrhFmonth=GetMasterValue("PdrhFmonth");
    b_PdrhFmonth=GetMasterOldValue("PdrhFmonth");

    if(m_PdrhFmonth!=b_PdrhFmonth)
    {
      Query->Close();
      Query->SQL->Clear();
      Query->SQL->Add("select FcMonth from sdFc where FcCurrent=1");
      Query->Open();
      if(Query->RecordCount<=0)
      {
        Query->Close();
        throw Exception("未定义当前财务月份!");
      }
      AnsiString tFcstr=Query->FieldValues["FcMonth"];
      if(m_PdrhFmonth<tFcstr)
      {
        Query->Close();
        throw Exception("财务月份不能小于当前月份!");
      }
      Query->Close();
    }
}
//---------------------------------------------------------------------------
void __fastcall TKSPdrh::ValidPdrhDate()  //日期
{

}
//---------------------------------------------------------------------------
void __fastcall TKSPdrh::ValidPdrhDesc()  //备注
{

}
//---------------------------------------------------------------------------
void __fastcall TKSPdrh::ValidPdrhCheck()  //审核
{
    int m_PdrhCheck;
    m_PdrhCheck=GetMasterValue("PdrhCheck");
    if(m_PdrhCheck!=0 && m_PdrhCheck!=1)
       throw Exception("审核标志只能取值为(0-未审核,1-已审核.)");
}
//---------------------------------------------------------------------------
void __fastcall TKSPdrh::ValidPdrhChecker()  //审核人
{
    int m_PdrhCheck;
    AnsiString  m_PdrhChecker;
    AnsiString  b_PdrhChecker;
    m_PdrhCheck=GetMasterValue("PdrhCheck");
    m_PdrhChecker=GetMasterValue("PdrhChecker");
    b_PdrhChecker=GetMasterOldValue("PdrhChecker");
    if(m_PdrhCheck==1)
    {
      if(m_PdrhChecker!=b_PdrhChecker)
      {
        Query->Close();
        Query->SQL->Clear();
        Query->SQL->Add("select productercode from sdproducter where productercode='"+m_PdrhChecker+"' and productercheck = 1");
        Query->Open();
        if(Query->RecordCount<=0)
        {
          Query->Close();
          throw Exception("审核人:'"+m_PdrhChecker+"'未定义或没有审核权限!");
        }
        Query->Close();
      }
    }
}
//---------------------------------------------------------------------------
void __fastcall TKSPdrh::ValidPdrhCheckDate()  //审核日期
{
}
//---------------------------------------------------------------------------
void __fastcall TKSPdrh::ValidPdrhUser()  //操作员
{

}
//---------------------------------------------------------------------------
void __fastcall TKSPdrh::ValidPdrhSysDate()  //系统日期
{
}
//---------------------------------------------------------------------------
void __fastcall TKSPdrh::ValidItemValues()
{
      ValidPdrdCode();
      ValidPdrdLine();
      ValidPdrdWo();
      ValidPdrdProcess();
      ValidPdrdGoods();
      ValidPdrdCQty();
      ValidPdrdEQty();
      ValidPdrdWQty();
      ValidPdrdRQty();
      ValidPdrdSQty();
      ValidPdrdFwt();
      ValidPdrdRwt();
      ValidPdrdDwt();
      ValidPdrdWwt();
      ValidPdrdSwt();
      ValidPdrdOwt();
      ValidPdrdDesc();
      ValidPdrdPsr();
}
//---------------------------------------------------------------------------
void __fastcall TKSPdrh::ValidPdrdCode()
{

}
//---------------------------------------------------------------------------
void __fastcall TKSPdrh::ValidPdrdLine()
{
    int m_PdrdLine;
    m_PdrdLine=GetDetailValue("PdrdLine");
    if(m_PdrdLine<=0)
       throw Exception("工序日报单的行号不能小于等于零!");
}
//---------------------------------------------------------------------------
void __fastcall TKSPdrh::ValidPdrdWo()
{
    AnsiString  m_PdrdWo;
    AnsiString  b_PdrdWo;
    m_PdrdWo=GetDetailValue("PdrdWo");
    b_PdrdWo=GetDetailOldValue("PdrdWo");

    if(m_PdrdWo.UpperCase()!=b_PdrdWo.UpperCase())
    {
       Query->Close();
       Query->SQL->Clear();
       Query->SQL->Add("select WoCode,WoGoods from sdWo where WoCheck=1 and WoCancel=0 and WoClose=0 and WoCode ='"+m_PdrdWo+"'");
       Query->Open();
       if(Query->RecordCount <= 0)
       {
          Query->Close();
          throw Exception("加工单:'"+m_PdrdWo+"'不存在,或已结清,或已作废,或未审核!");
       }
       Query->Close();
    }
}
//---------------------------------------------------------------------------
void __fastcall TKSPdrh::ValidPdrdProcess()
{

}
//---------------------------------------------------------------------------
void __fastcall TKSPdrh::ValidPdrdGoods()
{
}
//---------------------------------------------------------------------------
void __fastcall TKSPdrh::ValidPdrdCQty()
{
    double m_PdrdCQty;
    m_PdrdCQty=GetDetailValue("PdrdCQty");
    if(m_PdrdCQty<=0)
       throw Exception("完工数量必须大于零!");
}
//---------------------------------------------------------------------------
void __fastcall TKSPdrh::ValidPdrdEQty()
{
    double m_PdrdEQty;
    double m_PdrdCQty;
    m_PdrdCQty=GetDetailValue("PdrdCQty");
    m_PdrdEQty=GetDetailValue("PdrdEQty");
    if(m_PdrdEQty<0)
       throw Exception("合格数量不能小于零!");
    if(m_PdrdEQty>m_PdrdCQty)
       throw Exception("合格数量不能大于完工数量!");
}
//---------------------------------------------------------------------------
void __fastcall TKSPdrh::ValidPdrdWQty()
{
    double m_PdrdWQty;
    double m_PdrdCQty;
    m_PdrdCQty=GetDetailValue("PdrdCQty");
    m_PdrdWQty=GetDetailValue("PdrdWQty");
    if(m_PdrdWQty<0)
       throw Exception("废品数量不能小于零!");
    if(m_PdrdWQty>m_PdrdCQty)
       throw Exception("废品数量不能大于完工数量!");
}
//---------------------------------------------------------------------------
void __fastcall TKSPdrh::ValidPdrdRQty()
{
    double m_PdrdRQty;
    double m_PdrdCQty;
    m_PdrdCQty=GetDetailValue("PdrdCQty");
    m_PdrdRQty=GetDetailValue("PdrdRQty");
    if(m_PdrdRQty<0)
       throw Exception("返修数量不能小于零!");
    if(m_PdrdRQty>m_PdrdCQty)
       throw Exception("返修数量不能大于完工数量!");
}
//---------------------------------------------------------------------------
void __fastcall TKSPdrh::ValidPdrdSQty()
{
    double m_PdrdSQty;
    double m_PdrdCQty;
    m_PdrdCQty=GetDetailValue("PdrdCQty");
    m_PdrdSQty=GetDetailValue("PdrdSQty");
    if(m_PdrdSQty<0)
       throw Exception("次品数量不能小于零!");
    if(m_PdrdSQty>m_PdrdCQty)
       throw Exception("次品数量不能大于完工数量!");
}
//---------------------------------------------------------------------------
void __fastcall TKSPdrh::ValidPdrdFwt()
{
    double m_PdrdFwt;
    m_PdrdFwt=GetDetailValue("PdrdFwt");
    if(m_PdrdFwt<=0)
       throw Exception("实用工时必须大于零!");
}
//---------------------------------------------------------------------------
void __fastcall TKSPdrh::ValidPdrdRwt()
{
    double m_PdrdRwt;
    m_PdrdRwt=GetDetailValue("PdrdRwt");
    if(m_PdrdRwt<0)
      throw Exception("返修工时不能小于零!");
}
//---------------------------------------------------------------------------
void __fastcall TKSPdrh::ValidPdrdDwt()
{
    double m_PdrdDwt;
    m_PdrdDwt=GetDetailValue("PdrdDwt");
    if(m_PdrdDwt<0)
      throw Exception("停工工时不能小于零!");
}
//---------------------------------------------------------------------------
void __fastcall TKSPdrh::ValidPdrdWwt()
{
    double m_PdrdWwt;
    m_PdrdWwt=GetDetailValue("PdrdWwt");
    if(m_PdrdWwt<0)
      throw Exception("废品工时不能小于零!");
}
//---------------------------------------------------------------------------
void __fastcall TKSPdrh::ValidPdrdSwt()
{
    double m_PdrdSwt;
    m_PdrdSwt=GetDetailValue("PdrdSwt");
    if(m_PdrdSwt<0)
      throw Exception("次品工时不能小于零!");
}
//---------------------------------------------------------------------------
void __fastcall TKSPdrh::ValidPdrdOwt()
{
    double m_PdrdOwt;
    m_PdrdOwt=GetDetailValue("PdrdOwt");
    if(m_PdrdOwt<0)
      throw Exception("加班工时不能小于零!");
}
//---------------------------------------------------------------------------
void __fastcall TKSPdrh::ValidPdrdDesc()
{

}
//---------------------------------------------------------------------------
void __fastcall TKSPdrh::ValidPdrdPsr()
{

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

⌨️ 快捷键说明

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