コード例 #1
0
 def disburse(self, loan_id, first_repayment_date=None):
     if first_repayment_date is not None:
         first_repayment_date = datelib.mambu_date(first_repayment_date)
     #  This spelling mistake is intentional and is present in mambu
     return self._post_loan_transaction(
         loan_id,
         dict(type='DISBURSMENT', firstRepaymentDate=first_repayment_date))
コード例 #2
0
ファイル: api.py プロジェクト: paze-me/mambu
    def apply_fee(self, loan_id, amount, date=None):
        """Apply the fee to the loan associated with loan_id

        Parameters
        ----------
        loan_id: str
            id of the loan in mambu
        amount: float
            amount of the fee to apply to the loan in the local currency in
            whole units e.g. UK, 10 is equivalent to GBP10.00
        date: date, datetime, str
            date-like to coerce into datestr.  Passed to apply_fee to date
            transaction

        Returns
        -------
        dict
        """
        if date is None or datelib.coerce_date(date) == datelib.date_today():
            result = self._post_loan_transaction(
                loan_id, dict(type='FEE', amount=amount))
        else:
            date = datelib.mambu_date(date)
            result = self._post_loan_transaction(
                loan_id, dict(type='FEE', amount=amount, date=date))
        return result
コード例 #3
0
    def apply_fee(self, loan_id, amount, date=None):
        """Apply the fee to the loan associated with loan_id

        Parameters
        ----------
        loan_id: str
            id of the loan in mambu
        amount: float
            amount of the fee to apply to the loan in the local currency in
            whole units e.g. UK, 10 is equivalent to GBP10.00
        date: date, datetime, str
            date-like to coerce into datestr.  Passed to apply_fee to date
            transaction

        Returns
        -------
        dict
        """
        if date is None or datelib.coerce_date(date) == datelib.date_today():
            result = self._post_loan_transaction(
                loan_id, dict(type='FEE', amount=amount))
        else:
            date = datelib.mambu_date(date)
            result = self._post_loan_transaction(
                loan_id, dict(type='FEE', amount=amount, date=date))
        return result
コード例 #4
0
ファイル: api.py プロジェクト: paze-me/mambu
 def disburse_with_amount(self, loan_id, pay_amount, first_repayment_date=None):
     if first_repayment_date is not None:
         first_repayment_date = datelib.mambu_date(first_repayment_date)
     #  This spelling mistake is intentional and is present in mambu
     return self._post_loan_transaction(loan_id, dict(
         type='DISBURSMENT', amount=pay_amount,
         firstRepaymentDate=first_repayment_date))
コード例 #5
0
    def get_disbursements_due_today(self):
        """Return a list of loans with expectedDisbursementDate today.  Specific
        use of the more general get_loans_by_filter_field

        Returns
        -------
        list(Loan)
        """
        datestr = datelib.mambu_date(datelib.date_today())
        return self.get_disbursements_due_on_date(datestr)
コード例 #6
0
ファイル: api.py プロジェクト: paze-me/mambu
    def get_disbursements_due_today(self):
        """Return a list of loans with expectedDisbursementDate today.  Specific
        use of the more general get_loans_by_filter_field

        Returns
        -------
        list(Loan)
        """
        datestr = datelib.mambu_date(datelib.date_today())
        return self.get_disbursements_due_on_date(datestr)
コード例 #7
0
 def get_repayments_due_on_date(self, datestr):
     datestr = datelib.mambu_date(datestr)
     return self.get_loans_by_single_filter('FIRST_REPAYMENT_DATE', 'ON',
                                            datestr)
コード例 #8
0
 def get_principals_due_in_xbdays(self, days):
     due_date = datelib.mambu_date(datelib.next_n_bday(n=days))
     return self.get_principals_due_on_date(due_date)
コード例 #9
0
 def get_principals_due_on_date(self, datestr):
     datestr = datelib.mambu_date(datestr)
     return self.get_loans_by_single_filter('EXPECTED_MATURITY_DATE', 'ON',
                                            datestr)
コード例 #10
0
 def get_disbursements_due_in_xbdays(self, days):
     due_date = datelib.mambu_date(datelib.next_n_bday(n=days))
     return self.get_disbursements_due_on_date(due_date)
コード例 #11
0
ファイル: api.py プロジェクト: paze-me/mambu
 def get_repayments_due_on_date(self, datestr):
     datestr = datelib.mambu_date(datestr)
     return self.get_loans_by_single_filter(
         'FIRST_REPAYMENT_DATE', 'ON', datestr)
コード例 #12
0
ファイル: api.py プロジェクト: paze-me/mambu
 def get_principals_due_in_xbdays(self, days):
     due_date = datelib.mambu_date(datelib.next_n_bday(n=days))
     return self.get_principals_due_on_date(due_date)
コード例 #13
0
ファイル: api.py プロジェクト: paze-me/mambu
 def get_principals_due_on_date(self, datestr):
     datestr = datelib.mambu_date(datestr)
     return self.get_loans_by_single_filter(
         'EXPECTED_MATURITY_DATE', 'ON', datestr)
コード例 #14
0
ファイル: api.py プロジェクト: paze-me/mambu
 def get_disbursements_due_in_xbdays(self, days):
     due_date = datelib.mambu_date(datelib.next_n_bday(n=days))
     return self.get_disbursements_due_on_date(due_date)