mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Updates for Task Exports
This commit is contained in:
parent
0048658099
commit
65a356c99f
@ -427,8 +427,11 @@ class BaseExport
|
||||
|
||||
protected array $task_report_keys = [
|
||||
'start_date' => 'task.start_date',
|
||||
'start_time' => 'task.start_time',
|
||||
'end_date' => 'task.end_date',
|
||||
'end_time' => 'task.end_time',
|
||||
'duration' => 'task.duration',
|
||||
'duration_words' => 'task.duration_words',
|
||||
'rate' => 'task.rate',
|
||||
'number' => 'task.number',
|
||||
'description' => 'task.description',
|
||||
|
@ -11,18 +11,19 @@
|
||||
|
||||
namespace App\Export\CSV;
|
||||
|
||||
use App\Export\Decorators\Decorator;
|
||||
use App\Libraries\MultiDB;
|
||||
use App\Models\Company;
|
||||
use App\Models\DateFormat;
|
||||
use App\Models\Task;
|
||||
use App\Models\Timezone;
|
||||
use App\Transformers\TaskTransformer;
|
||||
use App\Utils\Ninja;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use League\Csv\Writer;
|
||||
use App\Models\Company;
|
||||
use App\Models\Timezone;
|
||||
use App\Libraries\MultiDB;
|
||||
use App\Models\DateFormat;
|
||||
use Carbon\CarbonInterval;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use League\Csv\Writer;
|
||||
use App\Export\Decorators\Decorator;
|
||||
use App\Transformers\TaskTransformer;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class TaskExport extends BaseExport
|
||||
{
|
||||
@ -177,19 +178,26 @@ class TaskExport extends BaseExport
|
||||
|
||||
foreach ($logs as $key => $item) {
|
||||
if (in_array('task.start_date', $this->input['report_keys']) || in_array('start_date', $this->input['report_keys'])) {
|
||||
$entity['task.start_date'] = Carbon::createFromTimeStamp($item[0])->setTimezone($timezone_name)->format($date_format_default);
|
||||
$carbon_object = Carbon::createFromTimeStamp($item[0])->setTimezone($timezone_name);
|
||||
$entity['task.start_date'] = $carbon_object->format($date_format_default);
|
||||
$entity['task.start_time'] = $carbon_object->format('H:i:s');
|
||||
}
|
||||
|
||||
if ((in_array('task.end_date', $this->input['report_keys']) || in_array('end_date', $this->input['report_keys'])) && $item[1] > 0) {
|
||||
$entity['task.end_date'] = Carbon::createFromTimeStamp($item[1])->setTimezone($timezone_name)->format($date_format_default);
|
||||
$carbon_object = Carbon::createFromTimeStamp($item[1])->setTimezone($timezone_name);
|
||||
$entity['task.end_date'] = $carbon_object->format($date_format_default);
|
||||
$entity['task.end_time'] = $carbon_object->format('H:i:s');
|
||||
}
|
||||
|
||||
if ((in_array('task.end_date', $this->input['report_keys']) || in_array('end_date', $this->input['report_keys'])) && $item[1] == 0) {
|
||||
$entity['task.end_date'] = ctrans('texts.is_running');
|
||||
$entity['task.end_time'] = ctrans('texts.is_running');
|
||||
}
|
||||
|
||||
if (in_array('task.duration', $this->input['report_keys']) || in_array('duration', $this->input['report_keys'])) {
|
||||
$entity['task.duration'] = $task->calcDuration();
|
||||
$seconds = $task->calcDuration();
|
||||
$entity['task.duration'] = $seconds;
|
||||
$entity['task.duration_words'] = CarbonInterval::seconds($seconds)->locale($this->company->locale())->cascade()->forHumans();
|
||||
}
|
||||
|
||||
$entity = $this->decorateAdvancedFields($task, $entity);
|
||||
@ -197,8 +205,12 @@ class TaskExport extends BaseExport
|
||||
$this->storage_array[] = $entity;
|
||||
|
||||
$entity['task.start_date'] = '';
|
||||
$entity['task.start_time'] = '';
|
||||
$entity['task.end_date'] = '';
|
||||
$entity['task.end_time'] = '';
|
||||
$entity['task.duration'] = '';
|
||||
$entity['task.duration_words'] = '';
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ class InvoiceDecorator extends Decorator implements DecoratorInterface
|
||||
$invoice = $entity;
|
||||
} elseif($entity->invoice) {
|
||||
$invoice = $entity->invoice;
|
||||
} elseif($entity->invoices()->exists()) {
|
||||
} elseif(method_exists($entity, 'invoices') && $entity->invoices()->exists()) {
|
||||
$invoice = $entity->invoices()->first();
|
||||
}
|
||||
|
||||
|
@ -5266,6 +5266,7 @@ $lang = array(
|
||||
'product_cost' => 'Product cost',
|
||||
'enable_rappen_roudning' => 'Enable Rappen Rounding',
|
||||
'enable_rappen_rounding_help' => 'Rounds totals to nearest 5',
|
||||
'duration_words' => 'Duration in words',
|
||||
);
|
||||
|
||||
return $lang;
|
||||
|
@ -2194,6 +2194,8 @@ Lorsque les montant apparaîtront sur votre relevé, veuillez revenir sur cette
|
||||
'encryption' => 'Cryptage',
|
||||
'mailgun_domain' => 'Domaine Mailgun',
|
||||
'mailgun_private_key' => 'Clé privée Mailgun',
|
||||
'brevo_domain' => 'Domaine Brevo',
|
||||
'brevo_private_key' => 'Clé privée Brevo',
|
||||
'send_test_email' => 'Envoyer un courriel test',
|
||||
'select_label' => 'Sélectionnez le libellé',
|
||||
'label' => 'Libellé',
|
||||
@ -4844,6 +4846,7 @@ Lorsque les montant apparaîtront sur votre relevé, veuillez revenir sur cette
|
||||
'email_alignment' => 'Justification du courriel',
|
||||
'pdf_preview_location' => 'Emplacement de prévisualisation du PDF',
|
||||
'mailgun' => 'Mailgun',
|
||||
'brevo' => 'Brevo',
|
||||
'postmark' => 'Postmark',
|
||||
'microsoft' => 'Microsoft',
|
||||
'click_plus_to_create_record' => 'Cliquez sur + pour créer un enregistrement',
|
||||
@ -5096,6 +5099,8 @@ Lorsque les montant apparaîtront sur votre relevé, veuillez revenir sur cette
|
||||
'drop_files_here' => 'Déposez les fichiers ici',
|
||||
'upload_files' => 'Téléverser les fichiers',
|
||||
'download_e_invoice' => 'Télécharger la facture électronique',
|
||||
'download_e_credit' => 'Télécharger E-Credit',
|
||||
'download_e_quote' => 'Télécharger E-Quote',
|
||||
'triangular_tax_info' => 'Transactions intra-communautaire triangulaire',
|
||||
'intracommunity_tax_info' => 'Livraison intra-communautaure sans taxe',
|
||||
'reverse_tax_info' => 'Veuillez noter que cette provision est sujette à une charge renversée',
|
||||
@ -5253,6 +5258,9 @@ Lorsque les montant apparaîtront sur votre relevé, veuillez revenir sur cette
|
||||
'select_email_provider' => 'Définir le courriel pour l\'envoi',
|
||||
'purchase_order_items' => 'Articles du bon d\'achat',
|
||||
'csv_rows_length' => 'Aucune donnée dans ce fichier CSV',
|
||||
'accept_payments_online' => 'Accepter les paiements en ligne',
|
||||
'all_payment_gateways' => 'Voir toutes les passerelles de paiements',
|
||||
'product_cost' => 'Coût du produit',
|
||||
);
|
||||
|
||||
return $lang;
|
||||
|
Loading…
x
Reference in New Issue
Block a user