diff --git a/app/Export/CSV/InvoiceExport.php b/app/Export/CSV/InvoiceExport.php new file mode 100644 index 000000000000..a0beec29c821 --- /dev/null +++ b/app/Export/CSV/InvoiceExport.php @@ -0,0 +1,17 @@ + 'number', + 1 => 'user_id', + 2 => 'amount', + 3 => 'balance', + 4 => 'client_id', + 5 => 'status_id', + 6 => 'is_deleted', + 7 => 'number', + 8 => 'discount', + 9 => 'po_number', + 10 => 'date', + 11 => 'due_date', + 12 => 'terms', + 13 => 'public_notes', + 14 => 'private_notes', + 15 => 'uses_inclusive_taxes', + 16 => 'tax_name1', + 17 => 'tax_rate1', + 18 => 'tax_name2', + 19 => 'tax_rate2', + 20 => 'tax_name3', + 21 => 'tax_rate3', + 22 => 'is_amount_discount', + 23 => 'footer', + 24 => 'partial', + 25 => 'partial_due_date', + 26 => 'custom_value1', + 27 => 'custom_value2', + 28 => 'custom_value3', + 29 => 'custom_value4', + 30 => 'custom_surcharge1', + 31 => 'custom_surcharge2', + 32 => 'custom_surcharge3', + 33 => 'custom_surcharge4', + 34 => 'exchange_rate', + 35 => 'line_items', + ]\InvoiceMap; use Illuminate\Http\Request; -use League\Csv\Reader; -use League\Csv\Statement; use Illuminate\Support\Facades\Cache; use Illuminate\Support\Str; +use League\Csv\Reader; +use League\Csv\Statement; class ImportController extends Controller { @@ -82,6 +127,7 @@ class ImportController extends Controller $data['data'] = [ 'hash' => $hash, + 'available' => InvoiceMap::importable(), 'headers' => array_slice($csv_array, 0, 2) ]; diff --git a/app/Import/Definitions/InvoiceMap.php b/app/Import/Definitions/InvoiceMap.php new file mode 100644 index 000000000000..a6780f86046a --- /dev/null +++ b/app/Import/Definitions/InvoiceMap.php @@ -0,0 +1,58 @@ + 'number', + 1 => 'user_id', + 2 => 'amount', + 3 => 'balance', + 4 => 'client_id', + 5 => 'status_id', + 6 => 'is_deleted', + 7 => 'number', + 8 => 'discount', + 9 => 'po_number', + 10 => 'date', + 11 => 'due_date', + 12 => 'terms', + 13 => 'public_notes', + 14 => 'private_notes', + 15 => 'uses_inclusive_taxes', + 16 => 'tax_name1', + 17 => 'tax_rate1', + 18 => 'tax_name2', + 19 => 'tax_rate2', + 20 => 'tax_name3', + 21 => 'tax_rate3', + 22 => 'is_amount_discount', + 23 => 'footer', + 24 => 'partial', + 25 => 'partial_due_date', + 26 => 'custom_value1', + 27 => 'custom_value2', + 28 => 'custom_value3', + 29 => 'custom_value4', + 30 => 'custom_surcharge1', + 31 => 'custom_surcharge2', + 32 => 'custom_surcharge3', + 33 => 'custom_surcharge4', + 34 => 'exchange_rate', + 35 => 'line_items', + ]; + } +} \ No newline at end of file