Skip to content

Commit

Permalink
Multiple Property Bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
pHAlkaline committed Jan 22, 2024
1 parent 4270dd6 commit a528a0c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 6 additions & 3 deletions app/Controller/FractionsController.php
Expand Up @@ -93,14 +93,17 @@ public function view($id = null) {
$this->Flash->error(__('Invalid fraction'));
$this->redirect(array('action' => 'index', '?' => $this->request->query));
}
$this->Fraction->contain('Manager', 'Comment', 'FractionType');
$this->Fraction->contain('Manager', 'Comment', 'FractionType', 'Entity');
$options = array('conditions' => array('Fraction.id' => $id));
$fraction = $this->Fraction->find('first', $options);
$totalDebit = $this->Fraction->Note->sumDebitNotes(null, $id);
$totalCredit = $this->Fraction->Note->sumCreditNotes(null, $id);
//$notificationEntities = ClassRegistry::init('Entity')->find('list', array('fields' => array('Entity.email', 'Entity.email'), 'conditions' => array('id' => $fraction['Manager']['id'])));
$notificationEntities = $this->Session->read('NotificationEntities')?$this->Session->consume('NotificationEntities'):ClassRegistry::init('Entity')->find('list', array('fields' => array('Entity.email', 'Entity.email'), 'conditions' => array('id' => $fraction['Manager']['id'])));

$entitiesInFraction = Set::extract('/Entity/id', $fraction);
if ($fraction['Fraction']['manager_id']){
$entitiesInFraction=[$fraction['Fraction']['manager_id']];
}
$notificationEntities = $this->Session->read('NotificationEntities')?$this->Session->consume('NotificationEntities'):ClassRegistry::init('Entity')->find('list', array('fields' => array('Entity.email', 'Entity.email'), 'conditions' => array('id' => $entitiesInFraction)));
$emailNotifications = Configure::read('EmailNotifications');
$this->set(compact('fraction', 'totalDebit', 'totalCredit', 'notificationEntities','emailNotifications'));
$this->setPhkRequestVar('fraction_id', $id);
Expand Down
1 change: 0 additions & 1 deletion app/Locale/ita/LC_MESSAGES/default.po
Expand Up @@ -2794,7 +2794,6 @@ msgstr "Calcolare"
msgid "Warning: when a payment advice is generated, ALL PAYMENT ADVICES previously created will be removed, EXCEPT those that have already been paid."
msgstr "Attenzione: quando viene generato un avviso di pagamento, TUTTI GLI AVVISI DI PAGAMENTO precedentemente creati verranno rimossi, TRANNE quelli già pagati."


msgid "Payment Advice"
msgid_plural "Payment Advices"
msgstr[0] "Avviso di pagamento"
Expand Down

0 comments on commit a528a0c

Please sign in to comment.