⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 data.h

📁 一款收款机C源代码!因为是几年前的代码了
💻 H
📖 第 1 页 / 共 4 页
字号:
/*
 * Module: data.h
 * Modified by: X.C.Zheng WeiHua
 * Modified on: Date:  03-8-11 14:02
 * Copyright(c) WeiHua Tech Ltd.
 */
#ifndef DATA_H
#define DATA_H


#include "ecrsys.h"
#include "mathes.h"
#include "lcd2.h"



/*************************************************************************
					Long-term variables
*************************************************************************/

#ifndef WD1VER			/* The version of Wd1-E */
		extern	DEPTDEF				*dept;
		extern	PLUDEF				*plu;
		extern	CLERKDEF 			*clerk;
	#ifdef VER_RSNT	/* Support the restaurant function */
		extern	TABLEDEF				*table;
		extern	WAITERDEF			*waiter;
	#endif /* End VER_RSNT */
	#ifdef ELEC_JRNL	/* Suppport the electronic journal function */
		extern	TRANSBUFFDEF		*sale_jrnl;			/* Sale journal */
		extern	TRANSBUFFDEF		*dc_jrnl;			/* Discount journal */
		extern	TRANSBUFFDEF		*rm_jrnl;			/* Return Merchandise journal */
	#endif /* End ELEC_JRNL */
		extern	byte                PLU_Used_Tbl[];

		extern	byte					Max_Dept_No;
		extern	word					Max_Plu_No;
		extern	byte					Max_Clerk_No;
	#ifdef VER_RSNT	/* Support the restaurant function */
		extern	word					Max_Table_No;
        extern  word                    Real_Table_No;
		extern	byte					Max_Waiter_No;
	#endif /* End VER_RSNT */
	#ifdef ELEC_JRNL	/* Suppport the electronic journal function */
		extern	word					Max_Sale_Jrnl_No;	/* Max sale journals number */
		extern	word					Max_Dc_Jrnl_No;	/* Max discount journals number */
//		extern	byte					Max_Rm_Jrnl_No;	/* Max Return Merchandise journals number */
		extern	word					Max_Rm_Jrnl_No;	/* Max Return Merchandise journals number */

		extern	word					sale_jrnl_first;	/* The sale journals foremost transaction records pointer */
		extern	word					sale_jrnl_last;	/* The sale journals latest transaction records pointer */
		extern	word					sale_jrnl_len;		/* The sale journals length */
		extern	word					dc_jrnl_first;
		extern	word					dc_jrnl_last;
		extern	word					dc_jrnl_len;
//		extern	byte					rm_jrnl_first;
//		extern	byte					rm_jrnl_last;
//		extern	byte					rm_jrnl_len;
		extern	word					rm_jrnl_first;
		extern	word					rm_jrnl_last;
		extern	word					rm_jrnl_len;

		extern	byte					*sale_jrnl_first_ptr;
		extern	byte					*sale_jrnl_last_ptr;
		extern	byte					*dc_jrnl_first_ptr;
		extern	byte					*dc_jrnl_last_ptr;
		extern	byte					*rm_jrnl_first_ptr;
		extern	byte					*rm_jrnl_last_ptr;
	#endif /* End ELEC_JRNL */
#else /* Else WD1VER */
		extern	DEPTDEF				dept[Max_Dept_No];
		extern	PLUDEF				plu[Max_Plu_No];
		extern	CLERKDEF 			clerk[Max_Clerk_No];
#endif /* End WD1VER */

extern	REPORT 				report;					/* Daily sales report */
extern	REPORT 				PTD_report;         	/* Period to date sales report */
extern	REPT 					Hour_Rept[];			/* Hourly sales report */

extern	word 					PLU_Group[][PLU_GROUP_LEN+1];		/* Reserve a cell for the group tail */
extern	PERDEF 				percent[];
extern	RFNDDEF 				refund;
extern	TVATDEF 				VAT[];
extern	TVATDEF 				Tax[];
#ifdef FCE_FUNC			/* Support the FCE function */
extern	FCEDEF   			fce[];
#endif /* End FCE_FUNC */
extern	PCASHDEF				PCASH[MAX_PCASH_NUM];/* The preset cash price */
extern	char 					check[][MAX_DESC_LEN];				/* Checks description */
extern	char 					charge[][MAX_DESC_LEN];				/* Charges description */
extern  char                    MISC[][MAX_DESC_LEN]; 
extern  char                    Credit[MAX_DESC_LEN];
extern	char 					Wlcm_Msg[][2+PRN_BUF_LEN*2];    		/* Welcome message, 3 lines, the odd bytes */
extern	char 					Btm_Msg[][2+PRN_BUF_LEN*2];       	/* Bottom message, 3 lines, the odd bytes */

extern  byte        Age_Limit[];

extern  TEXT_LCD_DEF Text_Lcd;


extern	word					FF_Key_Tabl[];			/* The current keyboard layout */
extern	word 			        FF_Key_SaleMain_Tabl[];	/* The current keyboard layout */
extern	word 			        FF_Key_HardPLU_Tabl[];	/* The current keyboard layout */


