From 167d0053730f0f56fd3cf3b53e25f41143201f5e Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Fri, 7 Jul 2017 15:12:57 +0300 Subject: [PATCH] Working on CSV import --- app/Services/ImportService.php | 13 ++++++++++++- resources/lang/en/texts.php | 3 ++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/Services/ImportService.php b/app/Services/ImportService.php index ec278af94a01..e643d48040eb 100644 --- a/app/Services/ImportService.php +++ b/app/Services/ImportService.php @@ -534,7 +534,18 @@ class ImportService // Lookup field translations foreach ($columns as $key => $value) { unset($columns[$key]); - $columns[$value] = trans("texts.{$value}"); + $label = $value; + // disambiguate some of the labels + if ($entityType == ENTITY_INVOICE) { + if ($label == 'name') { + $label = 'client_name'; + } elseif ($label == 'notes') { + $label = 'product_notes'; + } elseif ($label == 'terms') { + $label = 'invoice_terms'; + } + } + $columns[$value] = trans("texts.{$label}"); } array_unshift($columns, ' '); diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index 251bf9db8d94..316a9ced0def 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -511,7 +511,7 @@ $LANG = array( 'partial_remaining' => ':partial of :balance', 'more_fields' => 'More Fields', 'less_fields' => 'Less Fields', - 'client_name' => 'Client', + 'client_name' => 'Client Name', 'pdf_settings' => 'PDF Settings', 'product_settings' => 'Product Settings', 'auto_wrap' => 'Auto Line Wrap', @@ -2298,6 +2298,7 @@ $LANG = array( 'next_credit_number' => 'The next credit number is :number.', 'padding_help' => 'The number of zero\'s to pad the number.', 'import_warning_invalid_date' => 'Warning: The date format appears to be invalid.', + 'product_notes' => 'Product Notes', );