mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 05:14:30 -04:00
commit
df24b7ce93
@ -1 +1 @@
|
|||||||
5.1.1
|
5.1.2
|
@ -315,7 +315,7 @@ class CheckData extends Command
|
|||||||
$total_invoice_payments += $credit_total_applied;
|
$total_invoice_payments += $credit_total_applied;
|
||||||
} //todo this is contentious
|
} //todo this is contentious
|
||||||
|
|
||||||
nlog("total invoice payments = {$total_invoice_payments} with client paid to date of of {$client->paid_to_date}");
|
// nlog("total invoice payments = {$total_invoice_payments} with client paid to date of of {$client->paid_to_date}");
|
||||||
|
|
||||||
if (round($total_invoice_payments, 2) != round($client->paid_to_date, 2)) {
|
if (round($total_invoice_payments, 2) != round($client->paid_to_date, 2)) {
|
||||||
$wrong_paid_to_dates++;
|
$wrong_paid_to_dates++;
|
||||||
|
@ -339,7 +339,7 @@ class DemoMode extends Command
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
$vendor->id_number = $this->getNextVendorNumber($vendor);
|
$vendor->number = $this->getNextVendorNumber($vendor);
|
||||||
$vendor->save();
|
$vendor->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -238,7 +238,7 @@ class InvoiceItemSum
|
|||||||
|
|
||||||
$item_tax += $item_tax_rate1_total;
|
$item_tax += $item_tax_rate1_total;
|
||||||
|
|
||||||
if ($item_tax_rate1_total > 0) {
|
if ($item_tax_rate1_total != 0) {
|
||||||
$this->groupTax($this->item->tax_name1, $this->item->tax_rate1, $item_tax_rate1_total);
|
$this->groupTax($this->item->tax_name1, $this->item->tax_rate1, $item_tax_rate1_total);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -246,7 +246,7 @@ class InvoiceItemSum
|
|||||||
|
|
||||||
$item_tax += $item_tax_rate2_total;
|
$item_tax += $item_tax_rate2_total;
|
||||||
|
|
||||||
if ($item_tax_rate2_total > 0) {
|
if ($item_tax_rate2_total != 0) {
|
||||||
$this->groupTax($this->item->tax_name2, $this->item->tax_rate2, $item_tax_rate2_total);
|
$this->groupTax($this->item->tax_name2, $this->item->tax_rate2, $item_tax_rate2_total);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -254,7 +254,7 @@ class InvoiceItemSum
|
|||||||
|
|
||||||
$item_tax += $item_tax_rate3_total;
|
$item_tax += $item_tax_rate3_total;
|
||||||
|
|
||||||
if ($item_tax_rate3_total > 0) {
|
if ($item_tax_rate3_total != 0) {
|
||||||
$this->groupTax($this->item->tax_name3, $this->item->tax_rate3, $item_tax_rate3_total);
|
$this->groupTax($this->item->tax_name3, $this->item->tax_rate3, $item_tax_rate3_total);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -233,7 +233,7 @@ class InvoiceItemSumInclusive
|
|||||||
|
|
||||||
$item_tax += $item_tax_rate1_total;
|
$item_tax += $item_tax_rate1_total;
|
||||||
|
|
||||||
if ($item_tax_rate1_total > 0) {
|
if ($item_tax_rate1_total != 0) {
|
||||||
$this->groupTax($this->item->tax_name1, $this->item->tax_rate1, $item_tax_rate1_total);
|
$this->groupTax($this->item->tax_name1, $this->item->tax_rate1, $item_tax_rate1_total);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -241,7 +241,7 @@ class InvoiceItemSumInclusive
|
|||||||
|
|
||||||
$item_tax += $item_tax_rate2_total;
|
$item_tax += $item_tax_rate2_total;
|
||||||
|
|
||||||
if ($item_tax_rate2_total > 0) {
|
if ($item_tax_rate2_total != 0) {
|
||||||
$this->groupTax($this->item->tax_name2, $this->item->tax_rate2, $item_tax_rate2_total);
|
$this->groupTax($this->item->tax_name2, $this->item->tax_rate2, $item_tax_rate2_total);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -249,7 +249,7 @@ class InvoiceItemSumInclusive
|
|||||||
|
|
||||||
$item_tax += $item_tax_rate3_total;
|
$item_tax += $item_tax_rate3_total;
|
||||||
|
|
||||||
if ($item_tax_rate3_total > 0) {
|
if ($item_tax_rate3_total != 0) {
|
||||||
$this->groupTax($this->item->tax_name3, $this->item->tax_rate3, $item_tax_rate3_total);
|
$this->groupTax($this->item->tax_name3, $this->item->tax_rate3, $item_tax_rate3_total);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -932,6 +932,11 @@ class Import implements ShouldQueue
|
|||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if(in_array($payment->status_id, [Payment::STATUS_REFUNDED, Payment::STATUS_PARTIALLY_REFUNDED])) {
|
||||||
|
$this->processPaymentRefund($payment);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Payment::reguard();
|
Payment::reguard();
|
||||||
@ -941,6 +946,24 @@ class Import implements ShouldQueue
|
|||||||
$payment_repository = null;
|
$payment_repository = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function processPaymentRefund($payment)
|
||||||
|
{
|
||||||
|
$invoices = $payment->invoices()->get();
|
||||||
|
|
||||||
|
$invoices->each(function ($invoice) use($payment) {
|
||||||
|
|
||||||
|
if ($payment->refunded > 0 && in_array($invoice->status_id, [Invoice::STATUS_SENT])) {
|
||||||
|
|
||||||
|
$invoice->service()
|
||||||
|
->updateBalance($payment->refunded)
|
||||||
|
->updatePaidToDate($payment->refunded*-1)
|
||||||
|
->updateStatus()
|
||||||
|
->save();
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private function updatePaymentForStatus($payment, $status_id) :Payment
|
private function updatePaymentForStatus($payment, $status_id) :Payment
|
||||||
{
|
{
|
||||||
// define('PAYMENT_STATUS_PENDING', 1);
|
// define('PAYMENT_STATUS_PENDING', 1);
|
||||||
|
@ -92,6 +92,7 @@ class PaymentMigrationRepository extends BaseRepository
|
|||||||
}
|
}
|
||||||
|
|
||||||
$payment->status_id = $data['status_id'];
|
$payment->status_id = $data['status_id'];
|
||||||
|
$payment->refunded = $data['refunded'];
|
||||||
|
|
||||||
if($payment->status_id == Payment::STATUS_CANCELLED)
|
if($payment->status_id == Payment::STATUS_CANCELLED)
|
||||||
$payment->is_deleted = true;
|
$payment->is_deleted = true;
|
||||||
|
@ -16,9 +16,9 @@ use App\Services\AbstractService;
|
|||||||
|
|
||||||
class UpdateBalance extends AbstractService
|
class UpdateBalance extends AbstractService
|
||||||
{
|
{
|
||||||
private $invoice;
|
public $invoice;
|
||||||
|
|
||||||
private $balance_adjustment;
|
public $balance_adjustment;
|
||||||
|
|
||||||
public function __construct($invoice, $balance_adjustment)
|
public function __construct($invoice, $balance_adjustment)
|
||||||
{
|
{
|
||||||
@ -29,7 +29,7 @@ class UpdateBalance extends AbstractService
|
|||||||
public function run()
|
public function run()
|
||||||
{
|
{
|
||||||
if ($this->invoice->is_deleted) {
|
if ($this->invoice->is_deleted) {
|
||||||
return;
|
return $this->invoice;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->invoice->balance += floatval($this->balance_adjustment);
|
$this->invoice->balance += floatval($this->balance_adjustment);
|
||||||
|
@ -13,7 +13,7 @@ return [
|
|||||||
'require_https' => env('REQUIRE_HTTPS', true),
|
'require_https' => env('REQUIRE_HTTPS', true),
|
||||||
'app_url' => rtrim(env('APP_URL', ''), '/'),
|
'app_url' => rtrim(env('APP_URL', ''), '/'),
|
||||||
'app_domain' => env('APP_DOMAIN', ''),
|
'app_domain' => env('APP_DOMAIN', ''),
|
||||||
'app_version' => '5.1.1',
|
'app_version' => '5.1.2',
|
||||||
'minimum_client_version' => '5.0.16',
|
'minimum_client_version' => '5.0.16',
|
||||||
'terms_version' => '1.0.1',
|
'terms_version' => '1.0.1',
|
||||||
'api_secret' => env('API_SECRET', false),
|
'api_secret' => env('API_SECRET', false),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user