mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-18 04:20:50 +01:00
Ordinamento secondario righe documenti per id
Stile del codice
This commit is contained in:
parent
e1d85cce30
commit
2fbd4b7379
@ -15,7 +15,9 @@ abstract class Document extends Model implements ReferenceInterface
|
||||
{
|
||||
$results = $this->mergeCollections($this->descrizioni, $this->righe, $this->articoli, $this->sconti);
|
||||
|
||||
return $results->sortBy('order');
|
||||
return $results->sortBy(function ($item) {
|
||||
return [$item->order, $item->id];
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -76,8 +76,9 @@ class Fattura extends Document
|
||||
$model->data_registrazione = $data;
|
||||
$model->data_competenza = $data;
|
||||
$model->id_segment = $id_segment;
|
||||
if ($numero_esterno)
|
||||
if ($numero_esterno) {
|
||||
$model->numero_esterno = $numero_esterno;
|
||||
}
|
||||
|
||||
$model->idconto = $id_conto;
|
||||
|
||||
|
@ -83,13 +83,11 @@ foreach ($righe as $riga) {
|
||||
if (setting('Riferimento dei documenti nelle stampe') && $riga->hasOriginal()) {
|
||||
$ref = $riga->getOriginal()->parent->getReference();
|
||||
if (!empty($riga->getOriginal()->parent->numero_cliente)) {
|
||||
|
||||
$ref .= tr('<br>_DOC_ num. _NUM_ del _DATE_', [
|
||||
'_DOC_' => 'Rif. Vs. ordine cliente',
|
||||
'_NUM_' => $riga->getOriginal()->parent->numero_cliente,
|
||||
'_DATE_' => dateFormat($riga->getOriginal()->parent->data_cliente),
|
||||
]);
|
||||
|
||||
}
|
||||
if (!empty($ref)) {
|
||||
echo '
|
||||
|
Loading…
x
Reference in New Issue
Block a user