Dish Size
v6
In versions prior to 5.0, it was assumed that a dish was prepared the same way each time, with its composition and size fully described by its technological card. To sell such dishes that could be baked in forms of different diameters (pies, pizzas), drinks in cups of different volumes, etc., it was necessary to register each size of the dish as a separate dish, thus creating sets of modifiers for each size, duplicating other (size-unrelated) dish and modifier settings, and when editing an order in SyrveFront, if it was necessary to choose a different size, one dish had to be deleted and another added. The menu had a lot of buttons, and the reports had a lot of lines. There was a growing need to introduce a separate concept of dish size.
Dish size is an additional characteristic that defines the composition and consumption of ingredients, the yield of the finished dish, and, accordingly, its price. A set of interchangeable sizes forms a size scale. If a dish is assigned a size scale, one of the sizes from this scale must be selected when adding the dish to the order. Some sizes may be unavailable for a specific dish. Modifiers will be prepared in the same size as the dish, and some of them may be unavailable for the selected size.
Key Types
IProduct— an item in the nomenclature, has aScaleproperty with a reference to the size scale. TheCompoundItemTemplatefor a composite dish also has a similar reference to the size scale. If no size scale is assigned to the dish, thennull.IProductScale— a size scale, known by its name (Name) and default size (DefaultSize). The list of sizes for this scale can be obtained using the service methodGetProductScaleSizes.IProductSize— the size of the dish, has full and short name variants (NameandKitchenName).- The methods
AddOrderProductItemandAddOrderCompoundItemhave asizeargument that allows specifying the size of the added dish. OrderCookingItem— dishes added to the order (OrderProductItemandOrderCompoundItem) have aSizeproperty with a reference to the selected size.- The selected size can be changed using the editing method
ChangeOrderCookingItemSize. - The same scale can be used for many products; however, not all products are available in all sizes. You can find out which sizes a particular product is definitely unavailable in using the service method
GetDisabledSizes. - The method
GetPricenow allows you to find out the price considering the size (in addition to the price category and date).
Examples
An example of working with sizes can be seen in the SDK plugin Resto.Front.Api.SamplePlugin (EditorTester.AddCompoundItem).