Exemplo n.º 1
0
 /**
  * Get ecriture compta total
  * @param EPnr $pnr
  * @return number
  */
 public function getPnrPayed(EPnr $pnr)
 {
     $cost = 0;
     foreach ($pnr->getEcritures() as $ecriture) {
         if ($ecriture->getCredit()) {
             $cost += $ecriture->getCredit();
         }
         if ($ecriture->getDebit()) {
             $cost -= $ecriture->getDebit();
         }
     }
     return $cost;
 }