📄 sale.c
字号:
if(numcnt!=0)
{errorType(ERR_DIGIT_ILLEGAL);break;}
Idx= getmenu();
if(Idx >= MAX_MENU_KEY_CNTR)
{
errorType(ERR_DIGIT_ILLEGAL);
break;
}
do_menu_plu(Idx);
break;
#endif
case KD_AMOUNT: /* Amount key, used in the open PLU price input */
if((ra_flag) || (po_flag))
{
errorType(ERR_KEY_SEQ);
break;
}
Do_PLUcr();
break;
case KD_XTIME : /* X/Date Time Key */
if((ra_flag) || (po_flag))
{
errorType(ERR_KEY_SEQ);
break;
}
Do_xTime();
break;
case KD_VOID : /* VOID key */ // Void is incompatible with the refund.
if((ra_flag) || (po_flag))
{
errorType(ERR_KEY_SEQ);
break;
}
/* refund mode can not void */
Do_Void();
break;
case KD_REFUND: /* Refund key */
if(!sysflag->tax_shift_mode)
Clr_Tax_Flag();
if((ra_flag) || (po_flag))
{
errorType(ERR_KEY_SEQ);
break;
}
Do_Rfnd(); /* Do_Refund() */
break;
case KD_PER1: /* 1% */
case KD_PER2: /* 2% */
case KD_PER3: /* 3% */
if(!sysflag->tax_shift_mode)
Clr_Tax_Flag();
if((ra_flag) || (po_flag))
{
errorType(ERR_KEY_SEQ);
break;
}
if(InCmd == KD_PER1) /* Get the percentage index number */
per_idx = 0;
else if(InCmd == KD_PER2)
per_idx = 1;
else
per_idx = 2;
Do_Per();
break;
case KD_EC : /* Error Correct */
if(!sysflag->tax_shift_mode)
Clr_Tax_Flag();
if((ra_flag) || (po_flag))
{
errorType(ERR_KEY_SEQ);
break;
}
Do_EC();
break;
case KD_SUBTTL:
if(!sysflag->tax_shift_mode)
Clr_Tax_Flag();
if((ra_flag) || (po_flag))
{
errorType(ERR_KEY_SEQ);
break;
}
if(numcnt)
{
if(lnum == 1)
{
if((Void_flag) || (RM_flag) || (Mul_flag))
{errorType(ERR_KEY_SEQ);break;}
Calc(); /* Do the additive function, a simple calculator */
if(sysflag->tax_shift_mode)
Do_Tax_Flag();
continue;
}
#ifdef RCPT_REPRN /* Support the receipt reprint function */
else if((lnum == 0) && (numcnt != 0) && (Rcpt_RePrn_Cnt != 0))
{
if(Cash_flag){errorType(ERR_PAY_NO_END);break;}
if(NewTrans){errorType(ERR_SALE_NO_END);break;}
if((Void_flag) || (RM_flag) || (Mul_flag))
{errorType(ERR_KEY_SEQ);break;}
RePrn_Rcpt(1);
break;
}
#endif /* End RCPT_REPRN */
#ifdef VER_RSNT /* Support the restaurant function */
else if((lnum >= 100) && (lnum <= 120))
{
Do_Send_KP();
break;
}
#endif
else if (lnum >= 20090 && lnum <= 20092) {
if(NewTrans) /* The transaction not end */
{errorType(ERR_SALE_NO_END);break;}
if((Void_flag) || (RM_flag) || (Mul_flag))
{errorType(ERR_KEY_SEQ);break;}
if (lnum == 20091) {
Lcd_Set_Color(LCD_COLORFUL);
Lcd_Set_Mode(LCD_10_INCH);
Rst_Ts_Lcd();
return;
}
else if (lnum == 20092) {
Lcd_Set_Color(LCD_GRAY);
Lcd_Set_Mode(LCD_10_INCH);
Rst_Ts_Lcd();
return;
}
else { // lnum == 20090 /* switch to 7" display */
Delay(200); /* 延时200ms,作为触摸屏的一个缓冲 */
Lcd_Set_Mode(LCD_7_INCH);
return;
}
}
#if SW_VER == SW_WD2
else if((lnum == 987L) && (numcnt == 6)
#ifdef VER_RSNT /* Support the restaurant function */
&& (Rsnt_ChkSale() == OK)
#endif /* End VER_RSNT */
)
{
if(Cash_flag){errorType(ERR_PAY_NO_END);break;}
if(NewTrans){errorType(ERR_SALE_NO_END);break;}
if((Void_flag) || (RM_flag) || (Mul_flag))
{errorType(ERR_KEY_SEQ);break;}
Trng_Flag = 1; /* Set in the training mode */
MainMode = CurrMode = TRAINING; /* Work in the training mode */
#ifdef RCPT_REPRN /* Support the receipt reprint function */
Rcpt_RePrn_Cnt = 0;
#endif /* End RCPT_REPRN */
Do_Clear(); /* Clear the display and some flags */
break;
}
else if((lnum == 789L) && (numcnt == 6)
#ifdef VER_RSNT /* Support the restaurant function */
&& (Rsnt_ChkSale() == OK)
#endif /* End VER_RSNT */
)
{
if(Cash_flag){errorType(ERR_PAY_NO_END);break;}
if(NewTrans){errorType(ERR_SALE_NO_END);break;}
if((Void_flag) || (RM_flag) || (Mul_flag))
{errorType(ERR_KEY_SEQ);break;}
Trng_Flag = 0;
MainMode = CurrMode = REGISTER;
#ifdef RCPT_REPRN /* Support the receipt reprint function */
Rcpt_RePrn_Cnt = 0;
#endif /* End RCPT_REPRN */
Do_Clear(); /* Clear the display and some flags */
// break;
}
#endif
else
{
errorType(ERR_DIGIT_ILLEGAL);
continue;
}
}
Do_Subttl();
break;
case KD_TRS_VOID: /* Transaction VOID key */
if(!sysflag->tax_shift_mode)
Clr_Tax_Flag();
if((ra_flag) || (po_flag))
{
errorType(ERR_KEY_SEQ);
break;
}
Do_TSVD();
break;
case KD_CLERK: /* Clerk key */
if(!sysflag->tax_shift_mode)
Clr_Tax_Flag();
if((ra_flag) || (po_flag))
{
errorType(ERR_KEY_SEQ);
break;
}
if( numcnt ) /* If the current clerk is not null, only press Clerk key(no digit) to close it */
{errorType(ERR_DIGIT_ILLEGAL);break;}
if(Cash_flag){errorType(ERR_PAY_NO_END);break;}
if(NewTrans){errorType(ERR_SALE_NO_END);break;}
if((Void_flag) || (RM_flag)){errorType(ERR_KEY_SEQ);break;}
if(sysflag->clerk_mode)
{
clerkpass(); /* Input the clerk password */
Clr_Dsp_Data();
RightDisp(0L,sysflag->sysdots);
// if(sysflag->tax_shift_mode)
// Do_Tax_Flag();
DisTime();
}
else
errorType(ERR_CLERK_INHT);
break;
#ifdef VER_RSNT /* Support the restaurant function */
case KD_OPEN:
if(!sysflag->tax_shift_mode)
Clr_Tax_Flag();
if((ra_flag) || (po_flag))
{
errorType(ERR_KEY_SEQ);
break;
}
if(work_mode == RETAIL)
{errorType(ERR_RSNT_MODE);break;}
if(numcnt == 0)
{
InCmd = KD_SUSPEND;
Do_Suspend();
break;
}
Do_Open();
break;
case KD_SUSPEND:
if(!sysflag->tax_shift_mode)
Clr_Tax_Flag();
if((ra_flag) || (po_flag))
{
errorType(ERR_KEY_SEQ);
break;
}
if(work_mode == RETAIL)
{errorType(ERR_RSNT_MODE);break;}
Do_Suspend();
break;
case KD_TNSFER:
if(!sysflag->tax_shift_mode)
Clr_Tax_Flag();
if((ra_flag) || (po_flag))
{
errorType(ERR_KEY_SEQ);
break;
}
if(work_mode == RETAIL)
{errorType(ERR_RSNT_MODE);break;}
Do_Tnsfer();
break;
case KD_WAITER:
if(!sysflag->tax_shift_mode)
Clr_Tax_Flag();
if((ra_flag) || (po_flag))
{
errorType(ERR_KEY_SEQ);
break;
}
if(work_mode == RETAIL)
{errorType(ERR_RSNT_MODE);break;}
if(!currtable) /* Non-existing active table */
{errorType(ERR_TBL_NOT_ACT);break;}
if(table[currtable - 1].waiterno != NUL_VLU) /* The waiter is exist, error */
{errorType(ERR_WAITER_EXIST);break;}
if(waiterpass() == OK)
table[currtable - 1].waiterno = bakwaiterno;
Clr_Dsp_Data();
RightDisp(0, sysflag->sysdots);
break;
case KD_TIPIN:
if(!sysflag->tax_shift_mode)
Clr_Tax_Flag();
if((ra_flag) || (po_flag))
{
errorType(ERR_KEY_SEQ);
break;
}
if(work_mode == RETAIL)
{errorType(ERR_RSNT_MODE);break;}
Do_TipIn();
break;
case KD_TIPOUT:
if(!sysflag->tax_shift_mode)
Clr_Tax_Flag();
if((ra_flag) || (po_flag))
{
errorType(ERR_KEY_SEQ);
break;
}
if(work_mode == RETAIL)
{errorType(ERR_RSNT_MODE);break;}
Do_TipOut();
break;
#endif /* End VER_RSNT */
#ifdef FCE_FUNC /* Support the FCE function */
case KD_FCE1:
case KD_FCE2:
case KD_FCE3:
case KD_FCE4:
if(!sysflag->tax_shift_mode)
Clr_Tax_Flag();
if((ra_flag) || (po_flag))
{
errorType(ERR_KEY_SEQ);
break;
}
if(numcnt)
{
errorType(ERR_DIGIT_ILLEGAL);
break;
}
FCE_Idx = getFCE();
if(!NewTrans)
Do_XCH(); /* Exchange the foreign currenty to the local currency */
else
Do_FCE();
break;
case KD_FCE:
if(!sysflag->tax_shift_mode)
Clr_Tax_Flag();
if((ra_flag) || (po_flag))
{
errorType(ERR_KEY_SEQ);
break;
}
if(numcnt)
{
if((lnum > MAX_FCE_CNT) || (lnum == 0))
{
errorType(ERR_DIGIT_ILLEGAL);
break;
}
FCE_Idx = getFCE();
}
else
{
FCE_Idx = 0;
}
if(!NewTrans)
Do_XCH(); /* Exchange the foreign currenty to the local currency */
else
Do_FCE();
break;
#endif /* End FCE_FUNC */
case KD_DPSF:
Do_Shift_Dept();
break;
case KD_HARD_PLU:
Do_Hard_Plu();
break;
case KD_PAGE_LEFT_TABLE: // Page left
case KD_PAGE_RIGHT_TABLE: // Page right
Do_Page_Table();
break;
case KD_PAGE_LEFT_DEPT: // Page left
case KD_PAGE_RIGHT_DEPT: // Page right
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -