发布v2.5.6版本

This commit is contained in:
雨中磐石
2023-04-26 15:46:53 +08:00
parent 33ce4c6298
commit 8145b2df84
55 changed files with 1193 additions and 223 deletions

View File

@@ -68,24 +68,32 @@ class finaClassModel extends Model
$rows = m('finzhang')->getall("status=1 ".$where."",'*','sort, startdt desc');
$arr = array();
foreach($rows as $k=>$rs){
$arr[] = array(
$sarr = array(
'value' => $rs['id'],
'name' => $rs['name'],
'subname' => $rs['startdt'].'→'.$rs['enddt'],
);
if($lx==2){
unset($sarr['subname']);
$sarr['name'].='('.$rs['startdt'].')';
}
$arr[] = $sarr;
}
return $arr;
}
//获取财务帐号
public function getaccount()
public function getaccount($zhid='')
{
$where= m('admin')->getcompanywhere(3);
if(!$zhid)$zhid='0';
$where= 'and `zhangid`='.$zhid.'';
$rows = m('finount')->getall("status=1 ".$where."",'*','sort');
$arr = array();
foreach($rows as $k=>$rs){
$name = $rs['name'];
if(!isempt($rs['banknum']))$name.='(**'.substr($rs['banknum'],-4).')';
$arr[] = array(
'value' => $rs['id'],
'name' => $rs['name'],
'name' => $name,
);
}
return $arr;
@@ -105,4 +113,26 @@ class finaClassModel extends Model
if(isempt($accid))$db->update('`money`=0', '`id` not in('.$ids.')');
}
//读取科目数据
private $datarows = array();
public function kemudata()
{
$data = m('finkemu')->getall('`status`=1','*','`sort`');
$this->kemudatas($data, 0,'');
return $this->datarows;
}
private function kemudatas($data,$pid,$nae)
{
foreach($data as $k=>$rs){
if($pid==$rs['pid']){
$this->datarows[] = array(
'value' => $rs['id'],
'name' => ''.$rs['num'].' '.$nae.''.$rs['name'].''
);
$this->kemudatas($data, $rs['id'],$nae.$rs['name'].'-');
}
}
}
}

View File

@@ -1,8 +1,9 @@
<?php
//客户收款单
//客户收款单
class flow_custfinaClassModel extends flowModel
{
public $statearrs,$statearrf;
public $delbool = 0;
public function initModel(){
$this->statearrs = c('array')->strtoarray('未收款|red,已收款|green');
$this->statearrf = c('array')->strtoarray('未付款|red,已付款|green');
@@ -10,6 +11,8 @@ class flow_custfinaClassModel extends flowModel
public function flowrsreplace($rs)
{
if($rs['id']==0)return $rs;
$starrr = array('收','付');
$rs['paystatus'] = $rs['ispay'];
$ispay = '<font color=red>未'.$starrr[$rs['type']].'款</font>';
@@ -17,6 +20,29 @@ class flow_custfinaClassModel extends flowModel
$rs['ispay'] = $ispay;
$rs['type'] = ''.$starrr[$rs['type']].'款单';
$htid = $rs['htid'];
$url = '';
if($htid>0)$url = $this->getxiangurl('custract', $htid, 'auto');
if($htid<0)$url = $this->getxiangurl('custxiao', 0-$htid, 'auto');
if(arrvalue($rs,'xgid') && arrvalue($rs,'xgnum'))$url = $this->getxiangurl($rs['xgnum'], $rs['xgid'], 'auto');
if($url && !isempt($rs['htnum']))
$rs['htnum'] = '<a href="javascript:;" onclick="js.open(\''.$url.'\')">'.$rs['htnum'].'</a>';
if($rs['custid']>0){
//$url = $this->getxiangurl('customer', $rs['custid'], 'auto');
//$rs['custname'] = '<a href="javascript:;" onclick="js.open(\''.$url.'\')">'.$rs['custname'].'</a>';
}
$jzid = arrvalue($rs,'jzid');
if($jzid>0){
$url = $this->getxiangurl('finjishou', $jzid, 'auto');
$rs['jzid'] = '<a href="javascript:;" onclick="js.open(\''.$url.'\')">已生成</a>';
}else if($jzid=='-1'){
$rs['jzid'] = '<font color=#aaaaaa>不需要</font>';
}else{
$rs['jzid'] = '';
}
return $rs;
}
@@ -31,6 +57,31 @@ class flow_custfinaClassModel extends flowModel
$this->update("`ispay`='$ispay',`paydt`='$paydt'", $this->id);
m('crm')->ractmoney($this->rs['htid']);
}
//复制一单
if($ors['num']=='noupfuzhe'){
$jine = $this->rock->number(trim($arr['sm']));
$uarr = $this->getone($this->id);
$money= $uarr['money'];
unset($uarr['id']);
$uarr['createname'] = $this->adminname;
$uarr['createid'] = $this->adminid;
$uarr['money'] = $jine;
$this->insert($uarr);
$this->update('`money`=`money`-'.$jine.'', $this->id);
}
}
//操作菜单操作之前
protected function flowoptmenubefore($ors, $arr)
{
if($ors['num']=='noupfuzhe'){
$sm = trim($arr['sm']);
if(!$sm || !is_numeric($sm))return '输入“'.$sm.'”的不是金额';
$sm = $this->rock->number($sm);
if(floatval($sm)<=0)return '输入金额必须大于0';
if(floatval($sm) >= floatval($this->rs['money']))return '输入的金额不能超过'.$this->rs['money'].'';
}
}
protected function flowbillwhere($uid, $lx)
@@ -46,4 +97,30 @@ class flow_custfinaClassModel extends flowModel
'order' => '`optdt` desc'
);
}
protected function flowdeletebill($sm)
{
$this->delbool++;
$xgid = arrvalue($this->rs,'xgid');
$xgnum = arrvalue($this->rs,'xgnum');
$sid = $this->id;
if($xgnum && $xgid && $this->delbool==1){
$sflow = m('flow:'.$xgnum.'')->initbase($xgnum);
$drows = $this->getall("`xgnum`='$xgnum' and `xgid`='$xgid'");//相关联一起删
foreach($drows as $k=>$rs1){
$mid = $rs1['id'];
$this->loaddata($mid, false);
$this->deletebill($sm, false);
}
$sflow->update('`payid`=0', $xgid);
}
$this->id = $sid;
}
protected function flowgetoptmenu($opt,$bo=false)
{
if($opt=='noupcreatejz' && $bo){
return m('mode')->iscun('finjishou');
}
}
}

