package com.sunxung.factoring.service.invoicemanage;

import com.baomidou.mybatisplus.extension.service.IService;
import com.sunxung.factoring.entity.GridPage;
import com.sunxung.factoring.entity.invoicemanage.InvoiceGoodsInfo;
import com.sunxung.factoring.entity.invoicemanage.vo.SaleInvoiceGoodsAssignVo;
import com.sunxung.factoring.entity.invoicemanage.vo.SaleInvoiceGoodsSearch;

import java.math.BigDecimal;
import java.util.List;

/**
 * @Author : liutao
 * @Date: 2022-3-22
 */
public interface InvoiceGoodsInfoService extends IService<InvoiceGoodsInfo> {

    /**
     * 获取业务下所有开过销售发票（审核通过）且未分配完的货物列表
     *
     * @param search
     * @return
     */
    GridPage<SaleInvoiceGoodsAssignVo> findAllUnAssignedGoods(SaleInvoiceGoodsSearch search);

    /**
     * 计算已开票数量
     *
     * @param acceptanceBusinessGoodsId
     * @return
     */
    BigDecimal calculateInvoicedQuantity(Long acceptanceBusinessGoodsId);

    /**
     * 根据发票主表id获取货物列表
     * @param invoiceBasicInfoId
     * @return
     */
    List<InvoiceGoodsInfo> findListGoods(Long invoiceBasicInfoId);
}
