x+y Discount

Hi All, Has anyone had the challenge to implement a discount of the type x+y ? For Example a sales order for 25 items, 3 are for free (22+3). The 3 free items have to be posted to a seperate account, which can also not be the same as the standard discount accounts… Any ideas ? Thanks

Only thing you can do without single line of custom code is to setup new “discount” item with different posting groups from posting groups at “normal” item. I.e. one line in order should be for 22 “normal” units and another one - for 3 “discount” units. Of course this is not so good approach if you have a wide practice to sell items in this way as actually you need to duplicate your inventory range. Another way is to have two kind of posting groups at the same Item card - standard and “discount”. In this case you have to customize posting to G/L (Codeunits 12, 80) of those sales lines which you mark as “discount line” (for instance by having boolean field “discount item” at sales line for this).