Topic: Invoice Editable

The Invoice in FA as a whole is not editable. Specially in case of sales of components (inventory items) it is not recommended to make invoice editable. But in case of sales of Service Items following option shall be considerable.

When we click the EditInvoice Icon on Customer Transaction Inquiry page it shall open following document with following parameters.

http://localhost/bx242/sales/sales_order_entry.php?NewInvoice=72&InvoiceNo=70

Where NewInvoice refers to the Auto Sales Order of the Invoice No 70.

While processing this document the system shall check the InvoiceNo parameter and execute the Void Routine to void the previous invoice.

This Edit option shall be available to 2 type of companies

1. Total Service Based Company. A check can be added in company setup.
2. A Company selling components but has enabled Negative Inventory in Setup.

I couldn't code it completely so if admin can consider it then it will be a good solution to all FA Users

Regards.

Re: Invoice Editable

I am not really understand with what you mean. If you want to ask detail, please send PM to me.

Re: Invoice Editable

Thanks I have done it. I have made Invoice Editable. When an Invoice is edited and processed the old invoice is automatically voided and new invoice is created with the same Reference Number.

Re: Invoice Editable

@joe: is this desirable in the default FA?

Re: Invoice Editable

No, I don' t think so. In the core we should not allow full editing. It sends a wrong signal. I would leave it as is.

Joe

Re: Invoice Editable

@joe: I agree.
@boxygen: Zip, upload and paste link to changed files for this "feature" so that it can become an extension someday and be available for reference.

Re: Invoice Editable

Sure I will

Re: Invoice Editable

@apmuthu Here is the extension Invoice Editable

Regards.

Post's attachments

FA_Inv_editable_boxygen.zip 18.2 kb, 4 downloads since 2017-10-21 

You don't have the permssions to download the attachments of this post.

Re: Invoice Editable

I have updated so please update the attachment as well

Re: Invoice Editable

Updated.

The diff of your new file added as compared to the stock FA 2.4.2+ master apart from whitespace changes are::

--- sales/includes/ui/sales_order_ui.inc    Sun May 21 21:49:30 2017
+++ sales/includes/ui/sales_order_ui.inc    Sat Oct 21 22:32:51 2017
@@ -236,6 +236,10 @@
         display_note(_("Marked items have insufficient quantities in stock as on day of delivery."), 0, 1, "class='stockmankofg'");
 
     div_end();
+
+        if(list_updated('stock_id')) //added by faisal phuong
+            set_focus('stock_id');
+
 }
 
 // ------------------------------------------------------------------------------
@@ -265,6 +269,9 @@
     else
     {
         customer_list_row(_("Customer:"), 'customer_id', null, false, true, false, true);
+        If (isset($_GET['InvoiceNo']))
+            hidden('InvoiceNo', $_GET['InvoiceNo']); //Added by Faisal for Invoice Edit
+            
 
         if ($order->customer_id != get_post('customer_id', -1))
         {

Re: Invoice Editable

How do you get this difference file?

Re: Invoice Editable

You can use tools like WinMerge: http://winmerge.org/?lang=en

Re: Invoice Editable

I think this can be useful, I had to edit invoice a few times.
Thank you for sharing!