📄 report1.lst
字号:
253 1
254 1 while(1)
255 1 {
256 2 SerialFlashRead(FlashDat,InvCode_address,37,ReadInvCode);//读已存的发票代码
257 2 for(i=0;i<10;i++)
258 2 {
259 3 if(ReadInvCode[i] != InInvCode[i])//输入的发票号与读出的发票号不一样
260 3 {
261 4 j=0;
262 4 break;
263 4 }
264 3 if(ReadInvCode[i] == InInvCode[i])
265 3 {
266 4 j++;
267 4 if(j==10)
268 4 {
269 5 // RePlan(2);//清进度条变量
270 5 return 1;//如果输入的发票代码存在
271 5 }
272 4 }
273 3 }
274 2 InvCode_address+=37;
275 2 x++;
276 2 if(x >= tp.dat)
277 2 {
278 3 // RePlan(2);//清进度条变量
279 3 return 0;
280 3 }
281 2 // RePlan(0);
282 2 }
283 1 }
284
285 /*--------------------------------------------------------------------------
286 按发票号查询 sn=0发票起始号 sn=1发票终止号
287 --------------------------------------------------------------------------*/
288 uchar InvNumberdemand(uchar SN,ulong InputNumber,uchar *ReadNumber)
289 {
290 1 gyt4 *xp;
291 1 gyt2 tp;
292 1 uint x=0;
293 1 ulong address;
294 1 address=InvoStatBegin;//单卷发票存放的开始地址
295 1
296 1 I2cRead(InvoStatNum,2,tp.str);
297 1
298 1 if(tp.dat == 0)
299 1 return 0; //说明没有数据.
300 1
301 1 // RePlan(1);
C51 COMPILER V8.01 REPORT1 03/28/2006 09:49:26 PAGE 6
302 1
303 1 while(1)
304 1 {
305 2 SerialFlashRead(FlashDat,address,37,ReadNumber);//读已存的发票代码
306 2
307 2
308 2 if(SN) //按发票起始号查询
309 2 xp=&ReadNumber[10];//copy发票起始号
*** WARNING C182 IN LINE 309 OF REPORT1.C: pointer to different objects
310 2 else //按发票终止号查询
311 2 xp=&ReadNumber[14];//copy发票终止号
*** WARNING C182 IN LINE 311 OF REPORT1.C: pointer to different objects
312 2 //将发票起始号转换为ulong型
313 2 if(xp->dat == InputNumber)//输入的发票号与读出的发票起始号相同
314 2 {
315 3 // RePlan(2);//清进度条变量
316 3 return 1;
317 3 }
318 2 else
319 2 {
320 3 address+=37;
321 3 x++;
322 3 if(x >= tp.dat)
323 3 {
324 4 // RePlan(2);//清进度条变量
325 4 return 0;
326 4 }
327 3 // RePlan(0);
328 3 }
329 2 }
330 1 }
331 /*-------------------------------------------------------------------------
332 按开票日期查询
333 flag=1 按开票日期查询
334 flag=0 按发票号查询
335 -------------------------------------------------------------------------*/
336 uchar OpenInvDatdemand(uchar flag,uchar *InputData,uchar *ReadOpenData)
337 {
338 1 uint x=0;
339 1 ulong InvStartAddress;
340 1 gyt4 *xp,*inp1,*inp2;
341 1 gyt2 tp;
342 1
343 1 InvStartAddress=InvoListLimit1;//发票打印数据存放的开始地址
344 1
345 1 I2cRead(InvoPrintNum,2,tp.str);
346 1
347 1 if(tp.dat == 0)
348 1 return 0; //返回 数量为0 说明没有数据
349 1
350 1 // RePlan(1);
351 1
352 1 inp1 = InputData;
*** WARNING C182 IN LINE 352 OF REPORT1.C: pointer to different objects
353 1
354 1 while(1)
355 1 {
356 2 SerialFlashRead(FlashInvo,InvStartAddress,27,ReadOpenData);
357 2
358 2 inp2 = ReadOpenData;
*** WARNING C182 IN LINE 358 OF REPORT1.C: pointer to different objects
359 2
C51 COMPILER V8.01 REPORT1 03/28/2006 09:49:26 PAGE 7
360 2 if(flag==0)//按发票号查询
361 2 xp = &ReadOpenData[4];
*** WARNING C182 IN LINE 361 OF REPORT1.C: pointer to different objects
362 2
363 2 if((inp1->dat == inp2->dat) && flag==1)//按开票日期查询标志
364 2 {
365 3 // RePlan(2);//清进度条变量
366 3 return 1;//如果存在则返回1
367 3 }
368 2 if((inp1->dat == xp->dat) && flag==0)// 标志.说明是发票号查询标志
369 2 {
370 3 // RePlan(2);//清进度条变量
371 3 return 1;//输入的发票号存在返回1
372 3 }
373 2 else
374 2 {
375 3 InvStartAddress+=27;
376 3 x++;
377 3 if(x >= tp.dat)
378 3 {
379 4 // RePlan(2);//清进度条变量
380 4 return 0;
381 4 }
382 3 // RePlan(0);
383 3 }
384 2 }
385 1 }
386
387
388 /*--------------------------------------------------------------------------
389 日交易数据查询
390 --------------------------------------------------------------------------*/
391 uchar DayCollData(uchar *InputData,uchar *ReadDayCollData)
392 {
393 1 uchar i=0;
394 1 uint x=0;
395 1 gyt2 tp;
396 1 gyt4 *inp1,*inp2;
397 1 ulong DayCollDataAddress,InDat=0,ReadDat=0;
398 1
399 1 I2cRead(DailyDatNum,2,tp.str);
400 1
401 1 if(tp.dat == 0)
402 1 return 0; //数据为0说明没有数据
403 1
404 1 // RePlan(1);
405 1
406 1 DayCollDataAddress=DailyTradeBegin;//发票打印数据存放的开始地址
407 1
408 1 inp1 = InputData;
*** WARNING C182 IN LINE 408 OF REPORT1.C: pointer to different objects
409 1
410 1 while(1)
411 1 {
412 2 SerialFlashRead(FlashDat,DayCollDataAddress,64,ReadDayCollData); //读出的发票打印数据放在ReadDayCollData
-中
413 2
414 2 inp2 = ReadDayCollData;
*** WARNING C182 IN LINE 414 OF REPORT1.C: pointer to different objects
415 2
416 2 if(inp1->dat < inp2->dat)//输入的时间小于读取的时间
417 2 {
C51 COMPILER V8.01 REPORT1 03/28/2006 09:49:26 PAGE 8
418 3 // RePlan(2);//清进度条变量
419 3 return 0;
420 3 }
421 2
422 2 if(inp1->dat == inp2->dat)
423 2 {
424 3 // RePlan(2);//清进度条变量
425 3 return 1;//如果存在则返回1
426 3 }
427 2 else
428 2 {
429 3 DayCollDataAddress+=192;
430 3 x++;
431 3 if(x >= tp.dat)
432 3 {
433 4 // RePlan(2);//清进度条变量
434 4 return 0;
435 4 }
436 3 // RePlan(0);
437 3 }
438 2 }
439 1 }
440
441 /*--------------------------------------------------------------------------
442 flag=1 营业员金额在LCD上显示
443 flag=0 营业员金额在打印机上打印
444 flag = 0 : 营业员销售金额打印
445 flag = 1 : 营业员销售金额显示
446 DatJine : 营业员销售数据
447 xzReport = 'X' 报表
448 xzReport = 'Z' 报表
449 --------------------------------------------------------------------------*/
450 void OnLcdYingYiYuangJie(uchar flag,uchar *DatJine,uchar xzReport,uchar *bh)
451 {
452 1 uchar i=0,ClearZero[6];
453 1 gyt4 *xp;
454 1
455 1 strcpy(&WinHint[0][0],"编 号:");//不使用窗体函数则可以从WinHint[][0]位置开始存放
456 1 NumToStr(bh[0],&WinHint[0][7],0);
457 1
458 1 xp=DatJine;
*** WARNING C182 IN LINE 458 OF REPORT1.C: pointer to different objects
459 1 strcpy(&WinHint[1][0],"销售额:");
460 1 if(xp->dat == 0)
461 1 strcpy(&WinHint[1][7],"0.00");
462 1 else
463 1 NumToStr(xp->dat,&WinHint[1][7],5);
464 1
465 1 if(flag)
466 1 {
467 2 LcdDisplay(0,16," 营业员销售额查询",3);
468 2 LcdDisplay(16,0,WinHint[0],0);
469 2 LcdDisplay(32,0,WinHint[1],0);
470 2 LcdDisplay(48,Hj,"[退出]",0);
471 2 while(1)
472 2 if(KeyScan()==K_TC)break;
473 2 }
474 1 else
475 1 {
476 2 PrintLine("营业员销售额");
477 2 PrintStr(WinHint[0]);
478 2 PrintStr(WinHint[1]);
C51 COMPILER V8.01 REPORT1 03/28/2006 09:49:26 PAGE 9
479 2 PrintStr("电子存根");
480 2 PrintLine("");
481 2 }
482 1 if(xzReport == 'Z')
483 1 {
484 2 for(i=0;i<4;i++)
485 2 ClearZero[i]=0;
486 2 i = bh[0];
487 2 Businessdemand(i,ClearZero,xzReport);//将营业员销售金额清零
488 2 }
489 1 }
490
491 /*-------------------------------------------------------------------------
492 机器出厂数据显示与打印函数
493 flag = 1: 显示
494 flag = 2: 打印
495 -------------------------------------------------------------------------*/
496 void MachineData_LP(uchar flag,uchar *str)
497 {
498 1 uchar i=0,InitVal[4],PrintBuf[50];
499 1
500 1 WindowsSet(7);
501 1
502 1 strcpy(&WinHint[0][1],"机器编号:");
503 1 for(i=0;i<16;i++)
504 1 WinHint[1][i+1]=str[i];
505 1 WinHint[1][i+1]=0;//机器出厂数据
506 1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -