程设小组作业——计算机配件的进货/销售管理系统

sale_stastics_start.h 目前资金统计函数 (系统启动时获取数据用)

////////////////////////////////////
/*
资金统计函数:用于系统刚启动时的数据初始化计算
*/
int sale_stastics_start(plink head){
plink p;
p=read(1);
//save_old(1);
//free(head);
while(p!=NULL)
{
current_funds-=p->total;
current_welfle-=p->total;
p=p->next;
}
p=read(2);
//save_old(2);
//free(head);
while(p!=NULL)
{
current_funds+=p->total;
current_welfle+=p->total;
p=p->next;
}
p=read(3);
//save_old(3);
//free(head);
while(p!=NULL)
{
current_funds+=p->total;
current_welfle+=p->total;
p=p->next;
}
}

点赞

发表评论