fill($data); $invoice->save(); $invoice_calc = new InvoiceSum($invoice, $invoice->settings); $invoice = $invoice_calc->build()->getInvoice(); return $invoice; } }