import request from '@/utils/request';

//结账
export function balanceCarryOver() {
    return request({
        url: '/finance/balance/carryOver',
        method: 'post',
    })
}

//反结到上期
export function balanceCarryOverBack() {
    return request({
        url: '/finance/balance/carryOverBack',
        method: 'post',
    })
}
//反结所选日期
export function balanceCarryTo(carryToMonth) {

  return request({
    url: '/finance/balance/carryTo',
    method: 'post',
    params: carryToMonth,
  })

}

//是否断号
export function isBrokenNumber() {
    return request({
        url: '/finance/voucher/isBrokenNumber',
        method: 'get',
    })
}

//是否存在未审核的凭证
export function existNotAudited() {
  return request({
    url: '/finance/voucher/existNotAudited',
    method: 'get',
  })
}

//是否资产负债表平衡
export function zcfzBalance() {
    return request({
        url: '/finance/balance/zcfzBalance',
        method: 'post',
    })
}

//试算平衡

export function trialBalance() {
    return request({
        url: '/finance/balance/trialBalance',
        method: 'post',
    })
}

//获取凭证字select选项
export function getVoucherWordList() {
    return request({
        url: '/finance/balance/getVoucherWordList',
        method: 'get',
    })
}


//生成凭证
export const generateVoucher = (data) => {
    return request({
        url: '/finance/balance/generateVoucher',
        method: 'post',
        data: data
    })
}

//结账到12月
export function handleJz12Month() {
  return request({
    url: '/finance/balance/carryOverBatch',
    method: 'post',
  })
}

//反结到上年12月份
export function balanceCarryOverBackToLastYear() {
  return request({
    url: '/finance/balance/carryOverBackToLastYear',
    method: 'post',
  })
}

//生成损益结转凭证
export const generateVoucher_sunyijiezhuan = (data) => {
  return request({
    url: '/finance/balance/generateVoucher_sunyijiezhuan',
    method: 'post',
    data: data
  })
}

//生成收益分配凭证
export const generateVoucher_shouyifenpei = (data) => {
  return request({
    url: '/finance/balance/generateVoucher_shouyifenpei',
    method: 'post',
    data: data
  })
}

// 检查损益类科目余额
export function checkSYJZ() {
  return request({
    url: '/finance/balance/checkSYJZ',
    method: 'get',
  })
}
