Print invoice when salesorder.Process() is done  Topic is solved

Discussions relating to Jiwa 7 plugin development, and the Jiwa 7 API.

Print invoice when salesorder.Process() is done

Postby DannyC » Fri Dec 10, 2021 2:16 pm

I've got some plugin code which does a sales order process to close it when & as appropriate.

Stupid question...

I notice that the .Process() has some parameters
process.png
process.png (2.46 KiB) Viewed 1006 times


I'm assuming I can specify during the process to print an invoice (or delivery docket or whatever) by adding relevant parameters. I just can't get the right syntax.
Any examples?
User avatar
DannyC
Senpai
Senpai
 
Posts: 718
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 31

Re: Print invoice when salesorder.Process() is done

Postby SBarnes » Fri Dec 10, 2021 2:54 pm

The run number can be an empty string and report collection is the possible reports for printing as normal.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1696
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 191

Re: Print invoice when salesorder.Process() is done  Topic is solved

Postby pricerc » Fri Dec 10, 2021 4:29 pm

DannyC wrote:I've got some plugin code which does a sales order process to close it when & as appropriate.

Stupid question...

I notice that the .Process() has some parameters
process.png


I'm assuming I can specify during the process to print an invoice (or delivery docket or whatever) by adding relevant parameters. I just can't get the right syntax.
Any examples?


Code: Select all
    public static void PrintInvoice(SalesOrder salesOrder, string formatName)
    {
        foreach (SalesOrderReport salesOrderReport in salesOrder.GetCandidateReportsToPrint())
        {
            if (salesOrderReport.Name == formatName && salesOrderReport.BillingType == salesOrder.BillType)
            {
                salesOrder.Print(new JiwaCollection<SalesOrderReport>() { salesOrderReport });
                return;
            }
        }
        // missing handling for formatName not found.
    }
/Ryan

ERP Consultant,
Advanced ERP Limited, NZ
https://aerp.co.nz
User avatar
pricerc
Senpai
Senpai
 
Posts: 518
Joined: Mon Aug 10, 2009 12:22 pm
Location: Auckland, NZ
Topics Solved: 21


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 2 guests