Pages

Monday, June 6, 2016

Episode 486: Collaboration with Cloud Accounting (Part 1)

"Debits? Credits? ... What is that? Tastes good?"


Indeed, there are some programmers who show "Allergic reaction" against "Finance and accounting terminology".

However, these are words which working adults should know. Even in the "Information Technology Engineers Examination", which certifies basic IT skills, these terms appear frequently.

Incidentally, there will be nothing wrong if you call them as "Left column, right column" in practice. Both of the column are merely a "breakdown table of assets". If you consist to describe concretely, it will be sufficient to consider that "Left column: Breakdown of cash and cash-like assets", "Right column: Breakdown of assets which must be paid (debt) and which are not needed to be paid."


So... How each of "Breakdown table of assets" (Balance sheet) will be transitioning, in a case that a Cloud service providing company
  • sold service provisioning for twelve months
  • agreed on April 1st, for 120,000 JPY
  • paid on May 30th

For example...

In April, it can be regarded as "increasing of asset for one month of service worth (10.000 JPY)" since they have already provided their service (not yet paid, though.) It is so-called "Selling on credit". (Account receivable) And it will keep on changing on and after May...

[Sales Reporting]


Eventually, the Increase and the decrease on each side will be as follows.

04-01 Account receivable: +10,000 / Sales: +10,000
05-01 Account receivable: +10,000 / Sales: +10,000
05-30 Bank deposit: +120,000, Account receivable: -20,000 / Unearned revenue: +100,000
06-01 (No change in assets) / Sales: +10,000, Unearned revenue: -10,000
07-01 (No change in assets) / Sales: +10,000, Unearned revenue: -10,000
08-01 (No change in assets) / Sales: +10,000, Unearned revenue: -10,000
09-01 (No change in assets) / Sales: +10,000, Unearned revenue: -10,000
10-01 (No change in assets) / Sales: +10,000, Unearned revenue: -10,000
11-01 (No change in assets) / Sales: +10,000, Unearned revenue: -10,000
12-01 (No change in assets) / Sales: +10,000, Unearned revenue: -10,000
01-01 (No change in assets) / Sales: +10,000, Unearned revenue: -10,000
02-01 (No change in assets) / Sales: +10,000, Unearned revenue: -10,000
03-01 (No change in assets) / Sales: +10,000, Unearned revenue: -10,000

Obviously, only the "Right column: Debt and assets other than debt" is changing after June. "Unearned revenue" means payment in advance, and is treated as debt.

In the accounting department, these thirteen processings are managed creating thirteen sheets of "slip". (Not in paper, though.)

The workflow here is a mechanism that these slips will be generated automatically after the completion of "1. Sales Report" by a staff in Sales team. Slips have been generated already at the Step of "2. Bookkeeping" for accounting staffs.

[Sales Reporting:"2. Bookkeeping" screen]

= Setting sample of Script Step "Slip auto-generation" (Server-side JavaScript))
//// == Retrieving == 
//var recordDate  = data.get("0");      // Billing date "2016-03-01" 
var cashinDate  = data.get("1");      // Payment due date 
var salesVolume = data.get("2") - 0;  // Billing amount 
var recordTitle = data.get("5") + ""; // Title of contract  

var sMonth = data.get("3");  // Start month (date) "2016-03-01" 
sMonth = sMonth.getFirstTimeInMonth(); 
var sMonthStr = data.get("3") + "";  // Start month (date) "2016-03-01" 
var eMonthStr = data.get("4") + "";  // End month (date) "2016-03-01" 


//// == Calculating == 
var sMonthYYYY = sMonthStr.substring(0, 4) - 0; 
var sMonthMM   = sMonthStr.substring(5, 7) - 0; 
var eMonthYYYY = eMonthStr.substring(0, 4) - 0; 
var eMonthMM   = eMonthStr.substring(5, 7) - 0; 

var numOfMon = (eMonthYYYY - sMonthYYYY) * 12 + eMonthMM - sMonthMM + 1; 
var monthlySales = salesVolume / numOfMon;  

var mfRecord = ""; 
var i=0; 
var j=0; 
for (i = 0; i < numOfMon; i++){ 
  var tmpDate = new com.questetra.bpms.util.AddableDate( sMonth.addMonths(i).getTime() ); 
  var tmpDateStr = tmpDate + ""; 
  var monthlyTitle = tmpDateStr.substring(0, 7) + " @ " + recordTitle;  

  if( cashinDate.after(tmpDate) ){ 
    mfRecord += tmpDateStr + "\tUnearned revenue\t\tExcluded\t\t"; 
    mfRecord += monthlySales + "\t\tSales\t\tSales including Tax 8%\t\t"; 
    mfRecord += monthlySales + "\t\t"; 
    mfRecord += monthlyTitle + "\t\t\t\n"; 
    j = i + 1; 
  } else { 
    mfRecord += tmpDateStr + "\tUnearned revenue\t\tExcluded\t\t"; 
    mfRecord += monthlySales + "\t\tSales\t\tSales including Tax 8%\t\t"; 
    mfRecord += monthlySales + "\t\t"; 
    mfRecord += monthlyTitle + "\t\t\t\n"; 
  } 
} 

var kakeCredit = monthlySales * j; 
var maeukeDeposit = salesVolume - kakeCredit; 

mfRecord += cashinDate + "\tDeposit account\tMizuho Bank\tExcluded\t\t"; 
mfRecord += salesVolume + "\t\tAccount payable\t\tExcluded\t\t"; 
mfRecord += kakeCredit + "\t\t"; 
mfRecord += recordTitle + "\t\t\tUnrealized\n"; 

mfRecord += cashinDate + "\t\t\t\t\t"; 
mfRecord += "0" + "\t\tUnearned revenue\t\tExcluded\t\t"; 
mfRecord += maeukeDeposit + "\t\t"; 
mfRecord += recordTitle + "\t\t\tUnrealized\n"; 


//// == Updating == 
retVal.put("6", mfRecord ); 

[Data Items list]


[Free Download]
<Similar Models>
<<Related Articles>>


[ε’Œζ–‡θ¨˜δΊ‹ (Japanese Entry)]