Displaying items by tag: Schweiz Rechnung

Friday, 24 May 2019 09:56

Payment slip with reference number

In Switzerland it is common to send a payment slip with the invoice. 


in german: https://de.wikipedia.org/wiki/Einzahlungsschein_mit_Referenznummer



How this is done in NetSuite:

With a "Workflow Action Script" the "payment slip" is printed out on the invoice. A separate Advanced HTML template is filled with the data from the invoice and saved with the transaction record. NetSuite also offers the option to send this "payment slip" as a PDF by email together with the invoice.

Alta Via Consulting has developed a bundle for Switzerland that contains this payment slip and other localizations. Contact us for more details. 

Script that creates the PDF:

function createPdf(rec) {
        var renderer;
        var pdf;
        var recObj = getDataObject(rec);

        renderer = render.create();
        renderer.setTemplateByScriptId('CUSTTMPL_AV_ZAHLSCHEIN'); // Load the template CUSTTMPL_AV_ZAHLSCHEIN 125
        format: render.DataSource.JSON, // Expecting an object
        alias: 'record',
        data: JSON.stringify(recObj).replace(/&/g, '&')

    pdf = renderer.renderAsPdf()

    return pdf;


In order to provide the "Payment slip with reference number" in NetSuite, a check digit must be calculated (among other things). This happens recursively according to "modulo10":

function mod10(bb) {
    var R1 = 0;
    var alg = [0, 9, 4, 6, 8, 2, 7, 1, 3, 5];
    var be = bb.split("");
    var bl = bb.length;
    var Rbb;
    var P1;
    for (i = 0; i < bl; i++)
        Rbb = parseInt(R1) + parseInt(be[i])
        R1 = alg[Rbb % 10]
    P1 = (10 - R1) % 10
    return P1;
Published in Script Solution


O NetSuite SuiteCloudDeveloperNetwork rgb 2NetSuite SolutionProvider horiz rgb

NOTE! This site uses cookies and similar technologies.

If you not change browser settings, you agree to it.

I understand