extern	RPTFLAG				rpt_flag;				/* The report flag */

//extern	byte					LineFeedCnt;			/* The line feed counter */
extern	byte              cmosValid[];			/* The data check the above data is right or not in the SRAM */
extern	byte              cmosValid2[];			/* The data check the above data is right or not in the SRAM */
extern 	byte					qcTestFlag;				// qc test flag, clear it every power on.

extern 	byte			hard_plu_mode;      /*0-normal status  /  1-current status is Hard Plu level sale status*/
extern 	byte            Shift_Dept_mode;        /*0-normal status  /  1-current status is shift dept level sale status*/   
extern 	byte            Lcd_Pop_Flag ;           /*0-normal status /  1-current status is pop windows status*/                                          


/*************************************************************************
					Temporary variables
*************************************************************************/

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
			Common used temporary variables
 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
extern	byte 					MainMode;
extern	byte 					CurrMode;
extern	byte					LastMode;				/* The last control lock mode */

extern	word              KeyBuffer[];   		/* Keyboard buffer */
extern	word              Khead;            	/* Head pointer of Keyboard buffer */
extern	word              Ktail;            	/* Tail pointer of Keyboard buffer */
extern	word					key_scan_buf[];		/* Keyboard scan buffer */
extern	word					key_chk,key_off,key_wka,key_wkb,k_digit;
extern	word     			key_data;
extern	word              key_fd;					/* FEED key continuous pressing flag */
extern	char              currmodeInt;
extern	byte     			bellcnt;
extern	byte					bellsub;
extern	dword 				g_LCDBLCnt;				/* LCD backlight last on time when no key input */

extern	CHR               Ttl_Fd_line;
extern	CHR               Flag_Feed_Paper;
extern	CHR               Prn_Dot_Ring[PRN_DOT_BUF_LEN][PRN_DOT_BUF_MAX];
extern	CHR               phead, prear;
extern	CHR               DMA_Send_Buf[];
extern	int               dmaTranLen;    		/* Total 47 + 1 bytes need send */
extern	CHR               prn_step;
extern	CHR               Papr_Feed_Cntr;
extern	PRN_FLAG          prn_flag;
extern	byte              Flag_Key_Feed_Papr,paperFeedFlag;
extern	CHR   				prn_Buf[];    			/* printer string buffer */
extern	CHR					KP_Buf[];				/* The kitchen print buffer */

extern	byte 					DeptShiftFlag;			/* Department shift counter */
extern	byte 					DPLUShiftFlag;			/* DPLU shift counter */

extern	byte  				In_Buff[];				/* Input buffer */
extern	byte 					numcnt;         		/* Counter of digits number */
extern	long 					lnum;						/* The input numeric real value */
extern	word 					InCmd;          		/* Current command key */
extern	word 					lastincmd;				/* Last pressed command key */
extern	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.
															   	*/
extern	byte 					dec_cnt;					/* Decimal point counter used in REGISTER XTIME mode 
																	or the PROGRAM RATE input mode 
															 		*/
extern	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 
																	*/
extern	byte 					adj_dots;				/* Used in the XCOUNT mode, for adjust the quantity */

extern	DWORD 				g_sysCount;
extern	word  				delay_cnt;



/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
			PROGRAM mode temporary variables
 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
extern	byte 					Flag_Prgm_Head;    	/* The program mode head print flag
                           								1: Has print the head
                           								0: Did't print the head
                           								*/
                                          	
extern	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
																	*/
extern	byte 					modi_flag;           /* The program mode modify flag
																	1:	Has modified the attribute
																	0:	Did't modified the attribute
																	*/

extern	word 					Tmp_Key_Tab[];       /* The temporary key table, used in the free function key */

extern	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
 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
extern	byte   				NewTrans;				/* The transaction is completed or not      
																	1:	The transaction is not complete
																	0:	No new transaction
																	*/
extern	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 ***/

extern	byte					Trng_Flag;				/* Work in the training mode flag
																	0: Work in the register mode.
																	1: Work in the training mode.
																	*/
extern	Transaction       trans;
extern	Inter_Var         tmpvars;
extern	TRANSBUFFDEF 		transbuff[];			/* The transaction buffer, store the transaction information 
																	until the transaction is complete. */
extern	byte 					TnsBf_Len;				/* Indicate the transaction buffer length */
extern	byte					SndTnsBf_Len;			/* The second transaction buffer length */
extern	byte					Max_TnsBf_Len;			/* The max transaction buffer length */
extern	TRANSTVATDEF		transtvat;				/* The transaction buffer, store the VAT/Tax rate */

extern	byte 					currclerk;      		/* The current clerk operation */
extern	byte 					PCASH_Idx;      		/* The index number of PCASH payment */
extern	byte 					Check_Idx;      		/* The index number of check payment */
extern	byte 					Charge_Idx;     		/* The index number of charge payment */
extern	long 					Tmp_PLU_VOID_Idx;		/* Use in the REGISTER mode PLU VOID operation of PLU index number */
extern	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
																	*/
