mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
fixes for deleted payments being displayed on invoices with variable
This commit is contained in:
parent
238d6668e8
commit
33c8c713b1
@ -109,7 +109,11 @@ class DeletePayment
|
||||
|
||||
if ($paymentable_invoice->balance == $paymentable_invoice->amount) {
|
||||
$paymentable_invoice->service()->setStatus(Invoice::STATUS_SENT)->save();
|
||||
} else {
|
||||
}
|
||||
elseif($paymentable_invoice->balance == 0){
|
||||
$paymentable_invoice->service()->setStatus(Invoice::STATUS_PAID)->save();
|
||||
}
|
||||
else {
|
||||
$paymentable_invoice->service()->setStatus(Invoice::STATUS_PARTIAL)->save();
|
||||
}
|
||||
} else {
|
||||
|
@ -670,16 +670,16 @@ class HtmlEngine
|
||||
$data['$payment.transaction_reference'] = ['value' => '', 'label' => ctrans('texts.transaction_reference')];
|
||||
|
||||
|
||||
if ($this->entity_string == 'invoice' && $this->entity->payments()->exists()) {
|
||||
if ($this->entity_string == 'invoice' && $this->entity->net_payments()->exists()) {
|
||||
$payment_list = '<br><br>';
|
||||
|
||||
foreach ($this->entity->payments as $payment) {
|
||||
foreach ($this->entity->net_payments as $payment) {
|
||||
$payment_list .= ctrans('texts.payment_subject') . ": " . $this->formatDate($payment->date, $this->client->date_format()) . " :: " . Number::formatMoney($payment->amount, $this->client) ." :: ". GatewayType::getAlias($payment->gateway_type_id) . "<br>";
|
||||
}
|
||||
|
||||
$data['$payments'] = ['value' => $payment_list, 'label' => ctrans('texts.payments')];
|
||||
|
||||
$payment = $this->entity->payments()->first();
|
||||
$payment = $this->entity->net_payments()->first();
|
||||
|
||||
$data['$payment.custom1'] = ['value' => $payment->custom_value1, 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'payment1')];
|
||||
$data['$payment.custom2'] = ['value' => $payment->custom_value2, 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'payment2')];
|
||||
|
Loading…
x
Reference in New Issue
Block a user