$ia->importCsv($csv);
}
- function addBankAccounts() {
-
- $accnt = DB_DataObject::factory('subaccnt');
- if (!$accnt->get('subaccnt_number', '01')) {
- echo "SKIP Bank account creation - no subaccnt - 01\n";
- return;
- }
-
- $bankaccnt = DB_DataObject::factory('bankaccnt');
-
- $bankaccnt->whereAdd("
- bankaccnt_name != ''
- ");
- // do we have any bank accounts.. with names...
- if($bankaccnt->count()){
- return;
- }
- $bankaccnt = DB_DataObject::factory('bankaccnt');
-
- if(!$bankaccnt->get('bankaccnt_name', 'Current Account')){
- // create a standard account.
- $accnt = DB_DataObject::factory('accnt');
- $accnt->setFrom(array(
- 'accnt_number' => '131',
- 'accnt_descrip' => 'Current Account',
- 'accnt_comments' => '',
- 'accnt_profit' => '01',
- 'accnt_sub' => '01',
- 'accnt_type' => 'A',
- 'accnt_extref' => '',
- 'accnt_closedpost' => false,
- 'accnt_forwardupdate' => false,
- 'accnt_subaccnttype_code' => 'CA',
- 'accnt_curr_id' => $accnt->sqlValue("baseCurrId()"),
- 'accnt_active' => true
- ));
-
- if(!$accnt->find(true)){
- $accnt->insert();
- }
-
- $bankaccnt->setFrom(array(
- 'bankaccnt_name' => 'Current Account',
- 'bankaccnt_descrip' => 'Current Account',
- 'bankaccnt_bankname' => 'Current Account',
- 'bankaccnt_accntnumber' => 'N/A',
- 'bankaccnt_ar' => true,
- 'bankaccnt_ap' => true,
- 'bankaccnt_nextchknum' => 5000,
- 'bankaccnt_type' => 'K',
- 'bankaccnt_accnt_id' => $accnt->pid(),
- 'bankaccnt_curr_id' => $bankaccnt->sqlValue("baseCurrId()"),
- 'bankaccnt_notes' => '',
- 'bankaccnt_routing' => '',
- 'bankaccnt_ach_enabled' => false,
- 'bankaccnt_ach_origintype' => 'I'
- ));
-
- $bankaccnt->insert();
- }
-
- $bankaccnt = DB_DataObject::factory('bankaccnt');
-
- if(!$bankaccnt->get('bankaccnt_name', 'Savings Account')){
- $accnt = DB_DataObject::factory('accnt');
- $accnt->setFrom(array(
- 'accnt_number' => '404',
- 'accnt_descrip' => 'Savings Account',
- 'accnt_comments' => '',
- 'accnt_profit' => '01',
- 'accnt_sub' => '01',
- 'accnt_type' => 'A',
- 'accnt_extref' => '',
- 'accnt_closedpost' => false,
- 'accnt_forwardupdate' => false,
- 'accnt_subaccnttype_code' => 'CA',
- 'accnt_curr_id' => $accnt->sqlValue("baseCurrId()"),
- 'accnt_active' => true
- ));
-
- if(!$accnt->find(true)){
- $accnt->insert();
- }
-
- $bankaccnt->setFrom(array(
- 'bankaccnt_name' => 'Savings Account',
- 'bankaccnt_descrip' => 'Savings Account',
- 'bankaccnt_bankname' => 'Savings Account',
- 'bankaccnt_accntnumber' => 'N/A',
- 'bankaccnt_ar' => true,
- 'bankaccnt_ap' => true,
- 'bankaccnt_nextchknum' => 5000,
- 'bankaccnt_type' => 'K',
- 'bankaccnt_accnt_id' => $accnt->pid(),
- 'bankaccnt_curr_id' => $bankaccnt->sqlValue("baseCurrId()"),
- 'bankaccnt_notes' => '',
- 'bankaccnt_routing' => '',
- 'bankaccnt_ach_enabled' => false,
- 'bankaccnt_ach_origintype' => 'I'
- ));
-
- $bankaccnt->insert();
- }
- }
-
- }
+
}
\ No newline at end of file