Discussion:
how to print different sales invoice reports per client
(too old to reply)
Mpumi
2008-12-17 08:48:03 UTC
Permalink
hi all,

our client has customers across the world and they prefer having the sales
invoice for their external customers with a different look, so made a copy
of the current sales invoice and made my changes but i am getting the same
old invoice though i am print the copyofsalesinvoice. would you please
explain to me the step by step process of editing the backround of the sales
invoice classes to print the new sales invoice as many as i can, i have to
make 5 invoices for 5 different countries.

so far i am trying to edit the printJournal method on custInvoiceJour table
like so:
server void printJournal(SalesFormLetter salesFormLetter = null,
RecordSortedList journalList = null,
NoYes copy = NoYes::No)
{
Args parameters = new Args();
MenuFunction salesInvoiceMenu;
MenuFunction expSalesInvoiceMenu;
;

if (salesInvoiceMenu)
{
salesInvoiceMenu = new
MenuFunction(menuitemoutputstr(SalesInvoice),MenuItemType::Output);
parameters.caller(salesFormLetter);
}
else
{
salesInvoiceMenu = new
MenuFunction(menuitemoutputstr(copyofsalesinvoice),MenuItemType::Output);
parameters.caller(salesFormLetter);
}

if (journalList)
parameters.object(journalList);
else
parameters.record(this);

salesInvoiceMenu.run(parameters);
}

but this is not working, please help!
unknown
2008-12-19 17:58:13 UTC
Permalink
Hi

Im not sure what you are trying to do here

if (salesInvoiceMenu) //this hasnt been instanced yet and will always return false
{
salesInvoiceMenu = new
MenuFunction(menuitemoutputstr(SalesInvoice),MenuItemType::Output);
parameters.caller(salesFormLetter);
}
else // so you will always endup here
{
salesInvoiceMenu = new
//The copyofsalesinvoice is the menuItem im //guessing that you copied from the original //SalesInvoice menuItem. If you are getting the //same invoie and not your new one, check the //properties on your new menuItem and make sure //that it points to your new invoice report
//MenuFunction(menuitemoutputstr(copyofsalesinvoice),MenuItemType::Output);
//parameters.caller(salesFormLetter);
}

Below is an exampel on how I change between 2 invoice layouts in 2009 depending on if a checkbox is set or not, (Its more or less the same way AX4.0 does it)

if(CompanyInfo::find().FO_ExternalDocuments)
{
salesInvoiceMenu = new MenuFunction(menuitemoutputstr(SalesInvoice_SE),MenuItemType::Output);
}
// END 081104 FO/OC ()
else
salesInvoiceMenu = new MenuFunction(menuitemoutputstr(SalesInvoice),MenuItemType::Output);

You could just look at a specific value on the salesorder, langue for exampel.
unknown
2008-12-19 18:00:42 UTC
Permalink
sry about the // in some of the text hard to write in this small box
Loading...