예제 #1
0
int MTRecord::GetMaximumNoPayments()
{
    if (!IsPaymentPlan())
        return 0;

    OTPaymentPlan  thePlan;
    const OTString strPlan(GetContents().c_str());

    if (thePlan.LoadContractFromString(strPlan) &&
        thePlan.HasPaymentPlan())
        return thePlan.GetMaximumNoPayments();
    return 0;
}
예제 #2
0
bool MTRecord::HasPaymentPlan()
{
    if (!IsPaymentPlan())
        return false;

    OTPaymentPlan  thePlan;
    const OTString strPlan(GetContents().c_str());

    if (thePlan.LoadContractFromString(strPlan) &&
        thePlan.HasPaymentPlan())
        return true;
    return false;
}
예제 #3
0
long MTRecord::GetInitialPaymentAmount()
{
    if (!IsPaymentPlan())
        return 0;

    OTPaymentPlan  thePlan;
    const OTString strPlan(GetContents().c_str());

    if (thePlan.LoadContractFromString(strPlan) &&
        thePlan.HasInitialPayment())
        return thePlan.GetInitialPaymentAmount();
    return 0;
}
예제 #4
0
bool OTPayment::SetTempValuesFromPaymentPlan(const OTPaymentPlan & theInput)
{
    if (OTPayment::PAYMENT_PLAN == m_Type)
    {
        m_bAreTempValuesSet = true;
        m_bHasRecipient     = true;
        // -------------------------
        m_lAmount           = theInput.GetInitialPaymentAmount();  // There're also regular payments of GetPaymentPlanAmount(). Can't fit 'em all.        
        m_lTransactionNum   = theInput.GetTransactionNum();                
        // -------------------------
        // const OTString &  OTPaymentPlan::GetConsideration() const 
        //                  { return m_strConsideration; }
        if (theInput.GetConsideration().Exists())
            m_strMemo.Set(theInput.GetConsideration());
        else
            m_strMemo.Release();
        // -------------------------
        m_AssetTypeID      = theInput.GetAssetID();     
        m_ServerID         = theInput.GetServerID();     
        // ----------------------------
        m_SenderUserID     = theInput.GetSenderUserID();    
        m_SenderAcctID     = theInput.GetSenderAcctID();    
        // ----------------------------        
        m_RecipientUserID  = theInput.GetRecipientUserID();
        m_RecipientAcctID  = theInput.GetRecipientAcctID();
        // ----------------------------
        m_VALID_FROM    = theInput.GetValidFrom();      
        m_VALID_TO      = theInput.GetValidTo();
        // --------------------------------
        return true;
    }
    else
        OTLog::Error("OTPayment::SetTempValuesFromPaymentPlan: Error: Wrong type. (Returning false.)\n");

    return false;    
}