Topic: Change name of a Report

Hello All,

After spending the weekend trying to understand FA and make it work, here I am already trying modify certain elements.

Sorry for trouble, but I couldn't find a post which had details about changing the name of the report.

In my case, I chose FA primarily because I am able to print a 'delivery note' which contains prices, as I need to use this 'delivery note' as a 'commercial invoice' to be included in export paperwork.

Now, where as most of the famous packages wouldn't be able to handle this feature, FA has this option where you can have 'packaging slip' and 'delivery note' both, latter includes prices too.

My question is, there there a way, I can just change the name 'Delivery Note' to 'Commercial Invoice' in the pdf which gets generated ?

Not sure how easy this would be, but I hope it is a static value, which can be change in order for it to read 'Commercial Invoice' once pdf is generated.

Thanks a lot in advance.

Regards,
GJ

Re: Change name of a Report

Gentlemen,

So after some more digging around, I found the post at below link:
https://frontaccounting.com/fawiki/index.php?n=Help.ReportsAndAnalysis

After reading a few more things on the page, I edited the below line in bold, in  rep110.php file, and changed DELIVERY NOTE to COMMERCIAL INVOICE.

But even after that when I print the 'Template Delivery' I don't get the title as 'Commercial Invoice', it still prints as DELIVERY NOTE.

                {
                    $rep->title = _('DELIVERY NOTE');
                    $rep->filename = "Delivery" . $myrow['reference'] . ".pdf";
                }


Can any one throw some light on what is going wrong for me  please ?

Re: Change name of a Report

Do not edit the _('DELIVERY NOTE') as it is a translatable string that needs to be altered in the appropriate .po file which then needs to be compiled into a .mo file before being used.

If you are using only 1 language and/or prefer this string to be in English alone, hard code it using the following instead:

                {
                    $rep->title = 'CUSTOMER INVOICE';
                    $rep->filename = "Delivery" . $myrow['reference'] . ".pdf";
                }

Re: Change name of a Report

Hi Ap.Muthu,

Thanks a lot for your reply. Very kind.

I did exactly as you mentioned, just that I need the title to be COMMERCIAL INVOICE, but still not luck.

  
                {
                    $rep->title = 'COMMERCIAL INVOICE';
                    $rep->filename = "Delivery" . $myrow['reference'] . ".pdf";
                } 

Just wondering if I need to place the rep110.php file in any other folders at all ? Right now it is in main /reporting/ folder only and not in any of the /company/#/reporting folders.




apmuthu wrote:

Do not edit the _('DELIVERY NOTE') as it is a translatable string that needs to be altered in the appropriate .po file which then needs to be compiled into a .mo file before being used.

If you are using only 1 language and/or prefer this string to be in English alone, hard code it using the following instead:

                {
                    $rep->title = 'CUSTOMER INVOICE';
                    $rep->filename = "Delivery" . $myrow['reference'] . ".pdf";
                }

Re: Change name of a Report

gj6n68 wrote:

I did exactly as you mentioned, just that I need the title to be COMMERCIAL INVOICE, but still not luck.

  
                {
                    $rep->title = 'COMMERCIAL INVOICE';
                    $rep->filename = "Delivery" . $myrow['reference'] . ".pdf";
                } 

Hi, you need to take a look at reporting/includes/doctext.inc too. I think it will not difficult to find the string you need to edit there.

Re: Change name of a Report

Ap.Muthu and bogeyman,


Thanks a lot for wonderful help. After manipulating the code below in doctext.inc, I've managed to get desired and much required result of changing the title to commercial invoice and Com Inv No."


            $this->title = ($packing_slip==1 ? _("PACKING SLIP") : _("COMMERCIAL INVOICE"));
            $this->formData['document_name'] = _("Com Inv No.");

I've just changed the above code in doctext.inc and have not done any changes to rep110.php file.

But wanted to confirm one more thing.

As Ap.Muthu has suggested, as I am only ever going to use English language, should I hard code the changes within docttext.in file ? Or should I leave it as above for now ?

Also, do I need to make changes to rep110.php file or leave it as it is?

And finally, would any of these changes upset anything else, apart from translation issue, which I don't think I'll need ?

Sorry for queries and thanks a lot once again.

Regards,
GJ

Re: Change name of a Report

Hardcoding is the "Quick 'n Dirty" means.

You can make the string translatable using _("...") since the input argument will be used if not found in the .mo file (as absent in the original empty.po file). Changing it in the .po file and then using the newly compiled .mo file will make for less hassles when comparing code with the master repo and seamless in upgradation.

Re: Change name of a Report

Thanks a lot Ap.Muthu,

But honestly speaking that is a bouncer as I a illiterate in terms of .Mo and .PO and compiling the files. But would be keen to understand or learn if this is documented somewhere as I'd definitely want a smooth upgrade process and not get stuck after having implemented the system.

Thanks
GJ

Re: Change name of a Report

GJ,

For a simple change like this, the "quick 'n' dirty" way is just fine. You just need to remember what you did when you decide to upgrade to a new version.

Apmuthu,

I agree that a translation would be the "proper" way to do this, but how would that work if one was already using, say, Australian or Indian English? Should we (and could we?) have a "local.mo" which - if present - would override parts of the installed language pack?

Re: Change name of a Report

Just re-compile the standard en_US.mo file. Only changed strings need be in the new .po file and compiled into the .mo file.

In the case of Australian or Indian English too the same applies with changed strings.

Extract the .po file from your current .mo file - only those stings that changed need/will be there. Then refer to the empty.po file and add in "the strings you wish to change" into the extracted .po file and recompile and use it.

In future, do not upgrade the language file at all from the GUI and instead only incorporate the changes in them into your version of the extracted .po file, compile and use the resultant .mo file.

In most instances language files have little or no changes and version bumps occur regularly - good business for "consultants".

Re: Change name of a Report

Thanks a lot Ap.Muthu I'll have to try below and get grips with it all.



apmuthu wrote:

Just re-compile the standard en_US.mo file. Only changed strings need be in the new .po file and compiled into the .mo file.

In the case of Australian or Indian English too the same applies with changed strings.

Extract the .po file from your current .mo file - only those stings that changed need/will be there. Then refer to the empty.po file and add in "the strings you wish to change" into the extracted .po file and recompile and use it.

In future, do not upgrade the language file at all from the GUI and instead only incorporate the changes in them into your version of the extracted .po file, compile and use the resultant .mo file.

In most instances language files have little or no changes and version bumps occur regularly - good business for "consultants".