📄 dlgxsjz.cpp
字号:
MessageBox("已结清的销售信息","注意");
this->EndDialog(0);
}
this->m_strPhTitle="销售登记:";
this->m_strPh= "销售票号";
this->m_strId= "客户编号";
this->m_strJsfs="结算方式";
this->m_strName="客户名称";
this->m_strYsf= "应收";
this->m_strSsf= "实收";
this->m_strWsf= "未收";
this->m_strJzTitle= "本次销售结帐收款:";
this->m_strJzBz= "备注";
this->m_strJzJsr= "经手人";
this->m_strJzPh= "票号";
this->m_strJzRq= "日期";
this->m_strJzSFkfs= "收款方式";
this->m_strJzSFkJe= "收款金额";
this->m_strTablePh= "tabxsph";
this->m_strTableJz= "tabxsjz";
this->m_strPhKeyField="xs_ph";
m_strJzKeyField="sk_ph" ;
m_strsf="s";
return true;
}
bool CDlgXSJZ::InitJZ()
{
CRect rect;
CRect dlg_rect;
this->GetClientRect(&rect);
rect.top=200;
rect.left+=10;
rect.bottom=400;
rect.right-=20;
this->m_wfXsJz.Create("",WS_CHILD|WS_VISIBLE|WS_TABSTOP,rect,this,810);
m_wfXsJz.GetWindowRect(dlg_rect);
this->m_wstrSkTitle.Create(this->m_strJzTitle,WS_CHILD|WS_VISIBLE,CRect(3,3,300,20),&m_wfXsJz,821);
this->m_editBz.SetParent(&this->m_wfXsJz);m_editBz.SetCanEdit();m_editBz.Invalidate();
m_editBz.GetWindowRect(&rect);
rect.right=rect.left+60;
rect.OffsetRect(-dlg_rect.left-100,-dlg_rect.top);
m_wstrBz.Create(this->m_strJzBz,WS_CHILD|WS_VISIBLE,rect,&m_wfXsJz,811);
this->m_editPh.SetParent(&this->m_wfXsJz);m_editPh.Invalidate();m_editPh.SetWindowText(this->ChanShengPh());
m_editPh.GetWindowRect(&rect);
rect.right=rect.left+60;
rect.OffsetRect(-dlg_rect.left-100,-dlg_rect.top);
this->m_wstrPh.Create(this->m_strJzPh,WS_CHILD|WS_VISIBLE,rect,&m_wfXsJz,812);
this->m_editSkJe.SetParent(&this->m_wfXsJz);m_editSkJe.SetCanEdit();m_editSkJe.Invalidate();
m_editSkJe.GetWindowRect(&rect);
rect.right=rect.left+60;
rect.OffsetRect(-dlg_rect.left-100,-dlg_rect.top);
this->m_wstrSkJe.Create(this->m_strJzSFkJe,WS_CHILD|WS_VISIBLE,rect,&m_wfXsJz,813);
this->m_comboJsr.SetParent(&this->m_wfXsJz);m_comboJsr.Invalidate();
m_comboJsr.GetWindowRect(&rect);
rect.right=rect.left+60;
rect.OffsetRect(-dlg_rect.left-100,-dlg_rect.top);
this->m_wstrJsr.Create(this->m_strJzJsr,WS_CHILD|WS_VISIBLE,rect,&m_wfXsJz,814);
this->m_comboSkfs.SetParent(&this->m_wfXsJz);m_comboSkfs.Invalidate();
m_comboSkfs.GetWindowRect(&rect);
rect.right=rect.left+60;
rect.OffsetRect(-dlg_rect.left-100,-dlg_rect.top);
this->m_wstrSkfs.Create(m_strJzSFkfs,WS_CHILD|WS_VISIBLE,rect,&m_wfXsJz,815);
this->m_tcRq.SetParent(&this->m_wfXsJz);m_tcRq.Invalidate();
m_tcRq.GetWindowRect(&rect);
rect.right=rect.left+60;
rect.OffsetRect(-dlg_rect.left-100,-dlg_rect.top);
this->m_wstrRq.Create(this->m_strJzRq,WS_CHILD|WS_VISIBLE,rect,&m_wfXsJz,816);
CTime m_dateRq = CTime::GetCurrentTime();
this->m_tcRq.SetTime(&m_dateRq);
//init jsr;
CString sql;
sql.Format("select yg_name from tabyginfo");
if(!m_runsql.CheckSQLResult(sql))return false;
_variant_t value;
while(!m_runsql.m_recordset->adoEOF)
{
value=m_runsql.m_recordset->GetCollect("yg_name");
this->m_comboJsr.AddString((char*)(_bstr_t)value);
m_runsql.m_recordset->MoveNext();
}
//init jsfs;
sql.Format("select jsfs from tabjsfs");
this->m_runsql.RunSQL(sql);
while(!m_runsql.m_recordset->adoEOF)
{
value=m_runsql.m_recordset->GetCollect("jsfs");
this->m_comboSkfs.AddString((char*)(_bstr_t)value);
m_runsql.m_recordset->MoveNext();
}
this->m_comboSkfs.SetCurSel(0);
this->m_comboJsr.SetCurSel(0);
return true;
}
bool CDlgXSJZ::InitPH()
{
CRect dlg_rect;
CRect rect;
CString str="元";
this->GetClientRect(&rect);
rect.top+=10;
rect.left+=10;
rect.bottom=180;
rect.right-=20;
this->m_wrXsPh.Create("",WS_CHILD|WS_VISIBLE,rect,this);
this->m_wstrXsPhTitle.Create(this->m_strPhTitle,WS_CHILD|WS_VISIBLE,CRect(3,3,80,20),&m_wrXsPh,822);
m_wrXsPh.GetWindowRect(&dlg_rect);
this->m_editXsPh.SetWindowText(this->m_strdataPh);
this->m_editXsPh.SetParent(&this->m_wrXsPh);
m_editXsPh.GetWindowRect(&rect);
rect.right=rect.left+60;
rect.OffsetRect(-dlg_rect.left-80,-dlg_rect.top);
this->m_wstrXsPh.Create(this->m_strPh,WS_CHILD|WS_VISIBLE,rect,&m_wrXsPh);
this->m_editKhId.SetWindowText(this->m_strdataId);
this->m_editKhId.SetParent(&this->m_wrXsPh);
m_editKhId.GetWindowRect(&rect);
rect.right=rect.left+60;
rect.OffsetRect(-dlg_rect.left-80,-dlg_rect.top);
this->m_wstrKhId.Create(this->m_strId,WS_CHILD|WS_VISIBLE,rect,&this->m_wrXsPh,800);
this->m_editKhName.SetWindowText(this->m_strdataName);
this->m_editKhName.SetParent(&this->m_wrXsPh);
m_editKhName.GetWindowRect(&rect);
rect.right=rect.left+60;
rect.OffsetRect(-dlg_rect.left-80,-dlg_rect.top);
this->m_wstrKhName.Create(this->m_strName,WS_CHILD|WS_VISIBLE,rect,&this->m_wrXsPh,801);
this->m_editJsfs.SetWindowText(this->m_strdataJsfs);
this->m_editJsfs.SetParent(&this->m_wrXsPh);
m_editJsfs.GetWindowRect(&rect);
rect.right=rect.left+60;
rect.OffsetRect(-dlg_rect.left-80,-dlg_rect.top);
this->m_wstrJsfs.Create(this->m_strJsfs,WS_CHILD|WS_VISIBLE,rect,&this->m_wrXsPh,802);
this->m_editYs.SetWindowText(this->m_strdataYsf+str);
this->m_dYsfk=atof(m_strdataYsf);
this->m_editYs.SetParent(&this->m_wrXsPh);
m_editYs.GetWindowRect(&rect);
rect.right=rect.left+60;
rect.OffsetRect(-dlg_rect.left-80,-dlg_rect.top);
this->m_wstrYs.Create(this->m_strYsf,WS_CHILD|WS_VISIBLE,rect,&this->m_wrXsPh,803);
this->m_editSs.SetWindowText(this->m_strdataSsf+str);
this->m_dSsfk=atof(m_strdataSsf);
this->m_editSs.SetParent(&this->m_wrXsPh);
m_editSs.GetWindowRect(&rect);
rect.right=rect.left+60;
rect.OffsetRect(-dlg_rect.left-80,-dlg_rect.top);
this->m_wstrSs.Create(this->m_strSsf,WS_CHILD|WS_VISIBLE,rect,&this->m_wrXsPh,804);
this->m_dWsfk=atof(m_strdataWsf);
CString a=this->m_strdataWsf+str;
this->m_editWs.SetWindowText(a);
this->m_editSy.SetWindowText(a);
this->m_editIsJq.SetWindowText("未结清");
this->m_editWs.SetParent(&this->m_wrXsPh);
m_editWs.GetWindowRect(&rect);
rect.right=rect.left+60;
rect.OffsetRect(-dlg_rect.left-80,-dlg_rect.top);
this->m_wstrWs.Create(this->m_strWsf,WS_CHILD|WS_VISIBLE,rect,&this->m_wrXsPh,805);
return true;
}
bool CDlgXSJZ::GetXSTHINFO()
{
CDlgXSTHINFO dlg(16,XSTH);
while(dlg.ph=="")
{
if(MessageBox("请选择销售退货票号","注意",MB_YESNO)!=IDYES)
return false;
if(dlg.DoModal()!=IDOK)
return false;
}
this->SetWindowText("销售退货结账");
this->m_strdataPh= dlg.m_strdataPh;
this->m_strdataId= dlg.m_strdataId;
this->m_strdataName=dlg.m_strdataName;
this->m_strdataYsf= dlg.m_strdataYsf;
this->m_strdataSsf= dlg.m_strdataSsf;
this->m_strdataWsf= dlg.m_strdataWsf;
this->m_strdataJsfs=dlg.m_strdataJsfs;
CString jq= dlg.jq;
short is_jq=atoi(jq);
if(is_jq)
{
MessageBox("已结清的销售退货信息","注意");
this->EndDialog(0);
}
this->m_strPhTitle="销售退货登记:";
this->m_strPh= "退货票号";
this->m_strId= "客户编号";
this->m_strJsfs="结算方式";
this->m_strName="客户名称";
this->m_strYsf= "应付";
this->m_strSsf= "实付";
this->m_strWsf= "未付";
this->m_strJzTitle= "本次销售退货结帐付款:";
this->m_strJzBz= "备注";
this->m_strJzJsr= "经手人";
this->m_strJzPh= "票号";
this->m_strJzRq= "日期";
this->m_strJzSFkfs= "付款方式";
this->m_strJzSFkJe= "付款金额";
this->m_strTablePh= "tabxsthph";
this->m_strTableJz= "tabxsthjz";
this->m_strPhKeyField="xsth_ph";
m_strJzKeyField="fk_ph";
m_strsf="f";
return true;
}
bool CDlgXSJZ::GetRKINFO()
{
CDlgXSTHINFO dlg(15,RK);
while(dlg.ph=="")
{
if(MessageBox("请选择入库票号","注意",MB_YESNO)!=IDYES)
return false;
if(dlg.DoModal()!=IDOK)
return false;
}
this->m_strdataPh= dlg.m_strdataPh;
this->m_strdataId= dlg.m_strdataId;
this->m_strdataName=dlg.m_strdataName;
this->m_strdataYsf= dlg.m_strdataYsf;
this->m_strdataSsf= dlg.m_strdataSsf;
this->m_strdataWsf= dlg.m_strdataWsf;
this->m_strdataJsfs=dlg.m_strdataJsfs;
CString jq= dlg.jq;
short is_jq=atoi(jq);
if(is_jq)
{
MessageBox("已结清的入库信息","注意");
this->EndDialog(0);
}
this->SetWindowText("入库结账");
this->m_strPhTitle="入库登记:";
this->m_strPh= "入库票号";
this->m_strId= "供应商编号";
this->m_strJsfs="结算方式";
this->m_strName="供应商名称";
this->m_strYsf= "应付";
this->m_strSsf= "实付";
this->m_strWsf= "未付";
this->m_strJzTitle= "本次入库结帐付款:";
this->m_strJzBz= "备注";
this->m_strJzJsr= "经手人";
this->m_strJzPh= "票号";
this->m_strJzRq= "日期";
this->m_strJzSFkfs= "付款方式";
this->m_strJzSFkJe= "付款金额";
this->m_strTablePh= "tabrkph";
this->m_strTableJz= "tabrkjz";
this->m_strPhKeyField="rk_ph";
m_strJzKeyField="fk_ph";
m_strsf="f";
return true;
}
bool CDlgXSJZ::GetRKTHINFO()
{
CDlgXSTHINFO dlg(16,RKTH);
while(dlg.ph=="")
{
if(MessageBox("请选择入库退货票号","注意",MB_YESNO)!=IDYES)
return false;
if(dlg.DoModal()!=IDOK)
return false;
}
this->SetWindowText("入库退货结账");
this->m_strdataPh= dlg.m_strdataPh;
this->m_strdataId= dlg.m_strdataId;
this->m_strdataName=dlg.m_strdataName;
this->m_strdataYsf= dlg.m_strdataYsf;
this->m_strdataSsf= dlg.m_strdataSsf;
this->m_strdataWsf= dlg.m_strdataWsf;
this->m_strdataJsfs=dlg.m_strdataJsfs;
CString jq= dlg.jq;
short is_jq=atoi(jq);
if(is_jq)
{
MessageBox("已结清的入库退货信息","注意");
this->EndDialog(0);
}
this->m_strPhTitle="入库退货登记:";
this->m_strPh= "退货票号";
this->m_strId= "供应商编号";
this->m_strJsfs="结算方式";
this->m_strName="供应商名称";
this->m_strYsf= "应收";
this->m_strSsf= "实收";
this->m_strWsf= "未收";
this->m_strJzTitle= "本次入库退货结帐收款:";
this->m_strJzBz= "备注";
this->m_strJzJsr= "经手人";
this->m_strJzPh= "票号";
this->m_strJzRq= "日期";
this->m_strJzSFkfs= "收款方式";
this->m_strJzSFkJe= "收款金额";
this->m_strTablePh= "tabrkthph";
this->m_strTableJz= "tabrkthjz";
this->m_strPhKeyField="rkth_ph";
m_strJzKeyField="sk_ph" ;
m_strsf="s";
return true;
}
void CDlgXSJZ::SetUnChangeValue(CString str)
{
m_bSetUnChangeValue=true;
this->m_editSkJe.SetWindowText(str);
m_bSetUnChangeValue=false;
}
CDlgXSJZ::~CDlgXSJZ()
{
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -