Kostenlose Erstberatung
Freitag, 24 Mai 2019 09:56

Payment slip with reference number

Written by

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
        renderer.addCustomDataSource({
        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;
}​
Read 3714 times Last modified on Donnerstag, 07 Mai 2020 13:33

Leave a comment

Make sure you enter all the required information, indicated by an asterisk (*). HTML code is not allowed.

SPRECHEN SIE UNS AN!

O NetSuite SuiteCloudDeveloperNetwork rgb 2NetSuite SolutionProvider horiz rgb

Hinweis zum Datenschutz

Wir sind bemüht, Ihnen den bestmöglichen Service auf dieser Seite zu bieten. Damit dies reibungslos funktioniert verwenden wir sog. Cookies. Unsere Datenschutzbestimmungen können Sie unter dem Menu Datenschutz nachlesen.

Ich habe verstanden.