replicate(); $clone_invoice->status_id = Invoice::STATUS_DRAFT; $clone_invoice->number = null; $clone_invoice->date = null; $clone_invoice->due_date = null; $clone_invoice->partial_due_date = null; $clone_invoice->user_id = $user_id; $clone_invoice->balance = $invoice->amount; $clone_invoice->amount = $invoice->amount; $clone_invoice->line_items = $invoice->line_items; $clone_invoice->backup = null; return $clone_invoice; } }