M112 Sales with a return

M112 Verkoop en terugname van producten

In the BAR there is a partial payback

  • return of 1 Dry Martini, 12 EUR, VAT code A
  • sale of 1 Burger of the Chef, 15 EUR, VAT code B

This order is paid in cach.

C#
        
        //Create the correct action according to the example
        var newSalesAction = new PosSalesAction(
            FpsFinancesModels.Company,
            _myFpsPos,
            FpsFinancesModels.TerminalTer1Bar,
            FpsFinancesModels.EmployeeElisa,
            FpsFinancesModels.BookingPeriod20240730)
        {
            TicketMedium = TicketMedium.PAPER,
            SalesActionNumber = 1002,
            CheckboxReference = new CheckboxSignReference
            {
                Checkbox = FpsFinancesModels.Checkbox01,
                DateTime = DateTime.Now,
                Eventlabel = EventLabel.N,
                EventCounter = 1000,
                TotalCounter = 1200
            },
            TransactionLines =
            [
                new RefundLine(TransactionLineType.SINGLE_PRODUCT, 1, FpsFinancesModels.ProdDryMartini),
                new SaleLine(TransactionLineType.SINGLE_PRODUCT, 1, FpsFinancesModels.ProdBurgerOfTheChef)
            ],
            Payments =
            [
                new Payment
                {
                    Id = "1",
                    Name = "CONTANT",
                    Type = PaymentType.CASH,
                    InputMethod = InputMethod.MANUAL,
                    Amount = 16,
                    AmountType = PaymentLineType.PAYMENT
                }
            ]
        };

        //Sign the action
        var result = await checkboxService.SignPosAction(newSalesAction, false, cancellationToken);

        //Handle the result accordingly
        Console.WriteLine($"Result with Signature {result.SignResult?.DigitalSignature}");