📄 xzreport.c
字号:
Do_Clear();
break;
case KD_VOID:
#ifdef STOCK /* Support the PLU stock function */
Clr_PLU_Stock_Flag = 0;
#endif /* End STOCK */
if( CurrMode == ZREPORT) /* Can't do in the ZREPORT mode */
{errorType(ERR_Z_MODE);break;}
if(!numcnt) /* Not input the digit */
{errorType(ERR_DIGIT_ILLEGAL);break;}
if((lnum > Max_Dept_No) || (lnum == 0))
{
errorType(ERR_DEPT_OVER);
break;
}
Idx = lnum - 1; /* Get the department number. */
if( (Idvul_Flag == 0) || (Idvul_Flag == 1) )
Idvul_Flag = 1;
else /* When press PLU or CLERK key first, error. */
{errorType(ERR_IDVUL_NO_END);break;}
if( Idvul_Head_Prn_Flag == NOTPRINTD )
{
prn_Idvul_Head(1); /* Print the department individual report head */
Idvul_Head_Prn_Flag = PRINTD;
Idvul_Tail_Prn_Flag = NOTPRINTD;
Idvul_Qty = 0; /* The total count accumulator */
Idvul_Amt = 0; /* The total amount accumulator */
}
Do_Idvul_Rpt(Idx);
break;
case KD_DEPT:
#ifdef STOCK /* Support the PLU stock function */
Clr_PLU_Stock_Flag = 0;
#endif /* End STOCK */
if( CurrMode == ZREPORT) /* Can't do in the ZREPORT mode */
{errorType(ERR_Z_MODE);break;}
if(numcnt)
{
if((lnum > Max_Dept_No)||(lnum <= 0))
{
errorType(ERR_DEPT_OVER);
break;
}
if( (Idvul_Flag == 0) || (Idvul_Flag == 1) )
Idvul_Flag = 1;
else /* When press PLU or CLERK key first, error. */
{errorType(ERR_IDVUL_NO_END);break;}
if( Idvul_Head_Prn_Flag == NOTPRINTD )
{
prn_Idvul_Head(1); /* Print the department individual report head */
Idvul_Head_Prn_Flag = PRINTD;
Idvul_Tail_Prn_Flag = NOTPRINTD;
Idvul_Qty = 0; /* The total count accumulator */
Idvul_Amt = 0; /* The total amount accumulator */
}
Idx = lnum -1;
Do_Idvul_Rpt(Idx);
break;
}
else
{
if(Idvul_Flag != 0)
{errorType(ERR_IDVUL_NO_END);break;}
Do_Daily_Dept_Rpt();
prn_Stamp();
}
break;
case KD_PLU:
#ifdef SCANNER /* Support the scanner function */
case SPLU:
if((InCmd == SPLU) || (BarInFlag == 1))
{
if(Judge_Weight_PLU(BCDbuf) == OK) /* Judge is the weight PLU bar code or not */
{
byte tmp_buf[BAR_BUFF_LEN];
memcpy(tmp_buf, BCDbuf, BAR_BUFF_LEN);
Do_Weight_PLU(tmp_buf, BCDbuf);
}
if ((Idx = SC_SearchIndex(BCDbuf)) < 0)
{
errorType(ERR_BAR_EXIST);
#ifdef STOCK /* Support the PLU stock function */
Clr_PLU_Stock_Flag = 0;
#endif /* End STOCK */
break;
}
Idx = Sindex[Idx];
#ifdef STOCK /* Support the PLU stock function */
if(Clr_PLU_Stock_Flag == 1)
{
Clr_PLU_Stock_Flag = 0;
if(Wait_Sure(Disp_Sure) == NG)
{
bellcnt = 120;
Clr_Dsp_Data();
RightDisp(0, sysflag->sysdots);
break;
}
plu[Idx].inventory = 0;
Clr_Dsp_Data();
RightDisp(0, sysflag->sysdots);
break;
}
#endif /* End STOCK */
if(CurrMode == ZREPORT) /* In the Z mode */
{
errorType(ERR_Z_MODE);
break;
}
if( (Idvul_Flag == 0) || (Idvul_Flag == 2) )
Idvul_Flag = 2;
else /* When press DEPT or CLERK key first, error. */
{errorType(ERR_IDVUL_NO_END);break;}
if( Idvul_Head_Prn_Flag == NOTPRINTD )
{
Idvul_Head_Prn_Flag = PRINTD;
Idvul_Tail_Prn_Flag = NOTPRINTD;
prn_Idvul_Head(2); /* Print the individual report head */
Idvul_Qty = 0; /* The total count accumulator */
Idvul_Amt = 0; /* The total amount accumulator */
}
Do_Idvul_Rpt(Idx); // plu report
break;
}
#endif /* End SCANNER */
if(!numcnt)
{
#ifdef STOCK /* Support the PLU stock function */
if(Clr_PLU_Stock_Flag == 1)
{
Clr_PLU_Stock_Flag = 0;
if(Wait_Sure(Disp_Sure) == NG)
{
bellcnt = 120;
Clr_Dsp_Data();
RightDisp(0, sysflag->sysdots);
break;
}
for(Idx = 0; Idx < Max_Plu_No; Idx ++)
{
plu[Idx].inventory = 0;
}
Clr_Dsp_Data();
RightDisp(0, sysflag->sysdots);
break;
}
#endif /* End STOCK */
if(Idvul_Flag != 0)
{errorType(ERR_IDVUL_NO_END);break;}
if(Do_Daily_PLU_Rpt() == OK)
prn_Stamp();
continue;
}
else if( lnum == 0 )
{
#ifdef STOCK /* Support the PLU stock function */
if(Clr_PLU_Stock_Flag == 1)
{
Clr_PLU_Stock_Flag = 0;
errorType(ERR_DIGIT_ILLEGAL);
break;
}
#endif /* End STOCK */
if(Idvul_Flag != 0)
{errorType(ERR_IDVUL_NO_END);break;}
if( CurrMode == ZREPORT )
{errorType(ERR_Z_MODE);break;}
Do_PLU_Area_Rpt();
continue;
}
// if( CurrMode == ZREPORT) /* Can't do in the ZREPORT mode */
// {errorType(ERR_Z_MODE);break;}
DEBUG_SET(
/*do_plu_part()*/;
)
break;
#ifdef REST_PLU_FUNC
case KD_MENU01:
case KD_MENU02:
case KD_MENU03:
case KD_MENU04:
case KD_MENU05:
case KD_MENU06:
case KD_MENU07:
case KD_MENU08:
case KD_MENU09:
case KD_MENU10:
if(CurrMode == ZREPORT) /* In the Z mode */
{
errorType(ERR_Z_MODE);
break;
}
if(numcnt!=0)
{errorType(ERR_DIGIT_ILLEGAL);break;}
Idx= getmenu();
if(Idx >= MAX_MENU_KEY_CNTR)
{
errorType(ERR_DIGIT_ILLEGAL);
break;
}
if( (Idvul_Flag == 0) || (Idvul_Flag == 7) )
Idvul_Flag = 7;
else /* When press DEPT or CLERK key first, error. */
{errorType(ERR_IDVUL_NO_END);break;}
if( Idvul_Head_Prn_Flag == NOTPRINTD )
{
Idvul_Head_Prn_Flag = PRINTD;
Idvul_Tail_Prn_Flag = NOTPRINTD;
prn_Idvul_Head(7); /* Print the individual report head */
Idvul_Qty = 0; /* The total count accumulator */
Idvul_Amt = 0; /* The total amount accumulator */
}
prn_Sngl_MENU_Rep(Idx);
break;
#endif
case KD_CLERK:
#ifdef STOCK /* Support the PLU stock function */
Clr_PLU_Stock_Flag = 0;
#endif /* End STOCK */
if(!sysflag->clerk_mode)
{
errorType(ERR_CLERK_INHT);
continue;
}
if(!numcnt)
{
if(Idvul_Flag != 0)
{errorType(ERR_IDVUL_NO_END);break;}
Do_Daily_Clerk_Rpt();
prn_Stamp();
continue;
}
if( CurrMode == ZREPORT) /* Can't do in the ZREPORT mode */
{errorType(ERR_Z_MODE);break;}
if( (lnum > Max_Clerk_No) || lnum == 0 )
{errorType(ERR_DIGIT_ILLEGAL);continue;}
if( (Idvul_Flag == 0) || (Idvul_Flag == 3) )
Idvul_Flag = 3;
else
{errorType(ERR_IDVUL_NO_END);break;} /* When press DEPT or PLU key first, error. */
if( Idvul_Head_Prn_Flag == NOTPRINTD )
{
Idvul_Head_Prn_Flag = PRINTD;
Idvul_Tail_Prn_Flag = NOTPRINTD;
prn_Idvul_Head(3); /* Print the individual report head */
Idvul_Qty = 0; /* The total count accumulator */
Idvul_Amt = 0; /* The total amount accumulator */
}
Idx = (int)( lnum - 1 );
Do_Idvul_Rpt(Idx);
break;
#ifdef VER_RSNT /* Support the restaurant function */
case KD_OPEN:
#ifdef STOCK /* Support the PLU stock function */
Clr_PLU_Stock_Flag = 0;
#endif /* End STOCK */
if(work_mode == RETAIL)
{errorType(ERR_RSNT_MODE);break;}
if(!numcnt)
{
if(Idvul_Flag != 0)
{errorType(ERR_IDVUL_NO_END);break;}
if(Do_Table_Rpt() == OK) /* Do the table report */
prn_Stamp();
continue;
}
if(CurrMode == ZREPORT)
{errorType(ERR_Z_MODE);break;}
if((lnum <= 0) || (lnum > MAX_TABLE_LOGI_NO))
{
errorType(ERR_DIGIT_ILLEGAL);
continue;
}
if(Get_Table(lnum, &Idx) == NG) /* From the logical number, get the physical number */
{
errorType(ERR_LOGI_NO_EXIST);
continue;
}
else
{
lnum = Idx;
if( (Idvul_Flag == 0) || (Idvul_Flag == 4) )
Idvul_Flag = 4;
else
{errorType(ERR_IDVUL_NO_END);break;}
if( Idvul_Head_Prn_Flag == NOTPRINTD )
{
Idvul_Head_Prn_Flag = PRINTD;
Idvul_Tail_Prn_Flag = NOTPRINTD;
prn_Idvul_Head(4); /* Print the individual report head */
Idvul_Qty = 0; /* The total count accumulator */
Idvul_Amt = 0; /* The total amount accumulator */
}
// Idx = lnum - 1;
Do_Idvul_Rpt(Idx);
}
break;
case KD_SUSPEND:
#ifdef STOCK /* Support the PLU stock function */
Clr_PLU_Stock_Flag = 0;
#endif /* End STOCK */
if(work_mode == RETAIL)
{errorType(ERR_RSNT_MODE);break;}
if( CurrMode == ZREPORT )
{errorType(ERR_Z_MODE);break;}
if(!numcnt)
{
if(Idvul_Flag != 0)
{errorType(ERR_IDVUL_NO_END);break;}
Do_Active_Rpt(); /* Do the table report */
prn_Stamp();
continue;
}
if((lnum <= 0) || (lnum > MAX_TABLE_LOGI_NO))
{
errorType(ERR_DIGIT_ILLEGAL);
continue;
}
if(Get_Table(lnum, &Idx) == NG) /* From the logical number, get the physical number */
{
errorType(ERR_LOGI_NO_EXIST);
continue;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -