$(function() { function asFunction(value) { if($.isArray(value)) { return function(v) { return $.inArray(v, value) >= 0; } } else if($.isFunction(value)) { return value; } else { return function(v) { return v == value; } } } function not(value) { return function(v) { return !asFunction(value)(v); } } function and(a, b) { return function(v) { return asFunction(a)(v) && asFunction(b)(v); } } var riihimaki = '694'; var akpMunicipalities = ['505', '908', riihimaki]; application.setAsukasmaaraRules([{ value: 'required', subkayttotarkoitus: ['011', '012', '013', '014'], kayttotarkoitus: function(kayttotarkoitus) { return kayttotarkoitus != 1; } }, { value: 'visible', subkayttotarkoitus: ['011', '012', '013', '014'] }]); application.setLiittymatyyppiRules([{ kunta: akpMunicipalities, value: 1 }, { value: 2 }, { value: 3 }, { value: 4 }, { value: 5 }]); application.setHuoneistomaaraRules([]); application.setProductFilteringRules([{ id: [4802, 4803, 4804], kayttotarkoitus: [0, 1] }]) // Muovi vain taloyhtiöille application.setProductTypeFilteringRules([{ id: ["MUO", "LAS", "MET", "KAR"], kayttotarkoitus: [0, 1] }]); application.setAsukasmaaraRules([{ kunta: riihimaki, kayttotarkoitus: [0, 1], value: 'visible', default: 1 }]); application.setCompostTyhjennystiheysRules([{ value: 0, visible: true, enabled: true }, { value: 4, visible: true, enabled: false, iCompost: false }, { value: 6, visible: true, enabled: false, iCompost: false }, { value: 8, visible: true, enabled: false, iCompost: false }, { value: 10, visible: true, enabled: false, iCompost: false }, { value: 12, visible: true, enabled: false, iCompost: false }, { value: 4, visible: true, enabled: true, iCompost: true }, { value: 6, visible: true, enabled: true, iCompost: true }, { value: 8, visible: true, enabled: true, iCompost: true }, { value: 10, visible: true, enabled: true, iCompost: true }, { value: 12, visible: true, enabled: true, iCompost: true }]); application.setTyhjennystiheysRules( [{ "value": "", "text": "-- Valitse --", "selected": true }, { "value": "1", "text": "Kerran viikossa", "laji": ["SEK", "BIO"], "kayttotarkoitus": ["0","1"] }, { "value": "1", "text": "Kerran viikossa", "laji": ["SEK", "BIO", "MUO", "KAR"], "kayttotarkoitus": ["2"] }, { "value": "2", "text": "Joka toinen viikko", "laji": ["BIO"] }, { "value": "2", "text": "Joka toinen viikko", "laji": ["SEK", "MON"], "kayttotarkoitus": ["0","1"] }, { "value": "2", "text": "Joka toinen viikko", "laji": ["SEK", "MUO", "MON", "KAR"], "kayttotarkoitus": ["2"] }, { "value": "4", "text": "Neljän viikon välein", product: ['787','888','889','921'] }, { "value": "4", "text": "Neljän viikon välein", "laji": ["SEK", "MON"], "kayttotarkoitus": ["0","1"] }, { "value": "4", "text": "Neljän viikon välein", "laji": ["SEK", "MUO", "MON", "KAR", "LAS", "MET"], "kayttotarkoitus": ["2"] }, { "value": "4", "text": "Neljän viikon välein", "product": ["797"] }, { "value": "6", "text": "Kuuden viikon välein", "laji": ["SEK"], bio: true }, { "value": "8", "text": "Kahdeksan viikon välein", "laji": ["SEK"], bio: true }, { "value": "6", "text": "Kuuden viikon välein", "laji": ["MON"], "kayttotarkoitus": ["0","1"] }, { "value": "6", "text": "Kuuden viikon välein", "laji": ["MUO", "MON", "KAR"], "kayttotarkoitus": ["2"] }, { "value": "8", "text": "Kahdeksan viikon välein", "laji": ["MON"], "kayttotarkoitus": ["0","1"] }, { "value": "8", "text": "Kahdeksan viikon välein", "laji": ["MUO", "MON", "KAR", "LAS", "MET"], "kayttotarkoitus": ["2"] }, { "value": "12", "text": "12 viikon välein", "laji": ["MUO", "KAR", "LAS", "MET"], "kayttotarkoitus": ["2"] }, { "value": "16", "text": "16 viikon välein", "laji": ["MUO", "KAR", "LAS", "MET"], "kayttotarkoitus": ["2"] }, { "value": "24", "text": "24 viikon välein", "laji": ["LAS", "MET"], "kayttotarkoitus": ["2"] } ]); application.setBinOwnershipRules([{ value: "2", text: "Kiinteistöllä on jo astia" }, { value: "1", text: "Tilaan veloituksetta astian Kiertokapulalta" }]); }); showFeedbackWindow.setFeedbackTypes([]); showShoppingCartWindow.setConfirmationWindowProductRules([ { extra_service: { category : "a1" }, tuote_$ :{ label: "Tilaus" }, tuote_0 :{ label: "Astiatilaus" }, "1astnimi_$" :{ label: "Tilaus" }, lisatietoa: { label: "Lisätietoja esim. astian sijainnista, toimituspaikasta" }, same_as_before: { label: "Sama kuin toimitusosoite" }, maara_$: { label: "Määrä" } }, { extra_service: { category : "a2" }, tuote_$ :{ label: "Tilaus" }, tuote_0 :{ label: "Noutopalvelu" }, "1astnimi_$" :{ label: "Tilaus" }, first_emptying_notice_$:{ label: "Hinnat sisältävät alv:n 24%." }, lisatietoa: { label: "Lisätietoja noudettavista jätteistä ja toivottu noutopäivä" }, poikkeavaheader: { label: "Nouto-osoite" }, same_as_before: { label: "Sama kuin nouto-osoite" } }, { extra_service: { category : "a3" }, tuote_$ :{ label: "Tilaus" }, tuote_0 :{ label: "Lavapalvelutilaus" }, "1astnimi_$" :{ label: "Tilaus" }, first_emptying_notice_$:{ label: "Hinnat sisältävät alv:n 24%." }, lisatietoa: { label: "Lisätietoja noudettavista jätteistä ja toivottu noutopäivä" }, poikkeavaheader: { label: "Nouto-osoite" }, same_as_before: { label: "Sama kuin nouto-osoite" } }, { extra_service: { category : ["a4", "a5", "a6"] }, tuote_$ :{ label: "Tilaus" }, tuote_0 :{ label: "Materiaalitilaus" }, "1astnimi_$" :{ label: "Tilaus" }, lisatietoa: { label: "Lisätietoja" }, first_emptying_notice_$:{ label: "Hinnat sisältävät alv:n 24%." }, same_as_before: { label: "Sama kuin toimitusosoite" }, maara_$: { label: "Määrä" } } ]);