Advertisement
Guest User

Untitled

a guest
Dec 13th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.88 KB | None | 0 0
  1. <?php
  2. namespace App\Command;
  3.  
  4. use Cake\Console\Arguments;
  5. use Cake\Console\Command;
  6. use Cake\Console\ConsoleIo;
  7. use Cake\Console\ConsoleOptionParser;
  8.  
  9.  
  10. class CreditnoteCommand extends Command
  11. {
  12.  
  13.     public function initialize()
  14.     {
  15.         parent::initialize();
  16.         $this->loadModel('CreditNotes');
  17.     }
  18.    
  19.     public function execute(Arguments $args, ConsoleIo $io)
  20.     {
  21.      
  22.  
  23.         $creditnotes = $this
  24.                         ->CreditNotes
  25.                             ->find()
  26.                             ->select(['id','pacient_id','tax_entity_id','invoice_id','Invoices.invoice_number','date_transaction'])
  27.                             ->contain(['Invoices']);
  28.  
  29.             //PARA IMPRIMIR POR CONSOLA
  30.             foreach ( $creditnotes as $creditnote){
  31.            
  32.                 $io->out(print_r($creditnote, true));
  33.             }
  34.        
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement