123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242 |
- <?php
- /**
- * 生成一个日常支出
- *
- * @param [type] $accountBook
- * @param [type] $expensesType
- * @param [type] $outlayAccountType
- * @param [type] $outlayAccountMsg
- * @param [type] $outlayPrice
- * @param [type] $outlayBank
- * @param [type] $outlayDate
- * @param [type] $outlayRemarks
- * @return void
- */
- function _saveOutlayAB($accountBook, $expensesType, $outlayAccountType, $operatingBankType, $depositMethod, $outlayMsg, $outlayPrice, $outlayBank, $outlayDate, $outlayRemarks, $staff) {
- $accountBook->expensesType = $expensesType;
- $accountBook->expenditureType = $outlayAccountType;
- $accountBook->operatingBankType = $operatingBankType;
- $accountBook->depositMethod = $depositMethod;
- $accountBook->expenditureMsg = $outlayMsg;
- $accountBook->expenditurePrice = $outlayPrice;
- $accountBook->expenditureBank = $outlayBank;
- $accountBook->expenditureDate = $outlayDate;
- $accountBook->remarks = $outlayRemarks;
- $accountBook->bookSerial = "#IN" . date ( "Ymd" ) . mt_rand ( 1000, 9999 );
- $accountBook->inputDate = date ( "Y-m-d H:i:s" );
- $accountBook->inputStaff = $staff [0] ['sid'];
- $id = $accountBook->insert ();
- return $id;
- }
- /**
- * 生成一条理财流水
- *
- * @return void
- */
- function _saveFWB($wasteBook, $expensesType, $accountType, $dailyType, $operatingBankType, $depositMethod, $outlayPrice, $outlayId, $accountBank, $outlayDate, $staff) {
- $itemWaste = array (
- 'expensesType' => $expensesType,
- 'accountType' => $accountType,
-
- 'dailyType' => $dailyType,
- 'operatingBankType' => $operatingBankType,
- 'depositMethod' => $depositMethod,
- 'accountPriceShow' => abs ( $outlayPrice ),
- 'accountPrice' => $outlayPrice,
- 'dataID' => $outlayId,
- 'accountBank' => $accountBank,
- 'category' => $staff [0] ['category'],
- 'cid' => $staff [0] ['cid'],
- 'name' => $staff [0] ['username'],
- 'sid' => $staff [0] ['sid'],
- 'inputDate' => $outlayDate,
- 'createAt' => date ( "Y-m-d H:i:s" ),
- 'synPaymentDate' => 1
- );
- $wasteBook->setAccountBookStatistics ( $itemWaste );
- }
- /**
- * 生成日常收入-理财
- *
- * @param [type] $accountBook
- * @param [type] $expensesType
- * @param [type] $accountType
- * @param [type] $operatingBankType
- * @param [type] $depositMethod
- * @param [type] $outlayBank
- * @param [type] $revenuePrice
- * @param [type] $revenueMsg
- * @param [type] $revenueDate
- * @param [type] $revenueRemarks
- * @param [type] $staff
- * @return void
- */
- function _saveRevenueAB($accountBook, $expensesType, $accountType, $operatingBankType, $depositMethod, $outlayBank, $revenuePrice, $revenueMsg, $revenueDate, $revenueRemarks, $staff) {
- $accountBook->expensesType = $expensesType;
- $accountBook->accountType = $accountType;
-
- $accountBook->operatingBankType = $operatingBankType;
- $accountBook->depositMethod = $depositMethod;
-
- $accountBook->receivedBank = $outlayBank;
-
- $accountBook->receivedPrice = $revenuePrice;
- $accountBook->receivedMsg = $revenueMsg;
- $accountBook->receivedDate = $revenueDate;
- $accountBook->remarks = $revenueRemarks;
-
- $accountBook->bookSerial = "#IN" . date ( "Ymd" ) . mt_rand ( 1000, 9999 );
- $accountBook->inputDate = date ( "Y-m-d H:i:s" );
- $accountBook->inputStaff = $staff [0] ['sid'];
- $inComeId = $accountBook->insert ();
- return $inComeId;
- }
- /**
- * 产生一条汇总信息
- *
- * @param [type] $abDetail
- * @param [type] $accountBookStatistics
- * @return void
- */
- function _saveAccountBookStatistics($abDetail, $accountBookStatistics) {
- $item = array (
- 'date' => date ( "Y-m-d" ),
- 'expenditureType' => $abDetail ['expenditureType'],
- 'expenditureMsg' => $abDetail ['expenditureMsg'],
- 'aid' => $abDetail ['aid'],
- 'payPrice' => $abDetail ['expenditurePrice'],
- 'expensesType' => $abDetail ['expensesType']
- );
- $accountBookStatistics->setAccountBookStatistics ( $item );
- }
- /**
- * 产生一条收入汇总信息
- *
- * @param [type] $abDetail
- * @param [type] $accountBookStatistics
- * @return void
- */
- function _saveRevenueAccountBookStatistics($abDetail, $accountBookStatistics) {
- $item = array (
- 'date' => date ( "Y-m-d" ),
- 'accountType' => $abDetail ['accountType'],
- 'accountMsg' => $abDetail ['accountMsg'],
- 'aid' => $abDetail ['aid'],
- 'inComePrice' => $abDetail ['receivedPrice'],
- 'expensesType' => $abDetail ['expensesType']
- );
- $accountBookStatistics->setAccountBookStatistics ( $item );
- }
- /**
- * 转换公司账号银行名称
- *
- * @param [type] $bank
- * @return void
- */
- function _getCompanyBankEN($bank) {
- $accountBank = '';
- if ($bank == '纵横广发' || $bank == '(纵横广发)广发存款') {
- $accountBank = 'CGBDeposit';
- } elseif ($bank == '纵横工行') {
- $accountBank = 'ICBCDeposit';
- } elseif ($bank == '个人存款') {
- $accountBank = 'PersonalDeposit';
- }
- return $accountBank;
- }
- /**
- * 理财银行转换名称的转换
- *
- * @param [type] $bank
- * @return void
- */
- function _getFinancesBankEN($bank) {
- $accountBank = '';
- if ($bank == '广发理财') {
- $accountBank = 'CGBDeposit';
- } elseif ($bank == '工行理财') {
- $accountBank = 'ICBCDeposit';
- } elseif ($bank == '个人理财(广发)') {
- $accountBank = 'CGBPersonalDeposit';
- }
- return $accountBank;
- }
- function _checkDepositMethod($revenueAccountMsg) {
- $depositMethod = '';
- if ($revenueAccountMsg == '固定') {
- $depositMethod = '固定';
- } elseif ($revenueAccountMsg == '活期') {
- $depositMethod = '活期';
- }
- return $depositMethod;
- }
- function _getRevenueTypeCN($value) {
- $revenueType = '';
- if ($value ['accountType'] == 6 || $value ['accountType'] == 9 || $value ['accountType'] == 10) {
- $revenueType = '日常收入-' . $value ['data'] ['incomeTypeMsg'];
- } elseif ($value ['accountType'] == 7 || $value ['accountType'] == 8) {
- $revenueType = '发票收款';
- } elseif ($value ['accountType'] == 1) {
- $revenueType = '费用收入(借款)';
- } elseif ($value ['accountType'] == 2) {
- $revenueType = '费用收入(借款报销)';
- } elseif ($value ['accountType'] == 3) {
- $revenueType = '费用收入(报销)';
- } elseif ($value ['accountType'] == 4) {
- $revenueType = '费用收入(对公汇款)';
- } elseif ($value ['accountType'] == 12) {
- $revenueType = '费用收入( 培训班结算)';
- }
- return $revenueType;
- }
- function _getOutlayTypeCN($value) {
- $outlayType = '';
- if ($value ['accountType'] == 5 || $value ['accountType'] == 9 || $value ['accountType'] == 10) {
- $outlayType = '日常支出-' . $value ['data'] ['expenditureTypeMsg'];
- } elseif ($value ['accountType'] == 1) {
- $outlayType = '费用管理(借款)';
- } elseif ($value ['accountType'] == 2) {
- $outlayType = '费用管理(借款报销)';
- } elseif ($value ['accountType'] == 3) {
- $outlayType = '费用管理(报销)';
- } elseif ($value ['accountType'] == 4) {
- $outlayType = '费用管理(对公汇款)';
- } elseif ($value ['accountType'] == 12) {
- $outlayType = '费用管理( 培训班结算)';
- } elseif ($value ['accountType'] == 11) {
- $outlayType = '收款退款';
- }
- return $outlayType;
- }
- function _structureReportItem($inputDate,$receivablesMessage,$revenueType,$category,$settlementType,$revenueBankMsg,$revenuePriceShow,$revenueTotalDay
- ,$outlayType,$outlayMsg,$outlayBankMsg,$outlayPriceShow,$outlayTotalDay){
- $item['inputDate']=$inputDate;
- $item['receivablesMessage']=$receivablesMessage;
- $item['revenueType']=$revenueType;
- $item['category']=$category;
- $item['settlementType']=$settlementType;
- $item['revenueBankMsg']=$revenueBankMsg;
- $item['revenuePriceShow']=$revenuePriceShow;
- $item['revenueTotalDay']=$revenueTotalDay;
-
- $item['outlayType']=$outlayType;
-
-
-
- $item['outlayMsg']=$outlayMsg;
- $item['outlayBankMsg']=$outlayBankMsg;
- $item['outlayPriceShow']=$outlayPriceShow;
- $item['outlayTotalDay']=$outlayTotalDay;
- $item['balance']=0;
- return $item;
- }
- ?>
|