📄 data.c
字号:
/*
* Module: data.c
* Modified by: X.C.Zheng WeiHua
* Modified on: Date: 03-8-11 14:01
* Copyright(c) WeiHua Tech Ltd.
*/
#include "ecrsys.h"
#include "mathes.h"
/*************************************************************************
Long-term stroage variables
*************************************************************************/
REPORT report; /* Daily sales report */
REPORT PTD_report; /* Period to date sales report */
REPT Hour_Rept[24]; /* Hourly sales report */
byte PLU_Used_Tbl[MAX_PLU_USED_TBL_CNT];
word PLU_Group[PLU_GROUP_NUM][PLU_GROUP_LEN+1]; /* Reserve a cell for the group tail */
PERDEF percent[MAX_PER_NUM];
RFNDDEF refund;
TVATDEF VAT[MAX_VAT_NUM]; /* The VAT and tax take up the two cell for can reserve the preset data */
TVATDEF Tax[MAX_TAX_NUM];
#ifdef FCE_FUNC /* Support the FCE function */
FCEDEF fce[MAX_FCE_CNT];
#endif /* End FCE_FUNC */
char RA_Cash[MAX_DESC_LEN+1];
char RA_Check[MAX_DESC_LEN+1];
char RA_Charge[MAX_DESC_LEN+1] ;
char RA_Misc[MAX_DESC_LEN+1];
char PO_Cash[MAX_DESC_LEN+1];
char PO_Check[MAX_DESC_LEN+1];
char PO_Charge[MAX_DESC_LEN+1] ;
char PO_Misc[MAX_DESC_LEN+1];
PCASHDEF PCASH[MAX_PCASH_NUM]; /* The preset cash price */
char check[MAX_CHECK_NUM][MAX_DESC_LEN]; /* Checks description */
char charge[MAX_CHARGE_NUM][MAX_DESC_LEN]; /* Charges description */
char MISC[MAX_MISC_NUM][MAX_DESC_LEN];
char Credit[MAX_DESC_LEN];
char Wlcm_Msg[MSG_HEAD_LINES][2+PRN_BUF_LEN*2]; /* Welcome message, 3 lines, the odd bytes */
char Btm_Msg[MSG_BTM_LINES][2+PRN_BUF_LEN*2]; /* Bottom message, 3 lines, the odd bytes */
byte Age_Limit[2];
const word *Ts_Key_Tab; /* The current key table */
const byte *Ts_Key_Table_Size;
const word *Bak_Ts_Key_Tab; /* The current key table */
const byte *Bak_Ts_Key_Table_Size;
word FF_Key_Tabl[MAX_EXTEND_KEY]; /*当前只用作支持POS 键盘的按键缓冲区*/
word FF_Key_SaleMain_Tabl[MAX_LAYOUT_KEY]; /* The current keyboard layout */
word FF_Key_HardPLU_Tabl[MAX_LAYOUT_KEY]; /* The current keyboard layout */
RPTFLAG rpt_flag; /* The report flag */
//byte LineFeedCnt; /* The line feed counter */
byte cmosValid[40]; /* The data check the above data is right or not in the SRAM */
byte hard_plu_mode = 0; /*0-normal status / 1-current status is Hard Plu level sale status*/
byte Shift_Dept_mode = 0; /*0-normal status / 1-current status is shift dept level sale status*/
byte Lcd_Pop_Flag = 0 ; /*0-normal status / 1-current status is pop windows status*/
/*************************************************************************
Temporary variables
*************************************************************************/
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
Common used temporary variables
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
byte MainMode;
byte CurrMode;
byte LastMode; /* The last control lock mode */
word KeyBuffer[KEY_BUFF_SIZE]; /* Keyboard buffer */
word Khead; /* Head pointer of Keyboard buffer */
word Ktail; /* Tail pointer of Keyboard buffer */
word key_scan_buf[MAX_KEY_SCAN_CNTR]; /* Keyboard scan buffer */
word key_chk,key_off,key_wka,key_wkb,k_digit;
word key_data;
word key_fd; /* FEED key continuous pressing flag */
CHR Ttl_Fd_line;
CHR Flag_Feed_Paper;
CHR Prn_Dot_Ring[PRN_DOT_BUF_LEN][PRN_DOT_BUF_MAX];
CHR phead, prear;
CHR DMA_Send_Buf[MAX_CNTR_PRN_HEAD];
int dmaTranLen = MAX_CNTR_PRN_HEAD - 1; /* Total 47 + 1 bytes need send */
CHR prn_step = 0;
CHR Papr_Feed_Cntr;
PRN_FLAG prn_flag;
byte Flag_Key_Feed_Papr,paperFeedFlag;
CHR prn_Buf[PRN_LEN +1]; /* printer string buffer */
CHR _no_use[PRN_LEN +1]; /* No use */
CHR KP_Buf[MAX_KP_LEN+1]; /* The kitchen print buffer */
CHR _no_use2[MAX_KP_LEN+1]; /* No use */
byte DeptShiftFlag; /* Department shift counter */
byte DPLUShiftFlag; /* DPLU shift counter */
//byte In_Buff[MAX_LCD_NUM]; /* Input buffer */
byte In_Buff[MAX_INPUT_LEN+1]; /* Input buffer */
byte numcnt; /* Counter of digits number */
long lnum; /* The input numeric real value */
word InCmd; /* Current command key */
word lastincmd; /* Last pressed command key */
byte dec_flag; /* Decimal point flag of input the decimal or not.
1: Has input decimal point key.
0: Has not input the decimal poin key.
*/
byte dec_cnt; /* Decimal point counter used in REGISTER XTIME mode
or the PROGRAM RATE input mode or in the calculator mode.
*/
long adj_num; /* Used in the XCOUNT mode, for adjust the quantity
If the quantitiy is 1.120Q, only print 1.12Q,
2.000Q, only print 2Q
*/
byte adj_dots; /* Used in the XCOUNT mode, for adjust the quantity */
DWORD g_sysCount = 0L;
word delay_cnt;
char currmodeInt;
byte bellcnt;
byte bellsub; /*注解?*/
dword g_LCDBLCnt; /* Lcd backlight last on time when no key input */
//dword LCD_BL_Time; /* The LCD backlight time */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
PROGRAM mode temporary variables
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
byte Flag_Prgm_Head; /* The program mode head print flag
1: Has print the head
0: Did't print the head
*/
byte progflag; /* The programing flag, used for the control changed.
1: Doing programing, the control lock can't be changed
0: Not in the programing mode, can switch the control lock
*/
byte modi_flag; /* The program mode modify flag
1: Has modified the attribute
0: Did't modified the attribute
*/
word Tmp_Key_Tab[MAX_EXTEND_KEY]; /* The temporary key table, used in the free function key */
byte Prog_en_dec_input_flag; /* The PROGRAM mode of DEC key input is legal or not flag.
1: Enable
0: Disable
*/
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
Sale mode temporary variables
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
byte NewTrans; /* The transaction is completed or not
1: The transaction is not complete
0: No new transaction
*/
byte continue_sale_flag; /* The transaction is completed or not
0xAA: The transaction is not complete
0x55: No new transaction
*/
/*** The above two variables has the same mean, only used in different place ***/
byte Trng_Flag; /* Work in the training mode flag
0: Work in the register mode.
1: Work in the training mode.
*/
Transaction trans;
Inter_Var tmpvars;
TRANSBUFFDEF transbuff[MAX_TNSBF_LEN]; /* The transaction buffer, store the transaction information
until the transaction is complete. */
byte TnsBf_Len; /* Indicate the transaction buffer length */
byte SndTnsBf_Len; /* The second transaction buffer length */
/* 第二缓冲区作用说明:
注: 由于收据复打缓冲区与第二缓冲区毫无相关, 所以可以达到分时复用的目的
这个是第二缓冲区的长度指针, 第二缓冲区记录部门与PLU交易时候的
总金额, 用于小计打折/Refund起到几个分摊的作用.
第二缓冲区的结构文档还可以参考: E:\wd2\File\小计后打折/Refund 分摊功能文档.doc
第二缓冲区中的内容与收据复打和电子日志无关, 主要是起到一个临时的作用.
*/
byte Max_TnsBf_Len; /* The max transaction buffer length */
TRANSTVATDEF transtvat; /* The transaction buffer, store the VAT/Tax rate */
byte currclerk; /* The current clerk operation */
//byte CurrLogoNo; /* The current logo unmber */
//byte sysmode; /* The current operation status */
//byte bakmode; /* Backup the sysmodes value, for the other use, such as refund etc. */
byte PCASH_Idx; /* The index number of PCASH payment */
byte Check_Idx; /* The index number of check payment */
byte Charge_Idx; /* The index number of charge payment */
long Tmp_PLU_VOID_Idx; /* Use in the REGISTER mode PLU VOID operation of PLU index number */
long tmp_count; /* The temporary variable used in the key funcion VOID,XTIME
AMOUNT. The trans.amount in this three funcion will
be subsituted by it
*/
long tmp_price; /* The temporary variable used in the key funcion VOID,XTIME
AMOUNT. The trans.amount in this three funcion will
be subsituted by it
*/
byte repcnt; /* The DEPT or PLU repeat press counter */
byte per_idx; /* percent select index:
* 0: 1%
* 1: 2%
* 2: 3%
*/
byte Cash_flag; /* Cash_flag==1 current payment no end
Cash_flag==0 no payment */
byte Void_flag; /* Void_flag=1 press VOID key
Void_flag=0 not press VOID key or void over */
byte RM_flag; /* Return merchandise operation flag
1: Has press the RM key
0: Did not press the RM key or RM operaion over
*/
byte Mul_flag; /* The XTIME key is press for the multiplicatve operation flag
1: Has press the XTIME key.
0: Do not press the XTIME key.
*/
byte pluenflag; /* Open PLU price input flag
1: already enter manual price for PLU
0: use programmed price for PLU
*/
byte Subt_Press_Flag; /* SUBTTL key press flag or not
1: Has press the SUBTTL key in the last time
0: Do not press the SUBTTL key
*/
byte Subt_Prn_Flag;
/* SUBTTL key information printed or not
1: Has print the sub total information
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -