webmain/flow/input/mode_custfinaAction.php

(开头部分) 6KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php
/**
*	客户.收款单
*/
class mode_custfinaClassAction extends inputAction{
	

	protected function savebefore($table, $arr, $id, $addbo){

		$narr	= array();
		$htid 	= (int)$arr['htid'];
		$money 	= floatval($arr['money']);
		if($money<=0)return '金额必须大于0';
		
		//编辑时判断
		if($this->rs && 1==2){
			$xgid 	= arrvalue($this->rs,'xgid');
			$xgnum 	= arrvalue($this->rs,'xgnum');
			if($xgnum && $xgid){
				$sflow = m('flow:'.$xgnum.'')->initbase($xgnum);
				$onrs  = $sflow->getone($xgid);
				if($onrs){
					$jiner = floatval($onrs['money']);
					if($money != $jiner)return '此单据关联“'.$sflow->modename.','.$onrs['num'].'”的金额'.$onrs['money'].'不一样';
					$narr['custid'] 	= $onrs['custid'];
					$narr['custname'] 	= $onrs['custname'];
					$narr['htnum'] 		= $onrs['num'];
				}
			}
		}

		
		//从合同读取
		if($htid>0){
			$htrs = m('custract')->getone($htid);
			$narr['htnum'] 		= $htrs['num'];
			$narr['custid'] 	= $htrs['custid'];
			$narr['type'] 		= $htrs['type'];
			$narr['custname'] 	= $htrs['custname'];
			$zmoney				= floatval($htrs['money']);
			$omoney	= m('crm')->getmoneys($htid, $id);
			$chaojg	= $omoney + $money - $zmoney;
			if($chaojg>0)return '金额已超过合同上金额'.$zmoney.'';
		}
		
		//从销售单读取
		if($htid<0){
			$htrs = m('goodm')->getone('`id`='.(0-$htid).'');
			$narr['htnum'] 		= $htrs['num'];
			$narr['custid'] 	= $htrs['custid'];
			$narr['type'] 		= '0';
			$narr['custname'] 	= $htrs['custname'];
			$zmoney				= floatval($htrs['money']);
			$omoney	= m('crm')->getmoneys($htid, $id);
			$chaojg	= $omoney + $money - $zmoney;
			if($chaojg>0)return '金额已超过销售单上金额'.$zmoney.'';
		}
		$narr['htid'] = $htid;
		if(!isset($narr['type']))$narr['type'] = 0;
		return array('rows'=> $narr);
后面还有 167 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。