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

📄 xzreport.c

📁 一款收款机C源代码!因为是几年前的代码了
💻 C
📖 第 1 页 / 共 5 页
字号:
                }
                else
                {
                    lnum = Idx;
                    if((Idvul_Flag == 0) || (Idvul_Flag == 5))
                        Idvul_Flag = 5;
                    else
                        {errorType(ERR_IDVUL_NO_END);break;}
                    if(table[Idx].status == 0)
                    {
                        errorType(ERR_TBL_NOT_ACT);
                        break;
                    }
                    if( Idvul_Head_Prn_Flag == NOTPRINTD )
                    {
                        Idvul_Head_Prn_Flag = PRINTD;
                        Idvul_Tail_Prn_Flag = NOTPRINTD;
                        prn_Idvul_Head(5);         /* Print the individual report head */
                        Idvul_Qty = 0;             /* The total count accumulator */
                        Idvul_Amt = 0;             /* The total amount accumulator */
                    }
                    Do_Idvul_Rpt(Idx);
                }
                break;

            case	KD_WAITER:
                #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_Waiter_Rpt() == OK)
                        prn_Stamp();
                    continue;
                }
                if( CurrMode == ZREPORT)            /* Can't do in the ZREPORT mode */
                    {errorType(ERR_Z_MODE);break;}
                if( (lnum > Max_Waiter_No) || lnum == 0 )
                    {errorType(ERR_DIGIT_ILLEGAL);continue;}
                if( (Idvul_Flag == 0) || (Idvul_Flag == 6) )
                    Idvul_Flag = 6;
                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(6);               /* Print the individual report head */
                    Idvul_Qty = 0;              /* The total count accumulator */
                    Idvul_Amt = 0;              /* The total amount accumulator */
                    Idvul_TipInCnt = 0;
                    Idvul_TipOutCnt = 0;
                    Idvul_TipInAmt = 0;
                    Idvul_TipOutAmt = 0;
                }
                Idx = (int)( lnum - 1 );
                Do_Idvul_Rpt(Idx);
                break;
#endif /* End VER_RSNT */

            case	KD_XTIME:
