var code = getQuery("code");
function save() {
    var error = checkValidation("");
    if (error === "") {
        var data = getJsonValue();
        data["MoainCode"] = data["MoainCode"] || null;
        ajax({
            loading: true,
            url: "AccountingApi/" + (code !== "" ? "UpdateStandardSummery" : "InsertStandardSummery"),
            data: data,
            success: function (result) {
                refreshParent("loadGrid()");
                showMsgModal(2, result.FinalMessage);
                closeTopModal();
            }
        });
    }
    else {
        showMsgModal(0, error, error, '0');
    }
}
async function getEventLookupCombo($combo, search, code) {
    await ajax({
        url: "AccountingApi/GetMoainList",
        data: {
            checkActive: false,
            search: search,
            selectedCode: code,
            pageNo: 1
        },
        success: function (result) {
            result.forEach(function (item) {
                item.Name = item.Code + " " + item.Name.split('/')[1];
            });
            $combo.lookupBuilder().bindData(result);
        }
    });
}

