1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- namespace app\cxinv\model;
- class InvoicePool extends Base
- {
- //设置字段信息
- protected $schema = [
- 'id' =>'bigint',//
- 'invNo' =>'varchar',//发票编码
- 'inv_value' =>'decimal',//发票面值
- 'inv_out' =>'varchar',//发票售方
- 'inv_company' =>'varchar',//发票售方名称
- 'apply_id' =>'bigint',//申请人id
- 'apply_name' =>'varchar',//申请人名称
- 'inv_type' =>'varchar',//发票类型
- // "special"=>"增值税专用发票",
- // "normal"=>"增值税普通发票",
- // "roll"=>"增值税普通发票(卷式)",
- // "special_electronic"=>"增值税电子专用发票",
- // "electronic"=>"增值税电子普通发票",
- // "toll"=>"增值税电子普通发票(通行费)",
- // "fully_digitalized_special_electronic"=>"全电专用发票",
- // "fully_digitalized_normal_electronic"=>"全电普通发票",
- 'open_type' =>'tinyint',//开票类型 1金税开票 2金税线下 3纯线下
- 'company_type' =>'varchar',//买方账户类型01 企业,02 机关事业单位,03 个人, 04 其他
- 'platform_type' =>'tinyint',//0 无属性 1 ToB 2 ToC
- 'is_ticket' =>'tinyint',//是否支持金税开票
- 'is_comon' =>'tinyint',//是否通用订单0/11
- 'seller_check' =>'tinyint',//销售方验证
- 'buyer_check' =>'tinyint',//购买方验证
- 'exam_remark' =>'varchar',//审核备注
- 'remark' =>'varchar',//备注
- 'check_remark' =>'varchar',//校验备注
- 'email' =>'varchar',//邮箱
- 'winv_fee' =>'decimal',//未核销
- 'ainv_fee' =>'decimal',//已核销
- 'post_fee' =>'decimal',//物流费用
- 'post_code' =>'varchar',//物流编号
- 'post_company' =>'varchar',//物流公司
- 'tag_id' =>'int',//标签id
- 'status' =>'int',//1财务审核通过 2 待财务上传发票 3 金税开票中/验票中 4 开票成功 5 开票失败 6发票退票/废弃 7取消申请 8 财务驳回 9验票失败
- 'is_del' =>'tinyint',//
- 'addtime' =>'datetime',//
- 'updatetime' =>'datetime',//
- ];
- protected $createTime = 'addtime';
- protected $updateTime = 'updatetime';
- public function PoolInfo()
- {
- return $this->hasOne(InvoicePoolInfo::class,'invNo','invNo');
- }
- public function InvoiceGood()
- {
- return $this->hasMany(InvoiceGood::class,'invNo','invNo')->where([['is_del','=',0],['goodNum','>',0]])->order('id asc');
- }
- public function Assoc(){
- return $this->hasMany(Assoc::class,'viceCode','invNo')->where([['is_del','=',0]])->order('id asc');
- }
- }
|