Class ContractTariffDAO

java.lang.Object
ru.bgcrm.plugin.bgbilling.dao.BillingDAO
ru.bgcrm.plugin.bgbilling.proto.dao.ContractTariffDAO

public class ContractTariffDAO extends BillingDAO
  • Constructor Details

    • ContractTariffDAO

      public ContractTariffDAO(User user, String billingId)
    • ContractTariffDAO

      public ContractTariffDAO(User user, DBInfo dbInfo)
  • Method Details

    • addTariffPlan

      public void addTariffPlan(int contractId, int tariffId, int position)
    • setTariffPlan

      public void setTariffPlan(int contractId, int tariffId)
    • contractTariffList

      public List<ContractTariff> contractTariffList(int contractId)
      Returns the contract's tariff list
      Parameters:
      contractId - the contract ID
      Returns:
      the tariff list
    • getContractTariffPlan

      public ContractTariff getContractTariffPlan(int id, int moduleId, int contractId, boolean useFilter, boolean showUsed, boolean contractGroupFilter, List<IdTitle> tariffList)
      Returns the contract's tariff plan and fills the directory of available tariffs
      Parameters:
      id - the record ID, -1 if a new tariff is being added and only the directories are needed
      moduleId - the module instance ID
      contractId - the contract ID
      useFilter - the filter by contracts for the offered tariffs
      showUsed - whether to show only used tariffs
      tariffList - the list to load the tariff list into, or null if not needed
      Returns:
      the tariff plan
    • getContractTariffPlan

      @Deprecated public ContractTariff getContractTariffPlan(int id, int moduleId, int contractId, boolean useFilter, boolean showUsed, List<IdTitle> tariffList)
      Deprecated.
    • updateContractTariffPlan

      public void updateContractTariffPlan(int contractId, int id, int tpid, int position, String dateFrom, String dateTo, String comment)
      Updates or adds a contract tariff
      Parameters:
      contractId - the contract ID
      id - the tariff record ID, -1 to add
      tpid - the tariff plan ID
      position - the position
      dateFrom - the start date
      dateTo - the end date
      comment - the comment
    • deleteContractTariffPlan

      public void deleteContractTariffPlan(int contractId, int id)
      Deletes a contract tariff
      Parameters:
      contractId - the contract ID
      id - the tariff plan record ID
    • contractTariffGroupList

      @Deprecated public List<ContractTariffGroup> contractTariffGroupList(int contractId)
      Deprecated.
      Returns the list of all tariff groups on the contract
      Parameters:
      contractId - the contract ID
      Returns:
      the tariff group list
    • getContractTariffGroup

      @Deprecated public ContractTariffGroup getContractTariffGroup(int id)
      Deprecated.
      Returns the contract's tariff group
      Parameters:
      id - the record ID
      Returns:
      the tariff group
    • updateContractTariffGroup

      @Deprecated public void updateContractTariffGroup(int id, int contractId, int tariffGroupId, Date dateFrom, Date dateTo, String comment)
      Deprecated.
      Updates or adds a contract tariff group
      Parameters:
      id - <= 0 to add a tariff group, otherwise the ID of the record being changed
      contractId - the contract ID
      tariffGroupId - the tariff group ID
      dateFrom - the start date
      dateTo - the end date
      comment - the comment
    • updateContractTariffGroup

      @Deprecated public void updateContractTariffGroup(int contractId, int id, int tariffGroupId, String dateFrom, String dateTo, String comment)
      Deprecated.
    • deleteContractTariffGroup

      public void deleteContractTariffGroup(int tariffId)
    • contractTariffOptionList

      public List<ContractTariffOption> contractTariffOptionList(int contractId)
      Returns the contract's tariff options
      Parameters:
      contractId - the contract ID
      Returns:
      the tariff option list
    • contractTariffOptionHistory

      public List<ContractTariffOption> contractTariffOptionHistory(int contractId)
      Returns the history of tariff options on the contract
      Parameters:
      contractId - the contract ID
      Returns:
      the tariff option list
    • contractAvailableOptionList

      public List<IdTitle> contractAvailableOptionList(int contractId)
      Returns the list of available tariff options
      Parameters:
      contractId - the contract ID
      Returns:
      the option list
    • activateModeList

      public List<IdTitle> activateModeList(int contractId, int optionId)
    • activateContractOption

      public void activateContractOption(int contractId, int optionId, int modeId, boolean web)
    • reactivateContractOption

      public void reactivateContractOption(int contractId, int id)
    • deactivateContractOption

      public void deactivateContractOption(int contractId, int id)
      Deactivates a tariff option on the contract
      Parameters:
      contractId - the contract ID
      id - the option ID
    • contractPersonalTariffList

      public List<ContractPersonalTariff> contractPersonalTariffList(int contractId)
      Returns the contract's personal tariffs
      Parameters:
      contractId - the contract ID
      Returns:
      the personal tariff list
    • getPersonalTariff

      public ContractPersonalTariff getPersonalTariff(int id)
      Returns a contract's personal tariff
      Parameters:
      id - the tariff ID
      Returns:
      the personal tariff
    • deleteContractPersonalTariff

      public void deleteContractPersonalTariff(int contractId, int id)
    • updateContractPersonalTariff

      public void updateContractPersonalTariff(int contractId, int tariffId, String title, int position, String dateFrom, String dateTo)