Adding js code in another file

Hello;

I need some help or advise or someone to correct me in the following:
I need to add js script that is related to sales_invoice.js but I do not need to add it in sales_invoice.js or in the custom script, but I need to add it in separated file, so when I do upgrade, nothing will be effected.

I tried to add the following script in a file named: sales_invoice_custom.js and I placed this file in erpnext/public/js directory:

{% include ‘erpnext/accounts/doctype/sales_invoice/sales_invoice.js’ %};
cur_frm.add_fetch(‘item_code’, ‘gold_gram’, ‘gold_gram’);

But it did not work (the code did not take any effect), it is same as nothing were added.
I think maybe that this line is wrong {% include 'erpnext/accounts/doctype/sales_invoice/sales_invoice.js' %}; and it should be something else, also I think that there is another things to be added or written in other files. So can someone direct me?

One more thing:
Is it possible to add this code in a file (.js) and place it in separated application?
Note: this code need to be related to sales_invoice.js certainly but I need to place it in separated file and it is highly recommended to be placed in separated application.

Looking for help and advise.
Regards
Bilal