| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 684 人关注过本帖, 1 人收藏
标题:编程心得
取消只看楼主 加入收藏
wangchatian
Rank: 2
等 级:论坛游民
帖 子:34
专家分:10
注 册:2011-1-24
结帖率:50%
收藏(1)
已结贴  问题点数:20 回复次数:2 
编程心得
                  
   我在编写财务软件时曾遇到过一些难点和问题,在解决这些问题的过程中有一点,我在里写出来,愿与各位朋友分享,同时也希望得到各位的指点。
   我的一些在中小企业做会计工作的朋友往往会对我说: 他们所用的财务软件不太好用。我问他们是哪家的软件时,而他们告诉我的都是些著名的软件公司。我很纳闷。说实在话,
对财务我并非内行,于是我应邀去了他们公司现场观看了他们操作,结果我发现:
1、    他们所用的软件都是著名财务软件,功能强大,实应性强,技术是不容质疑的。
2、    这些软件面向面宽,功能齐全,自然选项就多,操作复杂。
3、    其实对许多中小企业来说,很多选项是不需要的。
在这些朋友的鼓动和激励下我考虑为中小企业设计一款财务软件。
基本流程我参照了航天信息公司的同类软件,汲取了他们的优点:
在编写凭证录入的模块中比较难的问题有三个:
     1、金额制和金额数量制两中模式的转换;
     2、第二个难点就是显示合计的大写;(这么简单的问题啊,见笑了);
     3、第三个难点是用树形结构显示科目供选择;
这三个问题的解决我贴出来吧,与朋友交流,并希望得到指导。
我是用stringgrid 控件作为父类 增加了几个属性和方法,其中利用了Canvas 对象,来解决第一个问题的。详细的过程我就不多说了,只要有一点Delphi基础应该不难。
解决第二个问题我写了三个函数,我把源码贴出来吧:
var
sdx:string;
begin
if s='1' then
sdx:='壹'
else if s='2'  then
sdx:='贰'
else  if  s='3' then
sdx:='叁'
else if s='4'  then
sdx:='肆'
else  if  s='5' then
sdx:='伍'
else if s='6'  then
sdx:='陆'
else  if  s='7' then
sdx:='柒'
else if s='8'  then
sdx:='捌'
else  if  s='9' then
sdx:='玖'
else if s='0'  then
sdx:='零';
result:=sdx;
end;
//-------------------------------------------
function  TF_publicuse.wz(j:integer):string;
var
swz:string;
begin
if j=0 then
swz:='分'
else if j=1 then
swz:='角'
else if j=2 then
swz:='元'
else if j=4 then
swz:='拾'
else if j=5 then
swz:='百'
else if j=6 then
swz:='千'
else if j=7 then
swz:='万'
else if j=8 then
swz:='拾'
else if j=9 then
swz:='百'
else if j=10 then
swz:='千'
else if j=11 then
swz:='亿';
result:=swz;
end;


function TF_publicuse.DXWZ(s:string):string;
var
s1,s2 :string;
n,j:integer;
strdx:string;
begin
n:=length(s);
for j:=0 to  n-1  do
begin
s1:=midstr(s,n-j,1);
if j>=7 then
begin
if (j=7) and (s1='0') then
strdx:=wz(j)+strdx
else if (j>7) and (s1='0') and (s1=s2) then
strdx:=strdx
else if (j>7) and (s1='0') and (s1<>s2) then
strdx:=dx(s1)+strdx
else
strdx:=dx(s1)+wz(j)+strdx;
end else
begin
if (j=0) and (s1='0')  then
strdx:='整'
else if  (j=3)  and (s1='0') then
strdx:=strdx
else if (s1='0') and (s1=s2) then
strdx:=strdx
else   if (s1='0') and (s1<>s2)   then
strdx:=dx(s1)+strdx
else
strdx:=dx(s1)+wz(j)+strdx;
end;
s2:=s1;
end;
result:=strdx;
end;
今天就交流到此吧,下次再续(下次将交流现金流量表的编写)。


[ 本帖最后由 wangchatian 于 2011-9-10 17:08 编辑 ]
搜索更多相关主题的帖子: 软件 财务软件 技术 
2011-09-10 16:58
wangchatian
Rank: 2
等 级:论坛游民
帖 子:34
专家分:10
注 册:2011-1-24
收藏
得分:0 
回复 4楼 xh20030402
代码简洁,很不错,望今后多交流。
2011-09-17 11:30
wangchatian
Rank: 2
等 级:论坛游民
帖 子:34
专家分:10
注 册:2011-1-24
收藏
得分:0 
回复 7楼 冰蟾子
中间连续为零的情况已考虑了啊,谢谢你的光顾。
2011-09-30 08:56
快速回复:编程心得
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.011366 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved