/** * Display a listing of the resource. * * @return Response */ public function index() { // $deal = Deal::all(); View::share('selected_option', 'Ver Ofertas'); return View::make('deal.list')->with('deal', $deal); }
public function testEmptyLinesInFile() { $this->resetEvents(); $fileName = "with_empty_lines.csv"; $path = $this->copyFileToTemp($fileName); $s = $this->service(); $companyId = rand(1000, 1000000); $fileDetails = ["year" => 2015, "month" => 7]; $rpf = $s->process($path, $companyId, $fileDetails); $this->assertTrue($rpf->status == RoyaltyPaymentFile::STATUS_PAYMENTS_PROCESSED); $rpf = $s->processRoyaltyStreams($rpf); $this->assertTrue($rpf->status == RoyaltyPaymentFile::STATUS_PROCESSED); $payments = RoyaltyPayment::all(); $this->assertTrue(count($payments) == 4); $this->assertTrue($payments[0]->payee_code == 1128); $this->assertTrue($payments[1]->payee_code == 1111); $this->assertTrue($payments[2]->payee_code == 1545); $this->assertTrue($payments[3]->payee_code == 1332); $clients = Client::all(); $this->assertTrue(count($clients) == 4); $payeePayments = PayeePayment::all(); $this->assertTrue(count($payments) == 4); $deals = Deal::all(); $this->assertTrue(count($deals) == 4); $streams = RoyaltyStream::all(); $this->assertTrue(count($streams) == 4); $this->assertTrue($streams[0]->song_number == 33959); $this->assertTrue($streams[1]->song_number == 14402); $this->assertTrue($streams[2]->song_number == 12043); $this->assertTrue($streams[3]->song_number == 51311); $streamFiles = RoyaltyStreamFile::all(); $this->assertTrue(count($streamFiles) == 4); $this->resetEvents(); }