View File

@@ -1,8 +1,9 @@
<?php
//客户付款单
//客户付款单
class flow_custfinbClassModel extends flowModel
{
public $statearrs,$statearrf;
public $delbool = 0;
public function initModel(){
$this->statearrs = c('array')->strtoarray('未收款|red,已收款|green');
$this->statearrf = c('array')->strtoarray('未付款|red,已付款|green');
@@ -10,6 +11,8 @@ class flow_custfinbClassModel extends flowModel
public function flowrsreplace($rs)
{
if($rs['id']==0)return $rs;
$starrr = array('收','付');
$rs['paystatus'] = $rs['ispay'];
$ispay = '<font color=red>未'.$starrr[$rs['type']].'款</font>';
@@ -17,6 +20,29 @@ class flow_custfinbClassModel extends flowModel
$rs['ispay'] = $ispay;
$rs['type'] = ''.$starrr[$rs['type']].'款单';
$htid = $rs['htid'];
$url = '';
if($htid>0)$url = $this->getxiangurl('custract', $htid, 'auto');
if($htid<0)$url = $this->getxiangurl('custxiao', 0-$htid, 'auto');
if(arrvalue($rs,'xgid') && arrvalue($rs,'xgnum'))$url = $this->getxiangurl($rs['xgnum'], $rs['xgid'], 'auto');
if($url && !isempt($rs['htnum']))
$rs['htnum'] = '<a href="javascript:;" onclick="js.open(\''.$url.'\')">'.$rs['htnum'].'</a>';
if($rs['custid']>0){
//$url = $this->getxiangurl('customer', $rs['custid'], 'auto');
//$rs['custname'] = '<a href="javascript:;" onclick="js.open(\''.$url.'\')">'.$rs['custname'].'</a>';
}
$jzid = arrvalue($rs,'jzid');
if($jzid>0){
$url = $this->getxiangurl('finjizhi', $jzid, 'auto');
$rs['jzid'] = '<a href="javascript:;" onclick="js.open(\''.$url.'\')">已生成</a>';
}else if($jzid=='-1'){
$rs['jzid'] = '<font color=#aaaaaa>不需要</font>';
}else{
$rs['jzid'] = '';
}
return $rs;
}
@@ -31,6 +57,31 @@ class flow_custfinbClassModel extends flowModel
$this->update("`ispay`='$ispay',`paydt`='$paydt'", $this->id);
m('crm')->ractmoney($this->rs['htid']);
}
//复制一单
if($ors['num']=='noupfuzhe'){
$jine = $this->rock->number(trim($arr['sm']));
$uarr = $this->getone($this->id);
$money= $uarr['money'];
unset($uarr['id']);
$uarr['createname'] = $this->adminname;
$uarr['createid'] = $this->adminid;
$uarr['money'] = $jine;
$this->insert($uarr);
$this->update('`money`=`money`-'.$jine.'', $this->id);
}
}
//操作菜单操作之前
protected function flowoptmenubefore($ors, $arr)
{
if($ors['num']=='noupfuzhe'){
$sm = trim($arr['sm']);
if(!$sm || !is_numeric($sm))return '输入“'.$sm.'”的不是金额';
$sm = $this->rock->number($sm);
if(floatval($sm)<=0)return '输入金额必须大于0';
if(floatval($sm) >= floatval($this->rs['money']))return '输入的金额不能超过'.$this->rs['money'].'';
}
}
protected function flowbillwhere($uid, $lx)
@@ -46,4 +97,36 @@ class flow_custfinbClassModel extends flowModel
'order' => '`optdt` desc'
);
}
protected function flowdeletebill($sm)
{
$this->delbool++;
$xgid = arrvalue($this->rs,'xgid');
$xgnum = arrvalue($this->rs,'xgnum');
$sid = $this->id;
if($xgnum && $xgid && $this->delbool==1){
$sflow = m('flow:'.$xgnum.'')->initbase($xgnum);
$drows = $this->getall("`xgnum`='$xgnum' and `xgid`='$xgid'");//相关联一起删
foreach($drows as $k=>$rs1){
$mid = $rs1['id'];
$this->loaddata($mid, false);
$this->deletebill($sm, false);
}
$sflow->update('`payid`=0', $xgid);
}
$this->id = $sid;
}
protected function flowgetoptmenu($opt,$bo=false)
{
if($opt=='noupcreatejz' && $bo){
return m('mode')->iscun('finjizhi');
}
}
public function flowlistscript()
{
include_once('webmain/flow/page/rock_page_custfina_script.php');
return '';
}
}

