1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Fix for JSON payment import

This commit is contained in:
Hillel Coren 2016-11-28 10:55:00 +02:00
parent b2c93897ed
commit 408aede80a
4 changed files with 5 additions and 5 deletions

View File

@ -171,9 +171,10 @@ class ImportService
}
foreach ($jsonInvoice['payments'] as $jsonPayment) {
$jsonPayment['client_id'] = $jsonPayment['client'] = $client->id; // TODO: change to client_id once views are updated
$jsonPayment['invoice_id'] = $jsonPayment['invoice'] = $invoice->id; // TODO: change to invoice_id once views are updated
$jsonPayment['invoice_id'] = $invoice->public_id;
if (EntityModel::validate($jsonPayment, ENTITY_PAYMENT) === true) {
$jsonPayment['client_id'] = $client->id;
$jsonPayment['invoice_id'] = $invoice->id;
$payment = $this->paymentRepo->save($jsonPayment);
$this->addSuccess($payment);
} else {

View File

@ -2227,7 +2227,6 @@ $LANG = array(
'entity_state' => 'State',
'payment_status_name' => 'Status',
'client_created_at' => 'Date Created',
'json_import_help' => 'We recommend importing into an empty account.',
'postmark_error' => 'There was a problem sending the email through Postmark: :link',
);

View File

@ -32,8 +32,7 @@
@foreach (\App\Services\ImportService::$entityTypes as $entityType)
{!! Former::file("{$entityType}_file")
->addGroupClass("import-file {$entityType}-file")
->help($entityType == IMPORT_JSON ? '<br/>' . trans('texts.json_import_help') : false) !!}
->addGroupClass("import-file {$entityType}-file") !!}
@endforeach
{!! Former::actions( Button::info(trans('texts.upload'))->submit()->large()->appendIcon(Icon::create('open'))) !!}

View File

@ -218,6 +218,7 @@
// Setup state/status filter
$('#statuses_{{ $entityType }}').select2({
placeholder: "{{ trans('texts.status') }}",
//allowClear: true,
templateSelection: function(data, container) {
if (data.id == 'archived') {
$(container).css('color', '#fff');