Subversion Repositories SmartDukaan

Rev

Rev 31147 | Rev 34516 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 31147 Rev 33795
Line 54... Line 54...
54
 
54
 
55
		window.location.href = context + "/customerOffer/downloadTemplate";
55
		window.location.href = context + "/customerOffer/downloadTemplate";
56
	});
56
	});
57
 
57
 
58
 
58
 
-
 
59
    $(document).on('click', ".customer-offer-daterange", function () {
-
 
60
        var startDate = getDatesFromPicker('input[name="customerOfferByDateRange"]').startDate;
-
 
61
        var endDate = getDatesFromPicker('input[name="customerOfferByDateRange"]').endDate;
-
 
62
 
-
 
63
        if (startDate == "" || startDate == undefined) {
-
 
64
            alert("start date is not be empty!!");
-
 
65
            return;
-
 
66
        }
-
 
67
        if (endDate == "" || endDate == undefined) {
-
 
68
 
-
 
69
            alert("end date is not be empty!!");
-
 
70
            return;
-
 
71
        }
-
 
72
        doGetAjaxRequestHandler(`${context}/getCustomerOffer?startDate=` + startDate + `&endDate=` + endDate, function (response) {
-
 
73
            $('#' + "main-content").html(response);
-
 
74
        });
-
 
75
    });
-
 
76
 
59
	$(document).on('click', "#offer-item-search-button", function() {
77
	$(document).on('click', "#offer-item-search-button", function() {
60
		var searchText = $("#offer-item-search-text").val();
78
		var searchText = $("#offer-item-search-text").val();
61
		var date = $(".schemes-date").val();
79
		var date = $(".schemes-date").val();
62
		if (typeof (searchText) == "undefined" || !searchText) {
80
		if (typeof (searchText) == "undefined" || !searchText) {
63
			searchText = "";
81
			searchText = "";
Line 198... Line 216...
198
 
216
 
199
		let offerId = $(this).data('offerid');
217
		let offerId = $(this).data('offerid');
200
 
218
 
201
		var dealerPayout = $("#dealerPayout").val();
219
		var dealerPayout = $("#dealerPayout").val();
202
 
220
 
-
 
221
        var offerType = $("#offerType").val();
-
 
222
 
203
		var schemePayout = $("#schemePayout").val();
223
		var schemePayout = $("#schemePayout").val();
204
 
224
 
205
 
225
 
206
		if (dealerPayout === "") {
226
		if (dealerPayout === "") {
207
			alert("Dealer Payout is required");
227
			alert("Dealer Payout is required");
208
			return;
228
			return;
209
		}
229
		}
210
 
230
 
-
 
231
        if (offerType === "") {
-
 
232
            alert("Offer Type is required");
-
 
233
            return;
-
 
234
        }
-
 
235
 
211
		if (schemePayout === "") {
236
		if (schemePayout === "") {
212
			alert("Scheme Payout is required");
237
			alert("Scheme Payout is required");
213
			return;
238
			return;
214
		}
239
		}
215
 
240
 
216
		var json = {
241
		var json = {
217
 
242
 
218
			"catalogId": currentItem,
243
			"catalogId": currentItem,
219
			"dealerPayout": dealerPayout,
244
			"dealerPayout": dealerPayout,
-
 
245
            "offerType": offerType,
220
			"schemePayout": schemePayout,
246
			"schemePayout": schemePayout,
221
			"startDate": getDatesFromPicker('input[name="offerItemDuration"]').startDate,
247
			"startDate": getDatesFromPicker('input[name="offerItemDuration"]').startDate,
222
			"endDate": getDatesFromPicker('input[name="offerItemDuration"]').endDate,
248
			"endDate": getDatesFromPicker('input[name="offerItemDuration"]').endDate,
223
			"offerId": offerId
249
			"offerId": offerId
224
 
250