Merge pull request #8126 from turbo124/v5-develop

Add issue templates back into the repo
This commit is contained in:
David Bomba 2023-01-10 12:49:46 +11:00 committed by GitHub
commit 442c21287b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 86 additions and 45 deletions

41
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,41 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: triage
assignees: ''
---
**What version of Invoice Ninja are you running? ie v4.5.25 / v5.0.30**
**What environment are you running?**
Docker
Shared Hosting
ZIP
Other
**Have you checked log files (storage/logs/) Please provide redacted output**
**Have you searched existing issues?**
**Have you reported this to Slack/forum before posting?**
**Describe the bug**
A clear and concise description of what the bug is.
**Steps To Reproduce**
Please list the steps to reproduce the issue
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Additional context**
Add any other context about the problem here.
<!-- Note: Before posting don't forget to check our "Troubleshooting" category in the [docs](https://invoiceninja.github.io/docs/self-host-troubleshooting/) (https://invoiceninja.github.io/docs/self-host-troubleshooting/) -->
**(v5) Can you replicate the issue on our demo site? https://demo.invoiceninja.com**

View File

@ -0,0 +1,24 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: feature request
assignees: ''
---
**What version of Invoice Ninja are you running? ie v4.5 / v5**
**What environment are you running?**
Docker
Shared Hosting
ZIP
Other
**Have you searched existing issues/requests?**
**Screenshots**
If applicable, add screenshots to help explain your request/question.
**Additional context**
Add any other context about the request/question here.

View File

@ -95,7 +95,6 @@ class ClientService
{
$credits = Credit::withTrashed()->where('client_id', $this->client->id)
->where('is_deleted', false)
->where('balance', '>', 0)
->where(function ($query) {
$query->whereDate('due_date', '<=', now()->format('Y-m-d'))
->orWhereNull('due_date');

View File

@ -167,7 +167,7 @@ class CreditService
}
public function adjustBalance($adjustment)
{
{nlog("adjusting by {$adjustment}");
$this->credit->balance += $adjustment;
return $this;

View File

@ -69,16 +69,6 @@ class RefundPayment
EmailRefundPayment::dispatch($this->payment, $this->payment->company, $contact);
}
$transaction = [
'invoice' => [],
'payment' => $this->payment->transaction_event(),
'client' => $this->payment->client->transaction_event(),
'credit' => [],
'metadata' => [],
];
// TransactionLog::dispatch(TransactionEvent::PAYMENT_REFUND, $transaction, $this->payment->company->db);
$notes = ctrans('texts.refunded') . " : {$this->total_refund} - " . ctrans('texts.gateway_refund') . " : ";
$notes .= $this->refund_data['gateway_refund'] !== false ? ctrans('texts.yes') : ctrans('texts.no');
@ -210,6 +200,7 @@ class RefundPayment
if ($this->payment->credits()->exists()) {
//Adjust credits first!!!
foreach ($this->payment->credits as $paymentable_credit) {
$available_credit = $paymentable_credit->pivot->amount - $paymentable_credit->pivot->refunded;
if ($available_credit > $this->total_refund) {
@ -222,12 +213,12 @@ class RefundPayment
->updatePaidToDate($this->total_refund * -1)
->save();
$this->total_refund = 0;
} else {
$paymentable_credit->pivot->refunded += $available_credit;
$paymentable_credit->pivot->save();
$paymentable_credit->balance += $available_credit;
$paymentable_credit->service()
->setStatus(Credit::STATUS_SENT)
->adjustBalance($available_credit)
@ -288,16 +279,6 @@ class RefundPayment
->updateBalance($refunded_invoice['amount'])
->save();
$transaction = [
'invoice' => $invoice->transaction_event(),
'payment' => [],
'client' => $client->transaction_event(),
'credit' => [],
'metadata' => [],
];
// TransactionLog::dispatch(TransactionEvent::PAYMENT_REFUND, $transaction, $invoice->company->db);
if ($invoice->is_deleted) {
$invoice->delete();
}
@ -311,15 +292,6 @@ class RefundPayment
$client->service()->updatePaidToDate(-1 * $refunded_invoice['amount'])->save();
$transaction = [
'invoice' => [],
'payment' => [],
'client' => $client->transaction_event(),
'credit' => [],
'metadata' => [],
];
// TransactionLog::dispatch(TransactionEvent::PAYMENT_REFUND, $transaction, $client->company->db);
} else {
//if we are refunding and no payments have been tagged, then we need to decrement the client->paid_to_date by the total refund amount.
@ -331,15 +303,6 @@ class RefundPayment
$client->service()->updatePaidToDate(-1 * $this->total_refund)->save();
$transaction = [
'invoice' => [],
'payment' => [],
'client' => $client->transaction_event(),
'credit' => [],
'metadata' => [],
];
// TransactionLog::dispatch(TransactionEvent::PAYMENT_REFUND, $transaction, $client->company->db);
}
return $this;

View File

@ -239,6 +239,11 @@ class SubscriptionService
->where('status_id', Invoice::STATUS_PAID)
->first();
if($last_invoice)
nlog($last_invoice->toArray());
else
nlog("no invoice found");
$refund = $this->calculateProRataRefundForSubscription($last_invoice);
if($use_credit_setting != 'off')
@ -709,6 +714,12 @@ class SubscriptionService
$recurring_invoice = $this->createNewRecurringInvoice($old_recurring_invoice);
//update the invoice and attach to the recurring invoice!!!!!
$invoice = Invoice::find($payment_hash->fee_invoice_id);
$invoice->recurring_id = $recurring_invoice->id;
$invoice->is_proforma = false;
$invoice->save();
$context = [
'context' => 'change_plan',
'recurring_invoice' => $recurring_invoice->hashed_id,
@ -910,7 +921,7 @@ class SubscriptionService
$invoice = InvoiceFactory::create($this->subscription->company_id, $this->subscription->user_id);
$invoice->line_items = $subscription_repo->generateLineItems($this->subscription);
$invoice->subscription_id = $this->subscription->id;
$invoice->is_proforman = true;
$invoice->is_proforma = true;
if(strlen($data['coupon']) >=1 && ($data['coupon'] == $this->subscription->promo_code) && $this->subscription->promo_discount > 0)
{

View File

@ -66,6 +66,9 @@ class ZeroCostProduct extends AbstractService
->start()
->save();
$invoice->recurring_id = $recurring_invoice->id;
$invoice->save();
$context = [
'context' => 'recurring_purchase',
'recurring_invoice' => $recurring_invoice->hashed_id,

View File

@ -19,7 +19,7 @@ class PDF extends FPDI
public function Footer()
{
$this->SetXY(0, -5);
$this->SetXY(0, -6);
$this->SetFont('Arial', 'I', 9);
$this->SetTextColor(135, 135, 135);