UINT8 CProductSaleWin::DeptSaleProc(UINT32 deptNo)
{
	UINT8 ret;
	DBG_PRINT(("进入CProductSaleWin::DeptSaleProc函数"));
	DBG_PRINT(("deptNo == %u", deptNo));
	ret = pSaleData->DeptSale(deptNo, "");
	
	if ((m_IfCancel)&&(ret == NO_SUCH_GOODS))//按商品取消键后,未在发票明细中找到该商品
	{
		ErrMsgBox(ret);
		pSaleData->NoCancelGoods();
		m_IfCancel = false;
		m_strSuffix = "";
		DeptSaleShow();
		ChangeTitle();
		ReFresh();
		return SUCCESS;
	}
	if (ret != SUCCEED) 
	{
		m_strSuffix = "";
	   return(ErrMsgBox(ret));
	}
	//添加实现内容调整的函数 
	DeptSaleShow();
	ChangeTitle();
	ReFresh();
	//切换到商品销售界面
	ChangeWin(PRODUCT_SALE_WIN);
	DBG_PRINT(("退出CProductSaleWin::DeptSaleProc函数"));
	return SUCCESS;
}
예제 #2
0
int CaInput::SetContentBuf(unsigned char *pData, int iLen)
{
	DBG_ASSERT_EXIT((pData != NULL ),("pData is NULL"));
	//DBG_ASSERT_EXIT((iLen > 0),("iLen=%d  is error!",iLen));
	if (iLen == 0)
	{
		Clear();
		ReFresh();
		return 0;
	}
	Clear();
	m_iConLen=iLen >MAX_BUF_LEN ? MAX_BUF_LEN:iLen;
	m_iScrLen=iLen > (m_iScrMaxLen - 1) ? (m_iScrMaxLen - 1) : iLen;

	if (is_gb_ex(pData, iLen - m_iScrLen) == 2)
	{
		m_iScrLen--;
	}

	if (!m_bReadOnly)//��ֻ���Ĺ�������
	{
		m_iCurScrPos=m_iScrLen;
		m_iCurConPos=m_iConLen;
	}
	else
	{
		m_iCurScrPos = 0;
		m_iCurConPos = 0;
	}
	memcpy(m_contentBuf,pData,m_iConLen);
	if(m_InputType == aPASSWORD)
	{
		memset(m_dispBuf,PASSWORD_CHAR,m_iScrLen);
	}
	else
	{
		if (!m_bReadOnly)
		{
			memcpy(m_dispBuf,pData + m_iConLen - m_iScrLen,m_iScrLen);
		}
		else
		{
			memcpy(m_dispBuf,pData,m_iScrLen);
		}
	}
	ReFresh();
	return m_iConLen;
}
UINT8 CProductSaleWin::ClientCodeInputProc(void)
{
	char *content;
	UINT8 ret;
	char *blank = "";
	INT8 chValue[128];
	memset((void*)chValue, 0, sizeof(chValue));
	string srrErr("");

	content = (char*)(m_pInput2->m_contentBuf);
	
		ret = pSaleData->ClientCodeInput(content,srrErr);
	
	m_pInput2->Clear();
	if (ret != SUCCESS) 
	{
		CaMsgBox::ShowMsg(srrErr);
		return FAILURE;
	}
	
	ClientCodeShow();
	ChangeTitle();
	ReFresh();
	strcpy(title_arr[1], blank);
	strcpy(title_arr[2], blank);
	strcpy(title_arr[3], blank);
	ChangeTitle();
	return SUCCESS;
}
예제 #4
0
void CErrInvUpWin::DoActive()
{
	DBG_PRINT((" CErrInvUpWin::DoActive()!"));
	m_pageIndex = 1;
	string StrErr = "";
	INT32 ret;
	ret = g_pAPIBase->InvUpFailInfo_API(*g_YwXmlArg, m_InvUpFailInfo, m_pageNum, StrErr);//获得未导入的发票卷数
 	DBG_PRINT((" m_pageNum = %u!", m_pageNum));
	if (SUCCESS != ret)
 	{
		m_pageIndex = 1;
		m_pageNum = 0;
		CaMsgBox::ShowMsg(StrErr);
		ChangeWin(FISCAL_MAIN_MENU);
	}
	else
	{
		if(m_pageNum <= 0)
		{
			CaMsgBox::ShowMsg("无上传日志信息");
			ChangeWin(FISCAL_MAIN_MENU);
			return;
		}
		QueryShow(m_InvUpFailInfo, m_pageIndex);//组织屏幕显示信息
		ChangeTitle();
		ReFresh();	
	}	
}
예제 #5
0
int CInvStubPrnWin::ProcEvent(int iEvent,unsigned char *pEventData, int iDataLen)
{
    UINT8 ret = 0;
	UINT32 ii;
	char *content;

	switch(iEvent)
	{	   
	case RETURN_MAIN_MENU:  //return to INPUTWIN
		 ChangeWin(INV_STUB_WIN);			
		 return SUCCESS;
	 	 break;

	case PAGEUP_KEY:
		 DBG_PRINT(("PAGEUP_KEY"));
		 if ((m_pageIndex-1)<1)
		 {
			 return FAILURE;
		 }
		 m_pageIndex--;
		 QueryShow(m_pInvHead, m_pInvHead->m_fphm, m_pageIndex, m_pageNum, 1);
		 ChangeTitle();
	     ReFresh();	
		 DBG_PRINT(("PAGEUP_KEY"));
		 return SUCCESS;
		 break;

	case PAGEDOWN_KEY:
		 if ((m_pageIndex+1)>m_pageNum)
		 {
			 return FAILURE;
		 }
		 m_pageIndex++;
		 QueryShow(m_pInvHead, m_pInvHead->m_fphm, m_pageIndex, m_pageNum, 0);
		 ChangeTitle();
	     ReFresh();	
		 DBG_PRINT(("PAGEDOWN_KEY"));
		 return SUCCESS;
		 break;

	default: 
			break;
	}  

	return CaWindow::ProcEvent(iEvent,pEventData,iDataLen);
}
예제 #6
0
int CErrInvUpWin::ProcEvent(int iEvent,unsigned char *pEventData, int iDataLen)
{
    UINT8 ret = 0;
	UINT32 ii;
	char *content;

	switch(iEvent)
	{	   
	case RETURN_MAIN_MENU:  //return to SYSTEMMENU
			 ChangeWin(FISCAL_MAIN_MENU);			
	
		 return SUCCESS;
	 	 break;

	case PAGEUP_KEY:

		 DBG_PRINT(("PAGEUP_KEY"));
		 if ((m_pageIndex-1)<1)
		 {
			 return FAILURE;
		 }
		 m_pageIndex--;
		 QueryShow(m_InvUpFailInfo, m_pageIndex);
		 ChangeTitle();
	     ReFresh();	
		 DBG_PRINT(("PAGEUP_KEY"));
		 return SUCCESS;
		 break;

	case PAGEDOWN_KEY:
		 if ((m_pageIndex+1)>m_pageNum)
		 {
			 return FAILURE;
		 }
		 m_pageIndex++;
		 QueryShow(m_InvUpFailInfo, m_pageIndex);
		 ChangeTitle();
	     ReFresh();	
		 return SUCCESS;
		 break;

	default: break;		
	}
 	  
	return CaWindow::ProcEvent(iEvent,pEventData,iDataLen);
}
int CMonthSaleShowWIn::ProcEvent(int iEvent,unsigned char *pEventData, int iDataLen)
{
    UINT8 ret = 0;
	UINT32 ii;
	char *content;

	switch(iEvent)
	{	   
	case RETURN_MAIN_MENU:  //return to SYSTEMMENU
		ChangeWin(MONTH_SALE_SUM_WIN);			
		 return SUCCESS;
	 	 break;

	case PAGEUP_KEY:

		 DBG_PRINT(("PAGEUP_KEY"));
		 if ((m_pageIndex-1)<1)
		 {
			 return FAILURE;
		 }
		 m_pageIndex--;
		 QueryShow(m_ptrTjxxhz, m_pageIndex);
		 ChangeTitle();
	     ReFresh();	
		 DBG_PRINT(("PAGEUP_KEY"));
		 return SUCCESS;
		 break;

	case PAGEDOWN_KEY:
		 if ((m_pageIndex+1)>m_pageNum)
		 {
			 return FAILURE;
		 }
		 m_pageIndex++;
		 QueryShow(m_ptrTjxxhz, m_pageIndex);
		 ChangeTitle();
	     ReFresh();	
		 return SUCCESS;
		 break;

	default: break;		
	}
 	  
	return CaWindow::ProcEvent(iEvent,pEventData,iDataLen);
}
예제 #8
0
void CChangeDiskPswWin::DoActive()
{
	m_pInput1->Clear();//清除Input里的内容
	m_pInput2->Clear();
	m_pInput3->Clear();
	
	m_OldPsw = "";
	m_NewPsw = "";
	
	ReFresh();	
}
예제 #9
0
void CHqlxsjWin::DoActive()
{
	DBG_PRINT(("CHqlxsjWin::DoActive()"));
	
	ReFresh();
	CaProgressBar proBar("获取离线数据中...");
	proBar.Show();
	INT32 ret = GetOffLineDate();
 	if (SUCCESS != ret)
 	{
		Reset();
		CaMsgBox::ShowMsg("获取离线数据失败");
		ReFresh();
		SetBtnFocus();
		return;
	}
	NormalShow();
	SetBtnFocus();
	ReFresh();
}
void CMonthSaleShowWIn::DoActive()
{
	DBG_PRINT((" CMonthSaleShowWIn::DoActive()!"));
	m_ptrTjxxhz = ((CMonthSaleSumWIn *)m_pFrame->GetWin(MONTH_SALE_SUM_WIN))->m_pTjxxhz;
	m_iStartDate = m_ptrTjxxhz->m_Qsrq;//中间件返回的起始日期
	m_iEndDate = m_ptrTjxxhz->m_Jzrq;  //中间件返回的截止日期

	m_pageIndex = 1;
	m_pageNum = 2;
	QueryShow(m_ptrTjxxhz, m_pageIndex);//组织屏幕显示信息
	ChangeTitle();
	ReFresh();	
}
예제 #11
0
void CInvStubPrnWin::DoActive()
{
	DBG_PRINT(("进入CInvStubPrnWin::DoActive函数!"));
	
	m_pPSWin = (CInvStubWin*)m_pFrame->GetWin(INV_STUB_WIN);
	m_code = m_pPSWin->m_code;
	m_invStartNo = m_pPSWin->m_invStartNo;
    m_invEndNo = m_pPSWin->m_invEndNo;
	
	m_pageIndex = 1;
	INVM_GetInvNum(m_code, m_invStartNo, m_invEndNo, m_pageNum);//获得发票数
	QueryShow(m_pInvHead, 0, m_pageIndex, m_pageNum, 0);//组织屏幕显示信息
	ChangeTitle();
	ReFresh();	
	DBG_PRINT(("退出CInvStubPrnWin::DoActive函数!"));
}
void CInvRetServerWin::DoActive()
{
    DBG_PRINT((" CInvRetServerWin::DoActive()!"));

    m_sInvNo = 0;
    m_eInvNo = 0;
    m_strSno = "";
    m_strEno = "";
    m_strCode = "";
    m_invVol.ResetVol();
    m_pInput1->Clear();//清除Input里的内容
    m_pInput2->Clear();//清除Input里的内容
    m_pInput3->Clear();//清除Input里的内容
    m_pInput1->SetContentBuf((UINT8*)g_globalArg->m_curInvVol->m_code.c_str(), g_globalArg->m_curInvVol->m_code.length());

    ReFresh();
}
예제 #13
0
void CMachineInfoWin::DoActive()
{
	DBG_PRINT(("CMachineInfoWin::DoActive()"));

	char title[OBJ_TITLE_MAX_LEN + 1];
   
	sprintf(title, "机器编号: %s", g_globalArg->m_machine->m_machineNo.c_str());
	m_pLabel1->SetTitle(title,strlen(title));	
	sprintf(title, "生产日期: %s", g_globalArg->m_machine->m_pDate.c_str());
	m_pLabel2->SetTitle(title,strlen(title));	
	sprintf(title, "软件版本: %s", g_globalArg->m_machine->m_sVer.c_str());
	m_pLabel3->SetTitle(title,strlen(title));	
	sprintf(title, "硬件版本: %s", g_globalArg->m_machine->m_hVer.c_str());
	m_pLabel4->SetTitle(title,strlen(title));	

	ReFresh();
}
예제 #14
0
int  CaGroup::SetFocus(void)
{
	ReFresh();
	if(m_pCurObj != NULL )
	{
			m_pCurObj->SetFocus();
	}
	else
	{
		CaObject *obj=NextFocusObj(NULL);
		if(obj != NULL )
		{
			m_pCurObj=obj;
			m_pCurObj->SetFocus();
		}
	}
	return 1;
}
UINT8 CProductSaleWin::ClientInputProc(void)
{
	char *content;
	UINT8 ret;
	char *blank = "";
	INT8 chValue[128];
	memset((void*)chValue, 0, sizeof(chValue));

	content = (char*)(m_pInput2->m_contentBuf);
	if ('.' == *content) 
	{
		CClient client;
		sprintf(chValue, "where KH_BH = '%s'", (content+1));
		client.m_filter = chValue;
		client.Requery();
		if(client.LoadOneRecord()!= SQLITE_OK)
		{
			CaMsgBox::ShowMsg("没有对应的付款人");
			return FAILURE;
		}
		ret = pSaleData->ClientNameInput(client.m_khmc.c_str(),client.m_khsh.c_str());		
	}
	else
	{
		ret = pSaleData->ClientNameInput(content);
	}
	
	m_pInput2->Clear();
	if (ret != SUCCESS) 
	{
	   return(ErrMsgBox(ret));
	}
	ClientShow();
	ChangeTitle();
	ReFresh();
	strcpy(title_arr[1], blank);
	strcpy(title_arr[2], blank);
	strcpy(title_arr[3], blank);
	ChangeTitle();
	return SUCCESS;
}
예제 #16
0
void CInvWasteWin::DoActive()
{
	DBG_PRINT(("进入CInvWasteWin::DoActive函数"));
	INT32 nCurrentInvNo = g_globalArg->m_curInvVol->m_ieno + 1 - g_globalArg->m_curInvVol->m_remain;
	DBG_PRINT(("nCurrentInvNo = %u",nCurrentInvNo));
	
	string strErr;
	UINT8 ret =SUCCESS;
	UINT8 uFlag=0;
	if (0 == g_globalArg->m_curInvVol->m_curInvNo) //避免反复读盘
	{
		BAR_DEF();
		BAR_SHOW("获取作废发票号码中...");
       ret = SALE_GetCurInv(g_globalArg->m_curInvVol,strErr);
 		if (ret ==FAILURE)
 		{
 			uFlag=1;
			if (strErr.length()>OBJ_TITLE_MAX_LEN)
			{
				strErr = strErr.substr(0,OBJ_TITLE_MAX_LEN);
			}
			sprintf(title_array[1], strErr.c_str()); //错误
			sprintf(title_array[2], "作废发票代码: 空");
			sprintf(title_array[3], "作废发票号码: 空");	
 		} 
		
	}

	if (0 ==uFlag)
	{
		sprintf(title_array[1], "");
		sprintf(title_array[2], "作废发票代码:%s ", g_globalArg->m_curInvVol->m_code.c_str());
		sprintf(title_array[3], "作废发票号码:%08u", g_globalArg->m_curInvVol->m_curInvNo);	
	}

	
	ChangeTitle();
	m_pBtn1->SetFocus();
	ReFresh();
	DBG_PRINT(("退出CInvWasteWin::DoActive函数"));
}
UINT8 CProductSaleWin::RemarksInputProc(void)
{
	char *content;
	UINT8 ret;
	char *blank = "";
	INT8 chValue[128];
	memset((void*)chValue, 0, sizeof(chValue));
	string srrErr("");

	content = (char*)(m_pInput2->m_contentBuf);
//	if ('.' == *content) 
//	{
//		CClient client;
//		sprintf(chValue, "where ID = '%s'", (content+1));
//		client.m_filter = chValue;
//		client.Requery();
//		if(client.LoadOneRecord()!= SQLITE_OK)
//		{
//			CaMsgBox::ShowMsg("没有对应的付款人");
//			return FAILURE;
//		}
//		ret = pSaleData->ClientNameInput(client.m_khmc.c_str());		
//	}
//	else
//	{
		ret = pSaleData->RemarksInput(content,srrErr);
//	}
	
	if (ret != SUCCESS) 
	{
		CaMsgBox::ShowMsg(srrErr);
		return FAILURE;
	}
	m_pInput2->Clear();
//	ClientShow();
//	ChangeTitle();
	ReFresh();
	return SUCCESS;
}
UINT8 CProductSaleWin::PlusProc(void)
{
	UINT8 ret;
	double ii;
	char *content;
	INT32 dotNum = 0;//小数位数
	
	content = (char*)(m_pInput2->m_contentBuf);
	ret=is_Money(content);
	if (ret != SUCCESS)
	{
		return(ErrMsgBox(ret));
	}
	ii = atof(content);
    DBG_PRINT(("ii= %lf",ii));
	if(((UINT64)double2int(ii*GOODS_NUM_EXTENSION)) >= MAX_MONEY)
	{
		return (ErrMsgBox(ILLEGAL_AMOUNT));
	}	
	dotNum = CheckFloatBit(ii);
	DBG_PRINT(("dotNum= %d",dotNum));
	if (dotNum>3) 
	{
		DBG_PRINT(("--------ii = %f--------", ii));
		DBG_PRINT(("--------dotNum = %d--------", dotNum));
		CaMsgBox::ShowMsg("小数位数不超过三位");
		return FAILURE;
	}	
	m_pInput2->Clear();
	ret = pSaleData->Plus(ii);
	if (ret != SUCCESS) 
	{
	   return(ErrMsgBox(ret));
	}
	ReFresh();
	return SUCCESS;
}
UINT8 CProductSaleWin::GoodesReductProc(void)
{
	char *content;
	double reductMoney;
	UINT8 ret;

	if(m_pInput2->IsEmpty())
	{
		CaMsgBox::ShowMsg("未输入折让金额");
		return FAILURE;
	}
	content = (char*)(m_pInput2->m_contentBuf);
	reductMoney = atof(content);
	m_pInput2->Clear();
	ret = pSaleData->GoodsReduct(reductMoney);
	if (ret != SUCCESS) 
	{
	   return(ErrMsgBox(ret));
	}
	DeptSaleShow();
	ChangeTitle();
	ReFresh();
	return SUCCESS;	
}
//---------------------------------------------------------------------------------
//处理事件
//---------------------------------------------------------------------------------
int CProductSaleWin::ProcEvent(int iEvent,unsigned char *pEventData, int iDataLen)
{
	UINT8 ret;
	double ii;
	char *content;
	string code = "";
	UINT32 deptNo;
	UINT8 IfInvSum = 0;
	INT32 dotNum = 0;
	INT32 nWin;
	INT32 nLen  = 0;
	UINT8 nIndex = 0;
	string strErr("");

	switch(iEvent) 
	{
	case ENTER_KEY:
		m_strSuffix = "";

		//判断装入纸质发票	
		if (isPaper() != 0)
		{
			DBG_PRINT(("没有纸质发票"));
			return(ErrMsgBox(NO_PAPER));
		}
		content = (char*)(m_pInput2->m_contentBuf);
		ii = atof(content);
		m_pInput2->Clear();
		ret = CashShow(ii);
		if (ret != SUCCEED) 
		{
			return(ErrMsgBox(ret));
		}	
		ChangeTitle();
		ReFresh();
		
		if (m_IfCancel)		//之前按了商品取消键
		{
			pSaleData->NoCancelGoods();
			m_IfCancel = false;
			m_strSuffix = "";
		}
		DBG_PRINT(("*****工作模式******:%u", g_globalArg->pSaveTemplateInfo->workMode));
 		ret = pSaleData->PayByCash(IfInvSum);
		DBG_PRINT(("IfInvSum == %u", IfInvSum));
		if ((ret == NO_GOODS)||(ret == DB_FULL))
		{
			ErrMsgBox(ret);
			ChangeWin(PRODUCT_SALE_MAIN_MENU); //返回销售档主界面
			return SUCCESS;
		}

		if (ret != SUCCEED) 
		{
			ErrMsgBox(ret);
			switch(ret) 
			{
				case GET_FISCAL_CODE_ERROR://取税控码失败
					break;
				case UPDATE_INV_VOL_ERROR://写数据库失败
					break;
				case DB_SAVE_ERROR://写数据库失败
					break;
				case MALLOC_MEM_ERROR:
					break;
				case INV_SUM_ERROR:
					break;
				case MUST_RE_LOGIN:
					break;
				case HAVE_ROLLED:
					break;
				case NM_EXCEED_MIN:   //发票金额超下限,退回到部类销售显示,等待再次结帐
				case NO_PAPER: //没纸,退回到部类销售显示,等待再次结帐
					DeptSaleShow();
					ChangeTitle();
					ReFresh();
					return FAILURE;
					break;
				case INV_LIB_ERR:
					break;
				case GX_SV_NUM_EXCEED:
					break;
				case GX_SV_TIME_EXCEED:
					break;
				case GX_SV_SUM_EXCEED: 
					break;
				default:
					return FAILURE;//留在商品销售界面
			}
		}
		else
		{
			DBG_PRINT(("启动开钱箱"));
			MoneyBox_Open();
		}

		if (pSaleData->m_returnOther == 1)
		{
			pSaleData->m_returnOther = 0;
//			ScannerRelease();//停止扫描枪扫描
//			g_winNo = 3;//对应INV_MANAGE_MENU界面
			nWin = INV_MANAGE_MENU;
		}
		else
		{
//			g_winNo = 2;//对应INV_MANAGE_MENU界面
			nWin = PRODUCT_SALE_MAIN_MENU;
		}
// 		if (1==IfInvSum) 
// 		{
// 			InvSumShowPrn();//显示卷汇总并打印
// 		}
// 		else
// 		{
			ChangeWin(nWin); //返回销售档主界面
//		}

		return SUCCESS;
		break;

    case DISCOUNT_KEY:

		if ((pSaleData->m_tmpGoodsNum>=(MAX_GOODS_LINE-1))&&(!m_IfCancel)) 
		{
			CaMsgBox::ShowMsg("商品行数超限");
			return FAILURE;
		}
		content = (char*)(m_pInput2->m_contentBuf);
		if (strlen(content)==0)
		{
			CaMsgBox::ShowMsg("请先输入折扣率");
			return SUCCESS;
		}
		ret =is_Figure(content);
		if (ret != SUCCESS)
		{
			return(ErrMsgBox(INPUT_FIGURE_ERROR));
	}
		ii = atof(content);
		ii = (INT32)ii;//向零取整
		m_pInput2->Clear();
		ret = pSaleData->Discount(ii);
		if (ret != SUCCESS) 
		{
		   return(ErrMsgBox(ret));
		}
		ReFresh();
// 		CaMsgBox::ShowMsg("暂不支持此功能");
// 		return SUCCESS;
		break;

	case PRICE_INPUT:
		return(PriceInputProc());
		break;

	case SUM_INPUT:
		return(SumInputProc());
		break;

	case CLIENT_NAME_INPUT:
		return(ClientInputProc());
		break;

	case FIND_KEY:
		return(ClientCodeInputProc());
		break;

	case HELP_KEY:
		return(RemarksInputProc());
		break;

	case CANCEL_GOODS:
		
		if (m_IfCancel)//之前按了商品取消键
		{
			pSaleData->NoCancelGoods();
			m_IfCancel = false;
			m_strSuffix = "";
			DeptSaleShow();
		}
		else
		{
			if (pSaleData->m_tmpGoodsNum==0)//无商品可取消
			{
				ErrMsgBox(NO_GOODS_CANCEL);	
				ChangeWin(PRODUCT_SALE_MAIN_MENU);
				return SUCCESS;
			}
			pSaleData->CancelGoods();
			m_IfCancel = true;
			m_strSuffix = "<消>";
			CancelGoodsShow();
		}		
		ChangeTitle();
	    ReFresh();
		return SUCCESS;
		break;

	case PLUS_KEY:
		return(PlusProc());
		break;

	case TOTAL_CANCEL:
		if (m_IfCancel)//之前按了商品取消键
		{
			pSaleData->NoCancelGoods();
			m_IfCancel = false;
			m_strSuffix = "";
		}
		return(TotalCancelProc());
		break;

	case PLU_KEY:
		if ((pSaleData->m_tmpGoodsNum>=MAX_GOODS_LINE)&&(!m_IfCancel)) 
		{
			CaMsgBox::ShowMsg("商品行数超限");
			return FAILURE;
		}
		content = (char*)(m_pInput2->m_contentBuf);
		code = "";
        nLen = GOODS_CODE_LEN - strlen(content);
		if (nLen > 0)//不足13位,则前补零到13位
		{
			while(nLen > 0)
			{
				code += "0";
				nLen--;
			}
		}		
		code += content;
		ret = pSaleData->DeptSale(0, code);
		m_pInput2->Clear();
		if (m_IfCancel&&(ret == NO_SUCH_GOODS))//按商品取消键后,未在发票明细中找到该商品
		{
			ErrMsgBox(ret);
			pSaleData->NoCancelGoods();
			m_IfCancel = false;
			m_strSuffix = "";
			DeptSaleShow();
			ChangeTitle();
			ReFresh();
			return SUCCESS;
		}
		if (ret != SUCCEED) 
	   {
			m_strSuffix = "";
		   return(ErrMsgBox(ret));
	   }
	   //添加实现内容调整的函数 
	   DeptSaleShow();
	   ChangeTitle();
	   ReFresh();	
	   //切换到商品销售界面
	   ChangeWin(PRODUCT_SALE_WIN);
	   return SUCCESS;
		break;
	
	case SHIFT_PLU_KEY: //临时输入商品名称
		if ((pSaleData->m_tmpGoodsNum>=MAX_GOODS_LINE)&&(!m_IfCancel)) 
		{
			CaMsgBox::ShowMsg("商品行数超限");
			return FAILURE;
		}
		content = (char*)(m_pInput2->m_contentBuf);
		ret = pSaleData->PLUSale(content, strErr);			
		if (m_IfCancel&&(ret == NO_SUCH_GOODS))//按商品取消键后,未在发票明细中找到该商品
		{
			ErrMsgBox(ret);
			pSaleData->NoCancelGoods();
			m_IfCancel = false;
			m_strSuffix = "";
			DeptSaleShow();
			ChangeTitle();
			ReFresh();
			return SUCCESS;
		}
		if (ret != SUCCEED) 
		{
			m_strSuffix = "";
			if (FAILURE == ret) 
			{
				CaMsgBox::ShowMsg(strErr);
				strErr = "";
			}
			else
			{
				ErrMsgBox(ret);
			}		
			return FAILURE;
		}
		m_pInput2->Clear();
	   //添加实现内容调整的函数 
	   DeptSaleShow();
	   ChangeTitle();
	   ReFresh();	
	   //切换到商品销售界面
	   ChangeWin(PRODUCT_SALE_WIN);
	   return SUCCESS;
		break;
	
// 	case SCANNER_EVENT_KEY:
// 		if ((pSaleData->m_tmpGoodsNum>=MAX_GOODS_LINE)&&(!m_IfCancel)) 
// 		{
// 			CaMsgBox::ShowMsg("商品行数超限");
// 			ClearScannerBuf();
// 			return FAILURE;
// 		}
// 		content = (char*)ScannerCode();
// 		DBG_PRINT((" 扫描枪读出的PLU码:%s", content));
// 		code = "";
//         nLen = GOODS_CODE_LEN - strlen(content);
// 		if (nLen > 0)//不足13位,则前补零到13位
// 		{
// 			while(nLen > 0)
// 			{
// 				code += "0";
// 				nLen--;
// 			}
// 		}
// 		code += content;
// 		//ret = pSaleData->PLUSale(code);
// 		ret = pSaleData->DeptSale(0, code);
// 		m_pInput2->Clear();
// 		if (m_IfCancel&&(ret == NO_SUCH_GOODS))//按商品取消键后,未在发票明细中找到该商品
// 		{
// 			ErrMsgBox(ret);
// 			ClearScannerBuf();
// 			pSaleData->NoCancelGoods();
// 			m_IfCancel = false;
// 			m_strSuffix = "";
// 			DeptSaleShow();
// 			ChangeTitle();
// 			ReFresh();
// 			return SUCCESS;
// 		}
// 		if (ret != SUCCEED) 
// 	   {
// 			ErrMsgBox(ret);
// 			ClearScannerBuf();
// 			return FAILURE;
// 	   }
// 	   //添加实现内容调整的函数 
// 	   DeptSaleShow();
// 	   ChangeTitle();
// 	   ReFresh();	
// 	   //切换到商品销售界面
// 	   ChangeWin(PRODUCT_SALE_WIN);
// 	   return SUCCESS;
// 		break;

	case CHANGE_DEPT_KEY:
		if ((pSaleData->m_tmpGoodsNum>=MAX_GOODS_LINE)&&(!m_IfCancel)) 
		{
			CaMsgBox::ShowMsg("商品行数超限");
			return FAILURE;
		}
		content = (char*)(m_pInput2->m_contentBuf);
		if (is_Figure(content) != SUCCESS)
		{
			CaMsgBox::ShowMsg("请输入1~99区间的整数");
			return FAILURE;
		}
		deptNo = atoi(content);
		m_pInput2->Clear();
		return(DeptSaleProc(deptNo));
		break;	

	case DEPT1_KEY:
		if ((pSaleData->m_tmpGoodsNum>=MAX_GOODS_LINE)&&(!m_IfCancel)) 
		{
			CaMsgBox::ShowMsg("商品行数超限");
			return FAILURE;
		}
		if (QuickSaleProc()!=SUCCESS)
		{
			return FAILURE;
		}
		return(DeptSaleProc(1));
	    break;

	case DEPT2_KEY:
		if ((pSaleData->m_tmpGoodsNum>=MAX_GOODS_LINE)&&(!m_IfCancel)) 
		{
			CaMsgBox::ShowMsg("商品行数超限");
			return FAILURE;
		}
		if (QuickSaleProc()!=SUCCESS)
		{
			return FAILURE;
		}
		return(DeptSaleProc(2));
	    break;
	   
	case DEPT3_KEY:
		if ((pSaleData->m_tmpGoodsNum>=MAX_GOODS_LINE)&&(!m_IfCancel)) 
		{
			CaMsgBox::ShowMsg("商品行数超限");
			return FAILURE;
		}
		if (QuickSaleProc()!=SUCCESS)
		{
			return FAILURE;
		}
		return(DeptSaleProc(3));
	    break;
	   
	case DEPT4_KEY:
		if ((pSaleData->m_tmpGoodsNum>=MAX_GOODS_LINE)&&(!m_IfCancel)) 
		{
			CaMsgBox::ShowMsg("商品行数超限");
			return FAILURE;
		}
		if (QuickSaleProc()!=SUCCESS)
		{
			return FAILURE;
		}
		return(DeptSaleProc(4));
	    break;

	case DEPT5_KEY:
		if ((pSaleData->m_tmpGoodsNum>=MAX_GOODS_LINE)&&(!m_IfCancel)) 
		{
			CaMsgBox::ShowMsg("商品行数超限");
			return FAILURE;
		}
		if (QuickSaleProc()!=SUCCESS)
		{
			return FAILURE;
		}
		return(DeptSaleProc(5));
	    break;
		
	case RETURN_MAIN_MENU:  //return to SYSTEMMENU
		if (pSaleData->m_tmpGoodsNum==0)
		{
			ChangeWin(PRODUCT_SALE_MAIN_MENU);
		}
		else
		{
			CaMsgBox::ShowMsg("商品行数非零,不能返回");
		}
		return SUCCESS;
		break;

	case GOODSREDUCT_KEY:
/*
		if ((pSaleData->m_tmpGoodsNum>=MAX_GOODS_LINE)&&(!m_IfCancel)) 
		{
			CaMsgBox::ShowMsg("商品行数超限");
			return FAILURE;
		}
		GoodesReductProc();*/
		CaMsgBox::ShowMsg("暂不支持此功能");
		return SUCCESS;
		break;
		
	default:
		break;
	}
	
	return CaWindow::ProcEvent(iEvent,pEventData,iDataLen);
}
예제 #21
0
void CNet3GWlenSetWin::DoActive()
{
	Disp3GInfo();
	ReFresh();
}
예제 #22
0
void CNetAutoDialSetWin::DoActive()
{
	DispParalInfo();
	ReFresh();
}
예제 #23
0
void CApnAccPointSetWin::DoActive()
{
	DispApnAccPointInfo();
	ReFresh();
}
예제 #24
0
int CaInput::ProcEvent(int iEvent,unsigned char *pEventData, int iDataLen)
{
	int res=0;

	//������д���¼�
	if ((iEvent == 0xFF) && (pEventData != NULL))
	{
		switch(m_InputType) 
		{
		case aINT:
			if(ReciveIntChar(0xFF,(char *)pEventData,strlen((char *)pEventData)) == 1 )
			{	res=1; }
			break;
		case aFLOAT:
			if(ReciveFloatChar(0xFF,(char *)pEventData,strlen((char *)pEventData)) == 1 )
			{	res= 1;	}
			break;
		case aPASSWORD:
//			res= 1;	
// 			break;
		case aCHAR:
			if(ReciveStrChar(0xFF,(char *)pEventData,strlen((char *)pEventData)) == 1 )
			{	res= 1;	}

//			memset(m_dispBuf,0,OBJ_TITLE_MAX_LEN);
//			strncpy(m_dispBuf,(char *)m_contentBuf,m_iTitleLen);
			break;
		default:
			break;
		}
	}

 	if (iEvent == CHANGE_INPUT_METHOD_EVENT && !m_bReadOnly 
		&& m_InputType!= aINT && m_InputType != aFLOAT && m_InputType!= aPASSWORD)
	{
		CPosFrame::OnChangeIME(this,iEvent,pEventData,iDataLen);
		res = 1;
	}
	else
	{
		switch(m_InputType) {
		case aINT:
			if(!m_bReadOnly && ReciveIntChar(iEvent,(char *)pEventData,iDataLen) == 1 )
			{	res=1; }
			break;
		case aFLOAT:
			if(!m_bReadOnly &&ReciveFloatChar(iEvent,(char *)pEventData,iDataLen) == 1 )
			{	res= 1;	}
			break;
		case aCHAR:
		case aPASSWORD:
			if(!m_bReadOnly && ReciveStrChar(iEvent,(char *)pEventData,iDataLen) == 1 )
			{	res= 1;	}
			break;
		default:
			break;
		}
	}

   if(res == 0)
	{
 		if (iEvent == CLEAR_ALL_EVENT && !m_bReadOnly )
		{
 			Clear();
			res=1;
		} 
		else if(iEvent == INPUT_LEFT )
		{
			ReciveLeftDirectKey(iEvent);
			res= 1;
		}
		else if(iEvent == INPUT_RIGHT )
		{
			ReciveRightDirectKey(iEvent);
			res= 1;
		}
		else if(iEvent == CLEAR_ONE_EVENT && !m_bReadOnly)
		{
 			ReciveEraseKey(iEvent);
			res=1;
		}
		else if(iEvent == ENTER_KEY || (iEvent >= 0x11 && iEvent <= 0x18))//TODO��Ӧ�س��͹��ܼ�
		{
			CaObject::ProcEvent(iEvent,pEventData,iDataLen);
			res = 1;
		}
		else
		{
			res=0;
		}
	}

	if(res == 1)
	{
		ReFresh();
		if(IsCurObj())
		{
			SetFocusIn();
		}
	}

	DBG_PRN("info",("m_contentBuf = %s",m_contentBuf));
	return res;

}
int CGInvLabelWin::ProcEvent(int iEvent,unsigned char *pEventData, int iDataLen)
{
	if (INV_DIST_QUERY_L1 == m_flag1 )//库存查询
	{	
		switch(iEvent)
		{
		case RETURN_MAIN_MENU:  //return to SYSTEMMENU
			ChangeWin(INV_MANAGE_MENU);					
			return SUCCESS;
			break;

		case PAGEUP_KEY:

			 DBG_PRINT(("PAGEUP_KEY"));
			 if ((m_pageIndex-1)<1)
			 {
				 return FAILURE;
				 //m_pageIndex = m_pageNum +1;
			 }
			 m_pageIndex--;
			 QueryShow(m_pInvVol, m_pageIndex);
			 ChangeTitle();
			 ReFresh();	
			 DBG_PRINT(("PAGEUP_KEY"));
			 return SUCCESS;
			 break;

		case PAGEDOWN_KEY:
			 if ((m_pageIndex+1)>m_pageNum)
			 {
				 return FAILURE;
				//m_pageIndex = 0;
			 }
			 m_pageIndex++;
			 QueryShow(m_pInvVol, m_pageIndex);
			 ChangeTitle();
			 ReFresh();	
			 return SUCCESS;
			 break;

		default: 
			break;		
		}
	}
	else if (INV_BLK_WASTE_L1 == m_flag1 )//空白发票作废
	{
		switch (iEvent)
		{
		case RETURN_MAIN_MENU:  //return to MtlBtnWin
			ChangeWin(GENERAL_INV_MTLBTN_WIN);			
			return SUCCESS;
			break;
#if (RELEASE_VER == 0)
		case DISCOUNT_KEY:
			DBG_PRINT(("进入DISCOUNT_KEY"));
			UINT8 nIfInvSum;
			AutoIssue(nIfInvSum);	
			break;
#endif
		default:
			break;
		}
	}
	else
	{
		switch(iEvent)
		{
		case RETURN_MAIN_MENU:  //return to SYSTEMMENU
			ChangeWin(GENERAL_INV_INPUT_WIN);					
			return SUCCESS;
			break;
		default:
			break;
		}
	}
 	  
	return CaWindow::ProcEvent(iEvent,pEventData,iDataLen);
}
예제 #26
0
void CaProgressBar::Show()
{
	ReFresh();
}
예제 #27
0
void CSysArgMenu::DoActive()
{
	DBG_PRINT(("进入CSysArgMenu::DoActive()函数"));
	
	ReFresh();
}
void CGInvLabelWin::DoActive()
{
	DBG_PRINT((" 进入CGInvLabelWin::DoActive函数!"));

	m_flag1 = ((CInvManageMenu*)m_pFrame->GetWin(INV_MANAGE_MENU))->m_InvWin_level1;
	DBG_PRINT(("m_flag1 = %u",m_flag1));
	m_level2 = ((CGInvInputWin*)m_pFrame->GetWin(GENERAL_INV_INPUT_WIN))->m_InvWin_level2;
	DBG_PRINT(("m_level2 = %u",m_level2));

 	if (INV_DIST_QUERY_L1 == m_flag1 )//库存查询界面
	{		
		m_pageIndex = 1;
		label[0]->SetTitleAlign(CaObject::ALIGN_RIGHT);
		m_iBtnW = (SCREEN_W/2 - 0) ; //控件的宽度
		m_iColW = m_iBtnW + 0;        //控件的列宽
		m_curH = 3 * LINE_H;
		label[3]->Create(0,m_curH, m_iBtnW, CHAR_H);
		label[3]->SetTitle(title_array[3], strlen(title_array[3]));
		label[4]->Create(m_iColW,m_curH, m_iBtnW, CHAR_H);
		label[4]->SetTitle(title_array[4], strlen(title_array[4]));
		label[3]->Visible(true);
		label[4]->Visible(true);
		INVM_GetVolNum(m_pageNum);//获得金税盘中的发票卷数
		QueryShow(m_pInvVol, m_pageIndex);//组织屏幕显示信息
	}
	else if (INV_BLK_WASTE_L1 == m_flag1)//空白发票作废界面
	{
		m_pageIndex = 1;
		m_pageNum = 1;
		label[3]->Visible(false);
		label[4]->Visible(false);
		BlankWasteShow();//组织屏幕显示信息
	}
	else
	{
		switch (m_level2)
		{
		case INV_RETURN_L2://红票开具界面
			{
				m_pLInvHead = ((CGInvInputWin*)m_pFrame->GetWin(GENERAL_INV_INPUT_WIN))->m_pInvHead;
				DBG_ASSERT_EXIT((m_pLInvHead != NULL), (" m_pLInvHead == NULL!"));	
				DBG_PRINT(("m_pLInvHead->m_fphm= %u",m_pLInvHead->m_fphm));
				m_pageIndex = 1;
				m_pageNum = 1;
				label[0]->SetTitleAlign(CaObject::ALIGN_LEFT);
				m_iBtnW = (SCREEN_W/2 - 0) ; //控件的宽度
				m_iColW = m_iBtnW + 0;        //控件的列宽
				m_curH = 3 * LINE_H;
				label[3]->Create(0,m_curH, m_iBtnW+12, CHAR_H);
				label[3]->SetTitle(title_array[3], strlen(title_array[3]));
				label[4]->Create(m_iColW+16,m_curH, m_iBtnW-16, CHAR_H);
				label[4]->SetTitle(title_array[4], strlen(title_array[4]));
				label[3]->Visible(true);
				label[4]->Visible(true);
				ReturnShow(m_pLInvHead);//组织屏幕显示信息
				break;
			}
		case INV_USEWST_L2://已开发票作废
			{
				m_pLInvHead = ((CGInvInputWin*)m_pFrame->GetWin(GENERAL_INV_INPUT_WIN))->m_pInvHead;
				DBG_ASSERT_EXIT((m_pLInvHead != NULL), (" m_pLInvHead == NULL!"));	
				DBG_PRINT(("m_pLInvHead->m_fphm= %u",m_pLInvHead->m_fphm));
				m_pageIndex = 1;
				m_pageNum = 1;
				label[0]->SetTitleAlign(CaObject::ALIGN_CENTER);
				m_iBtnW = (SCREEN_W/2 - 0) ; //控件的宽度
				m_iColW = m_iBtnW + 0;        //控件的列宽
				m_curH = 3 * LINE_H;
				label[3]->Create(0, m_curH, m_iBtnW-24, CHAR_H);
				label[3]->SetTitle(title_array[3], strlen(title_array[3]));
				label[4]->Create(m_iColW-20, m_curH, m_iBtnW+20, CHAR_H);
				label[4]->SetTitle(title_array[4], strlen(title_array[4]));
				label[3]->Visible(true);
				label[4]->Visible(true);
				UsedWasteShow(m_pLInvHead);//组织屏幕显示信息
				break;
			}
		default:
			break;
		}
	}	
	ChangeTitle();
	ReFresh();
	DBG_PRINT(("退出CGInvLabelWin::DoActive函数!"));
}