File diff suppressed because one or more lines are too long

View File

@@ -9,9 +9,13 @@ class flow_userractClassModel extends flowModel
$this->statearr = explode(',','<font color=blue>待执行</font>,<font color=green>生效中</font>,<font color=#888888>已终止</font>,<font color=red>已过期</font>');
}
public function flowrsreplace($rs)
public function flowrsreplace($rs, $lx=0)
{
$rs['state'] = $this->statearr[$rs['state']];
if(isset($rs['newname']) && !isempt($rs['newname']) && $rs['newname']!=$rs['uname'])$this->update("`uname`='".$rs['newname']."'",$rs['id']);
if($lx==1){
$rs['deptname'] = $this->adminmodel->getmou('deptname', $rs['uid']);
}
return $rs;
}
public function updatestate()
@@ -31,7 +35,7 @@ class flow_userractClassModel extends flowModel
return array(
'where' => '',
'table' => $table,
'fields'=> 'a.*,b.deptname',
'fields'=> 'a.*,b.deptname,b.`name` as newname',
'orlikefields'=>'b.deptname',
'order' => 'a.`optdt` desc',
'asqom' => 'a.'

View File

@@ -69,19 +69,30 @@ class homeitemsClassModel extends Model
if(in_array('flowtodo', $nubar) && !isset($arr['flowtodo']))$arr['flowtodo'] = m('flowtodo')->getwdtotals($uid);
if(in_array('cropt', $nubar) && !isset($arr['cropt']))$arr['cropt'] = m('goods')->getdaishu(); //出入库操作数
if(in_array('receiptmy', $nubar) && !isset($arr['receiptmy']))$arr['receiptmy'] = m('flow:receipt')->getweitotal($uid);
if(in_array('myhong', $nubar) && !isset($arr['myhong']))$arr['myhong'] = m('official')->rows('`uid`='.$uid.' and `type`=0 and `status`=1 and `thid`=0');//统计未套红的
if(in_array('officidus', $nubar) && !isset($arr['officidus']))$arr['officidus'] = m('officidu')->rows('`status` in(0,3) and `isturn`=1 and '.$this->rock->dbinstr('runrenid',$uid).'');
if(in_array('myhong', $nubar) && !isset($arr['myhong']) && $this->iscun('officiahong'))$arr['myhong'] = m('official')->rows('`uid`='.$uid.' and `type`=0 and `status`=1 and `thid`=0');//统计未套红的
if(in_array('officidus', $nubar) && !isset($arr['officidus']) && $this->iscun('officidu'))$arr['officidus'] = m('officidu')->rows('`status` in(0,3) and `isturn`=1 and '.$this->rock->dbinstr('runrenid',$uid).'');
//未完成工作计划
if(in_array('myplan', $nubar) && !isset($arr['myplan'])){
if(in_array('myplan', $nubar) && !isset($arr['myplan']) && $this->iscun('planm')){
$obj = m('flow:planm');
if(method_exists($obj,'getwwctotals'))$arr['myplan'] = $obj->getwwctotals($uid);
}
if($this->iscun('custfina')){
$dbss = m('custfina');
if(in_array('daifina', $nubar))$arr['daifina'] = $dbss->rows('`ispay`=1 and `jzid`=0 and `type`=0');
if(in_array('daifinb', $nubar))$arr['daifinb'] = $dbss->rows('`ispay`=1 and `jzid`=0 and `type`=1');
}
return $arr;
}
//判断模块是否开启存在
public function iscun($num)
{
$to = $this->db->rows('[Q]flow_set',"`num`='$num' and `status`=1");
return $to==1;
}
//我的申请
public function get_apply_arr()

View File

@@ -81,7 +81,7 @@ class modeClassModel extends Model
$farr[] = array('name'=>arrvalue($chufarr, 'base_name', '申请人'),'fields'=>'base_name');
$farr[] = array('name'=>arrvalue($chufarr, 'base_deptname', '申请人部门'),'fields'=>'base_deptname');
$farr[] = array('name'=>arrvalue($chufarr, 'base_sericnum', '单号'),'fields'=>'sericnum');
$farrs = m('flow_element')->getall("`mid`='$modeid'",'`fields`,`name`,`fieldstype`,`ispx`,`isalign`,`iszb`,`islb`,`issou`,`data`','`iszb`,`sort`');
$farrs = m('flow_element')->getall("`mid`='$modeid'",'`fields`,`name`,`fieldstype`,`ispx`,`isalign`,`iszb`,`islb`,`issou`,`data`,`width`','`iszb`,`sort`');
$inpub = c('input');
$zbarr = $zbnamea = array();
if(!isempt($mors['names']))$zbnamea = explode(',', $mors['names']);
@@ -139,11 +139,13 @@ class modeClassModel extends Model
if($glx==1){
return array(
'isflow' => $isflow,
'modeid' => $modeid,
'fieldsarr' => $farr,
'fieldzarr' => $zbarr,
'fieldsselarr' => $fselarr,
'chufarr' => $chufarr,
'modename' => $name,
'modetable'=> $this->rock->jm->encrypt($mors['table']),
'modenames' => $this->rock->repempt($mors['names']),
);
}
@@ -281,7 +283,7 @@ $rstr = "".$hstart."
$arr['gongwen'] = '204,239,289,290,232,256,258,291,292,293,306,205,257,259,294,255,233,206,304,305';
$arr['crm'] = '63,37,64,73,104,105,114,118,126,179,262,299,131,132,75,112,113,123,263,317,110,111,108,109,106,119,115,116,117,107,120,121,122,175,176,177,178,264,302,318,300,301,386,387';
$arr['crm'] = '63,37,64,73,104,105,114,118,126,179,262,299,131,132,75,112,113,123,263,317,110,111,108,109,106,119,115,116,117,107,120,121,122,175,176,177,178,264,302,318,300,301,386,387,458,459,460';
$arr['userinfo'] = '85,101,149';
$arr['userract'] = '95';
@@ -294,10 +296,12 @@ $rstr = "".$hstart."
$arr['hrtrsalary'] = '129';
$arr['reward'] = '130';
$arr['finjishou'] = '311,312,316,369';
$arr['finjishou'] = '311,312,316,369,457';
$arr['finzhang'] = '308';
$arr['finkemu'] = '309';
$arr['finount'] = '310';
$arr['finscrip'] = '453,454,455';
$arr['finscrib'] = '456';
$arr['finfybx'] = '187,191';
$arr['finccbx'] = '188';