Created
January 4, 2021 18:03
-
-
Save jongravois/9e3e0d9c27ee60f5c6fb3763a5e729e7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace App\Pipes\Invoices; | |
use App\Models\PostedInvoice; | |
use Closure; | |
class NoConsignmentAbort | |
{ | |
public function handle(PostedInvoice $invoice, Closure $next) | |
{ | |
if(!$invoice->consignment_code) { | |
//TODO NOTIFY | |
$invoice->update([ | |
'gp_percent_used' => 0, | |
'profit' => 0, | |
'split_bands' => false, | |
'processed' => true | |
]); | |
} // end if | |
return $next($invoice); | |
} // end function | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment