Subversion Repositories SmartDukaan

Rev

Rev 35775 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 35775 Rev 35838
Line 133... Line 133...
133
$(document).on('click', '.today-fofo-offer', function () {
133
$(document).on('click', '.today-fofo-offer', function () {
134
    let fofoId = $(this).data("fofoid");
134
    let fofoId = $(this).data("fofoid");
135
    doGetAjaxRequestHandler(`${context}/todayFofoOffer?fofoId=${fofoId}`, function (data) {
135
    doGetAjaxRequestHandler(`${context}/todayFofoOffer?fofoId=${fofoId}`, function (data) {
136
        $(".today-fofo-offer-view").show();
136
        $(".today-fofo-offer-view").show();
137
        $(".fofo-summry-view").hide();
137
        $(".fofo-summry-view").hide();
-
 
138
        $(".scheme-imei-history-view").hide();
-
 
139
        $(".partner-wallet-view").hide();
138
        $('.today-fofo-offer-view').html(data);
140
        $('.today-fofo-offer-view').html(data);
139
        // AUTO-LOAD Samsung immediately after tabs are ready
141
        // AUTO-LOAD Samsung immediately after tabs are ready
140
        loadFofoBrandOffers("Motorola", fofoId);
142
        loadFofoBrandOffers("Motorola", fofoId);
141
    });
143
    });
142
});
144
});
Line 144... Line 146...
144
 
146
 
145
$(document).on('click', '.fofo-stock-info', function () {
147
$(document).on('click', '.fofo-stock-info', function () {
146
 
148
 
147
	$(".today-fofo-offer-view").hide();
149
	$(".today-fofo-offer-view").hide();
148
    $(".scheme-imei-history-view").hide();
150
    $(".scheme-imei-history-view").hide();
-
 
151
    $(".partner-wallet-view").hide();
149
	$(".fofo-summry-view").show();
152
	$(".fofo-summry-view").show();
150
});
153
});
151
 
154
 
152
 
155
 
153
// Variables for modal search
156
// Variables for modal search
Line 160... Line 163...
160
 
163
 
161
    // Load the scheme-imei-history view (empty initially, user will search)
164
    // Load the scheme-imei-history view (empty initially, user will search)
162
    doGetAjaxRequestHandler(`${context}/getImeiMarginModal?searchImei=&fofoId=${modalFofoId}`, function (response) {
165
    doGetAjaxRequestHandler(`${context}/getImeiMarginModal?searchImei=&fofoId=${modalFofoId}`, function (response) {
163
        $(".today-fofo-offer-view").hide();
166
        $(".today-fofo-offer-view").hide();
164
        $(".fofo-summry-view").hide();
167
        $(".fofo-summry-view").hide();
-
 
168
        $(".partner-wallet-view").hide();
165
        $(".scheme-imei-history-view").show();
169
        $(".scheme-imei-history-view").show();
166
        $('.scheme-imei-history-view').html(response);
170
        $('.scheme-imei-history-view').html(response);
167
 
171
 
168
        // Initialize IMEI autocomplete if available
172
        // Initialize IMEI autocomplete if available
169
        if (typeof getAllImeiAheadOptions === 'function') {
173
        if (typeof getAllImeiAheadOptions === 'function') {
Line 175... Line 179...
175
        // Initialize model autocomplete for modal
179
        // Initialize model autocomplete for modal
176
        initModalModelAutocomplete();
180
        initModalModelAutocomplete();
177
    });
181
    });
178
});
182
});
179
 
183
 
-
 
184
// Partner Wallet handlers
-
 
185
$(document).on('click', '.partner-wallet-btn', function () {
-
 
186
    let fofoId = $(this).data("fofoid");
-
 
187
 
-
 
188
    // Load the partner wallet history view
-
 
189
    doGetAjaxRequestHandler(`${context}/getWalletHistoryByPartner?fofoId=${fofoId}`, function (response) {
-
 
190
        $(".today-fofo-offer-view").hide();
-
 
191
        $(".fofo-summry-view").hide();
-
 
192
        $(".scheme-imei-history-view").hide();
-
 
193
        $(".partner-wallet-view").show();
-
 
194
        $('.partner-wallet-view').html(response);
-
 
195
    });
-
 
196
});
-
 
197
 
180
// Initialize model autocomplete in modal
198
// Initialize model autocomplete in modal
181
function initModalModelAutocomplete() {
199
function initModalModelAutocomplete() {
182
    modalCurrentItem = null;
200
    modalCurrentItem = null;
183
    if (typeof getEntityAheadOptions === 'function') {
201
    if (typeof getEntityAheadOptions === 'function') {
184
        getEntityAheadOptions($("#modal-model-search-text"), function (selectedItem) {
202
        getEntityAheadOptions($("#modal-model-search-text"), function (selectedItem) {