X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/6ede4ba89cf66620bd1c40d092b3518fd51ba69c..b5c16658c0a91c98bb4e41bb6c0e1cc254222a68:/WEB-INF/lib/ttOrgImportHelper.class.php diff --git a/WEB-INF/lib/ttOrgImportHelper.class.php b/WEB-INF/lib/ttOrgImportHelper.class.php index 17827986..89428c4c 100644 --- a/WEB-INF/lib/ttOrgImportHelper.class.php +++ b/WEB-INF/lib/ttOrgImportHelper.class.php @@ -33,6 +33,7 @@ import('ttProjectHelper'); import('ttClientHelper'); import('ttInvoiceHelper'); import('ttCustomFieldHelper'); +import('ttExpenseHelper'); // ttOrgImportHelper - this class is a future replacement for ttImportHelper. // Currently, it is work in progress. @@ -370,6 +371,23 @@ class ttOrgImportHelper { $this->errors->add($i18n->get('error.db')); } } + + if ($name == 'EXPENSE_ITEM') { + // We get here when processing tags for the current group. + $expense_item_id = ttExpenseHelper::insert(array( + 'date' => $attrs['DATE'], + 'user_id' => $this->currentGroupUserMap[$attrs['USER_ID']], + 'group_id' => $this->current_group_id, + // 'org_id' => $this->org_id, TODO: add this when org_id field is added to the table. + 'client_id' => $this->currentGroupClientMap[$attrs['CLIENT_ID']], + 'project_id' => $this->currentGroupProjectMap[$attrs['PROJECT_ID']], + 'name' => $attrs['NAME'], + 'cost' => $attrs['COST'], + 'invoice_id' => $this->currentGroupInvoiceMap[$attrs['INVOICE_ID']], + 'paid' => $attrs['PAID'], + 'status' => $attrs['STATUS'])); + if (!$expense_item_id) $this->errors->add($i18n->get('error.db')); + } } }