Subversion Repositories SmartDukaan

Rev

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

Rev 32488 Rev 32603
Line 93... Line 93...
93
 
93
 
94
 
94
 
95
        console.log(invoiceDoc)
95
        console.log(invoiceDoc)
96
 
96
 
97
 
97
 
98
        if (invoiceDate === "" && warehouseId === "" && numItems === "" && supplierId === "" && totalValue === "" && invoiceNumber === "" && invoiceDoc === "") {
98
        if (invoiceDate === "" && warehouseId === "" && numItems === "" && supplierId === "" && totalValue === "" && invoiceNumber === "" && (invoiceDoc==null || invoiceDoc === "")) {
99
            alert("Field can't be empty");
99
            alert("Field can't be empty");
100
            return false;
100
            return false;
101
        }
101
        }
102
 
102
 
103
 
-
 
104
        if (invoiceDate === "") {
-
 
105
            alert("please select date");
-
 
106
            return false;
-
 
107
        }
-
 
108
        if (warehouseId === "") {
-
 
109
            alert("please choose warehouse");
-
 
110
            return false;
-
 
111
        }
-
 
112
 
-
 
113
        if (numItems === "") {
-
 
114
            alert("please fill number of items.");
-
 
115
            return false;
-
 
116
        }
-
 
117
 
-
 
118
 
-
 
119
        if (supplierId === "") {
-
 
120
            alert("please choose supplier");
-
 
121
            return false;
-
 
122
        }
-
 
123
 
-
 
124
 
-
 
125
        if (totalValue === "") {
-
 
126
            alert("please fill Total Value.");
-
 
127
            return false;
-
 
128
        }
-
 
129
 
-
 
130
        if (invoiceNumber === "") {
-
 
131
            alert("please fill Invoice Number.");
-
 
132
            return false;
-
 
133
        }
-
 
134
 
-
 
135
 
-
 
136
        if (invoiceDoc === "") {
-
 
137
            alert("please upload invoice.");
-
 
138
            return false;
-
 
139
        }
-
 
140
        var newReceiveInvoice = {};
103
        var newReceiveInvoice = {};
141
 
104
 
142
        newReceiveInvoice['invoiceDate'] = invoiceDate;
105
        newReceiveInvoice['invoiceDate'] = invoiceDate;
143
        newReceiveInvoice['warehouseId'] = warehouseId
106
        newReceiveInvoice['warehouseId'] = warehouseId
144
        newReceiveInvoice['numItems'] = numItems
107
        newReceiveInvoice['numItems'] = numItems
Line 216... Line 179...
216
                totalQty += parseInt(qty);
179
                totalQty += parseInt(qty);
217
            }
180
            }
218
            console.log(totalQty);
181
            console.log(totalQty);
219
        });
182
        });
220
 
183
 
-
 
184
        var $html = $(`<tr>
221
        var $html = $('<tr>  <td>  <input type="text" class="form-control typeaheaditem"   autocomplete="off"  placeholder="Search Model"/> </td> <td>  <input type="number" class="form-control qty"  name = "qty" placeholder="Quantity"/> </td><td>  <input type="number" class="form-control transferPrice"  readonly tabindex="-1" placeholder="Transfer Price"/> </td>	<td>  <input type="number" class="form-control totalValue" tabindex="-1"  readonly placeholder="Total Value"/> </td> <td> <input class="form-control btn btn-primary removeInPurchaseOrder" tabindex="-1" type="button" value="Remove"></td>  </tr> ');
185
        <td>  <input type="text" class="form-control typeaheaditem"   autocomplete="off"  placeholder="Search Model"/> </td>
-
 
186
        <td>  <input type="number" class="form-control qty"  name = "qty" placeholder="Quantity"/> </td>
-
 
187
        <td>  <input type="number" class="form-control transferPrice"  readonly tabindex="-1" placeholder="Transfer Price"/> </td>
-
 
188
        <td>  <input type="number" class="form-control totalValue" tabindex="-1"  readonly placeholder="Total Value"/> </td>
-
 
189
        <td> <input class="form-control btn btn-primary removeInPurchaseOrder" tabindex="-1" type="button" value="Remove"></td>
-
 
190
        </tr> `);
222
 
191
 
223
        var vendorId = $('#vendorId').val();
192
        var vendorId = $('#vendorId').val();
224
 
193
 
225
        $('tbody').append($html);
194
        $('tbody').append($html);
226
        getVendorItemAheadOptions($html.find('.typeaheaditem'), vendorId, function (
195
        getVendorItemAheadOptions($('tbody >tr').find('.typeaheaditem'), vendorId, function (
227
            selectedItem) {
196
            selectedItem) {
228
            let poDate = $('#poDate').val();
197
            let poDate = $('#poDate').val();
229
            var itemId = selectedItem.itemId;
198
            var itemId = selectedItem.itemId;
230
            if (addItem($html, itemId)) {
199
            if (addItem($html, itemId)) {
231
                doGetAjaxRequestHandler(`${context}/getPricing?vendorId=${vendorId}&itemId=${itemId}&onDate=${poDate}`, function (response) {
200
                doGetAjaxRequestHandler(`${context}/getPricing?vendorId=${vendorId}&itemId=${itemId}&onDate=${poDate}`, function (response) {