// this is direct document - first add parent
$ref = $this->reference;
$date = $this->document_date;
+ $due_date = $this->due_date;
$this->trans_type = get_parent_type($this->trans_type);
$this->reference = 'auto';
$this->read($this->trans_type, $trans_no, true);
$this->document_date = $date;
$this->reference = $ref;
+ $this->due_date = $due_date;
}
$this->reference = @html_entity_decode($this->reference, ENT_QUOTES);
+ if ($this->reference != 'auto' && $this->trans_no == 0 && !is_new_reference($this->reference, $this->trans_type))
+ {
+ commit_transaction();
+ return -1;
+ }
$this->Comments = @html_entity_decode($this->Comments, ENT_QUOTES);
foreach($this->line_items as $lineno => $line) {
$this->line_items[$lineno]->stock_id = @html_entity_decode($line->stock_id, ENT_QUOTES);
if ($tax_items != null) {
foreach ($tax_items as $item_tax) {
$index = $item_tax['tax_type_id'];
- if (isset($this->tax_group_array[$index])) {
+ if (isset($this->tax_group_array[$index]['rate'])) {
$tax_rate += $item_tax['rate'];
}
}