|
@@ -16,28 +16,22 @@ use Illuminate\Support\Facades\Log;
|
|
|
class Record extends Component
|
|
class Record extends Component
|
|
|
{
|
|
{
|
|
|
public $records, $dataId, $totals;
|
|
public $records, $dataId, $totals;
|
|
|
-
|
|
|
|
|
public $in;
|
|
public $in;
|
|
|
public $out;
|
|
public $out;
|
|
|
-
|
|
|
|
|
public $payments = [];
|
|
public $payments = [];
|
|
|
-
|
|
|
|
|
public $fromDate;
|
|
public $fromDate;
|
|
|
public $toDate;
|
|
public $toDate;
|
|
|
-
|
|
|
|
|
public $appliedFromDate;
|
|
public $appliedFromDate;
|
|
|
public $appliedToDate;
|
|
public $appliedToDate;
|
|
|
-
|
|
|
|
|
|
|
+ public $exportFromDate;
|
|
|
|
|
+ public $exportToDate;
|
|
|
|
|
+ public $isExporting = false;
|
|
|
public $selectedPeriod = 'OGGI';
|
|
public $selectedPeriod = 'OGGI';
|
|
|
-
|
|
|
|
|
public $filterCausals = null;
|
|
public $filterCausals = null;
|
|
|
public $filterMember = null;
|
|
public $filterMember = null;
|
|
|
-
|
|
|
|
|
public $isFiltering = false;
|
|
public $isFiltering = false;
|
|
|
-
|
|
|
|
|
public array $recordDatas = [];
|
|
public array $recordDatas = [];
|
|
|
public array $labels = [];
|
|
public array $labels = [];
|
|
|
-
|
|
|
|
|
public array $causals = [];
|
|
public array $causals = [];
|
|
|
public $members = array();
|
|
public $members = array();
|
|
|
|
|
|
|
@@ -54,6 +48,9 @@ class Record extends Component
|
|
|
$this->appliedFromDate = date("Y-m-d");
|
|
$this->appliedFromDate = date("Y-m-d");
|
|
|
$this->appliedToDate = date("Y-m-d");
|
|
$this->appliedToDate = date("Y-m-d");
|
|
|
|
|
|
|
|
|
|
+ $this->exportFromDate = date("Y-m-d");
|
|
|
|
|
+ $this->exportToDate = date("Y-m-d");
|
|
|
|
|
+
|
|
|
$this->getCausals(\App\Models\Causal::select('id', 'name')->where('parent_id', null)->get(), 0);
|
|
$this->getCausals(\App\Models\Causal::select('id', 'name')->where('parent_id', null)->get(), 0);
|
|
|
|
|
|
|
|
$this->members = \App\Models\Member::select(['id', 'first_name', 'last_name', 'fiscal_code'])->orderBy('last_name')->orderBy('first_name')->get();
|
|
$this->members = \App\Models\Member::select(['id', 'first_name', 'last_name', 'fiscal_code'])->orderBy('last_name')->orderBy('first_name')->get();
|
|
@@ -61,6 +58,214 @@ class Record extends Component
|
|
|
$this->payments = \App\Models\PaymentMethod::select('id', 'name', 'type')->where('enabled', true)->where('money', false)->get();
|
|
$this->payments = \App\Models\PaymentMethod::select('id', 'name', 'type')->where('enabled', true)->where('money', false)->get();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private function generateExportData($fromDate, $toDate)
|
|
|
|
|
+ {
|
|
|
|
|
+ $exportRecords = array();
|
|
|
|
|
+ $exportTotals = array();
|
|
|
|
|
+
|
|
|
|
|
+ $exclude_from_records = \App\Models\Member::where('exclude_from_records', true)->pluck('id')->toArray();
|
|
|
|
|
+
|
|
|
|
|
+ $datas = \App\Models\Record::with('member', 'supplier', 'payment_method')
|
|
|
|
|
+ ->select('records.*', 'records_rows.*')
|
|
|
|
|
+ ->join('records_rows', 'records.id', '=', 'records_rows.record_id')
|
|
|
|
|
+ ->whereBetween('date', [$fromDate, $toDate])
|
|
|
|
|
+ ->where(function ($query) {
|
|
|
|
|
+ $query->where('type', 'OUT')
|
|
|
|
|
+ ->orWhere(function ($query) {
|
|
|
|
|
+ $query->where('records.corrispettivo_fiscale', true)
|
|
|
|
|
+ ->orWhere('records.commercial', false);
|
|
|
|
|
+ });
|
|
|
|
|
+ })
|
|
|
|
|
+ ->where(function ($query) use ($exclude_from_records) {
|
|
|
|
|
+ $query->where('type', 'OUT')
|
|
|
|
|
+ ->orWhere(function ($subquery) use ($exclude_from_records) {
|
|
|
|
|
+ $subquery->whereNotIn('member_id', $exclude_from_records);
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ if ($this->filterCausals != null && sizeof($this->filterCausals) > 0) {
|
|
|
|
|
+ $causals = array();
|
|
|
|
|
+ foreach ($this->filterCausals as $z) {
|
|
|
|
|
+ $causals[] = $z;
|
|
|
|
|
+ $childs = \App\Models\Causal::where('parent_id', $z)->get();
|
|
|
|
|
+ foreach ($childs as $c) {
|
|
|
|
|
+ $causals[] = $c->id;
|
|
|
|
|
+ $childsX = \App\Models\Causal::where('parent_id', $c->id)->get();
|
|
|
|
|
+ foreach ($childsX as $cX) {
|
|
|
|
|
+ $causals[] = $cX->id;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ $datas->whereIn('causal_id', $causals);
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($this->filterMember != null && $this->filterMember > 0) {
|
|
|
|
|
+ $datas->where('member_id', $this->filterMember);
|
|
|
|
|
+ }
|
|
|
|
|
+ $datas = $datas->orderBy('date', 'ASC')
|
|
|
|
|
+ ->orderBy('records.created_at', 'ASC')
|
|
|
|
|
+ ->orderBy('records_rows.id', 'ASC')
|
|
|
|
|
+ ->get();
|
|
|
|
|
+
|
|
|
|
|
+ $groupedData = [];
|
|
|
|
|
+ $causalsCount = [];
|
|
|
|
|
+
|
|
|
|
|
+ foreach ($datas as $idx => $data) {
|
|
|
|
|
+ $causalCheck = \App\Models\Causal::findOrFail($data->causal_id);
|
|
|
|
|
+ $paymentCheck = $data->payment_method->money;
|
|
|
|
|
+
|
|
|
|
|
+ if (!$paymentCheck && ($causalCheck->no_first == null || !$causalCheck->no_first)) {
|
|
|
|
|
+ if (!$data->deleted) {
|
|
|
|
|
+ $amount = $data->amount;
|
|
|
|
|
+ $amount += getVatValue($amount, $data->vat_id);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $amount = $data->amount;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $typeLabel = $data->commercial ? 'Commerciale' : 'Non Commerciale';
|
|
|
|
|
+
|
|
|
|
|
+ $nominativo = '';
|
|
|
|
|
+ if ($data->type == "IN") {
|
|
|
|
|
+ if ($data->member) {
|
|
|
|
|
+ $nominativo = $data->member->last_name . " " . $data->member->first_name;
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if ($data->supplier) {
|
|
|
|
|
+ $nominativo = $data->supplier->name;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $groupKey = $data->date . '|' . $typeLabel . '|' . $data->payment_method->name . '|' . $data->type . '|' . $nominativo;
|
|
|
|
|
+
|
|
|
|
|
+ if (!isset($groupedData[$groupKey])) {
|
|
|
|
|
+ $groupedData[$groupKey] = [
|
|
|
|
|
+ 'date' => $data->date,
|
|
|
|
|
+ 'type_label' => $typeLabel,
|
|
|
|
|
+ 'payment_method' => $data->payment_method->name,
|
|
|
|
|
+ 'transaction_type' => $data->type,
|
|
|
|
|
+ 'nominativo' => $nominativo,
|
|
|
|
|
+ 'amount' => 0,
|
|
|
|
|
+ 'deleted' => false,
|
|
|
|
|
+ 'causals' => [],
|
|
|
|
|
+ 'notes' => []
|
|
|
|
|
+ ];
|
|
|
|
|
+ $causalsCount[$groupKey] = [];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $groupedData[$groupKey]['amount'] += $amount;
|
|
|
|
|
+ $causalsCount[$groupKey][$causalCheck->getTree()] = true;
|
|
|
|
|
+
|
|
|
|
|
+ if (!empty($data->note)) {
|
|
|
|
|
+ $groupedData[$groupKey]['notes'][] = $data->note;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if ($data->deleted) {
|
|
|
|
|
+ $groupedData[$groupKey]['deleted'] = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ foreach ($groupedData as $groupKey => $group) {
|
|
|
|
|
+ $causalsInGroup = array_keys($causalsCount[$groupKey]);
|
|
|
|
|
+
|
|
|
|
|
+ $causalDisplay = $group['type_label'];
|
|
|
|
|
+
|
|
|
|
|
+ if (count($causalsInGroup) > 1) {
|
|
|
|
|
+ $detailDisplay = 'Varie|' . implode('|', $causalsInGroup);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $detailDisplay = $causalsInGroup[0];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $recordKey = $group['date'] . "§" . $causalDisplay . "§" . $group['nominativo'] . "§" . $detailDisplay . "§" . ($group['deleted'] ? 'DELETED' : '') . "§";
|
|
|
|
|
+
|
|
|
|
|
+ if (!isset($exportRecords[$recordKey][$group['payment_method']][$group['transaction_type']])) {
|
|
|
|
|
+ $exportRecords[$recordKey][$group['payment_method']][$group['transaction_type']] = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $exportRecords[$recordKey][$group['payment_method']][$group['transaction_type']] += $group['amount'];
|
|
|
|
|
+
|
|
|
|
|
+ if (!isset($exportTotals[$group['payment_method']])) {
|
|
|
|
|
+ $exportTotals[$group['payment_method']]["IN"] = 0;
|
|
|
|
|
+ $exportTotals[$group['payment_method']]["OUT"] = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (!$group['deleted'])
|
|
|
|
|
+ $exportTotals[$group['payment_method']][$group['transaction_type']] += $group['amount'];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return $exportRecords;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private function generateExportTotals($fromDate, $toDate)
|
|
|
|
|
+ {
|
|
|
|
|
+ $exportTotals = array();
|
|
|
|
|
+
|
|
|
|
|
+ $exclude_from_records = \App\Models\Member::where('exclude_from_records', true)->pluck('id')->toArray();
|
|
|
|
|
+
|
|
|
|
|
+ $datas = \App\Models\Record::with('member', 'supplier', 'payment_method')
|
|
|
|
|
+ ->select('records.*', 'records_rows.*')
|
|
|
|
|
+ ->join('records_rows', 'records.id', '=', 'records_rows.record_id')
|
|
|
|
|
+ ->whereBetween('date', [$fromDate, $toDate])
|
|
|
|
|
+ ->where(function ($query) {
|
|
|
|
|
+ $query->where('type', 'OUT')
|
|
|
|
|
+ ->orWhere(function ($query) {
|
|
|
|
|
+ $query->where('records.corrispettivo_fiscale', true)
|
|
|
|
|
+ ->orWhere('records.commercial', false);
|
|
|
|
|
+ });
|
|
|
|
|
+ })
|
|
|
|
|
+ ->where(function ($query) use ($exclude_from_records) {
|
|
|
|
|
+ $query->where('type', 'OUT')
|
|
|
|
|
+ ->orWhere(function ($subquery) use ($exclude_from_records) {
|
|
|
|
|
+ $subquery->whereNotIn('member_id', $exclude_from_records);
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ if ($this->filterCausals != null && sizeof($this->filterCausals) > 0) {
|
|
|
|
|
+ $causals = array();
|
|
|
|
|
+ foreach ($this->filterCausals as $z) {
|
|
|
|
|
+ $causals[] = $z;
|
|
|
|
|
+ $childs = \App\Models\Causal::where('parent_id', $z)->get();
|
|
|
|
|
+ foreach ($childs as $c) {
|
|
|
|
|
+ $causals[] = $c->id;
|
|
|
|
|
+ $childsX = \App\Models\Causal::where('parent_id', $c->id)->get();
|
|
|
|
|
+ foreach ($childsX as $cX) {
|
|
|
|
|
+ $causals[] = $cX->id;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ $datas->whereIn('causal_id', $causals);
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($this->filterMember != null && $this->filterMember > 0) {
|
|
|
|
|
+ $datas->where('member_id', $this->filterMember);
|
|
|
|
|
+ }
|
|
|
|
|
+ $datas = $datas->orderBy('date', 'ASC')
|
|
|
|
|
+ ->orderBy('records.created_at', 'ASC')
|
|
|
|
|
+ ->orderBy('records_rows.id', 'ASC')
|
|
|
|
|
+ ->get();
|
|
|
|
|
+
|
|
|
|
|
+ foreach ($datas as $data) {
|
|
|
|
|
+ $causalCheck = \App\Models\Causal::findOrFail($data->causal_id);
|
|
|
|
|
+ $paymentCheck = $data->payment_method->money;
|
|
|
|
|
+
|
|
|
|
|
+ if (!$paymentCheck && ($causalCheck->no_first == null || !$causalCheck->no_first)) {
|
|
|
|
|
+ if (!$data->deleted) {
|
|
|
|
|
+ $amount = $data->amount;
|
|
|
|
|
+ $amount += getVatValue($amount, $data->vat_id);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $amount = $data->amount;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (!isset($exportTotals[$data->payment_method->name])) {
|
|
|
|
|
+ $exportTotals[$data->payment_method->name]["IN"] = 0;
|
|
|
|
|
+ $exportTotals[$data->payment_method->name]["OUT"] = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (!$data->deleted)
|
|
|
|
|
+ $exportTotals[$data->payment_method->name][$data->type] += $amount;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return $exportTotals;
|
|
|
|
|
+ }
|
|
|
public function resetFilters()
|
|
public function resetFilters()
|
|
|
{
|
|
{
|
|
|
$this->selectedPeriod = 'OGGI';
|
|
$this->selectedPeriod = 'OGGI';
|
|
@@ -256,10 +461,8 @@ class Record extends Component
|
|
|
$amount = $data->amount;
|
|
$amount = $data->amount;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // Determine the type (commercial or non-commercial)
|
|
|
|
|
$typeLabel = $data->commercial ? 'Commerciale' : 'Non Commerciale';
|
|
$typeLabel = $data->commercial ? 'Commerciale' : 'Non Commerciale';
|
|
|
|
|
|
|
|
- // Get nominativo
|
|
|
|
|
$nominativo = '';
|
|
$nominativo = '';
|
|
|
if ($data->type == "IN") {
|
|
if ($data->type == "IN") {
|
|
|
if ($data->member) {
|
|
if ($data->member) {
|
|
@@ -271,10 +474,8 @@ class Record extends Component
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // Create grouping key: date + type + payment_method + IN/OUT + nominativo
|
|
|
|
|
$groupKey = $data->date . '|' . $typeLabel . '|' . $data->payment_method->name . '|' . $data->type . '|' . $nominativo;
|
|
$groupKey = $data->date . '|' . $typeLabel . '|' . $data->payment_method->name . '|' . $data->type . '|' . $nominativo;
|
|
|
|
|
|
|
|
- // Initialize group if not exists
|
|
|
|
|
if (!isset($groupedData[$groupKey])) {
|
|
if (!isset($groupedData[$groupKey])) {
|
|
|
$groupedData[$groupKey] = [
|
|
$groupedData[$groupKey] = [
|
|
|
'date' => $data->date,
|
|
'date' => $data->date,
|
|
@@ -292,13 +493,10 @@ class Record extends Component
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
$groupedData[$groupKey]['amount'] += $amount;
|
|
$groupedData[$groupKey]['amount'] += $amount;
|
|
|
-
|
|
|
|
|
$causalsCount[$groupKey][$causalCheck->getTree()] = true;
|
|
$causalsCount[$groupKey][$causalCheck->getTree()] = true;
|
|
|
-
|
|
|
|
|
if (!empty($data->note)) {
|
|
if (!empty($data->note)) {
|
|
|
$groupedData[$groupKey]['notes'][] = $data->note;
|
|
$groupedData[$groupKey]['notes'][] = $data->note;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
if ($data->deleted) {
|
|
if ($data->deleted) {
|
|
|
$groupedData[$groupKey]['deleted'] = true;
|
|
$groupedData[$groupKey]['deleted'] = true;
|
|
|
}
|
|
}
|
|
@@ -387,7 +585,36 @@ class Record extends Component
|
|
|
return $data;
|
|
return $data;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public function export()
|
|
|
|
|
|
|
+ public function openExportModal()
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->exportFromDate = $this->appliedFromDate;
|
|
|
|
|
+ $this->exportToDate = $this->appliedToDate;
|
|
|
|
|
+
|
|
|
|
|
+ $this->emit('show-export-modal');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function exportWithDateRange()
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->isExporting = true;
|
|
|
|
|
+
|
|
|
|
|
+ $exportRecords = $this->generateExportData($this->exportFromDate, $this->exportToDate);
|
|
|
|
|
+ $exportTotals = $this->generateExportTotals($this->exportFromDate, $this->exportToDate);
|
|
|
|
|
+
|
|
|
|
|
+ $result = $this->exportWithData($exportRecords, $exportTotals);
|
|
|
|
|
+
|
|
|
|
|
+ $this->isExporting = false;
|
|
|
|
|
+
|
|
|
|
|
+ $this->emit('hide-export-modal');
|
|
|
|
|
+ }
|
|
|
|
|
+ function export()
|
|
|
|
|
+ {
|
|
|
|
|
+ $exportRecords = $this->generateExportData($this->appliedFromDate, $this->appliedToDate);
|
|
|
|
|
+ $exportTotals = $this->generateExportTotals($this->appliedFromDate, $this->appliedToDate);
|
|
|
|
|
+
|
|
|
|
|
+ return $this->exportWithData($exportRecords, $exportTotals);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private function exportWithData($exportRecords, $exportTotals)
|
|
|
{
|
|
{
|
|
|
ini_set('memory_limit', '512M');
|
|
ini_set('memory_limit', '512M');
|
|
|
gc_enable();
|
|
gc_enable();
|
|
@@ -398,8 +625,8 @@ class Record extends Component
|
|
|
$activeWorksheet = $spreadsheet->getActiveSheet();
|
|
$activeWorksheet = $spreadsheet->getActiveSheet();
|
|
|
|
|
|
|
|
$activeWorksheet->setCellValue('A1', "Data");
|
|
$activeWorksheet->setCellValue('A1', "Data");
|
|
|
- $activeWorksheet->setCellValue('B1', "Tipo");
|
|
|
|
|
- $activeWorksheet->setCellValue('C1', "Causale");
|
|
|
|
|
|
|
+ $activeWorksheet->setCellValue('B1', "Causale");
|
|
|
|
|
+ $activeWorksheet->setCellValue('C1', "Dettaglio");
|
|
|
$activeWorksheet->setCellValue('D1', "Nominativo");
|
|
$activeWorksheet->setCellValue('D1', "Nominativo");
|
|
|
$activeWorksheet->setCellValue('E1', "Stato");
|
|
$activeWorksheet->setCellValue('E1', "Stato");
|
|
|
|
|
|
|
@@ -459,13 +686,12 @@ class Record extends Component
|
|
|
$batchSize = 1000;
|
|
$batchSize = 1000;
|
|
|
$recordsProcessed = 0;
|
|
$recordsProcessed = 0;
|
|
|
|
|
|
|
|
- $totalRecords = count($this->records);
|
|
|
|
|
- $recordsArray = array_chunk($this->records, $batchSize, true);
|
|
|
|
|
|
|
+ $totalRecords = count($exportRecords);
|
|
|
|
|
+ $recordsArray = array_chunk($exportRecords, $batchSize, true);
|
|
|
|
|
|
|
|
foreach ($recordsArray as $recordsBatch) {
|
|
foreach ($recordsArray as $recordsBatch) {
|
|
|
foreach ($recordsBatch as $causal => $record) {
|
|
foreach ($recordsBatch as $causal => $record) {
|
|
|
$check = $causal;
|
|
$check = $causal;
|
|
|
-
|
|
|
|
|
$parts = explode("§", $check);
|
|
$parts = explode("§", $check);
|
|
|
$d = $parts[0] ?? '';
|
|
$d = $parts[0] ?? '';
|
|
|
$c = $parts[1] ?? '';
|
|
$c = $parts[1] ?? '';
|
|
@@ -536,21 +762,21 @@ class Record extends Component
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (isset($this->totals[$p->name])) {
|
|
|
|
|
|
|
+ if (isset($exportTotals[$p->name])) {
|
|
|
if ($p->type == 'ALL') {
|
|
if ($p->type == 'ALL') {
|
|
|
- $activeWorksheet->setCellValue($letters[$idx] . $count, formatPrice($this->totals[$p->name]["IN"] ?? 0));
|
|
|
|
|
|
|
+ $activeWorksheet->setCellValue($letters[$idx] . $count, formatPrice($exportTotals[$p->name]["IN"] ?? 0));
|
|
|
$idx++;
|
|
$idx++;
|
|
|
- $activeWorksheet->setCellValue($letters[$idx] . $count, formatPrice($this->totals[$p->name]["OUT"] ?? 0));
|
|
|
|
|
|
|
+ $activeWorksheet->setCellValue($letters[$idx] . $count, formatPrice($exportTotals[$p->name]["OUT"] ?? 0));
|
|
|
$idx++;
|
|
$idx++;
|
|
|
} elseif ($p->type == 'IN') {
|
|
} elseif ($p->type == 'IN') {
|
|
|
- $activeWorksheet->setCellValue($letters[$idx] . $count, formatPrice($this->totals[$p->name]["IN"] ?? 0));
|
|
|
|
|
|
|
+ $activeWorksheet->setCellValue($letters[$idx] . $count, formatPrice($exportTotals[$p->name]["IN"] ?? 0));
|
|
|
$idx++;
|
|
$idx++;
|
|
|
$activeWorksheet->setCellValue($letters[$idx] . $count, "");
|
|
$activeWorksheet->setCellValue($letters[$idx] . $count, "");
|
|
|
$idx++;
|
|
$idx++;
|
|
|
} elseif ($p->type == 'OUT') {
|
|
} elseif ($p->type == 'OUT') {
|
|
|
$activeWorksheet->setCellValue($letters[$idx] . $count, "");
|
|
$activeWorksheet->setCellValue($letters[$idx] . $count, "");
|
|
|
$idx++;
|
|
$idx++;
|
|
|
- $activeWorksheet->setCellValue($letters[$idx] . $count, formatPrice($this->totals[$p->name]["OUT"] ?? 0));
|
|
|
|
|
|
|
+ $activeWorksheet->setCellValue($letters[$idx] . $count, formatPrice($exportTotals[$p->name]["OUT"] ?? 0));
|
|
|
$idx++;
|
|
$idx++;
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|