account's balance at a point of time in AggCat - intuit-partner-platform

Is there anyway to obtain an account's info including account's balance at a point of time? Basically, I need to get the account's balance at the beginning of month and end of month for accounting purposes. However, a cron job to update account's info at the beginning/end of month may fail for various reasons, in which case there is no way to retrieve account's balance at beginning/end of month anymore!

We do not have a mechanism to capture the value at a specific time as you are asking but provide a balance each time you capture the transactions. If you capture a day later you can always perform a reverse running balance using the current balance - the transactions that occured between the data you wish to display.
Example:
August 1st:
$5.00 Transaction to McDonalds
$3.00 Transaction to Ralphs
Balance on August 2nd:
$35.00
Calculate Balance for the 1st.
$35 + 5 + 3= $43.00 balance at start of month.
You add the debits and subtract the credits and you can obtain the value you are seeking.

Related

add a conditional start date to a payment function

I am building a financial model and adding loan payments, and want the payments to start on a conditional start date.
I can calculate the PMT amount for a loan, but cant seem to get the payments PMT to show up in the specific start date (month) and to end when the balance is 0.
[1]: https://i.stack.imgur.com/4VWzk.png
I have a start date in Column J and calculated the payment, but I get an error message.
I tried the following, but not sure where I am going wrong.
J61 pmt start date either Jan 1 or June 1 2023
S2- start of the month
S4- end of the month
PMT(rate, nper, pv, [fv], [type]) this works
NPER= number of payments
=IFERROR(IF(AND(J61>S3,J61<=S4,1,0)),PMT(G61/H61,I61*H61,F61))
Not sure how to incorporate the ending balance into this formula.
End date with Balance equals= 0
Since your financial model has monthly granularity of calculations, it is not clear how you want to allocate the payments for loans that have intra-month start dates.
Here is a very simple solution that will not allocated pro rata for the days of a month, but allocated the total monthly payments starting with the month of the start date.
=(S$4>=$J61)*(S$4<=EDATE($J61,$H61)-1)*$K61
Which looks like this
So, as you can see in the screenshot, although the start date for the 1st loan is the 31st of January, there will already occur the full PMT amount for the month of January in the timeline.

How do I refresh the database annually?

I am storing the user information in my database along with other attributes such as his annual leave/vacation balance.
The user annual leave would be 14 days every year but I want to refresh it every year and add another 14 to it. If the user had 3 days of annual leave left at year's end, then he would start the new year with a 17 day balance.
Just use the percolate:synced-cron package to create an annual job to update such balances.
You might also need a lastUpdatedDate to make sure you don't accidentally add to the balance twice. You have to anticipate any errors that would leave your data partially-updated.

PayPal Soap API Balance for certain Date

I'm using the PayPal Soap-Api.
With the "GetBalance"-Api Operation it's possible to get the current Balance.
But for Accounting reasons, I need to fetch the Balance for every Day in a certain period. e.g.
22.01.2016, Balance: 500,00 €
21.01.2016, Balance: 425,00 €
20.01.2016, Balance: 964,60 €
...
01.01.2015, Balance: 0,00 €
I found no Api-Operation that would match my needs.
So I tried to use the "TransactionSearch"-Api Operation to get the Transactions for this period and calculate the Balance.
Since there is no documentation wether a Transaction is balance-affecting or not, my calculation always failed.
It is possible to set certain filters for the "TransactionSearch"-Api Operation like "BalanceAffecting". But also with this filter set, I get the wrong Transactions to calculate the Balance for every day.

need explanation for PayPal recurring options: BILLINGPERIOD, BILLINGFREQUENCY, TOTALBILLINGCYCLES