#ifdef STOCK 			/* Support the PLU stock function */
                if(sysflag->PLU_Stock_Flag == 0)
                {
                    errorType(ERR_DIGIT_ILLEGAL);
                    break;
                }
                if(Clr_PLU_Stock_Flag == 1)
                {
                    errorType(ERR_KEY_ILLEGAL);
                    Clr_PLU_Stock_Flag = 0;
                    break;
                }
                if(CurrMode != ZREPORT)
                {
                    errorType(ERR_DIGIT_ILLEGAL);
                    break;
                }
                if((lnum == 0) && (numcnt == 1))
                    Clr_PLU_Stock_Flag = 1;
                else
                    errorType(ERR_DIGIT_ILLEGAL);
             #endif /* End STOCK */
                break;
                /*------2005-12-12 analy added-----------------------------------------*/
        #ifdef TE_01P
            case KD_DAILY_RPT:
                if(rpt_type == 1)
                    break;
                Lcd_Disp_Daily_Rpt();
                rpt_type = 1;
                break;
                
            case    KD_ALL_SALE_RPT:
                if(rpt_type == 11)
                    break;
                rpt_type = 11;
                Lcd_Disp_PTD_Rpt();
                break;
                
            case KD_DEPT_RPT:
                if(rpt_type == 2)
                    break;
                Lcd_Disp_Daily_Dept_Rpt();
                rpt_type = 2;
                break;
                
            case    KD_ALL_DEPT_RPT:
                if(rpt_type == 12)
                    break;
                Lcd_Disp_PTD_Dept_Rpt();
                rpt_type = 12;
                break;
                
            case KD_PLU_RPT:
                if(rpt_type == 4)
                    break;
                Lcd_Disp_Daily_PLU_Rpt();
                rpt_type = 4;
                break;
                
            case    KD_ALL_PLU_RPT:
                if(rpt_type == 14)
                    break;
                Lcd_Disp_PTD_PLU_Rpt();
                rpt_type = 14;
                break;
                
            case	KD_CLERK_RPT:
                if(rpt_type == 6)
                    break;
                Lcd_Disp_Daily_Clerk_Rpt();
                rpt_type = 6;
                break;
                
            case KD_ALL_CLERK_RPT:
                if(rpt_type == 16)
                    break;
                Lcd_Disp_PTD_Clerk_Rpt();
                rpt_type = 16;
                break;
                
            case	KD_HOURLY_RPT:
                if(rpt_type == 7)
                    break;
                rpt_type = 7;
                Lcd_Disp_Hourly_Rpt();
                break;
                
          #ifdef ELEC_JRNL
            case KD_EJ_PRINT:
                if(rpt_type == 201)
                    break;
                if(sysflag->Log_Atv_Flag)
                {
                    Lcd_ClrText();
                    //			Lcd_Disp_Rpt_Head();
                    Lcd_Send_Text_Buff_Str(BUF_ID_LCD_TEXT, 1, "Elec Jrnl printing", ALIGN_LEFT);
                    Lcd_Disp_Text_Buff(BUF_ID_LCD_TEXT);
                    if(Do_Elec_Jrnl_Rpt_EX(1, 1) !=OK)
                    {
                        rpt_type = 0;
                        Lcd_Disp_Text(Disp_Failed);
                        break;
                    }
                    rpt_type = 201;
                    Lcd_Disp_Text(Disp_Successful);
                }
                else
                {
                    rpt_type = 0xff;
                    errorType(ERR_EJ_ATV);
                }
                break;
          #endif
        #endif
            default:          /* If input the wrong key, error */
                if((InCmd >= KD_DP_ST)&&(InCmd <= KD_DP_END))
                {
                    #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)
                        {errorType(ERR_DIGIT_ILLEGAL);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 = getDept();           /* Get the department number. */
                    if(Idx >= Max_Dept_No)
                    {
                        errorType(ERR_DEPT_OVER);
                        break;
                    }
                    if(Idx >= MAX_REL_DEPT_CNT)
                    {
                        errorType(ERR_DEPT_LIMIT);
                        break;
                    }
                    Do_Idvul_Rpt(Idx);
                    break;
                }

                else if ((InCmd >= KD_DPLU001) && (InCmd <= KD_DPLU120))
                {
                    if(numcnt!=0)
                        {errorType(ERR_DIGIT_ILLEGAL);break;}
                    Idx = InCmd - KD_DPLU001;
                    Idx=Dplu_Pluno[Idx];
                    if((Idx == 0) || (Idx > Max_Plu_No))
                        {errorType(ERR_DIGIT_ILLEGAL);break;}
                    lnum = Idx;		/* The index number */
                    numcnt = 4;				/* Set a not zero data */
                    InCmd = KD_PLU;
                    DEBUG_SET(
                    /*do_plu_part();*/;
                    )
                }
                else
                {
                    #ifdef STOCK			/* Support the PLU stock function */
                    Clr_PLU_Stock_Flag = 0;
                    #endif /* End STOCK */
                    errorType(ERR_KEY_ILLEGAL);
                }
                break;
        } /* end switch */
    } /* end while */
} /* end xzrepmain */



/***************************************************************/
/*-------------------------------------------------------------------------------------*
 *             Print the full report in X or Z mode.
 *       Parameter:  *report: Select which report to print, the daily or the PTD
 *                   mode:    The daily mode or the PTD mode.
 *                            DAILY:   Select the Daily mode.
 *                            P-T-D:   Select the PTD mode.
 *       return:     void.
 *-------------------------------------------------------------------------------------*/
