<?php

namespace PHPMaker2024\laundrytech;

// Page object
$PricelistdetailsEdit = &$Page;
?>
<?php $Page->showPageHeader(); ?>
<?php
$Page->showMessage();
?>
<main class="edit">
<form name="fpricelistdetailsedit" id="fpricelistdetailsedit" class="<?= $Page->FormClassName ?>" action="<?= CurrentPageUrl(false) ?>" method="post" novalidate autocomplete="off">
<script>
var currentTable = <?= JsonEncode($Page->toClientVar()) ?>;
ew.deepAssign(ew.vars, { tables: { pricelistdetails: currentTable } });
var currentPageID = ew.PAGE_ID = "edit";
var currentForm;
var fpricelistdetailsedit;
loadjs.ready(["wrapper", "head"], function () {
    let $ = jQuery;
    let fields = currentTable.fields;

    // Form object
    let form = new ew.FormBuilder()
        .setId("fpricelistdetailsedit")
        .setPageId("edit")

        // Add fields
        .setFields([
            ["priceListDetailId", [fields.priceListDetailId.visible && fields.priceListDetailId.required ? ew.Validators.required(fields.priceListDetailId.caption) : null], fields.priceListDetailId.isInvalid],
            ["priceListid", [fields.priceListid.visible && fields.priceListid.required ? ew.Validators.required(fields.priceListid.caption) : null, ew.Validators.integer], fields.priceListid.isInvalid],
            ["articleid", [fields.articleid.visible && fields.articleid.required ? ew.Validators.required(fields.articleid.caption) : null, ew.Validators.integer], fields.articleid.isInvalid],
            ["rate", [fields.rate.visible && fields.rate.required ? ew.Validators.required(fields.rate.caption) : null, ew.Validators.float], fields.rate.isInvalid],
            ["discount", [fields.discount.visible && fields.discount.required ? ew.Validators.required(fields.discount.caption) : null, ew.Validators.float], fields.discount.isInvalid],
            ["discountType", [fields.discountType.visible && fields.discountType.required ? ew.Validators.required(fields.discountType.caption) : null, ew.Validators.integer], fields.discountType.isInvalid],
            ["netAmount", [fields.netAmount.visible && fields.netAmount.required ? ew.Validators.required(fields.netAmount.caption) : null, ew.Validators.float], fields.netAmount.isInvalid]
        ])

        // Form_CustomValidate
        .setCustomValidate(
            function (fobj) { // DO NOT CHANGE THIS LINE! (except for adding "async" keyword)!
                    // Your custom validation code here, return false if invalid.
                    return true;
                }
        )

        // Use JavaScript validation or not
        .setValidateRequired(ew.CLIENT_VALIDATE)

        // Dynamic selection lists
        .setLists({
        })
        .build();
    window[form.id] = form;
    currentForm = form;
    loadjs.done(form.id);
});
</script>
<script>
loadjs.ready("head", function () {
    // Write your table-specific client script here, no need to add script tags.
});
</script>
<?php if (Config("CHECK_TOKEN")) { ?>
<input type="hidden" name="<?= $TokenNameKey ?>" value="<?= $TokenName ?>"><!-- CSRF token name -->
<input type="hidden" name="<?= $TokenValueKey ?>" value="<?= $TokenValue ?>"><!-- CSRF token value -->
<?php } ?>
<input type="hidden" name="t" value="pricelistdetails">
<input type="hidden" name="action" id="action" value="update">
<input type="hidden" name="modal" value="<?= (int)$Page->IsModal ?>">
<?php if (IsJsonResponse()) { ?>
<input type="hidden" name="json" value="1">
<?php } ?>
<input type="hidden" name="<?= $Page->OldKeyName ?>" value="<?= $Page->OldKey ?>">
<div class="ew-edit-div"><!-- page* -->
<?php if ($Page->priceListDetailId->Visible) { // priceListDetailId ?>
    <div id="r_priceListDetailId"<?= $Page->priceListDetailId->rowAttributes() ?>>
        <label id="elh_pricelistdetails_priceListDetailId" class="<?= $Page->LeftColumnClass ?>"><?= $Page->priceListDetailId->caption() ?><?= $Page->priceListDetailId->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->priceListDetailId->cellAttributes() ?>>
<span id="el_pricelistdetails_priceListDetailId">
<span<?= $Page->priceListDetailId->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?= HtmlEncode(RemoveHtml($Page->priceListDetailId->getDisplayValue($Page->priceListDetailId->EditValue))) ?>"></span>
<input type="hidden" data-table="pricelistdetails" data-field="x_priceListDetailId" data-hidden="1" name="x_priceListDetailId" id="x_priceListDetailId" value="<?= HtmlEncode($Page->priceListDetailId->CurrentValue) ?>">
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->priceListid->Visible) { // priceListid ?>
    <div id="r_priceListid"<?= $Page->priceListid->rowAttributes() ?>>
        <label id="elh_pricelistdetails_priceListid" for="x_priceListid" class="<?= $Page->LeftColumnClass ?>"><?= $Page->priceListid->caption() ?><?= $Page->priceListid->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->priceListid->cellAttributes() ?>>
<span id="el_pricelistdetails_priceListid">
<input type="<?= $Page->priceListid->getInputTextType() ?>" name="x_priceListid" id="x_priceListid" data-table="pricelistdetails" data-field="x_priceListid" value="<?= $Page->priceListid->EditValue ?>" size="30" placeholder="<?= HtmlEncode($Page->priceListid->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->priceListid->formatPattern()) ?>"<?= $Page->priceListid->editAttributes() ?> aria-describedby="x_priceListid_help">
<?= $Page->priceListid->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->priceListid->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->articleid->Visible) { // articleid ?>
    <div id="r_articleid"<?= $Page->articleid->rowAttributes() ?>>
        <label id="elh_pricelistdetails_articleid" for="x_articleid" class="<?= $Page->LeftColumnClass ?>"><?= $Page->articleid->caption() ?><?= $Page->articleid->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->articleid->cellAttributes() ?>>
<span id="el_pricelistdetails_articleid">
<input type="<?= $Page->articleid->getInputTextType() ?>" name="x_articleid" id="x_articleid" data-table="pricelistdetails" data-field="x_articleid" value="<?= $Page->articleid->EditValue ?>" size="30" placeholder="<?= HtmlEncode($Page->articleid->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->articleid->formatPattern()) ?>"<?= $Page->articleid->editAttributes() ?> aria-describedby="x_articleid_help">
<?= $Page->articleid->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->articleid->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->rate->Visible) { // rate ?>
    <div id="r_rate"<?= $Page->rate->rowAttributes() ?>>
        <label id="elh_pricelistdetails_rate" for="x_rate" class="<?= $Page->LeftColumnClass ?>"><?= $Page->rate->caption() ?><?= $Page->rate->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->rate->cellAttributes() ?>>
<span id="el_pricelistdetails_rate">
<input type="<?= $Page->rate->getInputTextType() ?>" name="x_rate" id="x_rate" data-table="pricelistdetails" data-field="x_rate" value="<?= $Page->rate->EditValue ?>" size="30" placeholder="<?= HtmlEncode($Page->rate->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->rate->formatPattern()) ?>"<?= $Page->rate->editAttributes() ?> aria-describedby="x_rate_help">
<?= $Page->rate->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->rate->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->discount->Visible) { // discount ?>
    <div id="r_discount"<?= $Page->discount->rowAttributes() ?>>
        <label id="elh_pricelistdetails_discount" for="x_discount" class="<?= $Page->LeftColumnClass ?>"><?= $Page->discount->caption() ?><?= $Page->discount->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->discount->cellAttributes() ?>>
<span id="el_pricelistdetails_discount">
<input type="<?= $Page->discount->getInputTextType() ?>" name="x_discount" id="x_discount" data-table="pricelistdetails" data-field="x_discount" value="<?= $Page->discount->EditValue ?>" size="30" placeholder="<?= HtmlEncode($Page->discount->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->discount->formatPattern()) ?>"<?= $Page->discount->editAttributes() ?> aria-describedby="x_discount_help">
<?= $Page->discount->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->discount->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->discountType->Visible) { // discountType ?>
    <div id="r_discountType"<?= $Page->discountType->rowAttributes() ?>>
        <label id="elh_pricelistdetails_discountType" for="x_discountType" class="<?= $Page->LeftColumnClass ?>"><?= $Page->discountType->caption() ?><?= $Page->discountType->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->discountType->cellAttributes() ?>>
<span id="el_pricelistdetails_discountType">
<input type="<?= $Page->discountType->getInputTextType() ?>" name="x_discountType" id="x_discountType" data-table="pricelistdetails" data-field="x_discountType" value="<?= $Page->discountType->EditValue ?>" size="30" maxlength="11" placeholder="<?= HtmlEncode($Page->discountType->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->discountType->formatPattern()) ?>"<?= $Page->discountType->editAttributes() ?> aria-describedby="x_discountType_help">
<?= $Page->discountType->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->discountType->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->netAmount->Visible) { // netAmount ?>
    <div id="r_netAmount"<?= $Page->netAmount->rowAttributes() ?>>
        <label id="elh_pricelistdetails_netAmount" for="x_netAmount" class="<?= $Page->LeftColumnClass ?>"><?= $Page->netAmount->caption() ?><?= $Page->netAmount->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->netAmount->cellAttributes() ?>>
<span id="el_pricelistdetails_netAmount">
<input type="<?= $Page->netAmount->getInputTextType() ?>" name="x_netAmount" id="x_netAmount" data-table="pricelistdetails" data-field="x_netAmount" value="<?= $Page->netAmount->EditValue ?>" size="30" placeholder="<?= HtmlEncode($Page->netAmount->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->netAmount->formatPattern()) ?>"<?= $Page->netAmount->editAttributes() ?> aria-describedby="x_netAmount_help">
<?= $Page->netAmount->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->netAmount->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
</div><!-- /page* -->
<?= $Page->IsModal ? '<template class="ew-modal-buttons">' : '<div class="row ew-buttons">' ?><!-- buttons .row -->
    <div class="<?= $Page->OffsetColumnClass ?>"><!-- buttons offset -->
<button class="btn btn-primary ew-btn" name="btn-action" id="btn-action" type="submit" form="fpricelistdetailsedit"><?= $Language->phrase("SaveBtn") ?></button>
<?php if (IsJsonResponse()) { ?>
<button class="btn btn-default ew-btn" name="btn-cancel" id="btn-cancel" type="button" data-bs-dismiss="modal"><?= $Language->phrase("CancelBtn") ?></button>
<?php } else { ?>
<button class="btn btn-default ew-btn" name="btn-cancel" id="btn-cancel" type="button" form="fpricelistdetailsedit" data-href="<?= HtmlEncode(GetUrl($Page->getReturnUrl())) ?>"><?= $Language->phrase("CancelBtn") ?></button>
<?php } ?>
    </div><!-- /buttons offset -->
<?= $Page->IsModal ? "</template>" : "</div>" ?><!-- /buttons .row -->
</form>
</main>
<?php
$Page->showPageFooter();
echo GetDebugMessage();
?>
<script>
// Field event handlers
loadjs.ready("head", function() {
    ew.addEventHandlers("pricelistdetails");
});
</script>
<script>
loadjs.ready("load", function () {
    // Write your table-specific startup script here, no need to add script tags.
});
</script>
