Пример #1
0
 /**
  * 
  * @author Erick Guevara Martínez
  * @param ProgrammedPayment $programmedPayment
  * @return \Application\Model\Collection\ActualPaymentCollection
  */
 public function filterByProgrammedPayment(ProgrammedPayment $programmedPayment)
 {
     return $this->filter(function (ActualPayment $actualPayment) use($programmedPayment) {
         return $actualPayment->getIdProgrammedPayment() == $programmedPayment->getIdProgrammedPayment();
     });
 }
 /**
  * 
  * @author Erick Guevara Martínez
  * @param ProgrammedPayment $programmedPayment
  * @return \Application\Model\Collection\ProformaInvoiceProgrammedPaymentCollection
  */
 public function filterByProgrammedPayment(ProgrammedPayment $programmedPayment)
 {
     return $this->filter(function (ProformaInvoiceProgrammedPayment $proformaInvoiceProgrammedPayment) use($programmedPayment) {
         return $proformaInvoiceProgrammedPayment->getIdProgrammedPayment() == $programmedPayment->getIdProgrammedPayment();
     });
 }
 /**
  *
  * @param ProgrammedPayment $programmedPayment
  * @return float
  */
 private function getPaymentBalance(ProgrammedPayment $programmedPayment)
 {
     $actualPayments = ActualPaymentQuery::create()->whereAdd(ActualPayment::ID_PROGRAMMED_PAYMENT, $programmedPayment->getIdProgrammedPayment())->find();
     $balance = 0;
     while ($actualPayments->valid()) {
         $balance += $actualPayments->read()->getAmmount();
     }
     return $balance;
 }
 /**
  * 
  * 
  * @author Erick Guevara Martínez
  * @param ProgrammedPayment $programmedPayment
  * @return PurchaseOrderProgrammedPaymentCollection
  */
 public function filterByProgrammedPayment(ProgrammedPayment $programmedPayment)
 {
     return $this->filter(function (PurchaseOrderProgrammedPayment $purchaseOrderPayment) use($programmedPayment) {
         return $purchaseOrderPayment->getIdProgrammedPayment() == $programmedPayment->getIdProgrammedPayment();
     });
 }
 /**
  * 
  * 
  * @author Erick Guevara Martínez
  * @param ProgrammedPayment $programmedPayment
  * @return \Application\Model\Collection\FolioImportProgrammedPaymentCollection
  */
 public function filterByProgrammedPayment(ProgrammedPayment $programmedPayment)
 {
     return $this->filter(function (FolioImportProgrammedPayment $folioImportProgrammedPayment) use($programmedPayment) {
         return $folioImportProgrammedPayment->getIdProgrammedPayment() == $programmedPayment->getIdProgrammedPayment();
     });
 }