https://developer.paypal.com/docs/classic/express-checkout/integration-guide/ECRecurringPayments/
I understand that setting BILLINGPERIOD to MONTH and BILLINGFREQUENCY to 1 will charge the user once a month.
But according to the above link, TOTALBILLINGCYCLES is optional and is set to 0 by default. So if I don't include that option, will the user be charged once a month forever or stopped after charging for the first year (12 times)?
Also, I want to charge the user for the first year only. What should i do? Should i set TOTALBILLINGCYCLES to 1 to achieve it?
Please advise.
Thanks
Please find TOTALBILLINGCYCLES in the link below:
https://developer.paypal.com/webapps/developer/docs/classic/api/merchant/CreateRecurringPaymentsProfile_API_Operation_NVP/
For the regular payment period, if no value is specified or the value is 0, the regular payment period continues until the profile is canceled or deactivated.
If you want to charge the user for the first year only, TOTALBILLINGCYCLES depends on your billing period.
If you set BILLINGPERIOD=Month and BILLINGFREQUENCY=1, you should set TOTALBILLINGCYCLES=12 to charge one year.
If you set BILLINGPERIOD=Year and BILLINGFREQUENCY=1, you should set TOTALBILLINGCYCLES=1 to charge one year.

PayPal billing agreements REST API - how to start immediately

How can I start charging a user the user immediately for a PayPal billing agreement?
Here's what I've got so far.
Create a Billing Plan (POST .../payments/billing-plans/)
Make it active (PATCH .../payments/billing-plans/)
Create a Billing Aggreement (POST .../payments/billing-agreements/)
Send user to approval_url, user approves, redirected to return url
Execute agreement (POST .../payments/billing-agreements//agreement-execute)
This all seems to work, but I want to charge the user right now and every month in the future. If I set start_date to now in step 3 I get an error, it must be in the future. If I set it in the future the user is not charged.
Do I need to 'Set outstanding agreement amounts' then 'Bill outstanding agreement amounts' for the initial payment?
Also, what about monthly payments, do they require some action or do they just happen as specified in the Billing Plan?
Update
I'm testing this around 2014-09-16T20:06:30+0000
If I send start_date as the current UTC time it get an error at step 2 telling me it must be in the future.
If I send the current date +30 secs or +2 hours I get through to step 5 which returns a 400 response: UNKNOWN_ERROR "An unknown error has occurred"
If I send the current date +4 hours it all works. The current UTC time is 8pm so adding 4 hours means the start_date is tomorrow.
Does this mean I can't charge the user today? Does the start_date have to be in next day or even the next business day?
I've talked to a PayPal rep and found that start_date must be tomorrow or later. They are going to add this to the docs.
If you want to start monthly billing immediately you might be able to do it by setting the start date to be in one months time and charging a setup fee to cover the first month. I haven't tested this as it's not what I want.
First payment for agreements will be billed right on specified start_date. The subsequent amounts are also taken automatically by PP. You need to work with the BillOutstandingAmount calls only if PP failed to pick the payment on the renewal date.
The problem I faced when developing with their RestAPI was specifying a wrong timezone. Maybe this is the same for you. Make sure the proper timezone is specified in your start_date (with all dates given to PP in fact)
Dates should be in this format: yyyy-MM-ddTHH:mm:ssZ
ex. start_date = 2014-09-16T09:20:00-0400
IF you want to make sure Paypal accepts the date as being valid, just add a few seconds to it.
Let's say you are in Java, you can do something like:
private String getPaypalDate()
{
DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
// Add 30 seconds to make sure Paypal accept the agreement date
Date rightNow = new Date(new Date().getTime() + 30000);
return df.format(rightNow);
}
I used this date format working.
$time = time();
$startDate = date('Y-m-d\\TH:i:s\\Z', $time);
I can't replicate, actually. I stumbled on this thread when getting the error due to setting it to moment.now(). But setting it to even 5 seconds in the future works a-ok. I'm using JavaScript, "start_date": moment().add({seconds:5}).format() and that checks out fine. Moment.js will set TZ to UTC when formatting as such, so it's gotta be a timezone thing on your end?
It looks like the payments just process based on the date being before or after 07:00 UTC of the current date.
For example. The current date time is 2017-05-04T04:50:00.00Z I set my start date to be the current UTC date time plus 30 seconds. Because the agreement date is set to a value greater then the current date time the API doesn't throw an error, but it DOESN'T set your time to be what you specified. Instead it sets it to 2017-05-04T07:00:00Z.
Now, if you have the same date time of 2017-05-04T04:50:00.00Z and instead of adding 30 seconds you add 24hrs you'd think that your time would then be set to be 2017-05-05T04:50:00.00Z. But no, the time will be set to 2017-05-05T07:00:00Z.
So it seems like these just process everyday at 07:00 UTC and you can't specify anything but the date.