1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00
invoiceninja/app/Factory/CloneQuoteToInvoiceFactory.php
David Bomba 9e9cd37b87
Modifications to Designs (#3353)
* Working on Quotes

* Naming refactor for Quotes

* Quote Actions

* Quote Pdfs

* Quote PDFs

* Refunds in Stripe

* Fixes tests

* Company Ledger work
2020-02-20 07:44:12 +11:00

20 lines
396 B
PHP

<?php
namespace App\Factory;
use App\Models\Invoice;
use App\Models\Quote;
class CloneQuoteToInvoiceFactory
{
public static function create(Quote $quote, $user_id) : ?Invoice
{
$invoice = new Invoice();
$invoice->user_id = $user_id;
$invoice->po_number = $quote->po_number;
$invoice->footer = $quote->footer;
$invoice->line_items = $quote->line_items;
return $invoice;
}
}