void Do_XZrep(REPORT *report, byte mode)
{  
   byte i;
   byte flag;
   long TVATAmt;
   byte prn_ra_po_info_flag = 0;

   i = 29;

/*--------------------------------------------------------------------*/

   _DrawOn();
   if(CurrMode==ZREPORT)
   {     
                                 //Print the z number.
      if(report->Z_Num==9999) report->Z_Num=0;
      report->Z_Num++;
//      memcpy(prn_Buf+1,Str_ZNum,strlen(Str_ZNum));
		xtr_strcpy(prn_Buf+1,Str_ZNum);			/* Modified on 2004-04-07 19:00 */
      LongPrnFmt((long)(report->Z_Num),0,RPOSI, RIGHTFLUSH);
      for(;i < PRN_BUF_LEN;i ++)          // If the RcptNum's length smaller than 4, adjust it with '0'.
         if(prn_Buf[i] == ' ')
            prn_Buf[i] = '0';
      print();
      prn_Line('-');
   }
   Rep_Head_Prn();

/*--------------------------------------------------------------------*/

   Do_Dept_Rep(mode);
   zero_skip_flag = 1;				/* The next support the zero skip in call the function 'Prn_Adj_Ex' */

	for(i = 0; i < MAX_PER_NUM; i ++)
	{
		if((report->Per_Item_Cnt[i] == 0) && (report->Per_Item_Amt[i] == 0) && (sysflag->zero_skip == 1)
				&& (report->Per_SubTtl_Cnt[i] == 0) && (report->Per_SubTtl_Amt[i] == 0))
			continue;
		memcpy(prn_Buf+1, percent[i].desc, MAX_DESC_LEN);
		flag = percent[i].flag;
		LongPrnFmt((((flag % 2) == 1)?-1:1)*percent[i].rate, 3, MAX_PRN_LEN - 1, RIGHTFLUSH);
		prn_Buf[MAX_PRN_LEN] = '%';
		print();
		Rpt_Prn(Str_Item, strlen(Str_Item), report->Per_Item_Cnt[i], 1, report->Per_Item_Amt[i], sysflag->sysdots);
		Rpt_Prn(Str_SubTtl, strlen(Str_SubTtl), report->Per_SubTtl_Cnt[i], 1, report->Per_SubTtl_Amt[i], sysflag->sysdots);
	}
	if((report->RF_Item_Qty!=0)||(report->RF_SubTtl_Qty!=0))
	{
		memcpy(prn_Buf+1, refund.desc, MAX_DESC_LEN);
		print();
	}
	Rpt_Prn(Str_Item, strlen(Str_Item), report->RF_Item_Qty, 0, report->RF_Item_amount, sysflag->sysdots);
	Rpt_Prn(Str_SubTtl, strlen(Str_SubTtl), report->RF_SubTtl_Qty, 0, report->RF_SubTtl_amount, sysflag->sysdots);

	if(sysflag->Tax_System)			/* Tax mode */
	{
		TVATAmt = 0;

		for(i = 0; i < MAX_TAX_NUM; i ++)
		{
			if(sysflag->zero_skip)
			{
				if(/*(report->TVATAble[i] == 0) && */(report->TVATAmt[i] == 0))
					continue;
			}
			memcpy(prn_Buf+1, Tax[i].desc, MAX_DESC_LEN);
			print();
//			prn_Adj(Str_TaxAbleAmt,report->TVATAble[i],sysflag->sysdots,RPOSI);
//			memcpy(prn_Buf+1, Str_AbleAmt, strlen(Str_AbleAmt));
			xtr_strcpy(prn_Buf+1, Str_AbleAmt);			/* Modified on 2004-04-07 18:59 */
			LongPrnFmt(report->TVATAble[i],sysflag->sysdots,RPOSI, RIGHTFLUSH);
			print();
//			prn_Adj(Str_TaxValue,report->TVATAmt[i],sysflag->sysdots,RPOSI);
			memcpy(prn_Buf+1, Str_Amt, strlen(Str

⌨️ 快捷键说明

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