
/**
 * 发票类
 * 
 * 构造器参数： contextAdditionalTax,         //附加税上下文
 *            contextValueAddedTax,         //增值税上下文
 *            contextIndividualIncomeTax    //个人所得税上下文
 */
class Invoice {
  constructor(contextAdditionalTax,contextValueAddedTax,contextIndividualIncomeTax){
    this.contextAdditionalTax = contextAdditionalTax || null;
    this.contextValueAddedTax = contextValueAddedTax || null;
    // this.contextIndividualIncomeTax = contextIndividualIncomeTax;
  }

  setContextAdditionalTax(contextAdditionalTax){
    this.contextAdditionalTax=contextAdditionalTax;
  }

  setContextValueAddedTax(contextValueAddedTax){
    this.contextValueAddedTax=contextValueAddedTax;
  }

  //计算附加税
  async doActionAddtitionalTax(params){
    return await this.contextAdditionalTax.doAction(params.businessmenType,params);
  }
  //计算增值税
  async doActionValueAddedTax(params){
    return await this.contextValueAddedTax.doAction(params.businessmenType,params);
  }

  //计算个人所的税
  // async doActionIndividualIncomeTax(params.businessmenType,params){

  // }



}

module.exports=Invoice;