Subversion Repositories SmartDukaan

Rev

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

Rev 33400 Rev 33795
Line 346... Line 346...
346
 
346
 
347
    $("#order-items").find("tr:not(:first-child)").each(function (index, el) {
347
    $("#order-items").find("tr:not(:first-child)").each(function (index, el) {
348
        // console.log(el);
348
        // console.log(el);
349
        // console.log(index);
349
        // console.log(index);
350
        var $el = $(el);
350
        var $el = $(el);
-
 
351
        var $customerOfferItemId = $el.find('.offerSelect');
351
        var $unitPriceElement = $el.find('.unitPrice');
352
        var $unitPriceElement = $el.find('.unitPrice');
352
        var itemId = parseInt($unitPriceElement.attr("itemId"));
353
        var itemId = parseInt($unitPriceElement.attr("itemId"));
353
        var qty = parseInt($unitPriceElement.attr("quantity"));
354
        var qty = parseInt($unitPriceElement.attr("quantity"));
354
        var found = false;
355
        var found = false;
355
            var customSerialNumberEl = $(el).find('.customSerialNumber');
356
            var customSerialNumberEl = $(el).find('.customSerialNumber');
Line 359... Line 360...
359
            var $discountElement = $el.find('.discount');
360
            var $discountElement = $el.find('.discount');
360
            var $poiId = $el.find('.poiId');
361
            var $poiId = $el.find('.poiId');
361
            var unitPrice = parseFloat($unitPriceElement.val());
362
            var unitPrice = parseFloat($unitPriceElement.val());
362
            var discount = parseFloat($discountElement.val());
363
            var discount = parseFloat($discountElement.val());
363
            var poiId = $poiId.val();
364
            var poiId = $poiId.val();
-
 
365
            var customerOfferItemId;
-
 
366
            if ($customerOfferItemId) {
-
 
367
                customerOfferItemId = $customerOfferItemId.val();
-
 
368
            } else {
-
 
369
                customerOfferItemId = 0;
-
 
370
            }
-
 
371
 
364
            if (isNaN(discount)) {
372
            if (isNaN(discount)) {
365
                discount = 0;
373
                discount = 0;
366
            }
374
            }
367
            let customSerialNumbers = [];
375
            let customSerialNumbers = [];
368
 
376
 
Line 380... Line 388...
380
            tmpObj = {
388
            tmpObj = {
381
                itemId: itemId,
389
                itemId: itemId,
382
                poiId: poiId,
390
                poiId: poiId,
383
                sellingPrice: unitPrice - discount,
391
                sellingPrice: unitPrice - discount,
384
                quantity: 0,
392
                quantity: 0,
-
 
393
                customerOfferItemId: customerOfferItemId,
385
                discountAmount: discount,
394
                discountAmount: discount,
386
                customSerialNumbers: customSerialNumberEl.val().split(","),
395
                customSerialNumbers: customSerialNumberEl.val().split(","),
387
                serialNumberDetails: []
396
                serialNumberDetails: []
388
            };
397
            };
389
 
398