$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;
$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");
}
'name' => $this->currentElement['NAME'],
'cost' => $this->currentElement['COST'],
'invoice_id' => $this->invoiceMap[$this->currentElement['INVOICE_ID']],
+ 'paid' => $this->currentElement['PAID'],
'status' => $this->currentElement['STATUS']));
}
'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 = '';
}