Fix empty invoice amounts when creating a new invoice
This commit is contained in:
parent
b8b894a5f9
commit
3ab425774e
|
|
@ -260,6 +260,9 @@ class DocumentsController extends AppController {
|
||||||
if(isset($source_document_id)) {
|
if(isset($source_document_id)) {
|
||||||
//This is not ideal. But nothing else is either.
|
//This is not ideal. But nothing else is either.
|
||||||
$sourceDoc = $this->Document->find('first', array('conditions' => array('Document.id' => $source_document_id)));
|
$sourceDoc = $this->Document->find('first', array('conditions' => array('Document.id' => $source_document_id)));
|
||||||
|
|
||||||
|
$totals = $this->calculateTotals($sourceDoc, $enquiry['Enquiry']['gst']);
|
||||||
|
$this->data['Invoice']['amount_invoiced'] = $totals['total'];
|
||||||
if($sourceDoc['Document']['type'] == 'orderAck') {
|
if($sourceDoc['Document']['type'] == 'orderAck') {
|
||||||
$oa_attributes = array(
|
$oa_attributes = array(
|
||||||
'ship_via',
|
'ship_via',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue