Merge pull request #1983 from SevanNerse/create-document-item
items of request array should be manipulated seperately
This commit is contained in:
commit
c7fe26e9d9
@ -163,19 +163,19 @@ class CreateDocumentItem extends Job
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$document_item = DocumentItem::create([
|
$this->request['company_id'] = $this->document->company_id;
|
||||||
'company_id' => $this->document->company_id,
|
$this->request['type'] = $this->document->type;
|
||||||
'type' => $this->document->type,
|
$this->request['document_id'] = $this->document->id;
|
||||||
'document_id' => $this->document->id,
|
$this->request['item_id'] = $item_id;
|
||||||
'item_id' => $item_id,
|
$this->request['name'] = Str::limit($this->request['name'], 180, '');
|
||||||
'name' => Str::limit($this->request['name'], 180, ''),
|
$this->request['description'] = !empty($this->request['description']) ? $this->request['description'] : '';
|
||||||
'description' => !empty($this->request['description']) ? $this->request['description'] : '',
|
$this->request['quantity'] = (double) $this->request['quantity'];
|
||||||
'quantity' => (double) $this->request['quantity'],
|
$this->request['price'] = round($this->request['price'], $precision);
|
||||||
'price' => round($this->request['price'], $precision),
|
$this->request['tax'] = round($item_tax_total, $precision);
|
||||||
'tax' => round($item_tax_total, $precision),
|
$this->request['discount_rate'] = !empty($this->request['discount']) ? $this->request['discount'] : 0;
|
||||||
'discount_rate' => !empty($this->request['discount']) ? $this->request['discount'] : 0,
|
$this->request['total'] = round($item_amount, $precision);
|
||||||
'total' => round($item_amount, $precision),
|
|
||||||
]);
|
$document_item = DocumentItem::create($this->request);
|
||||||
|
|
||||||
$document_item->item_taxes = false;
|
$document_item->item_taxes = false;
|
||||||
$document_item->inclusives = false;
|
$document_item->inclusives = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user