Allow Invoice Disc. on G/L Account similar behaviour Item

andy76andy76 Member Posts: 616
Hello,

I discover that if we make new sales order with lines of type G/L Account and want to insert an Inv. Discount Amount in form Sales Order Statistic we have to tick/flag the colum "Allow Invoice Discount" manually the lines of type G/L Account.
For Item type we have a field in Item table master data called Allow Inv. Discount that, if flagged, it transfer automatically the flag in Sales Line of type Item without this problem.

Is it possibile to have a same behaviour also for type G/L Account? How?

We have NAV 5.0 (CH)

Thank you

Comments

  • aseigleaseigle Member Posts: 207
    In Table 37 - Sales Line, the No. - OnValidate Trigger has a line that says when the type is G/L Account, "Allow Invoice Disc." := FALSE. If you change that value to true, it will default in when you enter a line for a G/L Account.

    I haven't tested it fully, but initial tests look promising.
  • andy76andy76 Member Posts: 616
    But in this way it is not parametric, as for Items where I can choose if single Item allow discount.
    Modifying the code the flag will be inserted always for each account (if I don't insert program conditions).

    Thank you
  • SavatageSavatage Member Posts: 7,142
    Sounds like your moving towards adding a new field on the G/L Account Table called "Allow Inv Disount" Type Boolean.
    In Table 37 - Sales Line, the No. - OnValidate Trigger has a line that says when the type is G/L Account, "Allow Invoice Disc." := FALSE. If you change that value to true, it will default in when you enter a line for a G/L Account.

    (something like)
    "Allow Invoice Disc." := FALSE; change from
    "Allow Invoice Disc." := GLacct."Allow Inv Discount";//change to

    By adding it to the table then you can add it to the G/L Account card and make adjustments individually.

    test test test
  • andy76andy76 Member Posts: 616
    Ok, but are you sure that there isn't something similar at standard and it is mandatory to write new code for this?

    Thank you
  • SavatageSavatage Member Posts: 7,142
    andy76 wrote:
    Ok, but are you sure that there isn't something similar at standard and it is mandatory to write new code for this?

    Thank you
    I haven't check myself but if the standard code is "Allow Invoice Disc." := FALSE;
    Then you have two choices. manually change it on the sales line when needed, which you can do already. Or automate it, with a change in code.
    Your call.
Sign In or Register to comment.