mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
fixes for invitations
This commit is contained in:
parent
ce3696257f
commit
e67c7995d9
@ -85,18 +85,18 @@ class ValidCreditsRules implements Rule
|
||||
|
||||
if(count($this->input['credits']) >=1){
|
||||
|
||||
$total_payments = $this->input['amount'] + array_sum(array_column($this->input['credits'], 'amount'));
|
||||
// $total_payments = $this->input['amount'] + array_sum(array_column($this->input['credits'], 'amount'));
|
||||
|
||||
info(print_r($this->input,1));
|
||||
info("total payments = {$total_payments}");
|
||||
info("total credits available = " . array_sum(array_column($this->input['credits'], 'amount')));
|
||||
info("total invoices payable = " . array_sum(array_column($this->input['invoices'], 'amount')));
|
||||
// info(print_r($this->input,1));
|
||||
// info("total payments = {$total_payments}");
|
||||
// info("total credits available = " . array_sum(array_column($this->input['credits'], 'amount')));
|
||||
// info("total invoices payable = " . array_sum(array_column($this->input['invoices'], 'amount')));
|
||||
|
||||
if($total_payments > array_sum(array_column($this->input['invoices'], 'amount'))){
|
||||
// if($total_payments > array_sum(array_column($this->input['invoices'], 'amount'))){
|
||||
|
||||
$this->error_msg = "Sum of total payments and credits is greater than the total of invoices";
|
||||
return false;
|
||||
}
|
||||
// $this->error_msg = "Sum of total payments and credits is greater than the total of invoices";
|
||||
// return false;
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@ use App\Utils\Ninja;
|
||||
use App\Utils\Traits\Inviteable;
|
||||
use App\Utils\Traits\MakesDates;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
@ -25,7 +26,8 @@ class QuoteInvitation extends BaseModel
|
||||
{
|
||||
use MakesDates;
|
||||
use Inviteable;
|
||||
|
||||
use SoftDeletes;
|
||||
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'client_contact_id',
|
||||
|
@ -55,8 +55,6 @@ class InvitationTest extends TestCase
|
||||
|
||||
//test pushing a contact invitation back on
|
||||
|
||||
|
||||
|
||||
$contact = $this->invoice->client->contacts->where('is_primary', false)->first();
|
||||
|
||||
$new_invite = InvoiceInvitationFactory::create($this->invoice->company_id, $this->invoice->user_id);
|
||||
@ -79,6 +77,5 @@ class InvitationTest extends TestCase
|
||||
|
||||
$this->assertEquals(2, count($arr['data']['invitations']));
|
||||
|
||||
//Now test that adding a contact back on works!!
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user