diff --git a/app/Ninja/Import/BaseTransformer.php b/app/Ninja/Import/BaseTransformer.php
index f39d81587bbb..541dd84ff857 100644
--- a/app/Ninja/Import/BaseTransformer.php
+++ b/app/Ninja/Import/BaseTransformer.php
@@ -31,6 +31,12 @@ class BaseTransformer extends TransformerAbstract
return isset($this->maps['countries'][$name]) ? $this->maps['countries'][$name] : null;
}
+ protected function getCountryIdBy2($name)
+ {
+ $name = strtolower($name);
+ return isset($this->maps['countries2'][$name]) ? $this->maps['countries2'][$name] : null;
+ }
+
protected function getFirstName($name)
{
$name = Utils::splitName($name);
diff --git a/app/Ninja/Import/Invoiceable/ClientTransformer.php b/app/Ninja/Import/Invoiceable/ClientTransformer.php
new file mode 100644
index 000000000000..20e5ee0e16af
--- /dev/null
+++ b/app/Ninja/Import/Invoiceable/ClientTransformer.php
@@ -0,0 +1,34 @@
+hasClient($data->client_name)) {
+ return false;
+ }
+
+ return new Item($data, function ($data) {
+ return [
+ 'name' => $data->client_name,
+ 'work_phone' => $data->tel,
+ 'website' => $data->website,
+ 'address1' => $data->address,
+ 'city' => $data->city,
+ 'state' => $data->state,
+ 'postal_code' => $data->postcode,
+ 'country_id' => $this->getCountryIdBy2($data->country),
+ 'private_notes' => $data->notes,
+ 'contacts' => [
+ [
+ 'email' => $data->email,
+ 'phone' => $data->mobile,
+ ],
+ ],
+ ];
+ });
+ }
+}
diff --git a/app/Ninja/Import/Invoiceable/InvoiceTransformer.php b/app/Ninja/Import/Invoiceable/InvoiceTransformer.php
new file mode 100644
index 000000000000..078ce7956e9b
--- /dev/null
+++ b/app/Ninja/Import/Invoiceable/InvoiceTransformer.php
@@ -0,0 +1,37 @@
+getClientId($data->client_name)) {
+ return false;
+ }
+
+ if ($this->hasInvoice($data->ref)) {
+ return false;
+ }
+
+ return new Item($data, function ($data) {
+ return [
+ 'client_id' => $this->getClientId($data->client_name),
+ 'invoice_number' => $data->ref,
+ 'po_number' => $data->po_number,
+ 'invoice_date_sql' => $data->date,
+ 'due_date_sql' => $data->due_date,
+ 'invoice_footer' => $data->footer,
+ 'paid' => (float) $data->paid,
+ 'invoice_items' => [
+ [
+ 'notes' => $data->description,
+ 'cost' => (float) $data->total,
+ 'qty' => 1,
+ ]
+ ],
+ ];
+ });
+ }
+}
\ No newline at end of file
diff --git a/app/Ninja/Import/Invoiceable/PaymentTransformer.php b/app/Ninja/Import/Invoiceable/PaymentTransformer.php
new file mode 100644
index 000000000000..c52494cdc689
--- /dev/null
+++ b/app/Ninja/Import/Invoiceable/PaymentTransformer.php
@@ -0,0 +1,19 @@
+ $data->paid,
+ 'payment_date_sql' => $data->date_paid,
+ 'client_id' => $data->client_id,
+ 'invoice_id' => $data->invoice_id,
+ ];
+ });
+ }
+}
\ No newline at end of file
diff --git a/app/Services/ImportService.php b/app/Services/ImportService.php
index 2b8e273b722b..818f4abc7fef 100644
--- a/app/Services/ImportService.php
+++ b/app/Services/ImportService.php
@@ -36,7 +36,7 @@ class ImportService
IMPORT_FRESHBOOKS,
IMPORT_HARVEST,
IMPORT_HIVEAGE,
- //IMPORT_INVOICEABLE,
+ IMPORT_INVOICEABLE,
//IMPORT_NUTCACHE,
//IMPORT_RONIN,
//IMPORT_WAVE,
@@ -190,19 +190,25 @@ class ImportService
$clientMap = [];
$clients = $this->clientRepo->all();
foreach ($clients as $client) {
- $clientMap[strtolower($client->name)] = $client->id;
+ if ($name = strtolower(trim($client->name))) {
+ $clientMap[$name] = $client->id;
+ }
}
$invoiceMap = [];
$invoices = $this->invoiceRepo->all();
foreach ($invoices as $invoice) {
- $invoiceMap[strtolower($invoice->invoice_number)] = $invoice->id;
+ if ($number = strtolower(trim($invoice->invoice_number))) {
+ $invoiceMap[$number] = $invoice->id;
+ }
}
$countryMap = [];
+ $countryMap2 = [];
$countries = Cache::get('countries');
foreach ($countries as $country) {
$countryMap[strtolower($country->name)] = $country->id;
+ $countryMap2[strtolower($country->iso_3166_2)] = $country->id;
}
$currencyMap = [];
@@ -215,6 +221,7 @@ class ImportService
ENTITY_CLIENT => $clientMap,
ENTITY_INVOICE => $invoiceMap,
'countries' => $countryMap,
+ 'countries2' => $countryMap2,
'currencies' => $currencyMap,
];
}
diff --git a/readme.md b/readme.md
index dea2f2c518ce..e8e9f832fc40 100644
--- a/readme.md
+++ b/readme.md
@@ -62,14 +62,13 @@ There are two options:
### Frameworks/Libraries
* [laravel/laravel](https://github.com/laravel/laravel) - A PHP Framework For Web Artisans
* [twbs/bootstrap](https://github.com/twbs/bootstrap) - Sleek, intuitive, and powerful front-end framework for faster and easier web development.
+* [jquery/jquery](https://github.com/jquery/jquery) - jQuery JavaScript Library
+* [jquery/jquery-ui](https://github.com/jquery/jquery-ui) - The official jQuery user interface library
* [patricktalmadge/bootstrapper](https://github.com/patricktalmadge/bootstrapper) - Laravel Twitter Bootstrap Bundle
* [danielfarrell/bootstrap-combobox](https://github.com/danielfarrell/bootstrap-combobox) - A combobox plugin
-* [jquery/jquery](https://github.com/jquery/jquery) - jQuery JavaScript Library
* [eternicode/bootstrap-datepicker](https://github.com/eternicode/bootstrap-datepicker) - A datepicker for @twitter bootstrap
-* [jquery/jquery-ui](https://github.com/jquery/jquery-ui) - The official jQuery user interface library
* [knockout/knockout](https://github.com/knockout/knockout) - Knockout makes it easier to create rich, responsive UIs with JavaScript
* [rniemeyer/knockout-sortable](https://github.com/rniemeyer/knockout-sortable) - A Knockout.js binding to connect observableArrays with jQuery UI sortable functionality
-* [MrRio/jsPDF](https://github.com/MrRio/jsPDF) - Generate PDF files in JavaScript. HTML5 FTW.
* [bpampuch/pdfmake](https://github.com/bpampuch/pdfmake) - Client/server side PDF printing in pure JavaScript
* [FortAwesome/Font-Awesome](https://github.com/FortAwesome/Font-Awesome) - The iconic font designed for Bootstrap that works with twitter bootstrap
* [Anahkiasen/former](https://github.com/Anahkiasen/former) - A powerful form builder, for Laravel and other frameworks (stand-alone too)
@@ -91,4 +90,5 @@ There are two options:
* [josdejong/jsoneditor](https://github.com/josdejong/jsoneditor/) - A web-based tool to view, edit and format JSON
* [simshaun/recurr](https://github.com/simshaun/recurr) - PHP library for working with recurrence rules
* [quilljs/quill](https://github.com/quilljs/quill/) - A cross browser rich text editor with an API
-* [Maatwebsite/Laravel-Excel](https://github.com/Maatwebsite/Laravel-Excel) - An eloquent way of importing and exporting Excel and CSV files for Laravel
\ No newline at end of file
+* [Maatwebsite/Laravel-Excel](https://github.com/Maatwebsite/Laravel-Excel) - An eloquent way of importing and exporting Excel and CSV files for Laravel
+* [thephpleague/fractal](https://github.com/thephpleague/fractal) - Output complex, flexible, AJAX/RESTful data structures
\ No newline at end of file
diff --git a/resources/views/accounts/templates_and_reminders.blade.php b/resources/views/accounts/templates_and_reminders.blade.php
index c8b90b3383f7..19773cad9b8d 100644
--- a/resources/views/accounts/templates_and_reminders.blade.php
+++ b/resources/views/accounts/templates_and_reminders.blade.php
@@ -3,6 +3,7 @@
@section('head')
@parent
+ @include('money_script')
diff --git a/resources/views/invoices/edit.blade.php b/resources/views/invoices/edit.blade.php
index 63e359ad9477..baa9641148bc 100644
--- a/resources/views/invoices/edit.blade.php
+++ b/resources/views/invoices/edit.blade.php
@@ -88,11 +88,13 @@
+ @if (Utils::isConfirmed())
+ @endif
@@ -173,10 +175,10 @@
|
- |
+ {{ $invoiceLabels['item'] }} |
{{ $invoiceLabels['description'] }} |
- |
- |
+ {{ $invoiceLabels['unit_cost'] }} |
+ {{ $invoiceLabels['quantity'] }} |
{{ trans('texts.tax') }} |
{{ trans('texts.line_total') }} |
|