From: Nik Okuntseff Date: Wed, 24 Jan 2018 17:37:17 +0000 (+0000) Subject: Fixes for fav reports export and import. X-Git-Tag: timetracker_1.19-1~1341 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=15732fdcbd4df6fdff051e6bdacc178fd1b4e5a9;p=timetracker.git Fixes for fav reports export and import. --- diff --git a/WEB-INF/lib/ttExpenseHelper.class.php b/WEB-INF/lib/ttExpenseHelper.class.php index ff7879c3..533c438d 100644 --- a/WEB-INF/lib/ttExpenseHelper.class.php +++ b/WEB-INF/lib/ttExpenseHelper.class.php @@ -41,10 +41,11 @@ class ttExpenseHelper { $cost = str_replace(',', '.', $fields['cost']); $invoice_id = $fields['invoice_id']; $status = $fields['status']; + $paid = (int) $fields['paid']; - $sql = "insert into tt_expense_items (date, user_id, client_id, project_id, name, cost, invoice_id, status) ". + $sql = "insert into tt_expense_items (date, user_id, client_id, project_id, name, cost, invoice_id, paid, status) ". "values (".$mdb2->quote($date).", $user_id, ".$mdb2->quote($client_id).", ".$mdb2->quote($project_id). - ", ".$mdb2->quote($name).", ".$mdb2->quote($cost).", ".$mdb2->quote($invoice_id).", ".$mdb2->quote($status).")"; + ", ".$mdb2->quote($name).", ".$mdb2->quote($cost).", ".$mdb2->quote($invoice_id).", $paid, ".$mdb2->quote($status).")"; $affected = $mdb2->exec($sql); if (is_a($affected, 'PEAR_Error')) return false; diff --git a/WEB-INF/lib/ttExportHelper.class.php b/WEB-INF/lib/ttExportHelper.class.php index a3f6485d..bf43f28c 100644 --- a/WEB-INF/lib/ttExportHelper.class.php +++ b/WEB-INF/lib/ttExportHelper.class.php @@ -241,7 +241,7 @@ class ttExportHelper { $expense_items = ttTeamHelper::getExpenseItems($user->team_id); fwrite($file, "\n"); foreach ($expense_items as $expense_item) { - fwrite($file, " userMap[$expense_item['user_id']]."\" client_id=\"".$this->clientMap[$expense_item['client_id']]."\" project_id=\"".$this->projectMap[$expense_item['project_id']]."\" cost=\"".$expense_item['cost']."\" invoice_id=\"".$this->invoiceMap[$expense_item['invoice_id']]."\" status=\"".$expense_item['status']."\">\n"); + fwrite($file, " userMap[$expense_item['user_id']]."\" client_id=\"".$this->clientMap[$expense_item['client_id']]."\" project_id=\"".$this->projectMap[$expense_item['project_id']]."\" cost=\"".$expense_item['cost']."\" invoice_id=\"".$this->invoiceMap[$expense_item['invoice_id']]."\" paid=\"".$expense_item['paid']."\" status=\"".$expense_item['status']."\">\n"); fwrite($file, " \n"); fwrite($file, " \n"); } diff --git a/WEB-INF/lib/ttImportHelper.class.php b/WEB-INF/lib/ttImportHelper.class.php index 753dc165..da4176c1 100644 --- a/WEB-INF/lib/ttImportHelper.class.php +++ b/WEB-INF/lib/ttImportHelper.class.php @@ -273,6 +273,7 @@ class ttImportHelper { 'name' => $this->currentElement['NAME'], 'cost' => $this->currentElement['COST'], 'invoice_id' => $this->invoiceMap[$this->currentElement['INVOICE_ID']], + 'paid' => $this->currentElement['PAID'], 'status' => $this->currentElement['STATUS'])); } @@ -295,18 +296,19 @@ class ttImportHelper { 'period' => $this->currentElement['PERIOD'], 'from' => $this->currentElement['PERIOD_START'], 'to' => $this->currentElement['PERIOD_END'], - 'chclient' => $this->currentElement['SHOW_CLIENT'], - 'chinvoice' => $this->currentElement['SHOW_INVOICE'], - 'chproject' => $this->currentElement['SHOW_PROJECT'], - 'chstart' => $this->currentElement['SHOW_START'], - 'chduration' => $this->currentElement['SHOW_DURATION'], - 'chcost' => $this->currentElement['SHOW_COST'], - 'chtask' => $this->currentElement['SHOW_TASK'], - 'chfinish' => $this->currentElement['SHOW_END'], - 'chnote' => $this->currentElement['SHOW_NOTE'], - 'chcf_1' => $this->currentElement['SHOW_CUSTOM_FIELD_1'], + 'chclient' => (int) $this->currentElement['SHOW_CLIENT'], + 'chinvoice' => (int) $this->currentElement['SHOW_INVOICE'], + 'chpaid' => (int) $this->currentElement['SHOW_PAID'], + 'chproject' => (int) $this->currentElement['SHOW_PROJECT'], + 'chstart' => (int) $this->currentElement['SHOW_START'], + 'chduration' => (int) $this->currentElement['SHOW_DURATION'], + 'chcost' => (int) $this->currentElement['SHOW_COST'], + 'chtask' => (int) $this->currentElement['SHOW_TASK'], + 'chfinish' => (int) $this->currentElement['SHOW_END'], + 'chnote' => (int) $this->currentElement['SHOW_NOTE'], + 'chcf_1' => (int) $this->currentElement['SHOW_CUSTOM_FIELD_1'], 'group_by' => $this->currentElement['GROUP_BY'], - 'chtotalsonly' => $this->currentElement['SHOW_TOTALS_ONLY'])); + 'chtotalsonly' => (int) $this->currentElement['SHOW_TOTALS_ONLY'])); } $this->currentTag = ''; } diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 7c8a7a22..460d3f4e 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.17.2.3778 | Copyright © Anuko | +  Anuko Time Tracker 1.17.3.3779 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve}