Display message

Hello !

I would like to print text on the additional data from the invoice when a specific payment method is selected.
I tested a code on the report of the invoice but not getting results.
All payment methods that will use for this text are registered as B BRASILXXXXX

//BP Deviation Documented
display str printTextMemoFirstPg()
{
    FiscalDocJourLegalTxt_BR    legalTxt;
    str                         memo;
    int                         line;
    Str                         lineAux;
    CustInvoiceJour             custInvoiceJour = FiscalDocJour_BR::findRecId(currentFiscalDocJourRecId).custInvoiceJour();
    TaxWithholdSpec             taxWithholdSpec;
    TmpTaxWithhold              tmpTaxWithhold;
    CustTable                   custTable = CustTable::find(custInvoiceJour.OrderAccount);

    FiscalDocJour_BR            fiscalDocJourLoc;

    #define.maxLineChar(60)
    #define.maxLine(4)
    ;
    lineAux = CustTrans::findFromInvoice(fiscalDocJourLoc.InvoiceId, fiscalDocJourLoc.InvoiceAccount).PaymMode;


     if (custInvoiceJour.DeliveryIENum_BR != 'ISENTO' && custInvoiceJour.DlvState == 'MA' && custInvoiceJour.InventSiteId == '21')
    {
       newmemo += "BASE DE CALCULO DO ICMS REDUZIDA, DE ACORDO COM INCISO XII, § 1, DO ANEXO 1.5, RICMS/MA. ";
    }


    if (lineAux LIKE "B BRAS*")
    {
      newmemo += "OS BOLETOS REFERENTES AO PARCELAMENTO ACOMPANHAM ESTA NF ";
    }

It has more code below
The same above validating IENUM, DLVSTATE and INVENTSITEID works correctly.
Anyone have any idea, would use the “LIKE” or strScan for example??

Use Strscan function to see whether your string is available or not. For ex: StrScan (‘ABCD’,‘AB’,1,Len(‘ABCD’) … if this results in a postiive number then you should concatenate your memo field …

It seems that you have problem with querying your data because you don’t follow rules of database normalization. Stop keeping the information in payment method name; create a new attribute to hold it and then simply check this attribute.