frame

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Register
Hello m'Managerians !
What do you think m'Manager 2.0 should be ? What features SHOULD or MUST be implemented right now ! Request or Vote here

Refund/Delete invoice

Would it be possible to be able to add a button to enable a refund (whole or part), and delete invoices?

Tagged:

Comments

  • @danmcr said:
    Would it be possible to be able to add a button to enable a refund (whole or part), and delete invoices?

    Hi,
    You can refund manually if you don't use Mollie. Open the invoice, navigate to Manage payment and you have a red button to refund whole or part. But you can not delete invoice. In most countries, when invoice is paid, refunded or cancelled it must remain in the system.

  • Hi,

    Thanks for your reply.

    Sometimes errors are made, or for whatever reason the invoice needs to be removed/deleted. Currently I would need to go into MySQL database to remove data.

    Thanks.

  • edited June 2017

    @danmcr said:
    Hi,

    Thanks for your reply.

    Sometimes errors are made, or for whatever reason the invoice needs to be removed/deleted. Currently I would need to go into MySQL database to remove data.

    Thanks.

    If you want to delete invoice after refund/paid, you can edit this function to fit your needs.
    Open application/modules/invoices/Invoices.php and locate this function

    public function delete_invoice()
        {
            $protected = [];
            $to_del = [];
            $ids = _dID($_REQUEST['id']);
            $response = [];
            if (is_array($ids))
            {
                foreach ($ids as $i) {
                    if (invoice_status($i) == 'is_paid' || invoice_status($i) == 'is_refunded' )
                    {
                        array_push($protected, $i);
                    }
                    else
                    {
                        array_push($to_del, $i);
                    }
                }
                $response['success']  = count($to_del);
                $response['fail'] = count($protected);
    
                if(!empty($to_del))
                {
                    delete('invoices', 'invoice_number', $to_del);
                }
            }
            echo json_encode($response);
        }
    

    You can remove the condition invoice_status($i) == 'is_refunded')

This discussion has been closed.

m'Manager

| Let's Build Together a Great App !
If you are a happy user, send me a coffee.
2015 - 2107 © m'Manager.
Powered by VanillaForums, Designed by ThemeSteam

Recent Donations

  • Joni Mueller from https://pixelita.com/ - 63€
  • HeyrmanD from https://locco-palace.be - 25€
  • Patricia from Sjopz.com - 10€
  • AskinSavascisi from wolftech.com - 3€
  • Get In Touch