115 lines
3.0 KiB
PHP
115 lines
3.0 KiB
PHP
<?php
|
||
// +----------------------------------------------------------------------
|
||
// | likeshop开源商城系统
|
||
// +----------------------------------------------------------------------
|
||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||
// | gitee下载:https://gitee.com/likeshop_gitee
|
||
// | github下载:https://github.com/likeshop-github
|
||
// | 访问官网:https://www.likeshop.cn
|
||
// | 访问社区:https://home.likeshop.cn
|
||
// | 访问手册:http://doc.likeshop.cn
|
||
// | 微信公众号:likeshop技术社区
|
||
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
|
||
// | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
|
||
// | 禁止对系统程序代码以任何目的,任何形式的再发布
|
||
// | likeshop团队版权所有并拥有最终解释权
|
||
// +----------------------------------------------------------------------
|
||
// | author: likeshop.cn.team
|
||
// +----------------------------------------------------------------------
|
||
|
||
namespace app\common\enum;
|
||
|
||
|
||
class OrderInvoiceEnum
|
||
{
|
||
/**
|
||
* 发票类型
|
||
* TYPE_NORMAL 普通
|
||
* TYPE_SPEC 专用
|
||
*/
|
||
const TYPE_NORMAL = 0;
|
||
const TYPE_SPEC = 1;
|
||
|
||
/**
|
||
* 抬头类型
|
||
* HEADER_TYPE_PERSONAL 个人
|
||
* HEADER_TYPE_COMPANY 企业
|
||
*/
|
||
const HEADER_TYPE_PERSONAL = 0;
|
||
const HEADER_TYPE_COMPANY = 1;
|
||
|
||
/**
|
||
* 开票状态
|
||
* STATUS_NO 未开票
|
||
* STATUS_NO 已开票
|
||
*/
|
||
const STATUS_NO = 0;
|
||
const STATUS_YES = 1;
|
||
|
||
/**
|
||
* @notes 获取状态描述
|
||
* @param bool $status
|
||
* @return bool|mixed|string
|
||
* @author 段誉
|
||
* @date 2022/4/11 18:55
|
||
*/
|
||
public static function getStatusDesc($status = true)
|
||
{
|
||
$desc = [
|
||
self::STATUS_NO => '未开票',
|
||
self::STATUS_YES => '已开票',
|
||
];
|
||
|
||
if ($status === true) {
|
||
return $status;
|
||
}
|
||
|
||
return isset($desc[$status]) ? $desc[$status] : $status;
|
||
}
|
||
|
||
|
||
/**
|
||
* @notes 获取类型描述
|
||
* @param bool $type
|
||
* @return bool|mixed|string
|
||
* @author 段誉
|
||
* @date 2022/4/12 9:14
|
||
*/
|
||
public static function getTypeDesc($type = true)
|
||
{
|
||
$desc = [
|
||
self::TYPE_NORMAL => '电子普通发票',
|
||
self::TYPE_SPEC => '专用发票',
|
||
];
|
||
|
||
if ($type === true) {
|
||
return $type;
|
||
}
|
||
|
||
return isset($desc[$type]) ? $desc[$type] : $type;
|
||
}
|
||
|
||
|
||
|
||
/**
|
||
* @notes 获取抬头类型描述
|
||
* @param bool $type
|
||
* @return bool|mixed|string
|
||
* @author 段誉
|
||
* @date 2022/4/12 9:14
|
||
*/
|
||
public static function getHeaderTypeTextDesc($type = true)
|
||
{
|
||
$desc = [
|
||
self::HEADER_TYPE_PERSONAL => '个人',
|
||
self::HEADER_TYPE_COMPANY => '企业',
|
||
];
|
||
|
||
if ($type === true) {
|
||
return $type;
|
||
}
|
||
|
||
return isset($desc[$type]) ? $desc[$type] : $type;
|
||
}
|
||
|
||
} |