| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255 |
- <?php
- Doo::loadCore ( 'db/DooModel' );
- /**
- * 发票审批相关信息及其操作业务逻辑
- * @author CP.
- * @version 1.0
- * @namespace invoice
- * @package invoiceModel
- */
- class invoice extends DooModel {
- /**
- *
- * @var integer $iid 发票ID
- */
- public $iid;
- /**
- *
- * @var integer $status 审批状态
- */
- public $status;
- /**
- *
- * @var string $invoiceManage 当前审批组人员
- */
- public $invoiceManage;
- /**
- *
- * @var string $pendingApprovals 当前需要审批的人
- */
- public $pendingApprovals;
- /**
- *
- * @var string $processApprovals 已经审批过的人员
- */
- public $processApprovals;
- /**
- *
- * @var string $invoiceSerial 发票单号
- */
- public $invoiceSerial;
- /**
- *
- * @var integer $invoicePrice 发票金额
- */
- public $invoicePrice;
- /**
- * 管理组人员:
- * @var unknown
- */
- public $moldManage;
- /**
- *
- * @var integer $cid 办事处ID
- */
- public $cid;
- /**
- *
- * @var string $categoryName 办事处名称
- */
- public $categoryName;
- /**
- *
- * @var integer $sid 提交发票人ID
- */
- public $sid;
- /**
- *
- * @var string $userName 提交人名字
- */
- public $userName;
- /**
- *
- * @var string $remark 备注
- */
- public $remark;
- /**
- *
- * @var string $invoiceElement 发票内容
- */
- public $invoiceElement;
- /**
- *
- * @var string $invoiceType 发票类型
- */
- public $invoiceType;
- /**
- *
- * @var string $invoiceTitle 发票抬头
- */
- public $invoiceTitle;
- /**
- *
- * @var string $invoiceCompany 开票公司
- */
- public $invoiceCompany;
- /**
- *
- * @var string $invoiceNo 发票号
- */
- public $invoiceNo;
- /**
- *
- * @var string $TIN 纳税人识别码
- */
- public $TIN;
- /**
- *
- * @var string $address 注册地址
- */
- public $address;
- /**
- *
- * @var string $phone 电话
- */
- public $phone;
- /**
- *
- * @var string $bank 开户银行
- */
- public $bank;
- /**
- *
- * @var string $bankAccount 银行账户
- */
- public $bankAccount;
- /**
- *
- * @var integer $doPost 邮寄
- */
- public $doPost;
- /**
- *
- * @var string $recipients 收件人
- */
- public $recipients;
- /**
- *
- * @var string $recipientsPhone 收件人电话
- */
- public $recipientsPhone;
- /**
- *
- * @var string $recipientsAddress 收件地址
- */
- public $recipientsAddress;
- /**
- *
- * @var string $mailItems 邮寄物品
- */
- public $mailItems;
- /**
- *
- * @var date $date 提交时间
- */
- public $date;
- /**
- *
- * @var date $updateTime 更新时间
- */
- public $updateTime;
- /**
- *
- * @var date $printTime 打印时间
- */
- public $printTime;
- public $_table = 'CLD_invoice';
- public $_primarykey = 'iid';
- public $_fields = array (
- 'iid',
- 'invoiceManage',
- 'pendingApprovals',
- 'processApprovals',
- 'invoiceSerial',
- 'status',
- 'invoicePrice',
- 'moldManage',
- 'cid',
- 'categoryName',
- 'remark',
- 'invoiceElement',
- 'invoiceType',
- 'invoiceTitle',
- 'invoiceCompany',
- 'invoiceNo',
- 'TIN',
- 'address',
- 'phone',
- 'bank',
- 'bankAccount',
- 'doPost',
- 'recipients',
- 'recipientsPhone',
- 'recipientsAddress',
- 'mailItems',
- 'sid',
- 'userName',
- 'date',
- 'updateTime' ,
- 'printTime'
- );
- public function getInvoiceByIid($iid = 0) {
- }
- /**
- * 获取单个可以打印的发票数据
- * @param number $iid 发票id
- */
- public function getInvoiceByPrint($iid = 0) {
- $detail = array ();
- if (! empty ( $iid ) && is_numeric ( $iid ))
- $detail = $this->getOne ( array (
- 'where' => "iid= '" . $iid . "' and status=2",
- 'asArray' => TRUE
- ) );
- return $detail;
- }
- /**
- * 记录发票号并完成打印
- * @param array $item 发票号和完成打印状态数据
- * @return number 返回发票ID
- */
- public function setPrintByInvoice($item = array()) {
- $lid = 0;
- if (is_array ( $item ) && ! empty ( $item )) {
- foreach ( $item as $key => $value ) {
- $this->$key = $value;
- }
- $lid = $this->update ();
- }
- return $lid;
- }
- /**
- * 获取待处理发票的数据 其中包括退回`终止
- * @return unknown
- */
- public function getPendingByInvoice() {
- $list = $this->find ( array (
- 'where' => "status=3 or status=4",
- 'asArray' => TRUE
- ) );
- return $list;
- }
- /**
- * 获取需要邮寄的发票
- * @return array
- */
- public function getPostByInvoice(){
- $list = $this->find ( array (
- 'where' => "status=5 and doPost=1",
- 'asArray' => TRUE
- ) );
- return $list;
- }
- }
- ?>
|