?? inq_tfe.c
字號:
case 1:
outf(x,y,BK_CLR,CHR_CLR,"%-4u年%-2u月%-2u日%-2u時",\
Ts_time.year, Ts_time.month,\
Ts_time.day, Ts_time.hour);
break;
case 2:
outf(x,y,BK_CLR,CHR_CLR,"%-4u年%-2u月%-2u日%-2u時",\
Te_time.year, Te_time.month,\
Te_time.day, Te_time.hour);
break;
case 3:
tch = Statsfee.intern_charge + Statsfee.nation_charge +\
Statsfee.local_charge;
tch += Statsfee.month_lease;
for(k=0; k<5; k++)
tch += Statsfee.addfee[k];
traned=fdigt_tran(tch/100);
outf(x, y, BK_CLR, CHR_CLR, "%-s", traned);
break;
default:
break;
} /* END SWITCH */
}
return;
}
/* function: change the floating point to character for commercial use
* called by: tfee_disp_tbl
* caller: none
* date: 1994.12.5
*/
char *fdigt_tran(double betran)
{
char *tbuf;
char traned[20];
int i, sign, dec, ndig=11;
if( betran == 0 )
{
traned[0]=0x30;
traned[1]=0x00;
return traned;
}
tbuf = fcvt(betran, ndig, &dec, &sign);
if(dec <= 3)
{
for(i=0; i<dec; i++)
traned[i] = tbuf[i];
traned[i] = 0x2e;
traned[i+1] = tbuf[i];
traned[i+2] = tbuf[i+1];
traned[i+3] = 0x00;
}
else if(dec <=6)
{
for(i=0; i<dec-3; i++)
traned[i] = tbuf[i];
traned[i] = 0x2c;
for(; i<dec; i++)
traned[i+1] = tbuf[i];
traned[i+1] = 0x2e;
traned[i+2] = tbuf[i];
traned[i+3] = tbuf[i+1];
traned[i+4] = 0x00;
}
else if(dec <=9)
{
for(i=0; i<dec-6; i++)
traned[i] = tbuf[i];
traned[i] = 0x2c;
for(; i<dec-3; i++)
traned[i+1] = tbuf[i];
traned[i+1] = 0x2c;
for(; i<dec; i++)
traned[i+2] = tbuf[i];
traned[i+2] = 0x2e;
traned[i+3] = tbuf[i];
traned[i+4] = tbuf[i+1];
traned[i+5] = 0x00;
}
else
return NULL;
return traned;
}
/* function: change the long integer to character for commercial use
* called by: tfee_disp_tbl
* caller: none
* date: 1994.12.5
*/
char *ldigt_tran(UL betran)
{
char tbuf[15];
char traned[20];
int i, len;
if( betran == 0 )
{
traned[0]=0x30;
traned[1]=0x00;
return traned;
}
ltoa(betran, tbuf, 10);
len = strlen(tbuf);
if(len <= 3)
{
for(i=0; i<len; i++)
traned[i] = tbuf[i];
traned[i] = 0x00;
}
else if(len <= 6)
{
for(i=0; i<len-3; i++)
traned[i] = tbuf[i];
traned[i] = 0x2c;
for(; i<len; i++)
traned[i+1] = tbuf[i];
traned[i+1] = 0x00;
}
else if(len <=9)
{
for(i=0; i<len-6; i++)
traned[i] = tbuf[i];
traned[i] = 0x2c;
for(; i<len-3; i++)
traned[i+1] = tbuf[i];
traned[i+1] = 0x2c;
for(; i<len; i++)
traned[i+2] = tbuf[i];
traned[i+2] = 0x00;
}
else if(len <=12)
{
for(i=0; i<len-9; i++)
traned[i] = tbuf[i];
traned[i] = 0x2c;
for(; i<len-6; i++)
traned[i+1] = tbuf[i];
traned[i+1] = 0x2c;
for(; i<len-3; i++)
traned[i+2] = tbuf[i];
traned[i+2] = 0x2c;
for(; i<len-3; i++)
traned[i+3] = tbuf[i];
traned[i+3] = 0x00;
}
else
return NULL;
return traned;
}
/* function: print the total fee in some period
* called by: inq_total_fee() and statsrics()
* caller: none
* date: 1994.12.5
*/
void prt_total_fee(void)
{
FILE *fp;
UI k;
UL th[4], tm[4], ttm, tcu;
double tch;
struct date now;
UC *head = " 話 費 匯 總 報 表";
if(check_prn() == FALSE) /* not ready */
return;
fp = fopen("gfsdata\\totfee.dat","rb");
if(fp == NULL)
{
message(TFEE_FILE_ERR);
return;
}
fread(&Statsfee, sizeof(FE_STAT_STRUCT), 1, fp);
fclose(fp);
fp = fopen(TotTimeFileName,"rb");
if(fp == NULL)
{
message(TFEE_FILE_ERR);
return;
}
fread(&Ts_time, sizeof(TIME_STRUCT), 1, fp);
fread(&Te_time, sizeof(TIME_STRUCT), 1, fp);
fclose(fp);
message_disp(8,"正在打印,請稍候..."); /* printing */
if(prnfd("\n%s\n\n", head)==FALSE)
{
message_end();
return;
}
if(print_invtbl1() == FALSE)
{
message_end();
return;
}
if(print_invdtl1() == FALSE)
{
message_end();
return;
}
if(print_invtbl2() == FALSE)
{
message_end();
return;
}
tch = (double)(Statsfee.intern_charge + Statsfee.nation_charge +\
Statsfee.local_charge)/100;
if( prnf("┃ 話 費 │ %9.2f │ %9.2f │ %9.2f │ %9.2f┃\n",\
(double)(Statsfee.intern_charge)/100, (double)(Statsfee.nation_charge)/100,\
(double)(Statsfee.local_charge)/100,\
tch)==FALSE)
{
message_end();
return;
}
if(print_invtbl2() == FALSE)
{
message_end();
return;
}
ttm = Statsfee.intern_time;
if( ttm%60 != 0 )
tm[0] = (ttm/60 + 1) % 60;
else
tm[0] = (ttm/60) % 60;
th[0] = (ttm/60 + 1) / 60;
ttm = Statsfee.nation_time;
if( ttm%60 != 0 )
tm[1] = (ttm/60 + 1) % 60;
else
tm[1] = (ttm/60) % 60;
th[1] = (ttm/60 + 1) / 60;
ttm = Statsfee.local_time;
if( ttm%60 != 0 )
tm[2] = (ttm/60 + 1) % 60;
else
tm[2] = (ttm/60) % 60;
th[2] = (ttm/60 + 1) / 60;
ttm = Statsfee.intern_time + Statsfee.nation_time + Statsfee.local_time;
if( ttm%60 != 0 )
tm[3] = (ttm/60 + 1) % 60;
else
tm[3] = (ttm/60) % 60;
th[3] = (ttm/60 + 1) / 60;
if(prnf("┃ 時 長 │ %6lu時%2u分 │%6lu時%2u分 │ %6lu時%2u分 │%6lu時%2u分┃\n",\
th[0],(UI)tm[0],th[1],(UI)tm[1],th[2],(UI)tm[2],th[3],(UI)tm[3])==FALSE)
{
message_end();
return;
}
if(print_invtbl2() == FALSE)
{
message_end();
return;
}
tcu = Statsfee.intern_count + Statsfee.nation_count +\
Statsfee.local_count;
if(prnf("┃ 次 數 │ %10lu │ %10lu │ %10lu │ %10lu┃\n",\
Statsfee.intern_count, Statsfee.nation_count,\
Statsfee.local_count,\
tcu)==FALSE)
{
message_end();
return;
}
if(print_invtbl3() == FALSE)
{
message_end();
return;
}
if(print_invdtl2() == FALSE)
{
message_end();
return;
}
if(print_invtbl4() == FALSE)
{
message_end();
return;
}
tch = (double)(Statsfee.month_lease)/100+\
(double)(Statsfee.addfee[0])/100+\
(double)(Statsfee.addfee[1])/100+\
(double)(Statsfee.addfee[2])/100+\
(double)(Statsfee.addfee[3])/100+\
(double)(Statsfee.addfee[4])/100;
if(prnf("┃ %8.2f │%8.2f│%8.2f│%8.2f│%8.2f│ %8.2f │ %9.2f┃\n",\
(double)(Statsfee.month_lease)/100,\
(double)(Statsfee.addfee[0])/100,\
(double)(Statsfee.addfee[1])/100,\
(double)(Statsfee.addfee[2])/100,\
(double)(Statsfee.addfee[3])/100,\
(double)(Statsfee.addfee[4])/100,tch) == FALSE)
{
message_end();
return;
}
if(print_invtbl5() == FALSE)
{
message_end();
return;
}
if(print_invdtl4() == FALSE)
{
message_end();
return;
}
if(print_invtbl6() == FALSE)
{
message_end();
return;
}
tch = (double)Statsfee.intern_charge + (double)Statsfee.nation_charge +\
(double)Statsfee.local_charge;
tch += (double)Statsfee.month_lease;
for(k=0; k<5; k++)
tch += (double)Statsfee.addfee[k];
if(prnf("┃ 人 民 幣 元 │%-4u年%2u月%2u日%2u時│%-4u年%2u月%2u日%2u時 │ %9.2f┃\n",\
Ts_time.year, Ts_time.month,\
Ts_time.day, Ts_time.hour,\
Te_time.year, Te_time.month,\
Te_time.day, Te_time.hour, tch/100\
)==FALSE)
{
message_end();
return;
}
if(print_invtbl7() == FALSE)
{
message_end();
return;
}
getdate(&now);
if(prnf(" 制表時間:%-4u年%-2u月%-2u日\n",now.da_year, now.da_mon, now.da_day ) == FALSE)
return;
/* new page */
if(new_page() == FALSE)
return;
message_end();
return;
}
/*
話 費 匯 總 報 表
┏━━━━━┯━━━━━━━━┯━━━━━━━┯━━━━━━━━┳━━━━━━┓
┃ 項 目 │ 國 際 長 途 │ 國 內 長 途 │ 市 話 ┃ 合 計 ┃
┠─────┼────────┼───────┼────────╂──────┨
┃ 話 費 │ %-9.2f │ %-9.2f │ %-9.2f ┃%-9.2f ┃
┠─────┼────────┼───────┼────────╂──────┨
┃ 時 長 │ %-6luh%2um │ %-6luh%2um │ %-6luh%2um ┃%-6luh%2um ┃
┠─────┼────────┼───────┼────────╂──────┨
┃ 次 數 │ %-10lu │ %-10lu │ %-10lu ┃%-10lu ┃
┠─────┼────┬───┴┬────┬─┴──┬─────╂──────┨
┃ 月 租 費 │新業務費│人工長途│維 修 費│其 它 費│ 附 加 費 ┃ 合 計 ┃
┠─────┼────┼────┼────┼────┼─────╂──────┨
┃%-8.2f │%-7.2f│%-7.2f│%-7.2f│%-7.2f│%-8.2f ┃%-9.2f ┃
┠─────┴────┼────┴────┼────┴─────╂──────┨
┃ 單 位 │ 起 始 時 間 │ 終 止 時 間 ┃ 總 費 ┃
┠──────────┼─────────┼──────────╂──────┨
┃ 人 民 幣 元 │%-4u年%2u月%2u日%2u時│%-4u年%2u月%2u日%2u時 ┃%-9.2f ┃
┗━━━━━━━━━━┷━━━━━━━━━┷━━━━━━━━━━┻━━━━━━┛
話 費 匯 總 報 表
┏━━━━━┯━━━━━━━━┯━━━━━━━┯━━━━━━━━┳━━━━━━┓
┃ 項 目 │ 國 際 長 途 │ 國 內 長 途 │ 市 話 ┃ 合 計 ┃
┠─────┼────────┼───────┼────────╂──────┨
┃ 話 費 │ 000000.00 │ 000000.00 │ 000000.00 ┃ 0000000.00 ┃
┠─────┼────────┼───────┼────────╂──────┨
┃ 時 長 │ 000000h00m │ 000000h00m │ 000000h00m ┃000000時00秒┃
┠─────┼────────┼───────┼────────╂──────┨
┃ 次 數 │ 000000000 │ 000000000 │ 000000000 ┃ 0000000000 ┃
┠─────┼────┬───┴┬────┬─┴──┬─────╂──────┨
┃ 月 租 費 │新業務費│人工長途│維 修 費│其 它 費│ 附 加 費 ┃ 合 計 ┃
┠─────┼────┼────┼────┼────┼─────╂──────┨
┃000000.00 │00000.00│00000.00│00000.00│00000.00│000000.00 ┃ 0000000.00 ┃
┠─────┴────┼────┴────┼────┴─────╂──────┨
┃ 單 位 │ 起 始 時 間 │ 終 止 時 間 ┃ 總 費 ┃
┠──────────┼─────────┼──────────╂──────┨
┃ 人 民 幣 元 │0000--00--00--00--│ 0000--00--00--00-- ┃00000000.00 ┃
┗━━━━━━━━━━┷━━━━━━━━━┷━━━━━━━━━━┻━━━━━━┛
用 戶 話 費 收 據
分機號碼: 0123456
┏━━━━┯━━━━━┯━━━━━┯━━━━━┯━━━━━┯━━━━━┓
┃ 項 目 │ 國際長途 │ 國內長途 │ 市內電話 │ 服務費 │ 合 計 ┃
┠────┼─────┼─────┼─────┼─────┼─────┨
┃ 話 費 │01234.67元│01234.67元│01234.67元│01234.67元│01234.67元┃
┠────┼─────┼─────┼─────┼─────┼─────┨
┃ 時 長 │0123時01分│0123時01分│0123時01分│ │0123時01分┃
┠────┼─────┼─────┼─────┼─────┼─────┨
┃ 次 數 │0123456789│0123456789│0123456789│ │0123456789┃
┗━━━━┷━━━━━┷━━━━━┷━━━━━┷━━━━━┷━━━━━┛
結算時段: 0123年01月01日01時至0123年01月01日01時 制單: 0123年01月01日
*/
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -