#LOCAL("DisplayPrice", #FUNCTION("DISPLAYPRICE", #Object, #INPUT.Currency, #Shop.TaxModel, #Session.User.Object)) #LOCAL("LastBookingAmount",0) #LOCAL("LastBookingFactor",0) #IF(#DEFINED(#BusinessHours.LastBookingAmount)) #SET("LastBookingAmount",#BusinessHours.LastBookingAmount) #ELSIF(#DEFINED(#BusinessHours.BaseCalendar.LastBookingAmount)) #SET("LastBookingAmount",#BusinessHours.BaseCalendar.LastBookingAmount) #ENDIF #IF(#DEFINED(#BusinessHours.LastBookingUnit)) #SET("LastBookingFactor",#BusinessHours.LastBookingUnit.Factor) #ELSIF(#DEFINED(#BusinessHours.BaseCalendar.LastBookingUnit)) #SET("LastBookingFactor",#BusinessHours.BaseCalendar.LastBookingUnit.Factor) #ENDIF #LOCAL("LastBookingDifference",#LastBookingAmount * #LastBookingFactor)
#IF(#FormError) #IF(#FormErrors.Reason.FORMAT_NOT_DATETIME)

{InputError}

{FormatNotDatetime}
#ELSIF(#FormErrors.Reason.BookingTooLateNow)

{InputError}

{BookingTooLateNow}
#ELSIF(#FormErrors.Reason.BookingTooLate)

{InputError}

#LOCAL("LeadTime",#Child.BusinessHours.LastBookingAmount) #IF(NOT #DEFINED(#LeadTime))#SET("LeadTime", #Child.BusinessHours.BaseCalendar.LastBookingAmount)#ENDIF #IF(#Child.BusinessHours.LastBookingUnit) #SET("LeadTime", #LeadTime." ".#Child.BusinessHours.LastBookingUnit.NameOrAlias) #ELSE #SET("LeadTime", #LeadTime." ".#Child.BusinessHours.BaseCalendar.LastBookingUnit.NameOrAlias) #ENDIF {BookingTooLate} #ENDLOCAL
#ELSIF(#FormErrors.Reason.BookingIsBusy)

{Attention}

{BookingIsBusy} #LOOP(#FormErrors.Errors) #IF(#Reason EQ "BookingIsBusy" AND #Name EQ "Quantity")
{Notification}: {RemainingQuantity} #RemainingQuantity #ENDIF #ENDLOOP
#ELSIF(#FormErrors.Reason.BookingNoBusiness)

{InputError}

{BookingNoBusiness}
#ELSIF(#FormErrors.Form.Address)

{InputError}

{PleaseCorrectErrors}
#ELSIF(#FormErrors.Reason.STRING_EMPTY)

{InputError}

{PleaseFillRequiredFields}
#ELSIF(#FormErrors.Reason.AcceptTAC)

{Notification}

{TacAgain}

#ELSIF(#FormErrors.Reason.ProductNoPrice)

{Notification}

{ProductNoPrice}

#ELSIF(#FormErrors.Reason.FalseQuantity)

{InputError}

{FalseQuantity} ({CountItems}: #MinOrder[float]#IF(#IntervalOrder != 1), {OrderInterval}: #IntervalOrder[float]#ENDIF)

#ELSIF(#FormErrors.Reason.FalseQuantityStockLevel)

{InputError}

{FalseQuantity} ({MaxCountItems}: #StockLevel[float])

#ELSIF(#FormErrors.Reason.SelectOption)

{InputError}

{PleaseFillRequiredFields}

#ELSE

{InputError}

#LOOP(#FormErrors.Errors) Error: Reason: #Reason, Value:#Value, Name:#Name (Index:#Index, Form:#Form) #Example.
#ENDLOOP
#ENDIF #ENDIF
#IF(NOT(#CanPayAppointment AND #DEFINED(#DisplayPrice) AND #FUNCTION("EXIST_APPOINTMENT_PAYMENT", #Object, #Session.User.Object, #Address.CountryID, #INPUT.Currency))) #ENDIF
{AppointmentData}
#BLOCK("WITH_FORM_ERROR", #FormError)
#IF(#StockLevel != #MinOrder)
{Quantity} {MandatoryStar}
#ELSE
{Quantity}
#MinOrder[float]
#ENDIF
#IF(#BusinessHours.CanCustomerDefinedAppDuration) #LOCAL("Duration", #Duration) #LOCAL("DurationUnitID", #DurationUnitID) #IF(NOT #DEFINED(#Duration) OR NOT #DEFINED(#DurationUnitID)) #SET("Duration", #BusinessHours.DefaultAppDurationAmount) #SET("DurationUnitID", #BusinessHours.DefaultAppDurationUnit.ID) #ENDIF
{Duration} {MandatoryStar}
#ENDLOCAL #ENDLOCAL #ELSE
{Duration}
#BusinessHours.DefaultAppDurationAmount[float] #BusinessHours.DefaultAppDurationUnit.NameOrAlias
#ENDIF
#IF(#DEFINED(#DisplayPrice))
{BasePrice}
#INCLUDE("INC-DisplayPrice")
{Price}
#LOCAL("AppointmentPrice", #FUNCTION("APPOINTMENTMENT_PRICE", #UNDEF, #Object, #INPUT.Currency, #UNDEF, #Session.User.Object, #Quantity))#AppointmentPrice[money]#ENDLOCAL
#IF(#CanPayAppointment) #LOCAL("LocalQuantity", #MinOrder) #IF(#Quantity)#SET("LocalQuantity", #Quantity)#ENDIF #LOCAL("AppointmentPrepayment", #FUNCTION("APPOINTMENTMENT_PREPAYMENT", #UNDEF, #Object, #INPUT.Currency, #UNDEF, #Session.User.Object, #LocalQuantity)) #IF(#DEFINED(#AppointmentPrepayment) AND #AppointmentPrepayment NE 0)
{Prepayment}
#AppointmentPrepayment[money]
#ENDIF#ENDLOCAL#ENDLOCAL #ENDIF #ENDIF
{StartDate} *
#LOOP(#GREP(#UserDefinedAttributeValues,"Attribute.Type","PreDefCustomerString")) #LOCAL("CustomerOptions", #GREP(#MULTISELECTEDVALUES(#Attribute.PreDefAttributes, #Value),"Selected",1)) #LOCAL("AttributeAlias",#Attribute.Alias) #LOCAL("InputAA","INPUT.".#AttributeAlias) #IF(#COUNT(#CustomerOptions) > 0)
#IF(#COUNT(#CustomerOptions) > 1)#WITH_ERROR(#FormError)#LOCAL("ErrorItemNo", 0)
#Attribute.NameOrAlias *
#ENDLOCAL#ENDWITH_ERROR#ELSE
#Attribute.NameOrAlias
#ValueOrAlias#ENDLOOP
#ENDIF
#ENDIF #ENDLOCAL#ENDLOCAL#ENDLOCAL #ENDLOOP
{Remark}
#IF(#BusinessHours.AcceptWithReservation AND #DEFINED(#Shop.AcceptWithReservationText))#Shop.AcceptWithReservationText[0]#ENDIF
{Address}
#LOCAL("AddressPrefix","Address")#LOCAL("Address", #Session.User.BillingAddress) #LOCAL("RegistrationField", #Shop.RegistrationField)#LOCAL("RegistrationSet", "BillingAddress") #LocaleInclude("EditRegistrationField-Address", #Address.Country.Code2) #ENDLOCAL#ENDLOCAL#ENDLOCAL#ENDLOCAL
#IF(#CanPayAppointment AND #DEFINED(#LISTPRICE(#Object, #INPUT.Currency)) AND #CanAddToBasket AND #FUNCTION("EXIST_APPOINTMENT_PAYMENT", #Object, #Session.User.Object, #Address.CountryID, #INPUT.Currency))
{Payment}
{PaymentMethod}
#IF(#Shop.AcceptTac)
#ELSE #ENDIF
#ENDIF
{MandatoryFields}
#ENDBLOCK #ENDLOCAL #ENDLOCAL #ENDLOCAL #ENDLOCAL