package variable

const TaxTaskURL string = "https://task.listensoft.net"          //获取任务的URL
const SessionKeepURL string = "https://keepalive.listensoft.net" //session会话保持服务器

type LXContextVar string               // ctx传递存储的信息KEY
const ComInfo LXContextVar = "comInfo" //企业基本信息
type Environment string                //环境变量
type Kjze string                       //会计准则
const UUID LXContextVar = "uuid"       //标志
const BsTask LXContextVar = "bsTask"   //办税任务
func (k Kjze) Check() bool {
	if k == KjXqy2013 || k == KjYbqyWzx || k == KjQykjzd || k == KjYbqyYzx || k == KjMbf || k == Nyhzs || k == Zyhzs {
		return true
	}
	return false
}

const (
	KjXqy2013 Kjze = "小企业会计准则2013版"
	KjYbqyWzx Kjze = "一般企业会计准则" // (未执行新金融准则)
	KjQykjzd  Kjze = "企业会计制度"
	KjYbqyYzx Kjze = "一般企业会计准则(已执行新金融准则)"
	KjMbf     Kjze = "民办非"
	Nyhzs     Kjze = "农业合作社"
	Zyhzs     Kjze = "专业合作社"
)

type Gslx string //公司类型
func (k Gslx) Check() bool {
	if k == Yszrgs || k == Gtgsh || k == Grdzqy || k == Hhqr || k == Nchzs || k == Mbf {
		return true
	}
	return false
}

const (
	Yszrgs Gslx = "有限责任公司"
	Gtgsh  Gslx = "个体工商户"
	Grdzqy Gslx = "个人独资企业"
	Hhqr   Gslx = "合伙企业"
	Nchzs  Gslx = "农村合作社"
	Mbf    Gslx = "民办非企业单位"
)

type Nsrlx string //纳税人类型

func (q Nsrlx) Check() bool {
	if q == Ybnsr || q == Xgmnsr {
		return true
	}
	return false
}

const (
	Ybnsr  Nsrlx = "一般纳税人"
	Xgmnsr Nsrlx = "小规模纳税人"
)

type Qysdslx string

func (q Qysdslx) Check() bool {
	if q == QysdsA || q == QysdsB {
		return true
	}
	return false
}

const (
	QysdsA Qysdslx = "A"
	QysdsB Qysdslx = "B"
)

type TaxStatus int //业务状态

const (
	_                     TaxStatus = iota
	TaxDoing                             //通用：
	TaxSuccess                           //通用： 成功  	    申报:申报成功无需扣款  税局扣款：成功  	申报检查：成功     发票采集： 成功
	TaxFail                              //通用： 失败 	    申报：申报失败		  税局扣款：失败    申报检查: 失败	   发票采集： 失败
	TaxTiJiaoJinSan                      //通用： 			申报：提交金三						   					发票采集： 预约采集处理中
	TaxSuccessNeedPay                    //通用： 			申报：申报成功，待缴款									 发票采集: 成功（未勾选发票）
	TaxSuccessPaid                       //通用： 			申报：申报成功，已缴款
	TaxSuccessd           TaxStatus = 20 //通用：			申报: 已申报过，无需扣款
	TaxSuccessdNeedPay    TaxStatus = 21 //通用： 			申报：已申报过，待缴款
	TaxSuccessdPaid       TaxStatus = 22 //通用： 			申报：已申报过，已缴款
	TaxSuccessdInequality TaxStatus = 23 //通用：            申报：已申报过，但税额不符
	TaxSuccessdOmit       TaxStatus = 30 //通用：													申报检查：有遗漏
	TaxNoNeed             TaxStatus = 40 //通用：			申报：无需申报(未核定财务报表用这个状态)    申报检查：无需申报(未核定财务报表用这个状态)
	TaxAbnormal           TaxStatus = 50 //														申报检查：已申报，有异常
	TaxSuccessNeedRefund  TaxStatus = 60 // 汇算清缴专用 申报成功，待退税
)

func (tax TaxStatus) Check() bool { //检验状态
	// TaxDoing 永远不用
	if tax != TaxSuccess &&
		tax != TaxFail &&
		tax != TaxTiJiaoJinSan &&
		tax != TaxSuccessNeedPay &&
		tax != TaxSuccessPaid &&
		tax != TaxSuccessd &&
		tax != TaxSuccessdNeedPay &&
		tax != TaxSuccessdPaid &&
		tax != TaxSuccessdOmit &&
		tax != TaxNoNeed &&
		tax != TaxSuccessdInequality &&
		tax != TaxAbnormal {
		return false
	}
	return true
}

func (tax TaxStatus) Success() bool { //检验是否成功状态
	// TaxDoing 永远不用
	if tax == TaxSuccess ||
		tax == TaxTiJiaoJinSan ||
		tax == TaxSuccessNeedPay ||
		tax == TaxSuccessPaid ||
		tax == TaxNoNeed {
		return true
	}
	return false
}

type TaxErrorText string