extern	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
																	*/
extern	byte 					repcnt;					/* The DEPT or PLU repeat press counter */
extern	byte  				per_idx;  				/* percent select index:
                    										 * 0: 1%
                    										 * 1: 2%
                    										 * 2: 3%
                    										 */

extern	byte   				Cash_flag;   			/* Cash_flag==1 current payment no end 
																	Cash_flag==0 no payment */
extern	byte   				Void_flag; 				/* Void_flag=1 press VOID key  
																	Void_flag=0 not press VOID key or void over */
extern	byte 					RM_flag;					/* Return merchandise operation flag
																	1:	Has press the RM key
																	0:	Did not press the RM key or RM operaion over 
																	*/
extern	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.
																	*/
extern	byte  				pluenflag;   			/* Open PLU price input flag
																	1: already enter manual price for PLU  
																	0: use programmed price for PLU
																	*/
extern	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
																	*/
																	
extern	byte 					Subt_Prn_Flag;			
																/* SUBTTL key information printed or not
																	1:	Has print the sub total information
																	0:	Did't print the sub total information
																*/
																	
extern	byte 					Flag_Prn_Head;     	/* The sale modes receipt head printed or not
     					                      				1: Has print the receipt head.
     					                      				0: Did't print the receipt head.
		     					                    			*/
extern	byte 					Void_Mode;				/* Use the REGISTER mode VOID operation of 
																	use preset price void or use input price void
																	1:	Use preset price void.
																	0:	Use input price void.
																	*/
extern	byte					Item_Mode;				/* The DEPT or PLU operation mode.
																	1:	Multiplicative operation mode
																	0:	Normal operation mode
																	*/

extern	byte                TaxFlag[];       /* the tax 1 status of dept * 0: no taxable 1: taxable */
extern	byte  				Tax1Flag;      		/* the tax 1 status of dept * 0: no taxable 1: taxable */
extern	byte  				Tax2Flag;      		/* the tax 2 status of dept * 0: no taxable 1: taxable */
extern	byte  				Tax3Flag;      		/* the tax 3 status of dept * 0: no taxable 1: taxable */
extern	byte				VAT_Idx;					/* The VAT index number */
extern	byte  				shift_flag[];   				/* tax 1 shift flag:
																1: [tax shift x] key pressed uneven times
																0: [tax shift x] is not pressed or press even times
																*/
extern	byte  				shift1_flag;   		/* tax 1 shift flag:
																	1: [tax shift 1] key pressed uneven times
																	0: [tax shift 1] is not pressed or press even times
																	*/
extern	byte  				shift2_flag;   		/* tax 2 shift flag:
																	1: [tax shift 2] key pressed uneven times
																	0: [tax shift 2] is not pressed or press even times
																	*/
extern	byte  				shift3_flag;   		/* tax 3 shift flag:
																	1: [tax shift 3] key pressed uneven times
																	0: [tax shift 3] is not pressed or press even times
																	*/
extern	byte					Tax_Emp_Flag;			/* Tax exempt flag:
																	1:	[tax exempt] key pressed uneven times, can do exempt the tax.
																	0:	[tax exempt] key pressed uneven times, can't do exempt the tax.
																	*/

extern	long 					ltmp;						/* The sale mode, store the tax value */
extern	long 					per_tmp;					/* The calculate percentage function temporary variable */
extern	long 					Per_Rate;				/* Percentage rate temporary variable */
extern	long 					NetAmtBak;           /* Backup the net amount, for the use 
																	in the hour report and clerk report */
extern	DoubleLong 			DLVar1;              /* For the used in double long computing */

#ifdef FCE_FUNC		/* Support the FCE function */
extern	byte					FCE_Idx;					/* Store the FCE operation index number */
extern	long					bak_fce_input;			/* Backup the FCE input */
#endif /* End FCE_FUNC */

extern	DoubleLong			Calc_Result;			/* The calculator function temporary result */
extern	byte					Calc_Flag;				/* The calculator function flag
																	1:	Allow get the logical code
																	0:	Disallow get the logical code
																	*/

extern	byte					Calc_Sign;				/* The calculator function data input sign */


/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
			Report mode temporary variables
 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
extern	long 					Idvul_Qty;				/* The individual report total quantity or total count */
extern	long 					Idvul_Amt;				/* The individual rpeort total amount */
extern	byte 					zero_skip_flag;		/* The report mode zero-skip is allowed or not when print
																	quantity,count,amount
																	1:	support the zero skip;
																	0:	Do not support the zero skip
																	*/
extern	byte                 Rpt_Disp_Roll_flag;


/*-----------------------------------------------------------------*
				The extend versions
 *-----------------------------------------------------------------*/

extern	byte					Head_Prn_Flag;			/* The flush print head print flag
																	1: print the head.
																	0: not print the head.
																	*/
#ifdef VER_RSNT			/* Support the restaurant function */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -