Fixes for fav reports export and import.
authorNik Okuntseff <support@anuko.com>
Wed, 24 Jan 2018 17:37:17 +0000 (17:37 +0000)
committerNik Okuntseff <support@anuko.com>
Wed, 24 Jan 2018 17:37:17 +0000 (17:37 +0000)
WEB-INF/lib/ttExpenseHelper.class.php
WEB-INF/lib/ttExportHelper.class.php
WEB-INF/lib/ttImportHelper.class.php
WEB-INF/templates/footer.tpl

index ff7879c..533c438 100644 (file)
@@ -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;
index a3f6485..bf43f28 100644 (file)
@@ -241,7 +241,7 @@ class ttExportHelper {
     $expense_items = ttTeamHelper::getExpenseItems($user->team_id);
     fwrite($file, "<expense_items>\n");
     foreach ($expense_items as $expense_item) {
-      fwrite($file, "  <expense_item date=\"".$expense_item['date']."\" user_id=\"".$this->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, "  <expense_item date=\"".$expense_item['date']."\" user_id=\"".$this->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, "    <name><![CDATA[".$expense_item['name']."]]></name>\n");
       fwrite($file, "  </expense_item>\n");
     }
index 753dc16..da4176c 100644 (file)
@@ -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 = '';
   }
index 7c8a7a2..460d3f4 100644 (file)
@@ -12,7 +12,7 @@
       <br>
       <table cellspacing="0" cellpadding="4" width="100%" border="0">
         <tr>
-          <td align="center">&nbsp;Anuko Time Tracker 1.17.2.3778 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.17.3.3779 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
             <a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
             <a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
             <a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>