Iniit
This commit is contained in:
@@ -0,0 +1,147 @@
|
||||
var Bizgaze;
|
||||
(function (Bizgaze) {
|
||||
let Apps;
|
||||
(function (Apps) {
|
||||
let Transact;
|
||||
(function (Transact) {
|
||||
let Controls;
|
||||
(function (Controls) {
|
||||
class Batch extends Unibase.Platform.Core.BaseComponent {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.rowlength = 0;
|
||||
}
|
||||
jsFiles() {
|
||||
return ['apps/transact/controls/pricelist/mrp.js', 'apps/transact/controls/pricelist/managers/pricelistmanager.js'];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(id, containerid) {
|
||||
var html = '<form id="frm_Bizgazetransact_createBatch" default method="post" data-validate="parsley" class="w-f bg-white" data-isdynamic="false"><header class="bg-white modal-header pa-10"><strong class="text-dark titlename" >Create Batch</strong><div class="btn-group ml-auto"><a class="btn btn-sm"><i class="ti-help-alt" title = "help" href = "" target = "_blank"></i></a></div></header>' +
|
||||
'<div style="overflow-x:hidden;" class="scrollable"><div id = "bizgaze_BatchErrorMessages" class="clear"></div><div class="card mt-5" ><div class="card-body"> <div class="row" style="overflow-x:hidden;"><div class="col-sm-6"><div class="floating-label-form-group" id = "div_MRP" ><label for= "txt_BatchNo" id = "lbl_BatchNo" >Batch Number<span class= "text-danger" >*</span></label><div class= "input-group" ><input type="text" class="form-control required floating-label-control decimal_numericsvalue" id = "txt_BatchNo" data - isdynamic="false" placeholder = "Batch No. *" style = "width:1200px" data-placeholder="Enter Batch No *" data-label="Batch No *" /><input type="hidden" id = "hf_batch" value = "">' +
|
||||
'<label for= "Validation" id = "lblValidation_Batch" ></label><input type = "hidden" id = "hfFormPropertyId" /></div></div></div><div class="col-sm-6"><label for="lbl" id="lbl_MRPid">MRP<span class="text-danger hide " id="spnIsRequired"> *</span></label><div class="input-group"><select type = "text" class="txtAutoComplete_MRP required form-control ui-autocomplete" data-required="true" value = "" id = "txtAutoComplete_MRP" placeholder = "Select MRP" style = "width:100%;"></select>' +
|
||||
'<input type = "hidden" id = "hf_MrpId"><label for= "Validation" id = "lblValidation_MRP"></label><input type = "hidden" id = "hfFormPropertyId" /></div>' +
|
||||
'</div><div class="col-sm-12"><div class="row"><div class="col-sm-6"><div class="floating-label-form-group floating-label-form-group-with-value" id = "div_PackedDate"><label for= "txt_PackedDate" id = "lbl_PackedDate">Packed Date <span class="text-danger">*</span></label><div class="input-group"><input type="text" id="txt_PackedDate" class="form-control value-control datepicker-input hasDatepicker" placeholder = "dd/mm/yyyy" data - isdynamic="false" data-placeholder="dd/mm/yyyy" data - label="dd/mm/yyyy" >' +
|
||||
'<span class="input-group-addon bg-white no-border spndate"><a href="#"><i class="fa fa-calendar"></i></a></span><input type = "hidden" id = "hf_PackedDate" /><label for= "Validation" id = "lblValidation_PackedDate" ></label><input type = "hidden" id = "hfFormPropertyId" /></div></div></div><div class="col-sm-6"><div class="floating-label-form-group floating-label-form-group-with-value" id = "div_ExpiryDate" ><label for= "txt_ExpiryDate" id = "lbl_ExpiryDate">Expiry Date </label><div class="input-group"><input type="text" id = "txt_ExpiryDate" class="form-control value-control datepicker-input hasDatepicker " placeholder = "dd/mm/yyyy" data - isdynamic="false" data - placeholder="dd/mm/yyyy" data - label="dd/mm/yyyy">' +
|
||||
'<span class="input-group-addon bg-white no-border spndate"><a href="#" > <i class="fa fa-calendar" ></i></a></span><input type = "hidden" id = "hf_ExpiryDate" /><label for= "Validation" id = "lblValidation_ExpiryDate"></label><input type = "hidden" id = "hfFormPropertyId" /></div></div></div></div></div></div></div></div></div><footer class="bg-white modal-footer">' +
|
||||
'<a href="javascript:;" id = "frm_btnBatchCancel" class="btn btn-light btn-sm mr-auto " > Close </a><a href = "javascript:;" id = "frm_btnBatchSave" class="btn btn-primary btn-sm" > Save </a></footer></form>';
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
$("#txt_PackedDate").daterangepicker({
|
||||
locale: {
|
||||
format: 'DD/MM/YYYY',
|
||||
},
|
||||
singleDatePicker: true,
|
||||
showDropdowns: true,
|
||||
minYear: 1901,
|
||||
maxDate: new Date(2050, 11, 31)
|
||||
});
|
||||
$("#txt_PackedDate").on('apply.daterangepicker', function (ev, picker) {
|
||||
$("#txt_PackedDate").val(picker.startDate.format('DD/MM/YYYY'));
|
||||
});
|
||||
$("#txt_ExpiryDate").daterangepicker({
|
||||
locale: {
|
||||
format: 'DD/MM/YYYY',
|
||||
},
|
||||
singleDatePicker: true,
|
||||
showDropdowns: true,
|
||||
minYear: 1901,
|
||||
maxDate: new Date(2050, 11, 31)
|
||||
});
|
||||
$("#txt_ExpiryDate").on('apply.daterangepicker', function (ev, picker) {
|
||||
$("#txt_ExpiryDate").val(picker.startDate.format('DD/MM/YYYY'));
|
||||
});
|
||||
$("#frm_btnBatchCancel").click(function () {
|
||||
$('#' + containerid).modal('hide');
|
||||
$('#' + containerid).remove();
|
||||
if (Batch.instance.rowlength != 0) {
|
||||
$("#select_Batch" + Batch.instance.rowlength).empty();
|
||||
}
|
||||
});
|
||||
$("#frm_btnBatchSave").click(function () {
|
||||
Batch.Instance().Save(id, containerid);
|
||||
});
|
||||
$(".hasDatepicker").keypress(function (e) {
|
||||
$(".hasDatepicker").attr("maxlength", "10");
|
||||
if (e.which != 8 && e.which != 0 && (e.which < 47 || e.which > 57)) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
var value = $(".hasDatepicker").val().toString().replace(/^(\d\d)(\d)$/g, '$1/$2').replace(/^(\d\d\/\d\d)(\d+)$/g, '$1/$2').replace(/[^\d\/]/g, '');
|
||||
$(".hasDatepicker").val(value);
|
||||
}
|
||||
});
|
||||
this.loadMrps(id);
|
||||
}
|
||||
loadMrps(ItemId) {
|
||||
var url = _appsettings.server_url() + '/apis/v4/bizgaze/transact/pricelists/mrps_auto/itemid/' + ItemId;
|
||||
var id = 0;
|
||||
AutoCompleteHelper.getHelper().Create("#txtAutoComplete_MRP", "#hf_MrpId", url, function (response) {
|
||||
if (id != response.id) {
|
||||
id = response.id;
|
||||
if ($("#txtAutoComplete_MRP option:selected").text() == 'Create MRP') {
|
||||
let obj = [];
|
||||
obj.push({
|
||||
ItemId: ItemId,
|
||||
element: null,
|
||||
});
|
||||
var itemobj = Bizgaze.Apps.Transact.Controls.MRP.Instance();
|
||||
Unibase.Platform.Helpers.NavigationHelper.Instance().popup(obj, "", itemobj, null, Unibase.Platform.Helpers.Size.DockLeft);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
Save(id, containerid) {
|
||||
if ($("#txt_BatchNo").val() == "" || $("#txt_BatchNo").val() == '') {
|
||||
MessageHelper.Instance().showError("Batch No is Required ", 'bizgaze_BatchErrorMessages');
|
||||
return false;
|
||||
}
|
||||
if (isNaN(Number($(".txtAutoComplete_MRP option:selected").val()))) {
|
||||
MessageHelper.Instance().showError("Please Select MRP ", 'bizgaze_BatchErrorMessages');
|
||||
return false;
|
||||
}
|
||||
var PackedDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatServerDate($("#txt_PackedDate").val());
|
||||
var P_date = new Date(PackedDate);
|
||||
var ExpiryDate = Unibase.Platform.Helpers.DateTimeHelper.Instance().formatServerDate($("#txt_ExpiryDate").val());
|
||||
var E_date = new Date(ExpiryDate);
|
||||
if (PackedDate > ExpiryDate) {
|
||||
MessageHelper.Instance().showError("Expiry Date cannot be Less than PackedDate ", 'bizgaze_BatchErrorMessages');
|
||||
return false;
|
||||
}
|
||||
var postData = {
|
||||
ItemId: id,
|
||||
MrpId: Number($(".txtAutoComplete_MRP option:selected").val()),
|
||||
PackedDate: P_date,
|
||||
ExpiryDate: E_date,
|
||||
BatchNo: $("#txt_BatchNo").val(),
|
||||
BatchId: 0
|
||||
};
|
||||
Bizgaze.Apps.Transact.Managers.PriceListManager.Instance().saveBatch(postData).then(function (response) {
|
||||
if (response.errors == null) {
|
||||
$('#' + containerid).modal('hide');
|
||||
$('#' + containerid).remove();
|
||||
MessageHelper.Instance().showSuccess(response.message, '');
|
||||
if (Batch.instance.rowlength != 0 && response.result != null) {
|
||||
Bizgaze.Apps.Transact.Controls.SplitItem.Instance().bindDetails(response, Batch.instance.rowlength);
|
||||
}
|
||||
}
|
||||
else {
|
||||
MessageHelper.Instance().showError(response.message, 'bizgaze_BatchErrorMessages');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === undefined) {
|
||||
this.instance = new Batch();
|
||||
}
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
Controls.Batch = Batch;
|
||||
})(Controls = Transact.Controls || (Transact.Controls = {}));
|
||||
})(Transact = Apps.Transact || (Apps.Transact = {}));
|
||||
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
|
||||
})(Bizgaze || (Bizgaze = {}));
|
||||
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
@@ -0,0 +1,600 @@
|
||||
var Bizgaze;
|
||||
(function (Bizgaze) {
|
||||
let Apps;
|
||||
(function (Apps) {
|
||||
let Transact;
|
||||
(function (Transact) {
|
||||
let Controls;
|
||||
(function (Controls) {
|
||||
class DcEditMrp extends Unibase.Platform.Core.BaseComponent {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.LoBId = 0;
|
||||
this.DcTypeId = 0;
|
||||
this.BranchId = 0;
|
||||
this.InventorySetting = 0;
|
||||
this.Ids = [0];
|
||||
this.Type = "";
|
||||
this.DcItemList = [];
|
||||
this.MrpSettingValue = "";
|
||||
}
|
||||
init(formpropertyid, prop, callback) {
|
||||
var instance = this;
|
||||
instance.DcItemList = [];
|
||||
instance.Ids = [0];
|
||||
instance.LoBId = Number(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_lobid").Value);
|
||||
instance.DcTypeId = Number(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_dctypeid").Value);
|
||||
instance.BranchId = Number(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_shipfromaddressid").Value);
|
||||
if (instance.DcTypeId == 1 || instance.DcTypeId == 3) {
|
||||
instance.BranchId = Number(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_shiptoaddressid").Value);
|
||||
}
|
||||
instance.fileCacheHelper.loadJsFile("apps/transact/managers/inventory/dcmanager.js", function () {
|
||||
instance.fileCacheHelper.loadJsFile("apps/transact/enums/enum.js", function () {
|
||||
instance.fileCacheHelper.loadJsFile("apps/transact/controls/pricelist/mrp.js", function () {
|
||||
instance.fileCacheHelper.loadJsFile("apps/transact/enums/enum.js", function () {
|
||||
instance.fileCacheHelper.loadJsFile("apps/transact/controls/inventory/dcitem.component.js", function () {
|
||||
instance.loadControlSettings(prop.ControlJsonText, prop.FormPropertyId);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
loadControl(containerid, prop) {
|
||||
let html = '<div class=""><input type="hidden" id="hdn_customcontrol" class="value-control" value="Bizgaze.Apps.Transact.Controls.DcEditMrp.Instance().getDcItems();"><div class="card-body"><div class="row qnty_controls lineheight wrapper-sm"><div class="col-lg-6 col-md-6 pl-0 min-padding"><strong class="EnabledType" id="ItemEnableType"></strong></div>' +
|
||||
'<div class="col-lg-6 col-md-6 d-lg-block d-md-none d-none">' +
|
||||
'<div class="qty-btns d-flex justify-content-end">' +
|
||||
'<div class="div_SplitchkPieces custom-control custom-checkbox checkbox-primary mr-10 text-right" > ' +
|
||||
'<input type="radio" class="custom-control-input" name="mrp" checked id="Splitchk_SplitPieces"><label class="custom-control-label" for= "Splitchk_SplitPieces">Pieces</label>' +
|
||||
'</div>' +
|
||||
'<div class="div_SplitchkQuantity custom-control custom-checkbox checkbox-primary"><input type="radio" class="custom-control-input" name="mrp" id = "SplitchkEnableQuantity" >' +
|
||||
'<label class="custom-control-label" for= "SplitchkEnableQuantity">Quantity</label>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
html += '<ul class="list-group no-borders row" id ="list-group"><li class="list-group-item MRP-row hidden added-row "></li></ul>';
|
||||
$("#" + containerid).html(html);
|
||||
}
|
||||
loadControlSettings(controlsettingjson, formpropertyid) {
|
||||
var instance = this;
|
||||
instance.getLobSettings(instance.LoBId, instance.BranchId);
|
||||
$("#Splitchk_SplitPieces").on("click", function () {
|
||||
var Class = "Mrp-row";
|
||||
if (DcEditMrp.instance.Type == "Batch") {
|
||||
Class = "Batch-row Batch-addedrow";
|
||||
}
|
||||
var packs = Number(($("#hf_packs").val() == undefined) ? 0 : $("#hf_packs").val());
|
||||
var pieces = Number(($("#hf_pieces").val() == undefined) ? 0 : $("#hf_pieces").val());
|
||||
if ($("#Splitchk_SplitPieces").is(":checked")) {
|
||||
$("#hdr_value").text("Cartons/Pieces");
|
||||
var html2 = '<div"><div class="row"><div class="col-6"><div class="floating-label-form-group form-group floating-label"><div class="input-group"><span class=""><a class="" href="javascript:;"><span onmousedown="event.preventDefault ?event.preventDefault(): event.returnValue = false" class="quantity_minus btn-icon-wrap" style="color:deepskyblue" id="span_minus"><i class="fa fa-minus quantity-minus pull-left"></i></span></a></span>' +
|
||||
'<input id="txt_Cartons" value="' + packs + '" min="0" value="" onkeypress="return Bizgaze.Apps.Transact.Controls.DcItem.Instance().isNumberKey(event)" data-placeholder="0" placeholder="Cartons" data-label="Cartons" class="allownumericonly txtDC_CartonsCount txtDC_ItemCount form-control value-control floating-label-control text-center" type="text" style="width:45px"></div></div></div><div class="col-6"><div class="floating-label-form-group form-group floating-label ">' +
|
||||
'<div class="input-group"><input value="' + pieces + '" min="0" onkeypress="return Bizgaze.Apps.Transact.Controls.DcItem.Instance().isNumberKey(event)" data-placeholder="0" placeholder="0" data-label="Pieces" class="allownumericonly txtDC_PieceCount txtDC_ItemCount form-control value-control floating-label-control text-center" id="txt_Pieces" type = "text" style="width:45px"> ' +
|
||||
'<span class=""><a class="" href="javascript:;"><span onmousedown="event.preventDefault ?event.preventDefault(): event.returnValue = false" class="quantity_plus btn-icon-wrap" style="color:deepskyblue" id="span_plus"><i class="fa fa-plus quantity-minus pull-left" id="txt_plus"></i></span></a></span></div></div ></div ></div>';
|
||||
}
|
||||
else {
|
||||
$("#hdr_value").text("Cartons");
|
||||
var html2 = '<div>' +
|
||||
'<div class="floating-label-form-group" id="Carton_Pieces_"><div class="input-group" id="div_Cartons">' +
|
||||
"<span class=''><a class='' href='javascript:;'><span onmousedown='event.preventDefault ?event.preventDefault(): event.returnValue = false' class='quantity_minus btn-icon-wrap' style='color:deepskyblue' id='span_minus' + rowid + ''><i class='fa fa-minus quantity-minus pull-left'></i></span></a></span>" +
|
||||
'<input type="text" id="txt_Cartons" min="0" style="margin-top:10px;" value="' + packs + '" class="txtDC_CartonsCount form-control allownumericonly value-control floating-label-control text-center" data-isdynamic="false" placeholder="Cartons" data-placeholder="Cartons" data-label="Cartons" onkeypress="return Bizgaze.Apps.Transact.Controls.DcItem.Instance().isNumberKey(event)">' +
|
||||
"<span class=''><a class='' href='javascript:;'><span onmousedown='event.preventDefault ?event.preventDefault(): event.returnValue = false' class='quantity_plus btn-icon-wrap' style='color:deepskyblue' id='span_plus' + rowid + ''><i class='fa fa-plus quantity-minus pull-left' id='txt_plus'+ rowid + ''></i></span></a></span>" +
|
||||
'</div></div></div>';
|
||||
}
|
||||
$('.SpiltCarton_Pieces_class_').html(html2);
|
||||
$('.SpiltCarton_Pieces_class_').find(".quantity_plus").unbind().click(function () {
|
||||
Bizgaze.Apps.Transact.Controls.DcEditMrp.Instance().plus($('.SpiltCarton_Pieces_class_'));
|
||||
});
|
||||
$('.SpiltCarton_Pieces_class_').find(".quantity_minus").unbind().click(function () {
|
||||
Bizgaze.Apps.Transact.Controls.DcEditMrp.Instance().minus($('.SpiltCarton_Pieces_class_'));
|
||||
});
|
||||
$('.SpiltCarton_Pieces_class_').find(".txtDC_PieceCount").unbind().click(function () {
|
||||
$("#hf_packs_onclick").val("0");
|
||||
$("#hf_Pieces_onclick").val("1");
|
||||
});
|
||||
$('.SpiltCarton_Pieces_class_').find(".txtDC_CartonsCount").unbind().click(function () {
|
||||
$("#hf_packs_onclick").val("1");
|
||||
$("#hf_Pieces_onclick").val("0");
|
||||
});
|
||||
});
|
||||
$("#SplitchkEnableQuantity").on("click", function () {
|
||||
var Class = "Mrp-row";
|
||||
if (DcEditMrp.instance.Type == "Batch") {
|
||||
Class = "Batch-row";
|
||||
}
|
||||
var packs = Number(($("#hf_packs").val() == undefined) ? 0 : $("#hf_packs").val());
|
||||
var pieces = Number(($("#hf_pieces").val() == undefined) ? 0 : $("#hf_pieces").val());
|
||||
var Quantity = (Number($("#hf_PackCount").val()) * Number($("#hf_PackSize").val()) * packs) + (pieces * Number($("#hf_PackSize").val()));
|
||||
var html2 = '<div>' +
|
||||
'<div class="floating-label-form-group" id="Qty_Carton_Pieces_">' +
|
||||
'<div class="input-group" id="div_Cartons">' +
|
||||
"<span class=''><a class='' href='javascript:;'><span onmousedown='event.preventDefault ?event.preventDefault(): event.returnValue = false' class='btn-icon-wrap quantity_minus' style='color:deepskyblue' id='span_minus' + rowid + ''><i class='fa fa-minus quantity-minus pull-left' id='txt_minus'></i></span></a></span>";
|
||||
if ($("#SplitchkEnableQuantity").is(":checked")) {
|
||||
html2 += '<input type="text" style="margin-top:0px;" id="txt_Quantity" min="0" onkeypress="return Bizgaze.Apps.Transact.Controls.DcItem.Instance().isNumberKey(event)" value="' + Quantity + '" class="allownumericonly mr-20 txtDC_CartonsCount form-control value-control floating-label-control text-center" data-isdynamic="false" placeholder="Quantity" data-placeholder="Quantity" data-label="Quantity">';
|
||||
}
|
||||
else {
|
||||
var Quantity = Number($("#txt_Quantity").val());
|
||||
packs = (Quantity / (Number($("#hf_PackCount").val()) * Number($("#hf_PackSize").val())));
|
||||
packs = packs == undefined ? 0 : packs;
|
||||
html2 += '<input type="text" id="txt_Cartons" min="0" style="margin-top:10px;" value="' + packs + '" class="txtDC_CartonsCount form-control allownumericonly value-control floating-label-control text-center" data-isdynamic="false" placeholder="Cartons" data-placeholder="Cartons" data-label="Cartons" onkeypress="return Bizgaze.Apps.Transact.Controls.DcItem.Instance().isNumberKey(event)">';
|
||||
}
|
||||
html2 += "<span class=''><a class='' href='javascript:;'><span onmousedown='event.preventDefault ?event.preventDefault(): event.returnValue = false' class='btn-icon-wrap quantity_plus' style='color:deepskyblue' id='span_plus' + rowid + ''><i class='fa fa-plus quantity-minus pull-left' id='txt_plus'></i></span></a></span>" +
|
||||
'</div></div></div>';
|
||||
$('.SpiltCarton_Pieces_class_').html(html2);
|
||||
if (Bizgaze.Apps.Transact.Controls.DcItem.Instance().IsWidget) {
|
||||
$("#txt_Cartons").prop('disabled', true);
|
||||
$("#txt_Quantity").prop('disabled', true);
|
||||
$("#txt_plus").addClass('hidden');
|
||||
$("#txt_minus").addClass('hidden');
|
||||
}
|
||||
$('.SpiltCarton_Pieces_class_').find(".quantity_plus").unbind().click(function () {
|
||||
Bizgaze.Apps.Transact.Controls.DcEditMrp.Instance().plus($('.SpiltCarton_Pieces_class_'));
|
||||
});
|
||||
$('.SpiltCarton_Pieces_class_').find(".quantity_minus").unbind().click(function () {
|
||||
Bizgaze.Apps.Transact.Controls.DcEditMrp.Instance().minus($('.SpiltCarton_Pieces_class_'));
|
||||
});
|
||||
});
|
||||
var model = Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds[Unibase.Platform.Helpers.NavigationHelper.ModalContainerIds.length - 1];
|
||||
$("#" + model).find(".btn_Save_Form").click(function () {
|
||||
var MrpId = Number($("#select_" + instance.Type).val());
|
||||
if (MrpId == 0) {
|
||||
MessageHelper.Instance().showError("Please Select MRP", 'div_ErrorMessage_' + Unibase.Platform.Forms.Components.FormViewer.instance.FormId);
|
||||
}
|
||||
});
|
||||
}
|
||||
loadPropertySettings(propertysettings, formpropertyid, DocPropertyName) {
|
||||
return null;
|
||||
}
|
||||
bindEditFormDetails(formpropertyid, propval, DocPropertyName) {
|
||||
return null;
|
||||
}
|
||||
GetDcItem(DcItemId) {
|
||||
Bizgaze.Apps.Transact.Managers.DCManager.Instance().getDcItemsbyId(DcItemId).then(function (responce) {
|
||||
var dataRow = {
|
||||
ItemId: responce.result.ItemId,
|
||||
ItemName: responce.result.ItemName,
|
||||
PendingQty: 0,
|
||||
DcItemId: responce.result.DcItemId,
|
||||
DeliveredQty: responce.result.in_DeliveredQty,
|
||||
MrpId: responce.result.MrpId,
|
||||
Mrp: responce.result.Mrp,
|
||||
BatchId: responce.result.BatchId,
|
||||
BatchNo: responce.result.BatchNo,
|
||||
SKU: 0,
|
||||
OrderItemId: responce.result.OrderItemId,
|
||||
OldMRPId: 0,
|
||||
OldMRP: 0,
|
||||
Cartons: responce.result.Packs,
|
||||
Pieces: responce.result.Pieces,
|
||||
Quantity: responce.result.Quantity,
|
||||
DamagedQty: responce.result.DamagedQty,
|
||||
EnableMRP: responce.result.EnableMRP,
|
||||
EnableBatch: responce.result.EnableBatch,
|
||||
PackCount: responce.result.PackCount,
|
||||
PackSize: responce.result.PackSize,
|
||||
ParentId: responce.result.ParentId
|
||||
};
|
||||
Bizgaze.Apps.Transact.Controls.DcEditMrp.instance.AddBatchMrpRow(dataRow);
|
||||
});
|
||||
}
|
||||
AddBatchMrpRow(row) {
|
||||
var instance = this;
|
||||
var Class = "";
|
||||
var MRP_hidden = "hidden";
|
||||
Class = "Mrp-row Mrp-addedrow";
|
||||
MRP_hidden = "hidden";
|
||||
instance.Type = "MRP";
|
||||
$("#ItemEnableType").text("MRP(Qnty)");
|
||||
if (row.EnableBatch == true && instance.MrpSettingValue == "Batch/MRP") {
|
||||
Class = "Batch-row Batch-addedrow";
|
||||
$("#ItemEnableType").text("Batch(Quantity)");
|
||||
instance.Type = "Batch";
|
||||
MRP_hidden = "";
|
||||
}
|
||||
var html = '<div class="row ' + Class + ' SplitDcItemListRow pl-15" id="div_"><input type="hidden" id="hf_PackSize" value="' + row.PackSize + '"><input type="hidden" id="hf_PackCount" value="' + row.PackCount + '"><input type="hidden" id="hf_packs" value="' + row.Cartons + '"><input type="hidden" id="hf_pieces" value="' + row.Pieces + '"><input type="hidden" id="txt_id" value="">' +
|
||||
'<li class="' + instance.Type + '-row-added col-lg-12 justify-content-between pr-0 row" id="li_"><input type="hidden" id="hf_packs_onclick' + '" value="1"><input type="hidden" id="hf_Pieces_onclick" value="0"><input type="hidden" id="hf_DcItemId" value=' + row.DcItemId + '><input type="hidden" id="hf_ItemId" value=' + row.ItemId + '><input type="hidden" id="hf_OrderItemId" value=' + row.OrderItemId + '><input type="hidden" id="hf_OrderId" value=' + row.OrderId + '><input type="hidden" id="hf_DamagedQty" value="' + row.DamagedQty + '">' +
|
||||
'<div class="row col-lg-6 pr-0" id="div_Split">' +
|
||||
'<div class="col-sm-12 mt-20 pr-0"><div class="row mt - 10"><select style="width:100%; " id="select_' + instance.Type + '" value="" class="txt_SearchItems form-control value-control floating-label-control select_' + instance.Type + ' required" data-isdynamic="false" placeholder="Select ' + instance.Type + '" data-placeholder="Select ' + instance.Type + '" data-label="Select "' + instance.Type + '""></select><input type="hidden" class="hf_' + instance.Type + '_Id" id="hf_Id' + instance.Type + '"/><input type="hidden" id="hfold_' + instance.Type + '"><input type="hidden" id="hf_' + instance.Type + '_Id_"></div></div>' +
|
||||
'<input type="hidden" id="MRP_Qty" class="MRP_Qty" value="0"><div class="col-sm-2 ' + MRP_hidden + '"><div class="floating-label-form-group"><label class="text-center">MRP</label><div class="input-group"><input type="text" class="Batch_Mrp text-center form-control" disabled="disabled" placeholder="0.00" value="' + row.Mrp + '"><input type="hidden" class="hf_MRPId"/></div></div></div></div>' +
|
||||
'<div class="col-lg-6 mt-20 pr-0"><div id="Split_Carton_Pieces" class="SpiltCarton_Pieces_class_ d-lg-block d-none d-sm-none"></div>' +
|
||||
'<div class="d-block d-lg-none">' +
|
||||
'<div class="div_SplitchkPieces1 custom-control custom-checkbox checkbox-primary text-right d-flex row pl-0 mt-10" > ' +
|
||||
'<div class="col-2 col-md-1 pieces_chck">' +
|
||||
'<input type="radio" class="custom-control-input pieces_chck" name="mrp" checked id="Splitchk_SplitPieces1">' +
|
||||
'<label class="custom-control-label pl-1" for= "Splitchk_SplitPieces1">Pieces</label>' +
|
||||
'</div>' +
|
||||
'<div id="Split_Carton_Pieces" class="SpiltCarton_Pieces_class1_ col-10 col-md-11"></div>' +
|
||||
'</div>' +
|
||||
'<div class="div_SplitchkQuantity1 custom-control custom-checkbox checkbox-primary d-flex row mt-20 pl-0">' +
|
||||
'<div class="col-2 col-md-1 qnty_chck"><input type="radio" class="custom-control-input qnty_chck" name="mrp" id ="SplitchkEnableQuantity1" >' +
|
||||
'<label class="custom-control-label pl-1" for= "SplitchkEnableQuantity1">Quantity</label>' +
|
||||
'</div>' +
|
||||
'<div id="Split_Carton_Pieces" class="SpiltCarton_Pieces_class2_ col-10 col-md-11"></div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div >';
|
||||
if (Bizgaze.Apps.Transact.Controls.DcItem.Instance().IsWidget == true) {
|
||||
html += '<div class="col-sm-1 div_Moreinfo mt-30"><a href="javascript:;" class="default pull-left" title="Edit" data-original-title="Edit"><span class="pull-right btn" style="text-decoration:underline;color:deepskyblue" id="btnDcItem_Edit" onclick="Bizgaze.Apps.Transact.Controls.DcEditMrp.Instance().bindQuantityDetails(' + row.DcItemId + ')">More Info</span></a>';
|
||||
}
|
||||
html += '</li></div> ';
|
||||
$(".MRP-row:last").after(html);
|
||||
var Class = "Mrp-row";
|
||||
if (DcEditMrp.instance.Type == "Batch") {
|
||||
Class = "Batch-row Batch-addedrow";
|
||||
}
|
||||
var packs_val = Number(($("#hf_packs").val() == undefined) ? 0 : $("#hf_packs").val());
|
||||
var pieces_val = Number(($("#hf_pieces").val() == undefined) ? 0 : $("#hf_pieces").val());
|
||||
$("#hdr_value").text("Cartons/Pieces");
|
||||
var html2 = '<div"><div class="row"><div class="col-6"><div class="floating-label-form-group form-group floating-label ml-15"><div class="input-group mobil-pieces"><span class=""><a class="" href="javascript:;"><span onmousedown="event.preventDefault ?event.preventDefault(): event.returnValue = false" class="quantity_minus btn-icon-wrap" style="color:deepskyblue" id="span_minus"><i class="fa fa-minus quantity-minus pull-left"></i></span></a></span>' +
|
||||
'<input id="txt_Cartons" value="' + packs_val + '" min="0" value="" onkeypress="return Bizgaze.Apps.Transact.Controls.DcItem.Instance().isNumberKey(event)" data-placeholder="0" placeholder="Cartons" data-label="Cartons" class="allownumericonly txtDC_CartonsCount txtDC_ItemCount form-control value-control floating-label-control text-center" type="text" style="width:45px;height:24px"></div></div></div><div class="col-6"><div class="floating-label-form-group form-group floating-label ">' +
|
||||
'<div class="input-group mobil-qnty"><input value="' + pieces_val + '" min="0" onkeypress="return Bizgaze.Apps.Transact.Controls.DcItem.Instance().isNumberKey(event)" data-placeholder="0" placeholder="0" data-label="Pieces" class="allownumericonly txtDC_PieceCount txtDC_ItemCount form-control value-control floating-label-control text-center" id="txt_Pieces" type = "text" style="width:45px;height:24px"> ' +
|
||||
'<span class=""><a class="" href="javascript:;"><span onmousedown="event.preventDefault ?event.preventDefault(): event.returnValue = false" class="quantity_plus btn-icon-wrap" style="color:deepskyblue" id="span_plus"><i class="fa fa-plus quantity-minus pull-left" id="txt_plus"></i></span></a></span></div></div ></div ></div>';
|
||||
$('.SpiltCarton_Pieces_class1_').html(html2);
|
||||
$('.SpiltCarton_Pieces_class1_').find(".quantity_plus").unbind().click(function () {
|
||||
Bizgaze.Apps.Transact.Controls.DcEditMrp.Instance().plus($('.SpiltCarton_Pieces_class1_'));
|
||||
});
|
||||
$('.SpiltCarton_Pieces_class1_').find(".quantity_minus").unbind().click(function () {
|
||||
Bizgaze.Apps.Transact.Controls.DcEditMrp.Instance().minus($('.SpiltCarton_Pieces_class1_'));
|
||||
});
|
||||
$('.SpiltCarton_Pieces_class1_').find(".txtDC_PieceCount").unbind().click(function () {
|
||||
$("#hf_packs_onclick").val("0");
|
||||
$("#hf_Pieces_onclick").val("1");
|
||||
});
|
||||
$('.SpiltCarton_Pieces_class1_').find(".txtDC_CartonsCount").unbind().click(function () {
|
||||
$("#hf_packs_onclick").val("1");
|
||||
$("#hf_Pieces_onclick").val("0");
|
||||
});
|
||||
var Class = "Mrp-row";
|
||||
if (DcEditMrp.instance.Type == "Batch") {
|
||||
Class = "Batch-row";
|
||||
}
|
||||
var packs_val = Number(($("#hf_packs").val() == undefined) ? 0 : $("#hf_packs").val());
|
||||
var pieces_val = Number(($("#hf_pieces").val() == undefined) ? 0 : $("#hf_pieces").val());
|
||||
var Quantity_val = (Number($("#hf_PackCount").val()) * Number($("#hf_PackSize").val()) * packs_val) + (pieces_val * Number($("#hf_PackSize").val()));
|
||||
var html2 = '<div>' +
|
||||
'<div class="floating-label-form-group w-90 ml-20" id="Qty_Carton_Pieces_">' +
|
||||
'<div class="input-group" id="div_Cartons">' +
|
||||
"<span class=''><a class='' href='javascript:;'><span onmousedown='event.preventDefault ?event.preventDefault(): event.returnValue = false' class='btn-icon-wrap quantity_minus' style='color:deepskyblue' id='span_minus' + rowid + ''><i class='fa fa-minus quantity-minus pull-left' id='txt_minus'></i></span></a></span>";
|
||||
html2 += '<input type="text" style="margin-top:0px;;height:24px" id="txt_Quantity" min="0" onkeypress="return Bizgaze.Apps.Transact.Controls.DcItem.Instance().isNumberKey(event)" value="' + Quantity_val + '" class="allownumericonly mr-20 txtDC_CartonsCount form-control value-control floating-label-control text-center" data-isdynamic="false" placeholder="Quantity" data-placeholder="Quantity" data-label="Quantity">';
|
||||
html2 +=
|
||||
"<span class=''><a class='' href='javascript:;'><span onmousedown='event.preventDefault ?event.preventDefault(): event.returnValue = false' class='btn-icon-wrap quantity_plus' style='color:deepskyblue' id='span_plus' + rowid + ''><i class='fa fa-plus quantity-minus pull-left' id='txt_plus'></i></span></a></span>" +
|
||||
'</div></div></div>';
|
||||
$('.SpiltCarton_Pieces_class2_').html(html2);
|
||||
if (Bizgaze.Apps.Transact.Controls.DcItem.Instance().IsWidget) {
|
||||
$("#txt_Cartons").prop('disabled', true);
|
||||
$("#txt_Quantity").prop('disabled', true);
|
||||
$("#txt_plus").addClass('hidden');
|
||||
$("#txt_minus").addClass('hidden');
|
||||
}
|
||||
$('.SpiltCarton_Pieces_class2_').find(".quantity_plus").unbind().click(function () {
|
||||
Bizgaze.Apps.Transact.Controls.DcEditMrp.Instance().plus($('.SpiltCarton_Pieces_class2_'));
|
||||
});
|
||||
$('.SpiltCarton_Pieces_class2_').find(".quantity_minus").unbind().click(function () {
|
||||
Bizgaze.Apps.Transact.Controls.DcEditMrp.Instance().minus($('.SpiltCarton_Pieces_class2_'));
|
||||
});
|
||||
$(".SpiltCarton_Pieces_class2_").addClass("hidden");
|
||||
$(".pieces_chck").click(function () {
|
||||
$(".SpiltCarton_Pieces_class2_").addClass("hidden");
|
||||
$(".SpiltCarton_Pieces_class1_").removeClass("hidden");
|
||||
});
|
||||
$(".qnty_chck").click(function () {
|
||||
$(".SpiltCarton_Pieces_class2_").removeClass("hidden");
|
||||
$(".SpiltCarton_Pieces_class1_").addClass("hidden");
|
||||
});
|
||||
var element = $("." + instance.Type + "-row:last");
|
||||
Bizgaze.Apps.Transact.Controls.DcEditMrp.instance.LoadBatchandMrp(element, instance.Type, row.ItemId);
|
||||
$("#select_" + instance.Type).on("change", function () {
|
||||
let obj = [];
|
||||
obj.push({
|
||||
ItemId: row.ItemId,
|
||||
element: null,
|
||||
});
|
||||
if ($("#select_" + instance.Type + " option:selected").text() == 'Create MRP') {
|
||||
var itemobj = Bizgaze.Apps.Transact.Controls.MRP.Instance();
|
||||
itemobj.DcEditMrp = true;
|
||||
Unibase.Platform.Helpers.NavigationHelper.Instance().popup(obj, "", itemobj, null, Unibase.Platform.Helpers.Size.DockLeft);
|
||||
}
|
||||
else if ($("#select_" + instance.Type + " option:selected").text() == 'Create Batch') {
|
||||
var item = Bizgaze.Apps.Transact.Controls.Batch.Instance();
|
||||
Unibase.Platform.Helpers.NavigationHelper.Instance().popup(row.ItemId, "", item, null, Unibase.Platform.Helpers.Size.DockLeft);
|
||||
}
|
||||
});
|
||||
var hiddenclass = "";
|
||||
var disabled = "";
|
||||
if (Bizgaze.Apps.Transact.Controls.DcItem.Instance().IsWidget == true) {
|
||||
hiddenclass = "hidden";
|
||||
disabled = "disabled";
|
||||
}
|
||||
if ($("#Splitchk_SplitPieces").is(":checked") || (row.Cartons != 0 && row.Pieces != 0 && instance.InventorySetting != Bizgaze.Apps.Transact.Enums.InventoryApplyType.Pieces)) {
|
||||
if (row.Pieces == "0")
|
||||
row.Pieces = "";
|
||||
$("#Splitchk_SplitPieces").prop("checked", true);
|
||||
var html2 = '<div"><div class="row"><div class="col-6"><div class="floating-label-form-group form-group floating-label">' +
|
||||
'<div class="input-group"><i class="fa fa-minus txt_minus quantity-minus pull-left " style="color:deepskyblue;padding-top:10px;" id = "txt_minus"></i > ' +
|
||||
'<input id="txt_Cartons" min="0" value="' + row.Cartons + '" onkeypress="return Bizgaze.Apps.Transact.Controls.DcItem.Instance().isNumberKey(event)" data-placeholder="0" placeholder="Cartons" data-label="Cartons" class="allownumericonly txtDC_CartonsCount form-control value-control floating-label-control text-center" type="text" style="width:45px">' +
|
||||
'</div></div></div><div class="col-6"><div class="floating-label-form-group form-group floating-label ">' +
|
||||
'<div class="input-group"><input value="' + row.Pieces + '" min="0" onkeypress="return Bizgaze.Apps.Transact.Controls.DcItem.Instance().isNumberKey(event)" data-placeholder="0" placeholder="Pieces" data-label="Pieces" class="allownumericonly txtDC_PieceCount form-control value-control floating-label-control text-center" id="txt_Pieces" type = "text" style="width:45px"> ' +
|
||||
'<i class="fa fa-plus quantity-plus pull-right " style="color:deepskyblue;padding-top:10px;" id="txt_plus" ></i>' +
|
||||
'</div></div ></div ></div>';
|
||||
}
|
||||
else {
|
||||
var html2 = '<div>' +
|
||||
'<div class="floating-label-form-group" id="Qty_Carton_Pieces_">' +
|
||||
'<div class="input-group" id="div_Cartons">' +
|
||||
"<span class=''><a class='' href='javascript:;'><span onmousedown='event.preventDefault ?event.preventDefault(): event.returnValue = false' class='quantity_minus btn-icon-wrap " + hiddenclass + "' style='color:deepskyblue' id='span_minus'><i class='fa fa-minus pull-left' id='txt_minus'></i></span></a></span>";
|
||||
if ($("#SplitchkEnableQuantity").is(":checked") == true || instance.InventorySetting == Bizgaze.Apps.Transact.Enums.InventoryApplyType.Quantity) {
|
||||
html2 += '<input type="text" id="txt_Quantity" min="0" value="' + row.Quantity + '" onkeypress="return Bizgaze.Apps.Transact.Controls.DcItem.Instance().isNumberKey(event)" value="" class="allownumericonly txtDC_CartonsCount form-control value-control floating-label-control text-center" data-isdynamic="false" placeholder="Quantity" data-placeholder="Quantity" data-label="Quantity" ' + disabled + '>';
|
||||
html2 += '<input type="hidden" id="hdn_Quantity" value="' + row.Quantity + '">';
|
||||
}
|
||||
else if (instance.InventorySetting == Bizgaze.Apps.Transact.Enums.InventoryApplyType.Pieces) {
|
||||
html2 += '<input type="text" id="txt_Pieces" min="0" onkeypress="return Bizgaze.Apps.Transact.Controls.DcItem.Instance().isNumberKey(event)" value="' + row.Pieces + '" class="allownumericonly txtDC_CartonsCount form-control value-control floating-label-control text-center" data-isdynamic="false" placeholder="Pieces" data-placeholder="Pieces" data-label="Pieces">';
|
||||
html2 += '<input type="hidden" id="hdn_Pieces" value="' + row.Pieces + '">';
|
||||
}
|
||||
else {
|
||||
html2 += '<input type="text" id="txt_Cartons" value="' + row.Cartons + '" min="0" onkeypress="return Bizgaze.Apps.Transact.Controls.DcItem.Instance().isNumberKey(event)" value="" class="allownumericonly txtDC_CartonsCount allownumericonly form-control value-control floating-label-control text-center" data-isdynamic="false" placeholder="Cartons" data-placeholder="Cartons" data-label="Cartons" ' + disabled + '>';
|
||||
html2 += '<input type="hidden" id="hdn_Cartons" value="' + row.Cartons + '">';
|
||||
}
|
||||
html2 += "<span class=''><a class='' href='javascript:;'><span onmousedown='event.preventDefault ?event.preventDefault(): event.returnValue = false' class='quantity_plus btn-icon-wrap " + hiddenclass + "' style='color:deepskyblue' id='span_plus'><i class='fa fa-plus pull-left'; id='txt_plus'></i></span></a></span>" +
|
||||
'</div></div></div>';
|
||||
}
|
||||
if (instance.Type == "MRP" || (row.DcItemId != 0 && instance.Type == "")) {
|
||||
if (row.MrpId != 0 || row.DcItemId != 0) {
|
||||
$("#select_" + instance.Type).empty();
|
||||
$('.hf_' + instance.Type + '_Id').val(row.MrpId);
|
||||
DcEditMrp.instance.Ids.push(row.MrpId);
|
||||
DcEditMrp.instance.getMrpQty('', row.MrpId, row.ItemId, DcEditMrp.instance.BranchId);
|
||||
DcEditMrp.instance.GetBatchandMRPQty(row.MrpId, row.Mrp, 0, instance.Type, row.ItemId);
|
||||
}
|
||||
}
|
||||
else if (instance.Type == "Batch" || row.DcItemId != 0) {
|
||||
if (row.BatchId != 0) {
|
||||
element.find(".select_" + instance.Type + "").empty();
|
||||
element.find('.hf_' + instance.Type + '_Id').val(row.BatchId);
|
||||
element.find(".Batch_Mrp").val(row.Mrp);
|
||||
element.find(".hf_MRPId").val(row.MrpId);
|
||||
DcEditMrp.instance.Ids.push(row.BatchId);
|
||||
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/transact/controls/pricelist/managers/pricelistmanager.js", function () {
|
||||
Bizgaze.Apps.Transact.Managers.PriceListManager.Instance().getbatch(row.BatchId).then(function (result) {
|
||||
DcEditMrp.instance.GetBatchandMRPQty(row.MrpId, row.Mrp, 0, instance.Type, row.ItemId);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
$('.SpiltCarton_Pieces_class_').html(html2);
|
||||
$('.SpiltCarton_Pieces_class_').find("#txt_Cartons").blur(function () {
|
||||
});
|
||||
$('.SpiltCarton_Pieces_class_').find("#txt_Quantity").blur(function () {
|
||||
});
|
||||
var quantityelement = $('.SpiltCarton_Pieces_class_' + ':last');
|
||||
$('.SpiltCarton_Pieces_class_').find(".quantity_minus").unbind().click(function () {
|
||||
Bizgaze.Apps.Transact.Controls.DcEditMrp.Instance().minus(quantityelement);
|
||||
});
|
||||
$('.SpiltCarton_Pieces_class_').find(".quantity_plus").unbind().click(function () {
|
||||
Bizgaze.Apps.Transact.Controls.DcEditMrp.Instance().plus(quantityelement);
|
||||
});
|
||||
if (row.ParentId != 0) {
|
||||
$("#txt_Quantity").attr('disabled', "true");
|
||||
$("#txt_Pieces").attr('disabled', "true");
|
||||
$("#txt_Cartons").attr('disabled', "true");
|
||||
$("#span_minus").addClass("hidden");
|
||||
$("#span_plus").addClass("hidden");
|
||||
}
|
||||
}
|
||||
LoadBatchandMrp(element, Type, ItemId) {
|
||||
var instance = DcEditMrp.Instance();
|
||||
var AutoText = $("#select_" + Type);
|
||||
var hdnAutoId = $(".hf_" + Type + "_Id");
|
||||
var isClaim = false;
|
||||
if (instance.DcTypeId == Bizgaze.Apps.Transact.Enums.DcType.ClaimInward || instance.DcTypeId == Bizgaze.Apps.Transact.Enums.DcType.ClaimOutward)
|
||||
isClaim = true;
|
||||
var BranchId = instance.BranchId;
|
||||
var OrderType = "Sales";
|
||||
var dctype = instance.DcTypeId;
|
||||
if (instance.DcTypeId == Bizgaze.Apps.Transact.Enums.DcType.Inward) {
|
||||
var OrderType = "Purchase";
|
||||
}
|
||||
if ($("#hf_Exchange").val() == "true") {
|
||||
if (dctype == 1)
|
||||
dctype = 2;
|
||||
else if (dctype == 2)
|
||||
dctype = 1;
|
||||
if (OrderType == "Purchase")
|
||||
OrderType = "Sales";
|
||||
else if (OrderType == "Sales")
|
||||
OrderType = "Purchase";
|
||||
}
|
||||
var url = _appsettings.server_url() + '/apis/v4/bizgaze/transact/pricelists/MrpsAutoComplete/itemid/' + ItemId + '/mrpids/' + DcEditMrp.instance.Ids.toString() + '/invoicetype/' + OrderType + '/dctype/' + dctype + '/branchid/' + BranchId + '/isinvoice/false';
|
||||
if (Type == "Batch") {
|
||||
url = _appsettings.server_url() + '/apis/v4/bizgaze/transact/pricelists/BatchAutoComplete/itemid/' + ItemId + '/ids/' + DcEditMrp.instance.Ids.toString() + '/invoicetype/' + OrderType + '/dctype/' + dctype + '/branchid/' + BranchId + '/isinvoice/false';
|
||||
}
|
||||
var id = 0;
|
||||
AutoCompleteHelper.getHelper().Create(AutoText, hdnAutoId, url, function (response) {
|
||||
if (id != response.id) {
|
||||
id = response.id;
|
||||
if ($("#hfold_" + Type).val() != "")
|
||||
DcEditMrp.instance.Ids.splice(DcEditMrp.instance.Ids.findIndex(m => m == $("#hfold_" + Type).val()), 1);
|
||||
DcEditMrp.instance.Ids.push(id);
|
||||
$("#hfold_" + Type).val(response.id);
|
||||
$("#hf_" + Type + "_Id_").val(response.id);
|
||||
if (response.id != 0 && Type == "Batch") {
|
||||
DcEditMrp.instance.getMrp(response.id);
|
||||
}
|
||||
else {
|
||||
DcEditMrp.instance.getMrpQty(element, id, ItemId, BranchId);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
getMrp(batchId) {
|
||||
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/transact/controls/pricelist/managers/pricelistmanager.js", function () {
|
||||
Bizgaze.Apps.Transact.Managers.PriceListManager.Instance().getbatch(batchId).then(function (result) {
|
||||
$(".Batch_Mrp").val(result.result.Mrp);
|
||||
$(".hf_MRPId").val(result.result.MrpId);
|
||||
});
|
||||
});
|
||||
}
|
||||
getMrpQty(element, id, ItemId, BranchId) {
|
||||
Bizgaze.Apps.Transact.Managers.DCManager.Instance().getMrpDcQty(ItemId, BranchId, id, false).then(function (responce) {
|
||||
$("#MRP_Qty").val(responce.result);
|
||||
});
|
||||
}
|
||||
getDcItems() {
|
||||
var instance = this;
|
||||
instance.DcItemList = [];
|
||||
var MrpId = 0;
|
||||
var Mrp = 0;
|
||||
var BatchId = 0;
|
||||
var BatchNo = 0;
|
||||
if (instance.Type == "MRP") {
|
||||
MrpId = Number($("#select_" + instance.Type).val());
|
||||
if (MrpId == 0) {
|
||||
MessageHelper.Instance().showError("Please Select MRP", 'div_ErrorMessage_' + Unibase.Platform.Forms.Components.FormViewer.instance.FormId);
|
||||
return false;
|
||||
}
|
||||
if (MrpId == -1)
|
||||
MrpId = 0;
|
||||
}
|
||||
else if (instance.Type == "Batch") {
|
||||
BatchId = Number($("#select_" + instance.Type).val());
|
||||
BatchNo = $("#select_" + instance.Type + " option:selected").text();
|
||||
Mrp = $(".Batch_Mrp").val();
|
||||
MrpId = Number($(".hf_MRPId").val());
|
||||
if (MrpId == -1)
|
||||
MrpId = 0;
|
||||
}
|
||||
var PackSize = Number($("#hf_PackSize").val());
|
||||
var PackCount = Number($("#hf_PackCount").val());
|
||||
var packs = Number($(".SpiltCarton_Pieces_class_").find("#txt_Cartons").val() == undefined ? 0 : $("#txt_Cartons").val());
|
||||
var pieces = Number(($(".SpiltCarton_Pieces_class_").find("#txt_Pieces").val() == undefined) ? 0 : $("#txt_Pieces").val());
|
||||
var Qty = (Number(PackCount) * Number(PackSize) * packs) + (pieces * Number(PackSize));
|
||||
if (window.innerWidth < 992) {
|
||||
packs = Number($(".SpiltCarton_Pieces_class1_").find("#txt_Cartons").val() == undefined ? 0 : $(".SpiltCarton_Pieces_class1_").find("#txt_Cartons").val());
|
||||
pieces = Number(($(".SpiltCarton_Pieces_class1_").find("#txt_Pieces").val() == undefined) ? 0 : $(".SpiltCarton_Pieces_class1_").find("#txt_Pieces").val());
|
||||
Qty = (Number(PackCount) * Number(PackSize) * packs) + (pieces * Number(PackSize));
|
||||
}
|
||||
if ($("#SplitchkEnableQuantity").is(":checked") || instance.InventorySetting == Bizgaze.Apps.Transact.Enums.InventoryApplyType.Quantity) {
|
||||
packs = (Number($(".SpiltCarton_Pieces_class_").find("#txt_Quantity").val()) / (Number(PackCount) * Number(PackSize)));
|
||||
pieces = Number(Number($(".SpiltCarton_Pieces_class_").find("#txt_Quantity").val()) - packs * Number(PackCount) * Number(PackSize)) / Number(PackSize);
|
||||
Qty = Number($("#txt_Quantity").val());
|
||||
}
|
||||
if ($("#SplitchkEnableQuantity1").is(":checked") || instance.InventorySetting == Bizgaze.Apps.Transact.Enums.InventoryApplyType.Quantity) {
|
||||
if (window.innerWidth < 992) {
|
||||
packs = (Number($(".SpiltCarton_Pieces_class2_").find("#txt_Quantity").val()) / (Number(PackCount) * Number(PackSize)));
|
||||
pieces = Number(Number($(".SpiltCarton_Pieces_class2_").find("#txt_Quantity").val()) - packs * Number(PackCount) * Number(PackSize)) / Number(PackSize);
|
||||
Qty = Number($(".SpiltCarton_Pieces_class2_").find("#txt_Quantity").val());
|
||||
}
|
||||
}
|
||||
instance.DcItemList.push({
|
||||
DcId: Unibase.Themes.Providers.DetailHelper.recordId,
|
||||
DcItemId: Number($("#hf_DcItemId").val()),
|
||||
Packs: packs,
|
||||
Pieces: pieces,
|
||||
BatchId: BatchId,
|
||||
BatchNo: BatchNo,
|
||||
ItemId: Number($("#hf_ItemId").val()),
|
||||
DeliveredQty: Qty,
|
||||
OrderItemId: Number($("#hf_OrderItemId").val()),
|
||||
OrderId: Number(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_orderid").Value),
|
||||
OldDcItemId: 0,
|
||||
MrpId: MrpId,
|
||||
Quantity: Qty,
|
||||
Cartons: packs,
|
||||
AutoMRPAllocation: false,
|
||||
ExchangeDC: false,
|
||||
OldBranchId: instance.BranchId
|
||||
});
|
||||
return instance.DcItemList;
|
||||
}
|
||||
plus(element) {
|
||||
if ($("#hf_packs_onclick").val() == "1" && $("#hf_Pieces_onclick").val() == "0") {
|
||||
var qtycount = Number(element.find(".txtDC_CartonsCount").val());
|
||||
element.find(".txtDC_CartonsCount").val(qtycount + 1);
|
||||
}
|
||||
else if ($("#hf_packs_onclick").val() == "0" && $("#hf_Pieces_onclick").val() == "1") {
|
||||
var qtyPiece = Number(element.find(".txtDC_PieceCount").val());
|
||||
element.find(".txtDC_PieceCount").val(qtyPiece + 1);
|
||||
}
|
||||
}
|
||||
minus(element) {
|
||||
if ($("#hf_packs_onclick").val() == "1" && $("#hf_Pieces_onclick").val() == "0") {
|
||||
var qtycount = Number(element.find(".txtDC_CartonsCount").val());
|
||||
if (qtycount != 0)
|
||||
element.find(".txtDC_CartonsCount").val(qtycount - 1);
|
||||
}
|
||||
else if ($("#hf_packs_onclick").val() == "0" && $("#hf_Pieces_onclick").val() == "1") {
|
||||
var qtyPiece = Number(element.find(".txtDC_PieceCount").val());
|
||||
if (qtyPiece != 0)
|
||||
element.find(".txtDC_PieceCount").val(qtyPiece - 1);
|
||||
}
|
||||
}
|
||||
GetBatchandMRPQty(MrpId, name, BatchId, Type, ItemId) {
|
||||
var url = 'apis/v4/bizgaze/transact/items/getitemavailability/itemid/' + ItemId + '/branchid/' + DcEditMrp.instance.BranchId + '/mrpid/' + MrpId;
|
||||
Bizgaze.Apps.Transact.Managers.DCManager.Instance().GetBatchandMRPQty(url).then(function (response) {
|
||||
var _name = "";
|
||||
if (Type == "MRP" || Type == "") {
|
||||
_name = (response.result.Mrp) + ' (' + Unibase.Core.Helpers.NumberHelper.Instance().roundNumber(Number($("#MRP_Qty").val()), 2) + ')';
|
||||
$("#select_" + Type).empty();
|
||||
if (MrpId == 0)
|
||||
MrpId = -1;
|
||||
$("#select_" + Type).append(new Option(_name, MrpId));
|
||||
$("#select_" + Type).val(MrpId).trigger("change");
|
||||
$("#select_" + Type).val(MrpId);
|
||||
}
|
||||
else if (Type == "Batch") {
|
||||
_name = 'Batch No.(' + name + ')Qty' + '(' + Unibase.Core.Helpers.NumberHelper.Instance().roundNumber(Number(response.result.Quantity), 2) + ')';
|
||||
$("#select_" + Type).append(new Option(_name, BatchId, true));
|
||||
}
|
||||
});
|
||||
}
|
||||
bindDetails(response) {
|
||||
var data = JSON.parse(response.result);
|
||||
if (DcEditMrp.instance.Type == "MRP") {
|
||||
$("#select_" + DcEditMrp.instance.Type).empty();
|
||||
$("#select_" + DcEditMrp.instance.Type).append(new Option(data.Mrp + '(0)', data.MrpId, true));
|
||||
$('.hf_Id' + DcEditMrp.instance.Type + '_Id').val(data.MrpId);
|
||||
}
|
||||
else if (DcEditMrp.instance.Type == "Batch") {
|
||||
$("#select_" + DcEditMrp.instance.Type).empty();
|
||||
$("#select_" + DcEditMrp.instance.Type).append(new Option(data.BatchNo + '(0)', data.BatchId, true));
|
||||
$('.hf_Id' + DcEditMrp.instance.Type + '_Id').val(data.BatchId);
|
||||
$(".Batch_Mrp").val(data.Mrp);
|
||||
$(".hf_MRPId").val(data.MrpId);
|
||||
}
|
||||
}
|
||||
getLobSettings(LobId, BranchId) {
|
||||
var _instance = this;
|
||||
Bizgaze.Apps.Transact.Managers.DCManager.Instance().getLobSettings(LobId, BranchId, _instance.DcTypeId).then(function (responce) {
|
||||
if (responce.result != null) {
|
||||
if (responce.result.InventoryApplyType != null && responce.result.InventoryApplyType != undefined) {
|
||||
_instance.InventorySetting = responce.result.InventoryApplyType;
|
||||
if (_instance.InventorySetting == Bizgaze.Apps.Transact.Enums.InventoryApplyType.Quantity) {
|
||||
$(".div_SplitchkPieces").addClass("hidden");
|
||||
$(".div_SplitchkQuantity").addClass("hidden");
|
||||
}
|
||||
else if (_instance.InventorySetting == Bizgaze.Apps.Transact.Enums.InventoryApplyType.Pieces) {
|
||||
$(".div_SplitchkPieces").addClass("hidden");
|
||||
$(".div_chkPacks").removeClass("hidden");
|
||||
}
|
||||
else {
|
||||
$(".div_SplitchkPieces").removeClass("hidden");
|
||||
$(".div_SplitchkQuantity").removeClass("hidden");
|
||||
}
|
||||
}
|
||||
_instance.MrpSettingValue = responce.result.ItemType;
|
||||
_instance.GetDcItem($("#hf_pk_value").val());
|
||||
}
|
||||
});
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === undefined) {
|
||||
this.instance = new DcEditMrp();
|
||||
}
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
Controls.DcEditMrp = DcEditMrp;
|
||||
})(Controls = Transact.Controls || (Transact.Controls = {}));
|
||||
})(Transact = Apps.Transact || (Apps.Transact = {}));
|
||||
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
|
||||
})(Bizgaze || (Bizgaze = {}));
|
||||
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
@@ -0,0 +1,41 @@
|
||||
var Bizgaze;
|
||||
(function (Bizgaze) {
|
||||
let Apps;
|
||||
(function (Apps) {
|
||||
let Transact;
|
||||
(function (Transact) {
|
||||
let Controls;
|
||||
(function (Controls) {
|
||||
class DcEditMrp_Setting {
|
||||
loadSettingHtml() {
|
||||
return ``;
|
||||
}
|
||||
bindControlData(controldatajson) {
|
||||
return "";
|
||||
}
|
||||
SaveControlData(controldatajson) {
|
||||
return "";
|
||||
}
|
||||
loadControlPropertiesHtml(Container) {
|
||||
return ``;
|
||||
}
|
||||
bindPropertySettings(prop) {
|
||||
var propertySettings = prop.PropertySettings;
|
||||
return "";
|
||||
}
|
||||
savePropertySettings(prop) {
|
||||
var propertySettings = prop.PropertySettings;
|
||||
return "";
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === undefined) {
|
||||
this.instance = new DcEditMrp_Setting();
|
||||
}
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
Controls.DcEditMrp_Setting = DcEditMrp_Setting;
|
||||
})(Controls = Transact.Controls || (Transact.Controls = {}));
|
||||
})(Transact = Apps.Transact || (Apps.Transact = {}));
|
||||
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
|
||||
})(Bizgaze || (Bizgaze = {}));
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"dceditmrp.setting.js","sourceRoot":"","sources":["dceditmrp.setting.ts"],"names":[],"mappings":"AAAA,IAAU,OAAO,CAoChB;AApCD,WAAU,OAAO;IACb,IAAiB,IAAI,CAkCpB;IAlCD,WAAiB,IAAI;QACjB,IAAiB,QAAQ,CAgCxB;QAhCD,WAAiB,QAAQ;YACrB,IAAiB,QAAQ,CA8BxB;YA9BD,WAAiB,QAAQ;gBACrB,MAAa,iBAAiB;oBAC1B,eAAe;wBACX,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,eAAe,CAAC,eAAoB;wBAChC,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,eAAe,CAAC,eAAoB;wBAChC,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,yBAAyB,CAAC,SAAS;wBAC/B,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,oBAAoB,CAAC,IAAgB;wBACjC,IAAI,gBAAgB,GAA6B,IAAI,CAAC,gBAAgB,CAAC;wBACvE,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,oBAAoB,CAAC,IAAgB;wBACjC,IAAI,gBAAgB,GAA6B,IAAI,CAAC,gBAAgB,CAAC;wBACvE,OAAO,EAAE,CAAC;oBACd,CAAC;oBAED,MAAM,CAAC,QAAQ;wBACX,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE;4BAC7B,IAAI,CAAC,QAAQ,GAAG,IAAI,iBAAiB,EAAE,CAAC;yBAC3C;wBACD,OAAO,IAAI,CAAC,QAAQ,CAAC;oBACzB,CAAC;iBACJ;gBA5BY,0BAAiB,oBA4B7B,CAAA;YACL,CAAC,EA9BgB,QAAQ,GAAR,iBAAQ,KAAR,iBAAQ,QA8BxB;QACL,CAAC,EAhCgB,QAAQ,GAAR,aAAQ,KAAR,aAAQ,QAgCxB;IACL,CAAC,EAlCgB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAkCpB;AACL,CAAC,EApCS,OAAO,KAAP,OAAO,QAoChB"}
|
||||
+1
@@ -0,0 +1 @@
|
||||
var Bizgaze;(function(n){let t;(function(n){let t;(function(n){let t;(function(n){class t{loadSettingHtml(){return``}bindControlData(){return""}SaveControlData(){return""}loadControlPropertiesHtml(){return``}bindPropertySettings(n){var t=n.PropertySettings;return""}savePropertySettings(n){var t=n.PropertySettings;return""}static Instance(){return this.instance===undefined&&(this.instance=new t),this.instance}}n.DcEditMrp_Setting=t})(t=n.Controls||(n.Controls={}))})(t=n.Transact||(n.Transact={}))})(t=n.Apps||(n.Apps={}))})(Bizgaze||(Bizgaze={}));
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
@@ -0,0 +1,41 @@
|
||||
var Bizgaze;
|
||||
(function (Bizgaze) {
|
||||
let Apps;
|
||||
(function (Apps) {
|
||||
let Transact;
|
||||
(function (Transact) {
|
||||
let Controls;
|
||||
(function (Controls) {
|
||||
class Dcitem_Setting {
|
||||
loadSettingHtml() {
|
||||
return ``;
|
||||
}
|
||||
bindControlData(controldatajson) {
|
||||
return "";
|
||||
}
|
||||
SaveControlData(controldatajson) {
|
||||
return "";
|
||||
}
|
||||
loadControlPropertiesHtml(Container) {
|
||||
return ``;
|
||||
}
|
||||
bindPropertySettings(prop) {
|
||||
var propertySettings = prop.PropertySettings;
|
||||
return "";
|
||||
}
|
||||
savePropertySettings(prop) {
|
||||
var propertySettings = prop.PropertySettings;
|
||||
return "";
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === undefined) {
|
||||
this.instance = new Dcitem_Setting();
|
||||
}
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
Controls.Dcitem_Setting = Dcitem_Setting;
|
||||
})(Controls = Transact.Controls || (Transact.Controls = {}));
|
||||
})(Transact = Apps.Transact || (Apps.Transact = {}));
|
||||
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
|
||||
})(Bizgaze || (Bizgaze = {}));
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"dcitems.setting.js","sourceRoot":"","sources":["dcitems.setting.ts"],"names":[],"mappings":"AAAA,IAAU,OAAO,CAoChB;AApCD,WAAU,OAAO;IACb,IAAiB,IAAI,CAkCxB;IAlCG,WAAiB,IAAI;QACjB,IAAiB,QAAQ,CAgC5B;QAhCG,WAAiB,QAAQ;YACrB,IAAiB,QAAQ,CA8B5B;YA9BG,WAAiB,QAAQ;gBACrB,MAAa,cAAc;oBAC3B,eAAe;wBACX,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,eAAe,CAAC,eAAoB;wBAChC,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,eAAe,CAAC,eAAoB;wBAChC,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,yBAAyB,CAAC,SAAS;wBAC/B,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,oBAAoB,CAAC,IAAgB;wBACjC,IAAI,gBAAgB,GAA6B,IAAI,CAAC,gBAAgB,CAAC;wBACvE,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,oBAAoB,CAAC,IAAgB;wBACjC,IAAI,gBAAgB,GAA6B,IAAI,CAAC,gBAAgB,CAAC;wBACvE,OAAO,EAAE,CAAC;oBACd,CAAC;oBAED,MAAM,CAAC,QAAQ;wBACX,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE;4BAC7B,IAAI,CAAC,QAAQ,GAAG,IAAI,cAAc,EAAE,CAAC;yBACxC;wBACD,OAAO,IAAI,CAAC,QAAQ,CAAC;oBACzB,CAAC;iBACJ;gBA5BgB,uBAAc,iBA4B9B,CAAA;YACL,CAAC,EA9BoB,QAAQ,GAAR,iBAAQ,KAAR,iBAAQ,QA8B5B;QACL,CAAC,EAhCoB,QAAQ,GAAR,aAAQ,KAAR,aAAQ,QAgC5B;IACL,CAAC,EAlCoB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAkCxB;AACD,CAAC,EApCS,OAAO,KAAP,OAAO,QAoChB"}
|
||||
+1
@@ -0,0 +1 @@
|
||||
var Bizgaze;(function(n){let t;(function(n){let t;(function(n){let t;(function(n){class t{loadSettingHtml(){return``}bindControlData(){return""}SaveControlData(){return""}loadControlPropertiesHtml(){return``}bindPropertySettings(n){var t=n.PropertySettings;return""}savePropertySettings(n){var t=n.PropertySettings;return""}static Instance(){return this.instance===undefined&&(this.instance=new t),this.instance}}n.Dcitem_Setting=t})(t=n.Controls||(n.Controls={}))})(t=n.Transact||(n.Transact={}))})(t=n.Apps||(n.Apps={}))})(Bizgaze||(Bizgaze={}));
|
||||
@@ -0,0 +1,694 @@
|
||||
var Bizgaze;
|
||||
(function (Bizgaze) {
|
||||
let Apps;
|
||||
(function (Apps) {
|
||||
let Transact;
|
||||
(function (Transact) {
|
||||
let Controls;
|
||||
(function (Controls) {
|
||||
class DcSerialNo extends Unibase.Platform.Core.BaseComponent {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.stockids = [0];
|
||||
this.SerialNoCount = 0;
|
||||
this.ParentStockId = 0;
|
||||
this.ParentStockName = "";
|
||||
this.StockType = false;
|
||||
this.url = "";
|
||||
this.SerialNoList = [];
|
||||
this.StockTypeId = 0;
|
||||
this.ItemId = 0;
|
||||
this.PackCount = 0;
|
||||
this.DcTypeId = 0;
|
||||
this.BranchId = 0;
|
||||
this.Remaining = 0;
|
||||
this.IsAllocated = false;
|
||||
this.IsEnableSerialNo = false;
|
||||
this.IsTransfer = "false";
|
||||
this.ScannedCount = 0;
|
||||
this.AddedSerialNoList = [];
|
||||
this.IsGenerateMaster = false;
|
||||
this.IsFiveStep = false;
|
||||
}
|
||||
init(containerid) {
|
||||
var instance = this;
|
||||
instance.StockType = false;
|
||||
instance.SerialNoList = [];
|
||||
instance.AddedSerialNoList = [];
|
||||
instance.ParentStockName = "";
|
||||
instance.Remaining = 0;
|
||||
instance.IsAllocated = false;
|
||||
instance.ScannedCount = 0;
|
||||
if (instance.IsGenerateMaster) {
|
||||
Bizgaze.Apps.Transact.Controls.DcSerialNo.Instance().generateMasterSNo();
|
||||
}
|
||||
if (instance.IsFiveStep) {
|
||||
if (Unibase.Platform.Membership.Infos.Identity.getCurrentUser().settings != null) {
|
||||
var companyId = 0;
|
||||
var companySetting = Unibase.Platform.Membership.Infos.Identity.getCurrentUser().settings.find(x => x.settingName == "companyid");
|
||||
if (companySetting != null) {
|
||||
companyId = companySetting.settingValue;
|
||||
instance.BranchId = Number(Unibase.Platform.Membership.Infos.Identity.getCurrentUser().settings.find(x => x.settingName == "branchid").settingValue);
|
||||
}
|
||||
else {
|
||||
Unibase.Platform.Forms.Components.FormViewer.Instance().showError("Please Configure Default Branch");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
Unibase.Platform.Forms.Components.FormViewer.Instance().showError("Please Configure Default Branch");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (!instance.IsFiveStep && !instance.IsGenerateMaster) {
|
||||
$("#coupon_img").addClass('hidden');
|
||||
$("#divSum").addClass('hidden');
|
||||
$("#div_scan").addClass('col-sm-12');
|
||||
instance.DcTypeId = Number(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_dctypeid").Value);
|
||||
instance.IsTransfer = Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_istransfer").Value;
|
||||
instance.BranchId = Number(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_shipfromaddressid").Value);
|
||||
if (instance.DcTypeId == Bizgaze.Apps.Transact.Enums.DcType.Inward || instance.IsTransfer) {
|
||||
instance.BranchId = Number(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_shiptoaddressid").Value);
|
||||
}
|
||||
}
|
||||
var html = '<input type="hidden" id="hdn_customcontrol" class="value-control" value="Bizgaze.Apps.Transact.Controls.DcSerialNo.Instance().getSerialNos();"><div class="Added SerialNos hidden card Section mt-20"><div class="card-header" id="section_SerialNos">Added Items</div><div class="card-body"><div class="">' +
|
||||
'<div class="panel-body Active_serialnos"><ul class="stock-item-serialnos added-row list-group"></ul></div></div></div></div><div class="added_SerialNos hidden card Section mt-20"><div class="card-header" id="section_AllocatedSerialNos">' +
|
||||
'<a class="btn_Addedserialno_angle text-dark" href="javascript:;" onclick="javascript: return Bizgaze.Apps.Transact.Controls.DcSerialNo.instance.showAddedSerialNos()"><i class="fa fa-angle-down hidden"></i><i class="fa fa-angle-right"></i><span class="ml-10"><a class="serial-link mt-10" href="javascript:;" ></a></span></a></div><div class="card-body"><div class="">' +
|
||||
'<div class="panel-body Allocated_serialnos"><ul class="addedd-serialnos added-row list-group"></ul></div></div></div></div>' +
|
||||
'</div>';
|
||||
$(containerid).after(html);
|
||||
if (!instance.IsGenerateMaster && !instance.IsFiveStep) {
|
||||
instance.getAllocatedStocks();
|
||||
instance.getcount();
|
||||
$("#spn_required").prop('disabled', true);
|
||||
var html111 = '<div data-simplebar class="simple-scroll-bar scrollable bg-cyan-light-5 control-sorting row pl-50 pa-10 pr-20" id="footersection123" style="overflow-y:auto;overflow-x:none;"><div class="row"><div class="mb-15 col-lg-4" ><div class="Border"><div class="Border1 hidden"><div class="pull-left" id="dragWidget"><a class="btn btn-icon btn-rounded btn-flush-primary flush-soft-hover"><span class="btn-icon-wrap"><i class="ti-fullscreen"></i></span></a></div><div class="card-action-wrap pull-right m-t-sm m-r-lg"><a href="javascript:;" class="inline-block btn btn-icon btn-rounded btn-flush-primary flush-soft-hover"><span class="btn-icon-wrap"><i class="ti-pencil"></i></span></a><a href="javascript:;" class="btn btn-icon btn-rounded btn-flush-primary flush-soft-hover" title="Permissions"><span class="btn-icon-wrap"><i class="ti-key"></i></span></a><span class="btn-icon-wrap"><i class="ti-trash"></i></span></a></div></div><div class="cardbody"><div class="" id=""><div class="card mb-0 card-sm shadow-hover" style="height:100px;"><div class="card-body"><span class="font-14 font-weight-400 text-dark">Total</span><span class="d-block align-items-center card-action-wrap pull-right font-11"><a href="#" class="inline-block full-screen hidden" id=""><i class="ion ion-md-expand"></i></a></span><div class="mt-15"> <span id="" class="h4 block mb-10"><span class="display-5 font-weight-400" id="txt_total"></span></span><span id=""></span><div class="pull-right" style="margin-top:-10px;"><div id=""></div><div class="py-0" style="margin-top:-10px;"></div></div></div></div></div></div></div></div></div>' +
|
||||
'<div class="mb-15 col-lg-4" ><div class="Border"><div class="Border1 hidden"><div class="pull-left" id="dragWidget"><a class="btn btn-icon btn-rounded btn-flush-primary flush-soft-hover"><span class="btn-icon-wrap"><i class="ti-fullscreen"></i></span></a></div><div class="card-action-wrap pull-right m-t-sm m-r-lg"><a href="javascript:;" class="inline-block btn btn-icon btn-rounded btn-flush-primary flush-soft-hover"><span class="btn-icon-wrap"><i class="ti-pencil"></i></span></a><a href="javascript:;" class="btn btn-icon btn-rounded btn-flush-primary flush-soft-hover" title="Permissions"><span class="btn-icon-wrap"><i class="ti-key"></i></span></a><span class="btn-icon-wrap"><i class="ti-trash"></i></span></a></div></div><div class="cardbody"><div class="" id=""><div class="card mb-0 card-sm shadow-hover" style="height:100px;"><div class="card-body"><span class="font-14 font-weight-400 text-dark">Scanned</span><span class="d-block align-items-center card-action-wrap pull-right font-11"><a href="#" class="inline-block full-screen hidden" id=""><i class="ion ion-md-expand"></i></a></span><div class="mt-15"> <span id="" class="h4 block mb-10"><span class="display-5 font-weight-400" id="txt_scanned"></span></span><span id=""></span><div class="pull-right" style="margin-top:-10px;"><div id=""></div><div class="py-0" style="margin-top:-10px;"></div></div></div></div></div></div></div></div></div>' +
|
||||
'<div class="mb-15 col-lg-4" ><div class="Border"><div class="Border1 hidden"><div class="pull-left" id="dragWidget"><a class="btn btn-icon btn-rounded btn-flush-primary flush-soft-hover"><span class="btn-icon-wrap"><i class="ti-fullscreen"></i></span></a></div><div class="card-action-wrap pull-right m-t-sm m-r-lg"><a href="javascript:;" class="inline-block btn btn-icon btn-rounded btn-flush-primary flush-soft-hover"><span class="btn-icon-wrap"><i class="ti-pencil"></i></span></a><a href="javascript:;" class="btn btn-icon btn-rounded btn-flush-primary flush-soft-hover" title="Permissions"><span class="btn-icon-wrap"><i class="ti-key"></i></span></a><span class="btn-icon-wrap"><i class="ti-trash"></i></span></a></div></div><div class="cardbody"><div class="" id=""><div class="card mb-0 card-sm shadow-hover" style="height:100px;"><div class="card-body"><span class="font-14 font-weight-400 text-dark">Remaining</span><span class="d-block align-items-center card-action-wrap pull-right font-11"><a href="#" class="inline-block full-screen hidden" id=""><i class="ion ion-md-expand"></i></a></span><div class="mt-15"> <span id="" class="h4 block mb-10"><span class="display-5 font-weight-400" id="txt_remaining"></span></span><span id=""></span><div class="pull-right" style="margin-top:-10px;"><div id=""></div><div class="py-0" style="margin-top:-10px;"></div></div></div></div></div></div></div></div></div>' +
|
||||
'</div></div>';
|
||||
$("#formFooter").before(html111);
|
||||
$('#txt_scanned').prop('disabled', true);
|
||||
$('#txt_remaining').prop('disabled', true);
|
||||
$('#txt_total').prop('disabled', true);
|
||||
$(".formviewer_id").css('height', $(".formviewer_id").height() - $("#footersection123").height() + 'px');
|
||||
}
|
||||
}
|
||||
bindSerialNo(serialNo, stockId) {
|
||||
var instance = this;
|
||||
if (instance.AddedSerialNoList.filter(x => x == serialNo).length == 1) {
|
||||
if ($(".SerialNos").hasClass('hidden')) {
|
||||
$(".SerialNos").removeClass('hidden');
|
||||
}
|
||||
var rowid = moment().valueOf();
|
||||
var ParentStockId = instance.ParentStockId;
|
||||
if (instance.ParentStockId == stockId) {
|
||||
ParentStockId = 0;
|
||||
}
|
||||
var html = '<li class="list-group-item pa-10 clear Serialno-row added-row li_' + rowid + ' serialno_' + ParentStockId + '"><input type="hidden" id="hf_rowid" value="' + rowid + '"><input type="hidden" id="hf_stocktypeid' + rowid + '" value="' + instance.StockTypeId + '">' +
|
||||
'<div class="row"><input type="hidden" id="hdn_stockid_' + rowid + '" value="' + stockId + '"><input type="hidden" id="hdn_parentstockId_' + rowid + '" value="' + instance.ParentStockId + '">';
|
||||
if (instance.StockTypeId == 2) {
|
||||
html += '<div class="col-sm-5 ml-10 div_Serialno divserialno_' + instance.ParentStockId + '"><a class="btn_parestserialno_angle' + rowid + ' text-dark" href="javascript:;" onclick="javascript: return Bizgaze.Apps.Transact.Controls.DcSerialNo.instance.showDetails(' + stockId + ',' + rowid + ')"><i class="fa fa-angle-down hidden"></i><i class="fa fa-angle-right"></i><span class="ml-10"><a class="serial-link mt-10 txtSerialNo_' + rowid + '" " id="txt_' + stockId + '" href="javascript:;" >' + serialNo + '</a></span></a></div>';
|
||||
html += '<div class="col-sm-5"><small id="parent_info' + instance.ParentStockId + '" style = "color:red;">Master Serial No</small></div>';
|
||||
}
|
||||
else {
|
||||
html += '<div class="col-sm-12 row div_itemserialnos' + rowid + '"><div class="col-sm-10 ml-35 div_Serialno divserialno_' + instance.ParentStockId + '">';
|
||||
html += '<strong class="textcolumn txt_' + serialNo + ' txtSerialNo_' + rowid + '" id="txt_' + stockId + '">' + serialNo + '</strong></div>';
|
||||
}
|
||||
html += '<div class="pull-right col-md-1"><a class="fa fa-trash-o m-t fa-md fa-lg pull-right" style ="color:red;" title = "Delete SerialNo" onclick="javascript: return Bizgaze.Apps.Transact.Controls.DcSerialNo.instance.removeRow(' + stockId + ',' + rowid + ')"></a>';
|
||||
'</div></li>';
|
||||
if (instance.StockTypeId == 1) {
|
||||
html += '</div>';
|
||||
}
|
||||
html += '</div>';
|
||||
$('.stock-item-serialnos:last').append(html);
|
||||
$(".scan_ScanSerialNumber").val('');
|
||||
if (instance.StockTypeId == 2 && instance.PackCount == 1) {
|
||||
instance.ScannedCount = instance.ScannedCount;
|
||||
}
|
||||
else {
|
||||
instance.ScannedCount += 1;
|
||||
$("#txt_scanned").text(Number($("#txt_scanned").text()) + 1);
|
||||
$("#txt_remaining").text(Number($("#txt_total").text()) - Number($("#txt_scanned").text()));
|
||||
}
|
||||
if (instance.IsGenerateMaster)
|
||||
$("#spn_scanned").text(Number($("#spn_scanned").text()) + 1);
|
||||
}
|
||||
}
|
||||
removeRow(StockId, rowid) {
|
||||
var instance = this;
|
||||
if ($("#hf_stocktypeid" + rowid).val() == "2") {
|
||||
bootbox.confirm("Are You Sure,Item Serial No's will be Deleted. If You Delete Master Serial No.", function (result) {
|
||||
if (result) {
|
||||
instance.stockids.splice(instance.stockids.findIndex(p => p == StockId), 1);
|
||||
$(".serialno_" + $("#hdn_parentstockId_" + rowid).val()).each(function () {
|
||||
var rowid = $(this).find("#hf_rowid").val();
|
||||
var StockId = $("#hdn_stockid_" + rowid).val();
|
||||
instance.SerialNoList.splice(instance.SerialNoList.findIndex(p => p == StockId), 1);
|
||||
instance.AddedSerialNoList.splice(instance.AddedSerialNoList.findIndex(p => p == $(".txtSerialNo_" + rowid).text()), 1);
|
||||
$('#txt_scanned').text(Number($('#txt_scanned').val()) - 1);
|
||||
instance.ScannedCount = instance.ScannedCount - 1;
|
||||
$('#txt_remaining').text(Number($('#txt_remaining').val()) + 1);
|
||||
});
|
||||
$(".serialno_" + $("#hdn_parentstockId_" + rowid).val()).remove();
|
||||
instance.StockType = false;
|
||||
instance.SerialNoList.splice(instance.SerialNoList.findIndex(p => p == StockId), 1);
|
||||
$(".li_" + rowid).remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
bootbox.confirm("Do you want to Delete Item Serial Number ?", function (result) {
|
||||
if (result) {
|
||||
if ($("#hf_stocktypeid" + rowid).val() == "2") {
|
||||
instance.StockType = false;
|
||||
}
|
||||
instance.SerialNoList.splice(instance.SerialNoList.findIndex(p => p.StockId == StockId), 1);
|
||||
instance.AddedSerialNoList.splice(instance.AddedSerialNoList.findIndex(p => p == $(".txtSerialNo_" + rowid).text()), 1);
|
||||
instance.ScannedCount = instance.ScannedCount - 1;
|
||||
$(".li_" + rowid).remove();
|
||||
$('#txt_scanned').text(Number($('#txt_scanned').text()) - 1);
|
||||
$('#txt_remaining').text(Number($('#txt_remaining').text()) + 1);
|
||||
if (instance.IsGenerateMaster)
|
||||
$('#spn_scanned').text(Number($('#spn_scanned').text()) - 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
getAllocatedStocks() {
|
||||
var instance = this;
|
||||
var url = 'apis/v4/bizgaze/transact/dcs/getallocatedstocks/dcitemid/' + $("#hf_pk_value").val() + '/StockStatusId/' + Bizgaze.Apps.Transact.Enums.StockStatus.Allocated;
|
||||
if (instance.DcTypeId == Bizgaze.Apps.Transact.Enums.DcType.Inward && instance.IsTransfer) {
|
||||
url = 'apis/v4/bizgaze/transact/dcs/gettransferedstocks/dcitemid/' + $("#hf_pk_value").val();
|
||||
}
|
||||
if (instance.DcTypeId == Bizgaze.Apps.Transact.Enums.DcType.Outward) {
|
||||
url = 'apis/v4/bizgaze/transact/dcs/getdeliveredstocks/dcitemid/' + $("#hf_pk_value").val() + '/StockStatusId/' + Bizgaze.Apps.Transact.Enums.StockStatus.Delivered;
|
||||
}
|
||||
Bizgaze.Apps.Transact.Managers.DCManager.Instance().getAllocatedStocks(url).then(function (responce) {
|
||||
$('.addedd-serialnos').empty();
|
||||
if (responce.result.length > 0) {
|
||||
if (responce.result.filter(x => x.StockStatusId != Bizgaze.Apps.Transact.Enums.StockStatus.Active).length > 0) {
|
||||
instance.IsAllocated = true;
|
||||
if ($(".added_SerialNos").hasClass('hidden')) {
|
||||
$(".added_SerialNos").removeClass('hidden');
|
||||
$(".added_SerialNos").find(".card-body").addClass('hidden');
|
||||
if (instance.DcTypeId == Bizgaze.Apps.Transact.Enums.DcType.Outward)
|
||||
$(".serial-link").text('Delivered Serial Nos');
|
||||
else
|
||||
$(".serial-link").text('Allocated Serial Nos');
|
||||
}
|
||||
}
|
||||
responce.result = responce.result.filter(x => x.StockStatusId != Bizgaze.Apps.Transact.Enums.StockStatus.Active);
|
||||
for (var i = 0; i < responce.result.length; i++) {
|
||||
var IsSerialNoTransfer = false;
|
||||
if (responce.result[i].CurrentWarehouseId != instance.BranchId) {
|
||||
IsSerialNoTransfer = true;
|
||||
}
|
||||
var rowid = moment().valueOf();
|
||||
var html = '<li class="list-group-item pa-10 clear Serialno-row added-row li_' + rowid + ' serialno_' + responce.result[i].CurrentParentId + '"><input type="hidden" id="hf_rowid" value="' + rowid + '"><input type="hidden" id="hf_stocktypeid' + rowid + '" value="' + responce.result[i].StockTypeId + '">' +
|
||||
'<div class="row"><div class="col-sm-5 ml-10 div_Serialno divserialno_' + rowid + '"><input type="hidden" id="hdn_stockid_' + rowid + '" value="' + responce.result[i].StockId + '"><input type="hidden" id="hdn_parentstockId_' + rowid + '" value="' + responce.result[i].ParentStockId + '">';
|
||||
if (responce.result[i].StockTypeId == 2) {
|
||||
html += '<div class="div_Serialno divserialno_' + responce.result[i].CurrentParentId + '"><a class="btn_parestAddedserialno_angle' + rowid + ' text-dark" href="javascript:;" onclick="javascript: return Bizgaze.Apps.Transact.Controls.DcSerialNo.instance.showStockDetails(' + responce.result[i].StockId + ',' + rowid + ')"><i class="fa fa-angle-down hidden"></i><i class="fa fa-angle-right"></i><span class="ml-10"><a class="ItemName-link mt-10 txtSerialNo_' + rowid + '" " id="txt_' + responce.result[i].StockId + '" href = "javascript:;" > ' + responce.result[i].SerialNo + '</span></a></div>';
|
||||
}
|
||||
else {
|
||||
html += '<strong class="textcolumn txtSerialNo_' + rowid + '" id="txt_' + responce.result[i].StockId + '">' + responce.result[i].SerialNo + '</strong>';
|
||||
}
|
||||
html += '</div>';
|
||||
html += '<div class="col-sm-1">';
|
||||
if (IsSerialNoTransfer) {
|
||||
html += '<a><i class="fa fa-exchange" aria-hidden="true"></i></a>';
|
||||
}
|
||||
html += '</div>';
|
||||
html += '<div class="col-sm-4">';
|
||||
if (responce.result[i].StockTypeId != 2 && responce.result[i].StockStatusId == Bizgaze.Apps.Transact.Enums.StockStatus.Delivered && instance.DcTypeId == Bizgaze.Apps.Transact.Enums.DcType.Inward) {
|
||||
html += '<small id="parent_info' + responce.result[i].ParentStockId + '" style = "color:red;">Delivered Serial No</small>';
|
||||
}
|
||||
else if (responce.result[i].StockTypeId == 2) {
|
||||
html += '<small id="parent_info' + responce.result[i].ParentStockId + '" style = "color:red;">Master Serial No</small>';
|
||||
}
|
||||
html += '</div>';
|
||||
if (responce.result[i].StockStatusId != Bizgaze.Apps.Transact.Enums.StockStatus.Delivered && instance.DcTypeId == Bizgaze.Apps.Transact.Enums.DcType.Inward && !IsSerialNoTransfer)
|
||||
html += '<div class="pull-right col-md-1"><a class="fa fa-trash-o m-t fa-md fa-lg pull-right" style ="color:red;" title = "Delete SerialNo" onclick="javascript: return Bizgaze.Apps.Transact.Controls.DcSerialNo.instance.DeleteStock(' + responce.result[i].StockId + ',' + rowid + ')"></a></div>';
|
||||
else if (instance.DcTypeId == Bizgaze.Apps.Transact.Enums.DcType.Outward && !IsSerialNoTransfer) {
|
||||
html += '<div class="pull-right col-md-1"><a class="fa fa-trash-o m-t fa-md fa-lg pull-right" style ="color:red;" title = "Delete SerialNo" onclick="javascript: return Bizgaze.Apps.Transact.Controls.DcSerialNo.instance.DeleteStock(' + responce.result[i].StockId + ',' + rowid + ')"></a></div>';
|
||||
}
|
||||
html += '</li></div>';
|
||||
$('.addedd-serialnos:last').append(html);
|
||||
if (IsSerialNoTransfer)
|
||||
$('.divserialno_' + rowid).css("color", "green");
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!$(".added_SerialNos").hasClass('hidden')) {
|
||||
$(".added_SerialNos").addClass('hidden');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
DeleteStock(StockId, rowid) {
|
||||
var instance = this;
|
||||
var ErrorMsg = "";
|
||||
if ($("#hf_stocktypeid" + rowid).val() == "2")
|
||||
ErrorMsg = "Are You Sure,Item Serial No's will be Deleted. If You Delete Master Serial No.";
|
||||
else
|
||||
ErrorMsg = "Do you want to Delete Item Serial Number ?";
|
||||
bootbox.confirm(ErrorMsg, function (result) {
|
||||
if (result) {
|
||||
var StockId = $("#hdn_stockid_" + rowid).val();
|
||||
let postdata = { StockId: Number(StockId), DcTypeId: instance.DcTypeId, OutwardDCItemId: Number($("#hf_pk_value").val()) };
|
||||
Bizgaze.Apps.Transact.Managers.DCManager.Instance().deleteSerialNo(postdata).then(function (response) {
|
||||
$(".li_" + rowid).remove();
|
||||
instance.getcount();
|
||||
instance.getAllocatedStocks();
|
||||
MessageHelper.Instance().showSuccess(response.result.Message, '');
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
showStockDetails(stockid, rowid) {
|
||||
$(".btn_parestAddedserialno_angle" + rowid).find(".fa-angle-down").toggleClass("hidden");
|
||||
$(".btn_parestAddedserialno_angle" + rowid).find(".fa-angle-right").toggleClass("hidden");
|
||||
$(".serialno_" + stockid).toggleClass("hidden");
|
||||
}
|
||||
showDetails(stockid, rowid) {
|
||||
$(".btn_parestserialno_angle" + rowid).find(".fa-angle-down").toggleClass("hidden");
|
||||
$(".btn_parestserialno_angle" + rowid).find(".fa-angle-right").toggleClass("hidden");
|
||||
$(".serialno_" + stockid).toggleClass("hidden");
|
||||
}
|
||||
showAddedSerialNos() {
|
||||
$(".btn_Addedserialno_angle").find(".fa-angle-down").toggleClass("hidden");
|
||||
$(".btn_Addedserialno_angle").find(".fa-angle-right").toggleClass("hidden");
|
||||
$(".added_SerialNos").find(".card-body").toggleClass("hidden");
|
||||
}
|
||||
GetItemSerialNos(ParentStockId, callback) {
|
||||
var instance = this;
|
||||
Bizgaze.Apps.Transact.Managers.DCManager.Instance().getItemSerialNos($("#hf_pk_value").val(), ParentStockId).then(function (responce) {
|
||||
if (responce.result.length > 0) {
|
||||
for (var i = 0; i <= responce.result.length; i++) {
|
||||
if (instance.ScannedCount > Number($("#txt_total").text()) && instance.DcTypeId == Bizgaze.Apps.Transact.Enums.DcType.Outward) {
|
||||
$("#txt_remaining").text(0);
|
||||
MessageHelper.Instance().showError("Serial No Count Exceeded " + Number($("#txt_total").text()) + "", $("#form-container-" + $("#hf_FormId").val()).find(".bizgaze_FormErrorMessages").attr('id'));
|
||||
return false;
|
||||
}
|
||||
instance.AddedSerialNoList.push(responce.result[i].SerialNo);
|
||||
instance.ParentStockId = responce.result[i].CurrentParentId;
|
||||
instance.ParentStockName = responce.result[i].CurrentParentName;
|
||||
instance.StockTypeId = responce.result[i].StockTypeId;
|
||||
instance.bindSerialNo(responce.result[i].SerialNo, responce.result[i].StockId);
|
||||
instance.SerialNoList.push({
|
||||
StockId: Number(responce.result[i].StockId),
|
||||
StockTypeId: Number(responce.result[i].StockTypeId),
|
||||
SerialNo: responce.result[i].SerialNo,
|
||||
ItemId: Number(instance.ItemId),
|
||||
InwardDCItemId: Number(responce.result[i].InwardDcItemId),
|
||||
StockStatusId: instance.DcTypeId == Bizgaze.Apps.Transact.Enums.DcType.Inward ? 5 : 2,
|
||||
Packs: 0,
|
||||
PurchasePrice: 0,
|
||||
SalesPrice: 0,
|
||||
Quantity: 0,
|
||||
CurrentWarehouseId: instance.BranchId,
|
||||
CurrentParentId: Number(instance.ParentStockId),
|
||||
CurrentInchargeId: 0,
|
||||
OutwardDCItemId: instance.DcTypeId == Bizgaze.Apps.Transact.Enums.DcType.Inward ? 0 : Number($("#hf_pk_value").val()),
|
||||
CurrentParentName: instance.ParentStockName,
|
||||
DcTypeId: instance.DcTypeId,
|
||||
});
|
||||
if (callback != null)
|
||||
callback(instance.SerialNoList);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
getSerialNo(SerialNo, containerid, propobj, callback) {
|
||||
var instance = this;
|
||||
SerialNo = SerialNo.trim();
|
||||
instance.fileCacheHelper.loadJsFile("apps/transact/enums/enum.js", function () {
|
||||
instance.fileCacheHelper.loadJsFile("apps/transact/managers/inventory/dcmanager.js", function () {
|
||||
if ($('.stock-item-serialnos').length == 0) {
|
||||
if ($("#div_FormName").text() == "Create 5 Step Validations") {
|
||||
Bizgaze.Apps.Transact.Controls.DcSerialNo.Instance().IsFiveStep = true;
|
||||
}
|
||||
instance.init(containerid);
|
||||
}
|
||||
var SerialNoExist = false;
|
||||
$(".stock-item-serialnos").find('.Serialno-row').each(function () {
|
||||
var rowid = $(this).find("#hf_rowid").val();
|
||||
if ($(".txtSerialNo_" + rowid).text() == SerialNo) {
|
||||
SerialNoExist = true;
|
||||
if (SerialNo != "") {
|
||||
$(".scan_ScanSerialNumber").val('');
|
||||
MessageHelper.Instance().showError("Serial Number Added", $("#form-container-" + $("#hf_FormId").val()).find(".bizgaze_FormErrorMessages").attr('id'));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
instance.Remaining = Number($("#txt_remaining").text());
|
||||
if (SerialNo != "" && SerialNoExist == false) {
|
||||
if (instance.ScannedCount == Number($("#txt_total").text()) && instance.DcTypeId == Bizgaze.Apps.Transact.Enums.DcType.Outward) {
|
||||
MessageHelper.Instance().showError("Serial No Count Exceeded " + Number($("#txt_total").text()) + "", $("#form-container-" + $("#hf_FormId").val()).find(".bizgaze_FormErrorMessages").attr('id'));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (instance.IsGenerateMaster) {
|
||||
if (SerialNo != "" && SerialNoExist == false) {
|
||||
if ($(".ddl_cascading_packcount option:selected").text() != "Others") {
|
||||
if (Number($(".ddl_cascading_packcount option:selected").text()) == Number($("#spn_scanned").text())) {
|
||||
MessageHelper.Instance().showError("Serial No Count Exceeded " + Number($("#spn_scanned").text()) + "", $("#form-container-" + $("#hf_FormId").val()).find(".bizgaze_FormErrorMessages").attr('id'));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (Number($(".txt_name").val()) == Number($("#spn_scanned").text())) {
|
||||
MessageHelper.Instance().showError("Serial No Count Exceeded " + Number($("#spn_scanned").text()) + "", $("#form-container-" + $("#hf_FormId").val()).find(".bizgaze_FormErrorMessages").attr('id'));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (SerialNoExist == false && SerialNo != "") {
|
||||
var DcItemId = 0;
|
||||
var ItemId = 0;
|
||||
DcItemId = Number($("#hf_pk_value").val());
|
||||
var url = 'apis/v4/bizgaze/transact/dcs/getstockbyserialno/serialno/' + SerialNo + '/dcitemid/' + DcItemId + '/itemid/' + ItemId;
|
||||
if ((instance.IsTransfer && instance.DcTypeId == Bizgaze.Apps.Transact.Enums.DcType.Inward) || instance.IsGenerateMaster)
|
||||
url = 'apis/v4/bizgaze/transact/dcs/getserialnobybranchid/serialno/' + SerialNo + '/branchid/' + instance.BranchId + '/itemid/' + instance.ItemId;
|
||||
if (instance.IsFiveStep) {
|
||||
instance.ItemId = Number($(".txtAutoComplete_itemid option:selected").val());
|
||||
url = 'apis/v4/bizgaze/transact/dcs/getinactiveserialnobyitemidandbranchid/itemid/' + instance.ItemId + '/branchid/' + instance.BranchId + '/serialno/' + SerialNo;
|
||||
}
|
||||
Bizgaze.Apps.Transact.Managers.DCManager.Instance().getserialNobySerialNo(url).then(function (responce) {
|
||||
if (responce.result != "" && responce.result != null) {
|
||||
if (responce.result.RefId != 0) {
|
||||
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/paybacks/managers/schememanager.js", function () {
|
||||
Bizgaze.Apps.Paybacks.Managers.SchemeManager.Instance().getCouponGeneration(Number(responce.result.RefId)).then(function (responce) {
|
||||
if (responce.result != null) {
|
||||
if (responce.result.QuantityReceived == 0) {
|
||||
$(".Active_serialnos").empty();
|
||||
MessageHelper.Instance().showError("Cannot use the coupon before receiving coupons", $("#form-container-" + $("#hf_FormId").val()).find(".bizgaze_FormErrorMessages").attr('id'));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
if (responce.result.StockStatusId == Bizgaze.Apps.Transact.Enums.StockStatus.InActive && !instance.IsGenerateMaster && !instance.IsFiveStep) {
|
||||
$(".scan_ScanSerialNumber").val('');
|
||||
MessageHelper.Instance().showError("" + SerialNo + " is InActive ", $("#form-container-" + $("#hf_FormId").val()).find(".bizgaze_FormErrorMessages").attr('id'));
|
||||
return false;
|
||||
}
|
||||
else if (responce.result.StockStatusId == Bizgaze.Apps.Transact.Enums.StockStatus.Allocated && instance.DcTypeId == Bizgaze.Apps.Transact.Enums.DcType.Inward) {
|
||||
$(".scan_ScanSerialNumber").val('');
|
||||
MessageHelper.Instance().showError("" + SerialNo + " is already Allocated ", $("#form-container-" + $("#hf_FormId").val()).find(".bizgaze_FormErrorMessages").attr('id'));
|
||||
return false;
|
||||
}
|
||||
else if (responce.result.StockStatusId == Bizgaze.Apps.Transact.Enums.StockStatus.Active && instance.DcTypeId == Bizgaze.Apps.Transact.Enums.DcType.Outward) {
|
||||
$(".scan_ScanSerialNumber").val('');
|
||||
MessageHelper.Instance().showError("Please Scan Allocated Serial No ", $("#form-container-" + $("#hf_FormId").val()).find(".bizgaze_FormErrorMessages").attr('id'));
|
||||
return false;
|
||||
}
|
||||
else if (responce.result.StockStatusId == Bizgaze.Apps.Transact.Enums.StockStatus.Delivered && instance.DcTypeId == Bizgaze.Apps.Transact.Enums.DcType.Outward) {
|
||||
$(".scan_ScanSerialNumber").val('');
|
||||
MessageHelper.Instance().showError("" + SerialNo + " is Delivered", $("#form-container-" + $("#hf_FormId").val()).find(".bizgaze_FormErrorMessages").attr('id'));
|
||||
return false;
|
||||
}
|
||||
else if (responce.result.CurrentWarehouseId != instance.BranchId && instance.IsTransfer && instance.DcTypeId != Bizgaze.Apps.Transact.Enums.DcType.Outward) {
|
||||
$(".scan_ScanSerialNumber").val('');
|
||||
MessageHelper.Instance().showError("" + SerialNo + " is not found in current Branch", $("#form-container-" + $("#hf_FormId").val()).find(".bizgaze_FormErrorMessages").attr('id'));
|
||||
return false;
|
||||
}
|
||||
else if (instance.IsGenerateMaster && responce.result.CurrentParentId != 0) {
|
||||
MessageHelper.Instance().showError("" + SerialNo + " is not found", $("#form-container-" + $("#hf_FormId").val()).find(".bizgaze_FormErrorMessages").attr('id'));
|
||||
return false;
|
||||
}
|
||||
else if (instance.IsGenerateMaster && responce.result.StockStatusId != Bizgaze.Apps.Transact.Enums.StockStatus.Active) {
|
||||
MessageHelper.Instance().showError("" + SerialNo + " is not found", $("#form-container-" + $("#hf_FormId").val()).find(".bizgaze_FormErrorMessages").attr('id'));
|
||||
return false;
|
||||
}
|
||||
instance.AddedSerialNoList.push(SerialNo);
|
||||
if (instance.AddedSerialNoList.filter(x => x == SerialNo).length == 1) {
|
||||
instance.ItemId = responce.result.ItemId;
|
||||
instance.PackCount = responce.result.PackCount;
|
||||
if (instance.DcTypeId == Bizgaze.Apps.Transact.Enums.DcType.Inward && responce.result.PackCount != 1) {
|
||||
if (responce.result.StockTypeId == 1 && instance.StockType == false) {
|
||||
$(".scan_ScanSerialNumber").val('');
|
||||
instance.AddedSerialNoList.splice(instance.AddedSerialNoList.findIndex(p => p == SerialNo), 1);
|
||||
MessageHelper.Instance().showError("Please scan Master Serial No.", $("#form-container-" + $("#hf_FormId").val()).find(".bizgaze_FormErrorMessages").attr('id'));
|
||||
return false;
|
||||
}
|
||||
else if (responce.result.StockTypeId == 2 && instance.StockType == false) {
|
||||
instance.StockType = true;
|
||||
instance.ParentStockId = responce.result.StockId;
|
||||
instance.ParentStockName = SerialNo;
|
||||
instance.StockTypeId = responce.result.StockTypeId;
|
||||
instance.stockids.push(Number(responce.result.StockId));
|
||||
instance.bindSerialNo(SerialNo, responce.result.StockId);
|
||||
}
|
||||
else if (responce.result.StockTypeId == 2 && instance.StockType == true) {
|
||||
$(".scan_ScanSerialNumber").val('');
|
||||
instance.AddedSerialNoList.splice(instance.AddedSerialNoList.findIndex(p => p == SerialNo), 1);
|
||||
MessageHelper.Instance().showError("Please Select Item Serial No.", $("#form-container-" + $("#hf_FormId").val()).find(".bizgaze_FormErrorMessages").attr('id'));
|
||||
return false;
|
||||
}
|
||||
else if (responce.result.PackCount != 1 && ((Number(responce.result.PackCount) != instance.SerialNoCount) && responce.result.StockTypeId == 1 && instance.StockType == true)) {
|
||||
instance.SerialNoCount += 1;
|
||||
instance.StockTypeId = responce.result.StockTypeId;
|
||||
instance.stockids.push(Number(responce.result.StockId));
|
||||
instance.bindSerialNo(SerialNo, responce.result.StockId);
|
||||
if (responce.result.PackCount == instance.SerialNoCount) {
|
||||
instance.StockType = false;
|
||||
instance.SerialNoCount = 0;
|
||||
instance.StockTypeId = 0;
|
||||
}
|
||||
}
|
||||
else if (responce.result.PackCount == 1) {
|
||||
instance.stockids.push(Number(responce.result.StockId));
|
||||
instance.StockTypeId = responce.result.StockTypeId;
|
||||
instance.bindSerialNo(SerialNo, responce.result.StockId);
|
||||
var text = $("#txt_" + instance.ParentStockId).text();
|
||||
$("#parent_info" + instance.ParentStockId).text('Master Serial No');
|
||||
$("#txt_" + instance.ParentStockId).html('<a class="ItemName-link mt-10 txt_ItemName " href="javascript:;" >' + text + '</a>');
|
||||
}
|
||||
}
|
||||
else if (instance.IsGenerateMaster) {
|
||||
instance.ParentStockId = Number($("#hdn_masterserialno").val());
|
||||
instance.StockTypeId = responce.result.StockTypeId;
|
||||
instance.stockids.push(Number(responce.result.StockId));
|
||||
instance.bindSerialNo(SerialNo, responce.result.StockId);
|
||||
instance.ParentStockName = $("#spn_mastercode").text();
|
||||
}
|
||||
else {
|
||||
instance.ParentStockId = responce.result.CurrentParentId;
|
||||
instance.StockTypeId = responce.result.StockTypeId;
|
||||
instance.stockids.push(Number(responce.result.StockId));
|
||||
instance.bindSerialNo(SerialNo, responce.result.StockId);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
MessageHelper.Instance().showError("Serial No not found", $("#form-container-" + $("#hf_FormId").val()).find(".bizgaze_FormErrorMessages").attr('id'));
|
||||
return false;
|
||||
}
|
||||
var StockStatusId = Bizgaze.Apps.Transact.Enums.StockStatus.Allocated;
|
||||
var OutwardDCItemId = 0;
|
||||
var Transfer = false;
|
||||
var OtherPackCount = 0;
|
||||
if (instance.IsGenerateMaster) {
|
||||
StockStatusId = Bizgaze.Apps.Transact.Enums.StockStatus.Allocated;
|
||||
OutwardDCItemId = 0;
|
||||
Transfer = false;
|
||||
if (!$(".txt_name").hasClass('hidden')) {
|
||||
OtherPackCount = Number($(".txt_name").val());
|
||||
}
|
||||
}
|
||||
else if (instance.IsFiveStep) {
|
||||
StockStatusId = Bizgaze.Apps.Transact.Enums.StockStatus.Active;
|
||||
OutwardDCItemId = 0;
|
||||
Transfer = false;
|
||||
}
|
||||
else if (instance.DcTypeId == Bizgaze.Apps.Transact.Enums.DcType.Outward) {
|
||||
OutwardDCItemId = Number($("#hf_pk_value").val());
|
||||
if (instance.IsTransfer) {
|
||||
StockStatusId = Bizgaze.Apps.Transact.Enums.StockStatus.Transfer;
|
||||
Transfer = true;
|
||||
}
|
||||
else {
|
||||
StockStatusId = Bizgaze.Apps.Transact.Enums.StockStatus.Delivered;
|
||||
}
|
||||
}
|
||||
else if (instance.DcTypeId == Bizgaze.Apps.Transact.Enums.DcType.Inward && instance.IsTransfer) {
|
||||
OutwardDCItemId = Number($("#hf_pk_value").val());
|
||||
}
|
||||
instance.SerialNoList.push({
|
||||
StockId: Number(responce.result.StockId),
|
||||
StockTypeId: Number(responce.result.StockTypeId),
|
||||
SerialNo: SerialNo,
|
||||
ItemId: Number(instance.ItemId),
|
||||
InwardDCItemId: Number(responce.result.InwardDcItemId),
|
||||
StockStatusId: StockStatusId,
|
||||
Packs: 0,
|
||||
PurchasePrice: 0,
|
||||
SalesPrice: 0,
|
||||
Quantity: 0,
|
||||
CurrentWarehouseId: instance.BranchId,
|
||||
CurrentParentId: Number(instance.ParentStockId),
|
||||
CurrentInchargeId: 0,
|
||||
OutwardDCItemId: OutwardDCItemId,
|
||||
CurrentParentName: instance.ParentStockName,
|
||||
DcTypeId: instance.DcTypeId,
|
||||
DcId: Unibase.Themes.Providers.DetailHelper.recordId,
|
||||
IsTransfer: Transfer,
|
||||
OtherPackCount: OtherPackCount
|
||||
});
|
||||
if (callback != null)
|
||||
callback(instance.SerialNoList);
|
||||
if (instance.StockType == false) {
|
||||
instance.ParentStockId = 0;
|
||||
instance.ParentStockName = "";
|
||||
}
|
||||
if (responce.result.StockTypeId == 2 && instance.DcTypeId == Bizgaze.Apps.Transact.Enums.DcType.Outward) {
|
||||
instance.GetItemSerialNos(responce.result.StockId, callback);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
getcount() {
|
||||
var instance = this;
|
||||
Bizgaze.Apps.Transact.Managers.DCManager.Instance().GetSerialNosCount($("#hf_pk_value").val(), instance.DcTypeId, instance.IsTransfer).then(function (responce) {
|
||||
if (responce.result != null) {
|
||||
$('#txt_total').text(responce.result.TotalSerialNos);
|
||||
$('#txt_scanned').text(responce.result.ScannedSerialNos);
|
||||
$('#txt_remaining').text(responce.result.RemainingSerialNos);
|
||||
instance.ScannedCount = responce.result.ScannedSerialNos;
|
||||
}
|
||||
});
|
||||
}
|
||||
checkPrintLabels() {
|
||||
var instance = this;
|
||||
instance.IsEnableSerialNo = false;
|
||||
$("#li_DetailSetting_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_PrintLabels").addClass("hidden");
|
||||
instance.fileCacheHelper.loadJsFile("apps/transact/managers/inventory/dcmanager.js", function () {
|
||||
var postdata = {
|
||||
dcid: Unibase.Themes.Providers.DetailHelper.recordId
|
||||
};
|
||||
$('.DetailSetting_' + Unibase.Themes.Providers.DetailHelper.installedAppId + '_PrintLabels').unbind().click(function () {
|
||||
instance.navigationHelper.showLoading();
|
||||
Bizgaze.Apps.Transact.Managers.DCManager.Instance().generateCouponforSNo(postdata).then(function (responce) {
|
||||
instance.navigationHelper.hideLoading();
|
||||
if (responce.result != null) {
|
||||
MessageHelper.Instance().showSuccess(responce.message, '');
|
||||
$("#li_DetailSetting_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_PrintLabels").addClass("hidden");
|
||||
var obj = Unibase.Themes.Compact.Components.Details.Instance();
|
||||
obj._recordId = Unibase.Themes.Compact.Components.Details.Instance()._recordId;
|
||||
obj._installedAppId = Unibase.Themes.Compact.Components.Details.Instance()._installedAppId;
|
||||
Unibase.Themes.Compact.Components.Details.Instance().loadPortlets(obj);
|
||||
}
|
||||
else {
|
||||
MessageHelper.Instance().showError(responce.message, "div_message");
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
Bizgaze.Apps.Transact.Managers.DCManager.Instance().getdcSerialNos(Unibase.Themes.Providers.DetailHelper.recordId).then(function (responce) {
|
||||
if (responce.result.length > 0) {
|
||||
Bizgaze.Apps.Transact.Managers.DCManager.Instance().getActivedcSerialNos(Unibase.Themes.Providers.DetailHelper.recordId).then(function (responce) {
|
||||
if (responce.result.length > 0) {
|
||||
instance.IsEnableSerialNo = false;
|
||||
$("#li_DetailSetting_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_PrintLabels").removeClass("hidden");
|
||||
}
|
||||
else {
|
||||
instance.IsEnableSerialNo = true;
|
||||
$("#li_DetailSetting_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_PrintLabels").addClass("hidden");
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
$("#li_DetailSetting_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_PrintLabels").addClass("hidden");
|
||||
}
|
||||
});
|
||||
}
|
||||
loadCartonDetails() {
|
||||
Bizgaze.Apps.Transact.Controls.DcSerialNo.Instance().IsGenerateMaster = true;
|
||||
Bizgaze.Apps.Transact.Controls.DcSerialNo.Instance().ItemId = Number($(".txtAutoComplete_itemid option:selected").val());
|
||||
$(".labelSection_cartondetails").empty();
|
||||
$('.btnSection_StartScanning').unbind().click(function () {
|
||||
$(".section_ScanSerialNos").removeClass('hidden');
|
||||
});
|
||||
$(".labelSection_cartondetails").addClass('col-sm-12');
|
||||
var html2 = '<div class="panel-body"><input type="hidden" id="hdn_masterserialno" value="0">' +
|
||||
'<ul class="list-group product-code details">' +
|
||||
'<li class="list-group-item pa-10 clear added-row">' +
|
||||
'<div class="col-sm-12 row"><div class="col-sm-7"><strong>Product Code</strong>' +
|
||||
'</div><div class="col-sm-1"><span>:</span></div><div class="pull-right col-md-4"><span>' + $(".txtAutoComplete_itemid option:selected").text() + ' </span>' +
|
||||
'</div></div></li>' +
|
||||
'<li class="list-group-item pa-10 clear added-row"><div class="col-sm-12 row"><div class="col-sm-7"><strong>Boxes per Carton </strong></div><div class="col-sm-1"><span>:</span></div><div class="pull-right col-sm-4">' + $(".ddl_cascading_packcount option:selected").text() + '</div></div></li>' +
|
||||
'<li class="list-group-item pa-10 clear added-row"><div class="col-sm-12 row"><div class="col-sm-7"><strong>Secondary QR Code</strong></div><div class="col-sm-1"><span>:</span></div><div class="pull-right col-sm-4"> <span id="spn_mastercode"></span></div></div></li>' +
|
||||
'<li class="list-group-item pa-10 clear added-row"><div class="col-sm-12 row"><div class="col-sm-7"><strong>Total Boxes Scanned</strong></div><div class="col-sm-1"><span>:</span></div><div class="pull-right col-sm-4"><span id="spn_scanned"></span></div></div></li>' +
|
||||
'</ul></div>';
|
||||
$(".labelSection_cartondetails").append(html2);
|
||||
}
|
||||
generateMasterSNo() {
|
||||
var errorcount = 0;
|
||||
var BranchId = 0;
|
||||
if ($(".txtAutoComplete_itemid option:selected").val() == undefined) {
|
||||
errorcount = 1;
|
||||
Unibase.Platform.Forms.Components.FormViewer.Instance().showError("Please Select Product Code");
|
||||
return false;
|
||||
}
|
||||
else if ($(".ddl_cascading_packcount option:selected").val() == undefined) {
|
||||
errorcount = 1;
|
||||
Unibase.Platform.Forms.Components.FormViewer.Instance().showError("Please Select PackCount");
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
if ($(".ddl_cascading_packcount option:selected").text() == "Others") {
|
||||
if ($("txt_packs").val() == "") {
|
||||
errorcount = 1;
|
||||
Unibase.Platform.Forms.Components.FormViewer.Instance().showError("Please Enter Packs");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Unibase.Platform.Membership.Infos.Identity.getCurrentUser().settings == null) {
|
||||
errorcount = 1;
|
||||
Unibase.Platform.Forms.Components.FormViewer.Instance().showError("Please Configure Default Branch");
|
||||
return false;
|
||||
}
|
||||
else if (Unibase.Platform.Membership.Infos.Identity.getSetting("companyid") == null || Unibase.Platform.Membership.Infos.Identity.getSetting("companyid") == undefined) {
|
||||
errorcount = 1;
|
||||
Unibase.Platform.Forms.Components.FormViewer.Instance().showError("Please Configure Default Branch");
|
||||
return false;
|
||||
}
|
||||
if (Unibase.Platform.Membership.Infos.Identity.getCurrentUser().settings != null) {
|
||||
var companySetting = Unibase.Platform.Membership.Infos.Identity.getCurrentUser().settings.find(x => x.settingName == "companyid");
|
||||
if (companySetting != null) {
|
||||
Bizgaze.Apps.Transact.Controls.DcSerialNo.Instance().BranchId = Number(Unibase.Platform.Membership.Infos.Identity.getCurrentUser().settings.find(x => x.settingName == "branchid").settingValue);
|
||||
}
|
||||
}
|
||||
if (errorcount == 0) {
|
||||
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/transact/managers/inventory/dcmanager.js", function () {
|
||||
var postdata = {
|
||||
CurrentWarehouseId: Bizgaze.Apps.Transact.Controls.DcSerialNo.Instance().BranchId,
|
||||
ItemId: Number($(".txtAutoComplete_itemid option:selected").val()),
|
||||
Quantity: 0
|
||||
};
|
||||
Bizgaze.Apps.Transact.Managers.DCManager.Instance().generateMasterSerialNo(postdata).then(function (responce) {
|
||||
var data = JSON.parse(responce.result);
|
||||
$("#spn_mastercode").empty();
|
||||
$("#spn_mastercode").text(data.SerialNo);
|
||||
$("#hdn_masterserialno").val(data.StockId);
|
||||
DcSerialNo.Instance().SerialNoList[0].CurrentParentId = data.StockId;
|
||||
DcSerialNo.Instance().SerialNoList[0].CurrentParentName = data.SerialNo;
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === undefined) {
|
||||
this.instance = new DcSerialNo();
|
||||
}
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
Controls.DcSerialNo = DcSerialNo;
|
||||
})(Controls = Transact.Controls || (Transact.Controls = {}));
|
||||
})(Transact = Apps.Transact || (Apps.Transact = {}));
|
||||
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
|
||||
})(Bizgaze || (Bizgaze = {}));
|
||||
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
@@ -0,0 +1,41 @@
|
||||
var Bizgaze;
|
||||
(function (Bizgaze) {
|
||||
let Apps;
|
||||
(function (Apps) {
|
||||
let Transact;
|
||||
(function (Transact) {
|
||||
let Controls;
|
||||
(function (Controls) {
|
||||
class DcSerialNo_Setting {
|
||||
loadSettingHtml() {
|
||||
return ``;
|
||||
}
|
||||
bindControlData(controldatajson) {
|
||||
return "";
|
||||
}
|
||||
SaveControlData(controldatajson) {
|
||||
return "";
|
||||
}
|
||||
loadControlPropertiesHtml(Container) {
|
||||
return ``;
|
||||
}
|
||||
bindPropertySettings(prop) {
|
||||
var propertySettings = prop.PropertySettings;
|
||||
return "";
|
||||
}
|
||||
savePropertySettings(prop) {
|
||||
var propertySettings = prop.PropertySettings;
|
||||
return "";
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === undefined) {
|
||||
this.instance = new DcSerialNo_Setting();
|
||||
}
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
Controls.DcSerialNo_Setting = DcSerialNo_Setting;
|
||||
})(Controls = Transact.Controls || (Transact.Controls = {}));
|
||||
})(Transact = Apps.Transact || (Apps.Transact = {}));
|
||||
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
|
||||
})(Bizgaze || (Bizgaze = {}));
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"dcserialno.setting.js","sourceRoot":"","sources":["dcserialno.setting.ts"],"names":[],"mappings":"AAAA,IAAU,OAAO,CAoChB;AApCD,WAAU,OAAO;IACb,IAAiB,IAAI,CAkCxB;IAlCG,WAAiB,IAAI;QACjB,IAAiB,QAAQ,CAgC5B;QAhCG,WAAiB,QAAQ;YACrB,IAAiB,QAAQ,CA8B5B;YA9BG,WAAiB,QAAQ;gBACrB,MAAa,kBAAkB;oBAC/B,eAAe;wBACX,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,eAAe,CAAC,eAAoB;wBAChC,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,eAAe,CAAC,eAAoB;wBAChC,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,yBAAyB,CAAC,SAAS;wBAC/B,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,oBAAoB,CAAC,IAAgB;wBACjC,IAAI,gBAAgB,GAA6B,IAAI,CAAC,gBAAgB,CAAC;wBACvE,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,oBAAoB,CAAC,IAAgB;wBACjC,IAAI,gBAAgB,GAA6B,IAAI,CAAC,gBAAgB,CAAC;wBACvE,OAAO,EAAE,CAAC;oBACd,CAAC;oBAED,MAAM,CAAC,QAAQ;wBACX,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE;4BAC7B,IAAI,CAAC,QAAQ,GAAG,IAAI,kBAAkB,EAAE,CAAC;yBAC5C;wBACD,OAAO,IAAI,CAAC,QAAQ,CAAC;oBACzB,CAAC;iBACJ;gBA5BgB,2BAAkB,qBA4BlC,CAAA;YACL,CAAC,EA9BoB,QAAQ,GAAR,iBAAQ,KAAR,iBAAQ,QA8B5B;QACL,CAAC,EAhCoB,QAAQ,GAAR,aAAQ,KAAR,aAAQ,QAgC5B;IACL,CAAC,EAlCoB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAkCxB;AACD,CAAC,EApCS,OAAO,KAAP,OAAO,QAoChB"}
|
||||
+1
@@ -0,0 +1 @@
|
||||
var Bizgaze;(function(n){let t;(function(n){let t;(function(n){let t;(function(n){class t{loadSettingHtml(){return``}bindControlData(){return""}SaveControlData(){return""}loadControlPropertiesHtml(){return``}bindPropertySettings(n){var t=n.PropertySettings;return""}savePropertySettings(n){var t=n.PropertySettings;return""}static Instance(){return this.instance===undefined&&(this.instance=new t),this.instance}}n.DcSerialNo_Setting=t})(t=n.Controls||(n.Controls={}))})(t=n.Transact||(n.Transact={}))})(t=n.Apps||(n.Apps={}))})(Bizgaze||(Bizgaze={}));
|
||||
@@ -0,0 +1,382 @@
|
||||
var Bizgaze;
|
||||
(function (Bizgaze) {
|
||||
let Apps;
|
||||
(function (Apps) {
|
||||
let Transact;
|
||||
(function (Transact) {
|
||||
let Controls;
|
||||
(function (Controls) {
|
||||
class DeliveredSerialNos extends Unibase.Platform.Core.BaseComponent {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.AddedSerialNos = [];
|
||||
this.SerialNoList = [];
|
||||
this.ScannedCount = 0;
|
||||
this.DcTypeId = 0;
|
||||
this.BranchId = 0;
|
||||
this.IsTransfer = "false";
|
||||
this.ScannedSNoCount = 0;
|
||||
}
|
||||
init(containerid, SerialNo, callback) {
|
||||
var instance = this;
|
||||
$(".section_Scan").addClass('hidden');
|
||||
instance.SerialNoList = [];
|
||||
instance.AddedSerialNos = [];
|
||||
instance.ScannedSNoCount = 0;
|
||||
Unibase.Forms.Controls.Scan.Instance().data = [];
|
||||
var html = '<input type="hidden" id="hdn_customcontrol" class="value-control" value="Bizgaze.Apps.Transact.Controls.DcSerialNo.Instance().getSerialNos();"><div class="Added_SerialNos hidden card Section mt-20"><div class="card-header" id="section_SerialNos">Added Items</div><div class="card-body"><div class="">' +
|
||||
'<div class="panel-body Active_serialnos"><ul class="stock-item-serialnos added-row list-group"></ul></div></div></div></div><div class="delivered_SerialNos hidden card Section mt-20"><div class="card-header" id="section_AllocatedSerialNos">' +
|
||||
'<a class="btn_Addedserialno_angle text-dark" href="javascript:;" onclick="javascript: return Bizgaze.Apps.Transact.Controls.DcSerialNo.instance.showAddedSerialNos()"><i class="fa fa-angle-down hidden"></i><i class="fa fa-angle-right"></i><span class="ml-10"><a class="serial-link mt-10" href="javascript:;" ></a></span></a></div><div class="card-body"><div class="">' +
|
||||
'<div class="panel-body Allocated_serialnos"><ul class="addedd-serialnos added-row list-group"></ul></div></div></div></div>' +
|
||||
'</div>';
|
||||
$(containerid).append(html);
|
||||
instance.DcTypeId = Number(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_dctypeid").Value);
|
||||
instance.IsTransfer = Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_istransfer").Value;
|
||||
if (instance.DcTypeId == Bizgaze.Apps.Transact.Enums.DcType.Inward && instance.IsTransfer) {
|
||||
instance.BranchId = Number(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_shipfromaddressid").Value);
|
||||
}
|
||||
else if (instance.DcTypeId == Bizgaze.Apps.Transact.Enums.DcType.Inward) {
|
||||
instance.BranchId = Number(Unibase.Platform.Membership.Infos.Identity.getCurrentUser().settings.find(x => x.settingName == "branchid").settingValue);
|
||||
}
|
||||
else if (instance.DcTypeId == Bizgaze.Apps.Transact.Enums.DcType.Outward) {
|
||||
instance.BranchId = Number(Unibase.Platform.Membership.Infos.Identity.getCurrentUser().settings.find(x => x.settingName == "branchid").settingValue);
|
||||
}
|
||||
instance.getcount();
|
||||
$("#spn_required").prop('disabled', true);
|
||||
var html111 = '<div data-simplebar class="simple-scroll-bar scrollable bg-cyan-light-5 control-sorting row pl-50 pa-10 pr-20" id="footersection123" style="overflow-y:auto;overflow-x:none;"><div class="row"><div class="mb-15 col-lg-4" ><div class="Border"><div class="Border1 hidden"><div class="pull-left" id="dragWidget"><a class="btn btn-icon btn-rounded btn-flush-primary flush-soft-hover"><span class="btn-icon-wrap"><i class="ti-fullscreen"></i></span></a></div><div class="card-action-wrap pull-right m-t-sm m-r-lg"><a href="javascript:;" class="inline-block btn btn-icon btn-rounded btn-flush-primary flush-soft-hover"><span class="btn-icon-wrap"><i class="ti-pencil"></i></span></a><a href="javascript:;" class="btn btn-icon btn-rounded btn-flush-primary flush-soft-hover" title="Permissions"><span class="btn-icon-wrap"><i class="ti-key"></i></span></a><span class="btn-icon-wrap"><i class="ti-trash"></i></span></a></div></div><div class="cardbody"><div class="" id=""><div class="card mb-0 card-sm shadow-hover" style="height:100px;"><div class="card-body"><span class="font-14 font-weight-400 text-dark">Total</span><span class="d-block align-items-center card-action-wrap pull-right font-11"><a href="#" class="inline-block full-screen hidden" id=""><i class="ion ion-md-expand"></i></a></span><div class="mt-15"> <span id="" class="h4 block mb-10"><span class="display-5 font-weight-400" id="txt_total"></span></span><span id=""></span><div class="pull-right" style="margin-top:-10px;"><div id=""></div><div class="py-0" style="margin-top:-10px;"></div></div></div></div></div></div></div></div></div>' +
|
||||
'<div class="mb-15 col-lg-4" ><div class="Border"><div class="Border1 hidden"><div class="pull-left" id="dragWidget"><a class="btn btn-icon btn-rounded btn-flush-primary flush-soft-hover"><span class="btn-icon-wrap"><i class="ti-fullscreen"></i></span></a></div><div class="card-action-wrap pull-right m-t-sm m-r-lg"><a href="javascript:;" class="inline-block btn btn-icon btn-rounded btn-flush-primary flush-soft-hover"><span class="btn-icon-wrap"><i class="ti-pencil"></i></span></a><a href="javascript:;" class="btn btn-icon btn-rounded btn-flush-primary flush-soft-hover" title="Permissions"><span class="btn-icon-wrap"><i class="ti-key"></i></span></a><span class="btn-icon-wrap"><i class="ti-trash"></i></span></a></div></div><div class="cardbody"><div class="" id=""><div class="card mb-0 card-sm shadow-hover" style="height:100px;"><div class="card-body"><span class="font-14 font-weight-400 text-dark">Scanned</span><span class="d-block align-items-center card-action-wrap pull-right font-11"><a href="#" class="inline-block full-screen hidden" id=""><i class="ion ion-md-expand"></i></a></span><div class="mt-15"> <span id="" class="h4 block mb-10"><span class="display-5 font-weight-400" id="txt_scanned"></span></span><span id=""></span><div class="pull-right" style="margin-top:-10px;"><div id=""></div><div class="py-0" style="margin-top:-10px;"></div></div></div></div></div></div></div></div></div>' +
|
||||
'<div class="mb-15 col-lg-4" ><div class="Border"><div class="Border1 hidden"><div class="pull-left" id="dragWidget"><a class="btn btn-icon btn-rounded btn-flush-primary flush-soft-hover"><span class="btn-icon-wrap"><i class="ti-fullscreen"></i></span></a></div><div class="card-action-wrap pull-right m-t-sm m-r-lg"><a href="javascript:;" class="inline-block btn btn-icon btn-rounded btn-flush-primary flush-soft-hover"><span class="btn-icon-wrap"><i class="ti-pencil"></i></span></a><a href="javascript:;" class="btn btn-icon btn-rounded btn-flush-primary flush-soft-hover" title="Permissions"><span class="btn-icon-wrap"><i class="ti-key"></i></span></a><span class="btn-icon-wrap"><i class="ti-trash"></i></span></a></div></div><div class="cardbody"><div class="" id=""><div class="card mb-0 card-sm shadow-hover" style="height:100px;"><div class="card-body"><span class="font-14 font-weight-400 text-dark">Remaining</span><span class="d-block align-items-center card-action-wrap pull-right font-11"><a href="#" class="inline-block full-screen hidden" id=""><i class="ion ion-md-expand"></i></a></span><div class="mt-15"> <span id="" class="h4 block mb-10"><span class="display-5 font-weight-400" id="txt_remaining"></span></span><span id=""></span><div class="pull-right" style="margin-top:-10px;"><div id=""></div><div class="py-0" style="margin-top:-10px;"></div></div></div></div></div></div></div></div></div>' +
|
||||
'</div></div>';
|
||||
$("#formFooter").before(html111);
|
||||
$('#txt_scanned').prop('disabled', true);
|
||||
$('#txt_remaining').prop('disabled', true);
|
||||
$('#txt_total').prop('disabled', true);
|
||||
$(".formviewer_id").css('height', $(".formviewer_id").height() - $("#footersection123").height() + 'px');
|
||||
$('#btnDynamicSave').addClass('hidden');
|
||||
$("#form-container-" + $("#hf_FormId").val()).find('#btn_CloseForm').off('click');
|
||||
$('#btn_CloseForm').click(function () {
|
||||
Unibase.Platform.Helpers.NavigationHelper.Instance().closePopUp();
|
||||
var detailInstance = Unibase.Themes.Compact.Components.Details.Instance();
|
||||
var panel = "#" + detailInstance._containerId;
|
||||
var obj = Unibase.Themes.Compact.Components.Details.Instance();
|
||||
obj._recordId = Unibase.Themes.Providers.DetailHelper.recordId;
|
||||
obj._installedAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
|
||||
var InstalledAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
|
||||
detailInstance.loadAppDefaultWidget(obj, panel, detailInstance._containerId, function () {
|
||||
detailInstance.loadDefaultWidgets(obj._installedAppId, panel);
|
||||
detailInstance.LoadApprovals(obj._recordId, obj._installedAppId);
|
||||
});
|
||||
});
|
||||
}
|
||||
_ScanSerailNo(serialno, container, propobj, callback) {
|
||||
$("#divListContainer").addClass('col-sm-12');
|
||||
var instance = DeliveredSerialNos.instance;
|
||||
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/transact/managers/inventory/dcmanager.js", function () {
|
||||
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/transact/enums/enum.js", function () {
|
||||
if ($('.stock-item-serialnos').length == 0) {
|
||||
instance.init(container, serialno, callback);
|
||||
}
|
||||
if (instance.AddedSerialNos.filter(x => x == serialno).length > 1) {
|
||||
Unibase.Platform.Forms.Components.FormViewer.Instance().showError("Serial No Added");
|
||||
return false;
|
||||
}
|
||||
instance.AddedSerialNos.push(serialno);
|
||||
var url = '';
|
||||
var dcitemid = Number($("#hf_pk_value").val());
|
||||
if (instance.DcTypeId == Bizgaze.Apps.Transact.Enums.DcType.Inward) {
|
||||
url = 'apis/v4/bizgaze/transact/dcs/GetTransferSerialNobyBranchId/serialno/' + serialno + '/branchid/' + instance.BranchId + '/itemid/' + Number($("#hf_itemid_" + dcitemid).val());
|
||||
}
|
||||
else if (instance.DcTypeId = Bizgaze.Apps.Transact.Enums.DcType.Outward) {
|
||||
url = 'apis/v4/bizgaze/transact/dcs/getitemserialnosbyparentname/itemid/' + Number($("#hf_itemid_" + dcitemid).val()) + '/branchid/' + instance.BranchId + '/serialno/' + serialno;
|
||||
}
|
||||
Bizgaze.Apps.Transact.Managers.DCManager.Instance().scanMasterSerialNo(url).then(function (responce) {
|
||||
var list = [];
|
||||
list = responce.result;
|
||||
if (responce.result.length == 0) {
|
||||
$(".scan_MasterScanSerialNumber").val('');
|
||||
Unibase.Platform.Forms.Components.FormViewer.Instance().showError(responce.message);
|
||||
}
|
||||
else if (responce.result[0].RefId != 0) {
|
||||
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/paybacks/managers/schememanager.js", function () {
|
||||
Bizgaze.Apps.Paybacks.Managers.SchemeManager.Instance().getCouponGeneration(Number(responce.result[0].RefId)).then(function (result) {
|
||||
if (result.result != null) {
|
||||
if (result.result.QuantityReceived == 0) {
|
||||
$(".Active_serialnos").empty();
|
||||
MessageHelper.Instance().showError("Cannot use the coupon before receiving coupons", $("#form-container-" + $("#hf_FormId").val()).find(".bizgaze_FormErrorMessages").attr('id'));
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
$(".txtAutoComplete_itemid").attr('disabled', "true");
|
||||
if ($(".Added_SerialNos").hasClass('hidden')) {
|
||||
$(".Added_SerialNos").removeClass('hidden');
|
||||
}
|
||||
instance.bindSerialNo(list, callback, false);
|
||||
Unibase.Platform.Automation.Components.Notifier.Instance().playAudio(Unibase.Platform.Automation.Enums.NotifyAlerts.CouponBeep);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
else {
|
||||
$(".txtAutoComplete_itemid").attr('disabled', "true");
|
||||
if ($(".Added_SerialNos").hasClass('hidden')) {
|
||||
$(".Added_SerialNos").removeClass('hidden');
|
||||
}
|
||||
instance.bindSerialNo(list, callback, false);
|
||||
Unibase.Platform.Automation.Components.Notifier.Instance().playAudio(Unibase.Platform.Automation.Enums.NotifyAlerts.CouponBeep);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
bindSerialNo(result, callback, IsEdit) {
|
||||
for (var i = 0; i < result.length; i++) {
|
||||
var instance = this;
|
||||
var rowid = moment().valueOf();
|
||||
var html = '<li class="list-group-item pa-10 clear Serialno-row added-row li_' + rowid + ' serialno_' + result[i].CurrentParentId + '"><input type="hidden" id="hf_rowid" value="' + rowid + '"><input type="hidden" id="hf_stocktypeid' + rowid + '" value="' + result[i].StockTypeId + '">' +
|
||||
'<div class="row"><input type="hidden" id="hdn_stockid_' + result[i].StockId + '" value="' + result[i].StockId + '"><input type="hidden" id="hdn_stockstatusid_' + rowid + '" value="' + result[i].StockStatusId + '"><input type="hidden" id="hdn_stockid_' + rowid + '" value="' + result[i].StockId + '"><input type="hidden" id="hdn_parentstockId_' + rowid + '" value="' + result[i].CurrentParentId + '">';
|
||||
if (result[i].StockTypeId == 2) {
|
||||
html += '<div class="col-sm-5 ml-10 div_Serialno divserialno_' + result[i].CurrentParentId + '"><a class="btn_parestserialno_angle' + rowid + ' text-dark" href="javascript:;" onclick="javascript: return Bizgaze.Apps.Transact.Controls.DeliveredSerialNos.Instance().showDetails(' + result[i].StockId + ',' + rowid + ')"><i class="fa fa-angle-down hidden"></i><i class="fa fa-angle-right"></i><span class="ml-10"><a class="serial-link mt-10 txtSerialNo_' + rowid + '" " id="txt_' + result[i].StockId + '" href="javascript:;" >' + result[i].SerialNo + '</a></span></a></div>';
|
||||
html += '<div class="col-sm-5"><small id="parent_info' + result[i].CurrentParentId + '" style = "color:red;">Master Serial No</small></div>';
|
||||
}
|
||||
else {
|
||||
html += '<div class="col-sm-12 row div_itemserialnos' + rowid + '"><div class="col-sm-10 ml-35 div_Serialno divserialno_' + result[i].CurrentParentId + '">';
|
||||
html += '<strong class="textcolumn txt_' + result[i].SerialNo + ' txtSerialNo_' + rowid + '" id="txt_' + result[i].StockId + '">' + result[i].SerialNo + '</strong></div>';
|
||||
}
|
||||
if (result[i].StockTypeId == Bizgaze.Apps.Transact.Enums.StockType.Package) {
|
||||
}
|
||||
html += '</li>';
|
||||
if (result[i].StockTypeId == 1) {
|
||||
html += '</div>';
|
||||
}
|
||||
html += '</div>';
|
||||
$('.stock-item-serialnos:last').append(html);
|
||||
if (result[i].StockTypeId == 2 && result[i].PackCount == 1) {
|
||||
instance.ScannedCount = instance.ScannedCount;
|
||||
}
|
||||
else {
|
||||
instance.ScannedCount += 1;
|
||||
$("#txt_scanned").text(Number($("#txt_scanned").text()) + 1);
|
||||
$("#txt_remaining").text(Number($("#txt_total").text()) - Number($("#txt_scanned").text()));
|
||||
}
|
||||
instance.AddedSerialNos.push(result[i].SerialNo);
|
||||
if (Number($("#txt_remaining").text()) == 0) {
|
||||
$("#scan_control").addClass('hidden');
|
||||
}
|
||||
}
|
||||
}
|
||||
getcount() {
|
||||
var instance = this;
|
||||
Bizgaze.Apps.Transact.Managers.DCManager.Instance().GetSerialNosCount($("#hf_pk_value").val(), instance.DcTypeId, instance.IsTransfer).then(function (responce) {
|
||||
if (responce.result != null) {
|
||||
$(".section_Scan").removeClass('hidden');
|
||||
$('#txt_total').text(responce.result.TotalSerialNos);
|
||||
$('#txt_scanned').text(responce.result.ScannedSerialNos);
|
||||
$('#txt_remaining').text(responce.result.RemainingSerialNos);
|
||||
instance.ScannedCount = responce.result.ScannedSerialNos;
|
||||
instance.ScannedSNoCount = responce.result.ScannedSerialNos;
|
||||
if (responce.result.TotalSerialNos == responce.result.ScannedSerialNos) {
|
||||
$("#scan_control").addClass('hidden');
|
||||
var html = '<div class="row col-12 text-center" id="div_ScanControl"><strong class="col-12 text-center" style="color:green">Scanning Completed</strong></div>';
|
||||
$(".divCustomProperties").after(html);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
getDeliveredSerialNos(callback) {
|
||||
Unibase.Forms.Controls.Scan.Instance().data = [];
|
||||
var instance = this;
|
||||
var StockStatusId = Bizgaze.Apps.Transact.Enums.StockStatus.Delivered;
|
||||
if (instance.IsTransfer && instance.DcTypeId == Bizgaze.Apps.Transact.Enums.DcType.Outward) {
|
||||
StockStatusId = Bizgaze.Apps.Transact.Enums.StockStatus.Transfer;
|
||||
}
|
||||
var url = 'apis/v4/bizgaze/transact/dcs/getdeliveredstocks/dcitemid/' + $("#hf_pk_value").val() + '/StockStatusId/' + StockStatusId;
|
||||
if (instance.DcTypeId == Bizgaze.Apps.Transact.Enums.DcType.Inward) {
|
||||
url = 'apis/v4/bizgaze/transact/dcs/gettransferedstocks/dcitemid/' + $("#hf_pk_value").val();
|
||||
}
|
||||
Bizgaze.Apps.Transact.Managers.DCManager.Instance().getAllocatedStocks(url).then(function (responce) {
|
||||
$('.addedd-serialnos').empty();
|
||||
$(".delivered_SerialNos").removeClass('hidden');
|
||||
if (responce.result.length > 0) {
|
||||
if (instance.DcTypeId == Bizgaze.Apps.Transact.Enums.DcType.Inward) {
|
||||
$(".serial-link").text('Allocated Serial Nos');
|
||||
}
|
||||
else if (instance.DcTypeId == Bizgaze.Apps.Transact.Enums.DcType.Outward && instance.IsTransfer) {
|
||||
$(".serial-link").text('Transfer Serial Nos');
|
||||
}
|
||||
else {
|
||||
$(".serial-link").text('Delivered Serial Nos');
|
||||
}
|
||||
responce.result = responce.result.filter(x => x.StockStatusId != Bizgaze.Apps.Transact.Enums.StockStatus.Active);
|
||||
DeliveredSerialNos.instance.bindSerialNo(responce.result, callback, true);
|
||||
}
|
||||
else {
|
||||
if (!$(".delivered_SerialNos").hasClass('hidden')) {
|
||||
$(".delivered_SerialNos").addClass('hidden');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
removeRow(stockid, rowid, callback) {
|
||||
var instance = DeliveredSerialNos.Instance();
|
||||
if (((Number($("#hdn_stockstatusid_" + rowid).val()) == Bizgaze.Apps.Transact.Enums.StockStatus.Delivered) || (Number($("#hdn_stockstatusid_" + rowid).val()) == Bizgaze.Apps.Transact.Enums.StockStatus.Allocated) || Number($("#hdn_stockstatusid_" + rowid).val()) == Bizgaze.Apps.Transact.Enums.StockStatus.Transfer && instance.DcTypeId == Bizgaze.Apps.Transact.Enums.DcType.Outward) || (Number($("#hdn_stockstatusid_" + rowid).val()) == Bizgaze.Apps.Transact.Enums.StockStatus.Allocated && instance.DcTypeId == Bizgaze.Apps.Transact.Enums.DcType.Inward)) {
|
||||
var ErrorMsg = "";
|
||||
if ($("#hf_stocktypeid" + rowid).val() == "2")
|
||||
ErrorMsg = "Are You Sure,Item Serial No's will be Deleted. If You Delete Master Serial No.";
|
||||
else
|
||||
ErrorMsg = "Do you want to Delete Item Serial Number ?";
|
||||
bootbox.confirm(ErrorMsg, function (result) {
|
||||
if (result) {
|
||||
var StockId = $("#hdn_stockid_" + rowid).val();
|
||||
let postdata = { StockId: Number(StockId), StockStatusId: Number($("#hdn_stockstatusid_" + rowid).val()), DcId: Unibase.Themes.Providers.DetailHelper.recordId, DcTypeId: instance.DcTypeId, OutwardDCItemId: Number($("#hf_pk_value").val()) };
|
||||
Bizgaze.Apps.Transact.Managers.DCManager.Instance().deleteSerialNo(postdata).then(function (response) {
|
||||
if (response.result != null) {
|
||||
$(".stock-item-serialnos").find(".serialno_" + stockid).each(function () {
|
||||
var rowid = $(this).find("#hf_rowid").val();
|
||||
DeliveredSerialNos.instance.AddedSerialNos.splice(DeliveredSerialNos.instance.AddedSerialNos.findIndex(p => p == $(".txtSerialNo_" + rowid).text()), 1);
|
||||
DeliveredSerialNos.instance.SerialNoList.splice(DeliveredSerialNos.instance.SerialNoList.findIndex(p => p == $(".txtSerialNo_" + rowid).text()), 1);
|
||||
});
|
||||
$(".li_" + rowid).remove();
|
||||
instance.getcount();
|
||||
instance.getDeliveredSerialNos(callback);
|
||||
MessageHelper.Instance().showSuccess(response.result.Message, '');
|
||||
}
|
||||
else {
|
||||
Unibase.Platform.Forms.Components.FormViewer.Instance().showError(response.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
if ($("#hf_stocktypeid" + rowid).val() == "2")
|
||||
ErrorMsg = "Are You Sure,Item Serial No's will be Deleted. If You Delete Master Serial No.";
|
||||
else
|
||||
ErrorMsg = "Do you want to Delete Item Serial Number ?";
|
||||
bootbox.confirm(ErrorMsg, function (result) {
|
||||
if (result) {
|
||||
$(".li_" + rowid).remove();
|
||||
var _itemlenth = $(".stock-item-serialnos").find(".serialno_" + stockid).length;
|
||||
$(".stock-item-serialnos").find(".serialno_" + stockid).each(function () {
|
||||
var rowid = $(this).find("#hf_rowid").val();
|
||||
DeliveredSerialNos.instance.AddedSerialNos.splice(DeliveredSerialNos.instance.AddedSerialNos.findIndex(p => p == $(".txtSerialNo_" + rowid).text()), 1);
|
||||
DeliveredSerialNos.instance.SerialNoList.splice(DeliveredSerialNos.instance.SerialNoList.findIndex(p => p == $(".txtSerialNo_" + rowid).text()), 1);
|
||||
});
|
||||
$(".serialno_" + stockid).remove();
|
||||
DeliveredSerialNos.instance.ScannedCount -= _itemlenth;
|
||||
$('#txt_scanned').text(DeliveredSerialNos.instance.ScannedCount);
|
||||
$('#txt_remaining').text(Number($("#txt_total").text()) - Number($("#txt_scanned").text()));
|
||||
DeliveredSerialNos.instance.SerialNoList.splice(DeliveredSerialNos.instance.SerialNoList.findIndex(p => p == $(".txtSerialNo_" + rowid).text()), 1);
|
||||
DeliveredSerialNos.instance.AddedSerialNos.splice(DeliveredSerialNos.instance.AddedSerialNos.findIndex(p => p == $(".txtSerialNo_" + rowid).text()), 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
showDetails(stockid, rowid) {
|
||||
$(".btn_parestserialno_angle" + rowid).find(".fa-angle-down").toggleClass("hidden");
|
||||
$(".btn_parestserialno_angle" + rowid).find(".fa-angle-right").toggleClass("hidden");
|
||||
$(".serialno_" + stockid).toggleClass("hidden");
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === undefined) {
|
||||
this.instance = new DeliveredSerialNos();
|
||||
}
|
||||
return this.instance;
|
||||
}
|
||||
ScanSerailNo(serialno, container, propobj, callback) {
|
||||
if (serialno != '')
|
||||
$("#divListContainer").addClass('col-sm-12');
|
||||
var instance = DeliveredSerialNos.instance;
|
||||
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/transact/managers/inventory/dcmanager.js", function () {
|
||||
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/transact/enums/enum.js", function () {
|
||||
if ($('.stock-item-serialnos').length == 0) {
|
||||
instance.init(container, serialno, callback);
|
||||
}
|
||||
var dup = Bizgaze.Apps.Transact.Controls.DeliveredSerialNos.Instance().AddedSerialNos.filter(x => x == serialno).length;
|
||||
if (instance.AddedSerialNos.filter(x => x == serialno).length >= 1) {
|
||||
Unibase.Platform.Forms.Components.FormViewer.Instance().showError("Serial No Already Added");
|
||||
return false;
|
||||
}
|
||||
instance.AddedSerialNos.push(serialno);
|
||||
var dcid = 0;
|
||||
if (Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.length != 0) {
|
||||
var InstalledAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
|
||||
dcid = Number(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_dcid").Value);
|
||||
}
|
||||
var url = '';
|
||||
var dcitemid = Number($("#hf_pk_value").val());
|
||||
url = 'apis/v4/bizgaze/transact/dcs/ScanItemSerialNosByparentName/itemid/' + Number($("#hf_itemid_" + dcitemid).val()) + '/dcid/' + dcid + '/serialno/' + serialno + '/dcitemid/' + dcitemid;
|
||||
Bizgaze.Apps.Transact.Managers.DCManager.Instance().scanMasterSerialNo(url).then(function (responce) {
|
||||
var list = [];
|
||||
list = responce.result;
|
||||
instance.ScannedSNoCount += responce.totalRecords;
|
||||
var StockId = responce.message;
|
||||
if (responce.result.length == 0) {
|
||||
$(".scan_MasterScanSerialNumber").val('');
|
||||
instance.AddedSerialNos.splice(instance.AddedSerialNos.findIndex(x => x == serialno), 1);
|
||||
Unibase.Platform.Forms.Components.FormViewer.Instance().showError(responce.message);
|
||||
}
|
||||
else {
|
||||
$(".txtAutoComplete_itemid").attr('disabled', "true");
|
||||
if ($(".Added_SerialNos").hasClass('hidden')) {
|
||||
$(".Added_SerialNos").removeClass('hidden');
|
||||
}
|
||||
if (instance.ScannedSNoCount > Number($("#txt_total").text())) {
|
||||
MessageHelper.Instance().showError("Serial No Count Exceeded - " + serialno + Number($("#txt_total").text()) + "", $("#form-container-" + $("#hf_FormId").val()).find(".bizgaze_FormErrorMessages").attr('id'));
|
||||
setTimeout(function () {
|
||||
$(".bizgaze_FormErrorMessages").empty();
|
||||
}, 1500);
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
instance.bindSerialNo(list, callback, false);
|
||||
Unibase.Platform.Automation.Components.Notifier.Instance().playAudio(Unibase.Platform.Automation.Enums.NotifyAlerts.CouponBeep);
|
||||
instance.updateSerialNo(StockId, responce.totalRecords);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
scanDCAndGrn(DcId, StockId, DcItemId) {
|
||||
debugger;
|
||||
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/transact/managers/inventory/dcmanager.js", function () {
|
||||
Bizgaze.Apps.Transact.Managers.DCManager.Instance().scanDCAndGrn(DcId, StockId, DcItemId).then(function (responce) {
|
||||
debugger;
|
||||
});
|
||||
});
|
||||
}
|
||||
validateserialno(result, callback, IsEdit) {
|
||||
debugger;
|
||||
var _length = result.filter(x => x.StockTypeId == 1).length;
|
||||
if (_length > Number($("#txt_total").text()) && !IsEdit) {
|
||||
MessageHelper.Instance().showError("Serial No Count Exceeded " + Number($("#txt_total").text()) + "", $("#form-container-" + $("#hf_FormId").val()).find(".bizgaze_FormErrorMessages").attr('id'));
|
||||
setTimeout(function () {
|
||||
$(".bizgaze_FormErrorMessages").empty();
|
||||
}, 1500);
|
||||
if (Number($("#txt_remaining").text()) == 0) {
|
||||
$("#scan_control").addClass('hidden');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
this.scanDCAndGrn(Unibase.Themes.Providers.DetailHelper.recordId, result[0].StockId, $("#hf_pk_value").val());
|
||||
this.bindSerialNo(result, callback, false);
|
||||
}
|
||||
}
|
||||
updateSerialNo(StockId, ScannedCount) {
|
||||
debugger;
|
||||
var instance = this;
|
||||
var url = 'apis/v4/bizgaze/transact/dcs/scandcandgrn/stockid/' + Number(StockId) + '/dcitemid/' + Number($("#hf_pk_value").val()) + '/dctypeid/' + instance.DcTypeId + '/istransfer/' + instance.IsTransfer + '/scannedcount/' + ScannedCount;
|
||||
Bizgaze.Apps.Transact.Managers.DCManager.Instance().scanMasterSerialNo(url).then(function (responce) {
|
||||
debugger;
|
||||
if (responce.result != null) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Controls.DeliveredSerialNos = DeliveredSerialNos;
|
||||
})(Controls = Transact.Controls || (Transact.Controls = {}));
|
||||
})(Transact = Apps.Transact || (Apps.Transact = {}));
|
||||
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
|
||||
})(Bizgaze || (Bizgaze = {}));
|
||||
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
@@ -0,0 +1,252 @@
|
||||
var Bizgaze;
|
||||
(function (Bizgaze) {
|
||||
let Apps;
|
||||
(function (Apps) {
|
||||
let Transact;
|
||||
(function (Transact) {
|
||||
let Controls;
|
||||
(function (Controls) {
|
||||
class EditItem extends Unibase.Platform.Core.BaseComponent {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.containerid = "";
|
||||
this.ItemList = [];
|
||||
this.DcTypeId = 0;
|
||||
this.PendingQty = 0;
|
||||
}
|
||||
init(formpropertyid, prop, callback) {
|
||||
var instance = this;
|
||||
instance.ItemList = [];
|
||||
instance.DcTypeId = 0;
|
||||
instance.PendingQty = 0;
|
||||
instance.fileCacheHelper.loadJsFiles(["apps/transact/managers/inventory/dcmanager.js", "apps/transact/managers/orders/ordermanager.js", "platform/core/helpers/numberhelper/numberhelper.js"], function () {
|
||||
instance.DcTypeId = Number(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_dctypeid").Value);
|
||||
instance.bindQuantityDetails();
|
||||
});
|
||||
}
|
||||
loadControl(containerid, prop) {
|
||||
var html = '<div class="card"><div class="card-body"><input type="hidden" id="hdn_customcontrol" class="value-control" value="Bizgaze.Apps.Transact.Controls.EditItem.Instance().getItems();"><span id="Itemname"></span><input type="hidden" id="hf_EditItemlist_ItemId"><input type="hidden" id="hf_EditItemlist_OrderItemId"><input type="hidden" id="hf_EditItemlist_MrpId"><input type="hidden" id="hf_EditItemlist_BatchId"></div></div>' +
|
||||
'<div class="alert-block m-t-lg"><input type="hidden" id="hf_packs" value="0"><input type="hidden" id="hf_pieces" value="0"><ul class="list-group m-t-sm"><li class="list-group-item clear"><div class="pull-right text-right" style = "width:125px;" id="qty" ><input id="txtDcItem_Quantity" onkeyup="Bizgaze.Apps.Transact.Controls.EditItem.Instance().del_changeQty();" class="form-control floating-label-control quantity" data-required="true" type="text" value="0" style = "text-align:center;"/><input type="hidden" id="hdnDcItem_Quantity">' +
|
||||
'</div><span id = "span_ItemName"></span></li><li class="floating-label-form-group-with-value list-group-item clear" ><div class="pull-right text-right" style = "width:125px;" ><input id="txtDcItem_DeliveredQty" onchange="Bizgaze.Apps.Transact.Controls.EditItem.Instance().updateDelMissingQty();" onkeyup="Bizgaze.Apps.Transact.Controls.EditItem.Instance().checkQty();" onblur="Bizgaze.Apps.Transact.Controls.EditItem.Instance().checkQty();" class="form-control floating-label-control" data-required="true" type="text" value="0" style = "text-align:center;" /><input type="hidden" id="hdnDcItem_DeliveredQty">' +
|
||||
'<input type="hidden" id = "lbl_deliveredqty"/></div>Delivered Qty</li><li class="list-group-item clear"><div class="pull-right text-right" style = "width:125px;" ><input id="txtDcItem_DamagedQty" onchange="Bizgaze.Apps.Transact.Controls.EditItem.Instance().updateDelMissingQty();" class="form-control" data-required="true" type="text" value ="0" style = "text-align:center;"/><input type="hidden" id="hdnDcItem_DamagedQty">' +
|
||||
'</div>Damaged Qty</li><li class="list-group-item clear"><div class="pull-right text-right" style = "width:125px;" ><input type="text" disabled class="form-control" id = "lblDcItem_MissingQty" readonly = "readonly" style = "text-align:center;" data-required="true" value="0"/><input type="hidden" id="hdnDcItem_MissingQty" ></div>Missing Qty</li></ul></div>';
|
||||
$("#" + containerid).html(html);
|
||||
$("#" + containerid).find(".quantity").change(function () { EditItem.Instance().del_changeQty(); });
|
||||
$('#txtDcItem_Quantity').keypress(function (event) {
|
||||
if ((event.which > 47 && event.which < 58) || (event.which == 46 || event.which == 8)) {
|
||||
}
|
||||
else {
|
||||
event.preventDefault();
|
||||
}
|
||||
}).on('paste', function (event) {
|
||||
event.preventDefault();
|
||||
});
|
||||
$('#txtDcItem_DeliveredQty').keypress(function (event) {
|
||||
if ((event.which > 47 && event.which < 58) || (event.which == 46 || event.which == 8)) {
|
||||
}
|
||||
else {
|
||||
event.preventDefault();
|
||||
}
|
||||
}).on('paste', function (event) {
|
||||
event.preventDefault();
|
||||
});
|
||||
$('#txtDcItem_DamagedQty').keypress(function (event) {
|
||||
if ((event.which > 47 && event.which < 58) || (event.which == 46 || event.which == 8)) {
|
||||
}
|
||||
else {
|
||||
event.preventDefault();
|
||||
}
|
||||
}).on('paste', function (event) {
|
||||
event.preventDefault();
|
||||
});
|
||||
}
|
||||
loadControlSettings(controlsettingjson, formpropertyid) {
|
||||
return ``;
|
||||
}
|
||||
loadPropertySettings(propertysettings, formpropertyid, DocPropertyName) {
|
||||
return ``;
|
||||
}
|
||||
bindEditFormDetails(formpropertyid, propval, DocPropertyName) {
|
||||
return ``;
|
||||
}
|
||||
bindQuantityDetails() {
|
||||
var instance = EditItem.Instance();
|
||||
Bizgaze.Apps.Transact.Managers.DCManager.Instance().getDcItemsbyId(Number($("#hf_pk_value").val())).then(function (responce) {
|
||||
var data = responce.result;
|
||||
var Quantity = data.In_Quantity;
|
||||
if (instance.DcTypeId == 2 || instance.DcTypeId == 4) {
|
||||
$("#span_ItemName").text("DC Qty");
|
||||
$("#div_FormName").text("DC Item Details");
|
||||
Quantity = data.Out_Quantity;
|
||||
}
|
||||
else {
|
||||
$("#span_ItemName").text("GRN Qty");
|
||||
$("#div_FormName").text("GRN Item Details");
|
||||
}
|
||||
var ItemName = data.ItemName + '-' + data.Sku;
|
||||
$("#Itemname").text(ItemName);
|
||||
$("#txtDcItem_DeliveredQty").val(data.DeliveredQty);
|
||||
$("#hdnDcItem_DeliveredQty").val(data.DeliveredQty);
|
||||
$("#lbl_deliveredqty").val(data.DeliveredQty);
|
||||
$('#txtDcItem_Quantity').val(Quantity);
|
||||
$('#hdnDcItem_Quantity').val(Quantity);
|
||||
$("#txtDcItem_DamagedQty").val(data.DamagedQty);
|
||||
$("#hdnDcItem_DamagedQty").val(data.DamagedQty);
|
||||
$("#hf_EditItemlist_ItemId").val(data.ItemId);
|
||||
$("#hf_EditItemlist_OrderItemId").val(data.OrderItemId);
|
||||
$("#hf_EditItemlist_BatchId").val(data.BatchId);
|
||||
$("#hf_EditItemlist_MrpId").val(data.MrpId);
|
||||
$("#hf_packs").val(data.Packs);
|
||||
$("#hf_pieces").val(data.Pieces);
|
||||
let MissingQty = Number(Quantity - Number(data.DeliveredQty + data.DamagedQty));
|
||||
if (MissingQty > 0)
|
||||
$("#lblDcItem_MissingQty").val(Unibase.Core.Helpers.NumberHelper.Instance().roundNumber(MissingQty, 2));
|
||||
$("#hdnDcItem_MissingQty").val(MissingQty);
|
||||
if (data.ParentId != 0) {
|
||||
$("#txtDcItem_DeliveredQty").attr('disabled', "true");
|
||||
$("#txtDcItem_Quantity").attr('disabled', "true");
|
||||
$("#txtDcItem_DamagedQty").attr('disabled', "true");
|
||||
}
|
||||
if (data.OrderItemId != 0) {
|
||||
Bizgaze.Apps.Transact.Managers.OrderManager.Instance().getPendingOrderItemQty(data.OrderItemId).then(function (responce) {
|
||||
if (responce.result != null) {
|
||||
instance.PendingQty = responce.result.PendingQty + Quantity;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
getItems() {
|
||||
var instance = this;
|
||||
var Qty = $('#txtDcItem_Quantity').val();
|
||||
var DelQty = $('#txtDcItem_DeliveredQty').val();
|
||||
var DamagQty = $('#txtDcItem_DamagedQty').val();
|
||||
var InstalledAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
|
||||
var OrderId = Number(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_orderid") == undefined ? 0 : Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_orderid").Value);
|
||||
var BranchId = Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_shiptoaddressid").Value;
|
||||
if (instance.DcTypeId == 2)
|
||||
BranchId = Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_shipfromaddressid").Value;
|
||||
var errosmsg = "";
|
||||
if (OrderId != 0 && instance.PendingQty) {
|
||||
if (Qty > instance.PendingQty) {
|
||||
if (instance.DcTypeId == 1) {
|
||||
errosmsg = "GRN Quantity shouldn't be greater than Pending Quantity";
|
||||
}
|
||||
else {
|
||||
errosmsg = "DC Quantity shouldn't be greater than than Pending Quantity";
|
||||
}
|
||||
Unibase.Platform.Forms.Components.FormViewer.Instance().showError(errosmsg);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (Number(DelQty) > Number(Qty)) {
|
||||
if (instance.DcTypeId == 1) {
|
||||
errosmsg = "Delivered Quantity shouldn't be greater than GRN Quantity";
|
||||
}
|
||||
else {
|
||||
errosmsg = "Delivered Quantity shouldn't be greater than DC Quantity";
|
||||
}
|
||||
Unibase.Platform.Forms.Components.FormViewer.Instance().showError(errosmsg);
|
||||
return false;
|
||||
}
|
||||
if (Number(DamagQty) > Number(Qty)) {
|
||||
if (instance.DcTypeId == 1) {
|
||||
errosmsg = " Damaged Qty Shouldn’t Be Greater Than GRN Quantity";
|
||||
}
|
||||
else {
|
||||
errosmsg = " Damaged Qty Shouldn’t Be Greater Than DC Quantity";
|
||||
}
|
||||
Unibase.Platform.Forms.Components.FormViewer.Instance().showError(errosmsg);
|
||||
return false;
|
||||
}
|
||||
instance.ItemList.push({
|
||||
DcId: Number(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_dcid").Value),
|
||||
DcItemId: Number($("#hf_pk_value").val()),
|
||||
Quantity: Number($('#txtDcItem_Quantity').val()),
|
||||
DeliveredQty: Number($('#txtDcItem_DeliveredQty').val()),
|
||||
DamagedQty: Number($('#txtDcItem_DamagedQty').val()),
|
||||
OrderItemId: Number($("#hf_EditItemlist_OrderItemId").val()),
|
||||
ItemId: Number($("#hf_EditItemlist_ItemId").val()),
|
||||
IsDirectDc: false,
|
||||
MrpId: Number($("#hf_EditItemlist_MrpId").val()),
|
||||
BatchId: Number($("#hf_EditItemlist_BatchId").val()),
|
||||
OldDcItemId: 0,
|
||||
ExchangeDC: false,
|
||||
Packs: Number($("#hf_packs").val()),
|
||||
Pieces: Number($("#hf_pieces").val()),
|
||||
IsFlexibleQty: false,
|
||||
Mrp: 0,
|
||||
BranchId: Number(BranchId),
|
||||
OldBranchId: Number(BranchId),
|
||||
DcTypeId: instance.DcTypeId,
|
||||
OrderId: OrderId,
|
||||
AutoMRPAllocation: false,
|
||||
LobId: Number(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_lobid").Value),
|
||||
});
|
||||
return instance.ItemList;
|
||||
}
|
||||
checkQty() {
|
||||
var instance = EditItem.Instance();
|
||||
if (Number($('#txtDcItem_DeliveredQty').val()) > Number($('#txtDcItem_Quantity').val())) {
|
||||
$('#txtDcItem_DeliveredQty').val($("#hdnDcItem_DeliveredQty").val());
|
||||
$('#lblDcItem_MissingQty').val(Unibase.Core.Helpers.NumberHelper.Instance().roundNumber(Number($('#txtDcItem_Quantity').val()) - Number($("#hdnDcItem_DeliveredQty").val()), 2));
|
||||
if (instance.DcTypeId == 1) {
|
||||
var errosmsg = "Delivered Quantity,Shouldn’t Be greater than Quantity";
|
||||
}
|
||||
else {
|
||||
var errosmsg = "Delivered Quantity,Shouldn’t Be greater than Quantity";
|
||||
}
|
||||
Unibase.Platform.Forms.Components.FormViewer.Instance().showError(errosmsg);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
del_changeQty() {
|
||||
var instance = EditItem.Instance();
|
||||
var errosmsg = "";
|
||||
if (Number($('#txtDcItem_Quantity').val()) > instance.PendingQty) {
|
||||
if (instance.DcTypeId == 1) {
|
||||
errosmsg = "GRN Quantity shouldn't be greater than Pending Quantity";
|
||||
}
|
||||
else {
|
||||
errosmsg = "DC Quantity shouldn't be greater than than Pending Quantity";
|
||||
}
|
||||
$("#txtDcItem_DeliveredQty").val($('#hdnDcItem_Quantity').val());
|
||||
$('#txtDcItem_Quantity').val($('#hdnDcItem_Quantity').val());
|
||||
var missingQty = Number($('#txtDcItem_Quantity').val()) - (Number($("#txtDcItem_DeliveredQty").val()) + Number($('#txtDcItem_DamagedQty').val()));
|
||||
$("#lblDcItem_MissingQty").val(Unibase.Core.Helpers.NumberHelper.Instance().roundNumber(missingQty, 2));
|
||||
Unibase.Platform.Forms.Components.FormViewer.Instance().showError(errosmsg);
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
$("#txtDcItem_DeliveredQty").val($('#txtDcItem_Quantity').val());
|
||||
var missingQty = Number($('#txtDcItem_Quantity').val()) - (Number($("#txtDcItem_DeliveredQty").val()) + Number($('#txtDcItem_DamagedQty').val()));
|
||||
$("#lblDcItem_MissingQty").val(Unibase.Core.Helpers.NumberHelper.Instance().roundNumber(missingQty, 2));
|
||||
}
|
||||
}
|
||||
updateDelMissingQty() {
|
||||
var M_Qty = Number($('#txtDcItem_Quantity').val()) - ((Number($('#txtDcItem_DeliveredQty').val())) + Number($('#txtDcItem_DamagedQty').val()));
|
||||
if (M_Qty > 0)
|
||||
$("#lblDcItem_MissingQty").val(Unibase.Core.Helpers.NumberHelper.Instance().roundNumber(M_Qty, 2));
|
||||
else {
|
||||
var dmgqty = Number($('#txtDcItem_Quantity').val()) - ((Number($('#txtDcItem_DeliveredQty').val())));
|
||||
if (dmgqty > 0)
|
||||
$('#txtDcItem_DamagedQty').val(Unibase.Core.Helpers.NumberHelper.Instance().roundNumber(dmgqty, 2));
|
||||
$("#lblDcItem_MissingQty").val(0);
|
||||
}
|
||||
}
|
||||
updateDmgMissingQty() {
|
||||
var M_Qty = Number($('#txtDcItem_Quantity').val()) - (Number($('#txtDcItem_DeliveredQty').val()) + Number($('#txtDcItem_DamagedQty').val()));
|
||||
$("#lblDcItem_MissingQty").val(Unibase.Core.Helpers.NumberHelper.Instance().roundNumber(M_Qty, 2));
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === undefined) {
|
||||
this.instance = new EditItem();
|
||||
}
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
Controls.EditItem = EditItem;
|
||||
})(Controls = Transact.Controls || (Transact.Controls = {}));
|
||||
})(Transact = Apps.Transact || (Apps.Transact = {}));
|
||||
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
|
||||
})(Bizgaze || (Bizgaze = {}));
|
||||
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
@@ -0,0 +1,41 @@
|
||||
var Bizgaze;
|
||||
(function (Bizgaze) {
|
||||
let Apps;
|
||||
(function (Apps) {
|
||||
let Transact;
|
||||
(function (Transact) {
|
||||
let Controls;
|
||||
(function (Controls) {
|
||||
class EditItemList_Setting {
|
||||
loadSettingHtml() {
|
||||
return ``;
|
||||
}
|
||||
bindControlData(controldatajson) {
|
||||
return "";
|
||||
}
|
||||
SaveControlData(controldatajson) {
|
||||
return "";
|
||||
}
|
||||
loadControlPropertiesHtml(Container) {
|
||||
return ``;
|
||||
}
|
||||
bindPropertySettings(prop) {
|
||||
var propertySettings = prop.PropertySettings;
|
||||
return "";
|
||||
}
|
||||
savePropertySettings(prop) {
|
||||
var propertySettings = prop.PropertySettings;
|
||||
return "";
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === undefined) {
|
||||
this.instance = new EditItemList_Setting();
|
||||
}
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
Controls.EditItemList_Setting = EditItemList_Setting;
|
||||
})(Controls = Transact.Controls || (Transact.Controls = {}));
|
||||
})(Transact = Apps.Transact || (Apps.Transact = {}));
|
||||
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
|
||||
})(Bizgaze || (Bizgaze = {}));
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"edititemlist.setting.js","sourceRoot":"","sources":["edititemlist.setting.ts"],"names":[],"mappings":"AAAA,IAAU,OAAO,CAoChB;AApCD,WAAU,OAAO;IACb,IAAiB,IAAI,CAkCxB;IAlCG,WAAiB,IAAI;QACjB,IAAiB,QAAQ,CAgC5B;QAhCG,WAAiB,QAAQ;YACrB,IAAiB,QAAQ,CA8B5B;YA9BG,WAAiB,QAAQ;gBACrB,MAAa,oBAAoB;oBACjC,eAAe;wBACX,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,eAAe,CAAC,eAAoB;wBAChC,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,eAAe,CAAC,eAAoB;wBAChC,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,yBAAyB,CAAC,SAAS;wBAC/B,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,oBAAoB,CAAC,IAAgB;wBACjC,IAAI,gBAAgB,GAA6B,IAAI,CAAC,gBAAgB,CAAC;wBACvE,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,oBAAoB,CAAC,IAAgB;wBACjC,IAAI,gBAAgB,GAA6B,IAAI,CAAC,gBAAgB,CAAC;wBACvE,OAAO,EAAE,CAAC;oBACd,CAAC;oBAED,MAAM,CAAC,QAAQ;wBACX,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE;4BAC7B,IAAI,CAAC,QAAQ,GAAG,IAAI,oBAAoB,EAAE,CAAC;yBAC9C;wBACD,OAAO,IAAI,CAAC,QAAQ,CAAC;oBACzB,CAAC;iBACJ;gBA5BgB,6BAAoB,uBA4BpC,CAAA;YACL,CAAC,EA9BoB,QAAQ,GAAR,iBAAQ,KAAR,iBAAQ,QA8B5B;QACL,CAAC,EAhCoB,QAAQ,GAAR,aAAQ,KAAR,aAAQ,QAgC5B;IACL,CAAC,EAlCoB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAkCxB;AACD,CAAC,EApCS,OAAO,KAAP,OAAO,QAoChB"}
|
||||
+1
@@ -0,0 +1 @@
|
||||
var Bizgaze;(function(n){let t;(function(n){let t;(function(n){let t;(function(n){class t{loadSettingHtml(){return``}bindControlData(){return""}SaveControlData(){return""}loadControlPropertiesHtml(){return``}bindPropertySettings(n){var t=n.PropertySettings;return""}savePropertySettings(n){var t=n.PropertySettings;return""}static Instance(){return this.instance===undefined&&(this.instance=new t),this.instance}}n.EditItemList_Setting=t})(t=n.Controls||(n.Controls={}))})(t=n.Transact||(n.Transact={}))})(t=n.Apps||(n.Apps={}))})(Bizgaze||(Bizgaze={}));
|
||||
@@ -0,0 +1,46 @@
|
||||
var Bizgaze;
|
||||
(function (Bizgaze) {
|
||||
let Apps;
|
||||
(function (Apps) {
|
||||
let Transact;
|
||||
(function (Transact) {
|
||||
let Controls;
|
||||
(function (Controls) {
|
||||
class FiveStepValidation extends Unibase.Platform.Core.BaseComponent {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.AddedSerialNos = [];
|
||||
this.Scannedcount = 0;
|
||||
}
|
||||
ScanSerailNo(serialno, container, propobj, callback) {
|
||||
if (serialno != "") {
|
||||
FiveStepValidation.instance.Scannedcount += 1;
|
||||
if (FiveStepValidation.instance.Scannedcount == 1) {
|
||||
$(".txtAutoComplete_itemid").attr('disabled', "true");
|
||||
$(".section_ScanSerialNos").find(".card-header").html('<div class="row"><div class="col-2"><span>Scan SerialNos<span></div><div class="col-4"><span class="mr-10"><a class="btn mr-20 btn-sm btn-primary btn-rounded text-white" id = "ScannedCount">' + FiveStepValidation.instance.Scannedcount + '</a></span></div></div>');
|
||||
}
|
||||
else {
|
||||
$("#ScannedCount").text(FiveStepValidation.instance.Scannedcount);
|
||||
}
|
||||
let audiotype;
|
||||
audiotype = Unibase.Platform.Automation.Enums.NotifyAlerts.CouponBeep;
|
||||
Unibase.Platform.Automation.Components.Notifier.Instance().playAudio(audiotype);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
removerow(element, serialno) {
|
||||
element.closest('.Serialno-row').remove();
|
||||
FiveStepValidation.instance.AddedSerialNos.splice(FiveStepValidation.instance.AddedSerialNos.findIndex(p => p == serialno), 1);
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === undefined) {
|
||||
this.instance = new FiveStepValidation();
|
||||
}
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
Controls.FiveStepValidation = FiveStepValidation;
|
||||
})(Controls = Transact.Controls || (Transact.Controls = {}));
|
||||
})(Transact = Apps.Transact || (Apps.Transact = {}));
|
||||
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
|
||||
})(Bizgaze || (Bizgaze = {}));
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"fivestepvalidation.js","sourceRoot":"","sources":["fivestepvalidation.ts"],"names":[],"mappings":"AAAA,IAAU,OAAO,CAyGhB;AAzGD,WAAU,OAAO;IACb,IAAiB,IAAI,CAuGpB;IAvGD,WAAiB,IAAI;QACjB,IAAiB,QAAQ,CAqGxB;QArGD,WAAiB,QAAQ;YACrB,IAAiB,QAAQ,CAmGxB;YAnGD,WAAiB,QAAQ;gBACrB,MAAa,kBAAmB,SAAQ,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa;oBAA3E;;wBACI,mBAAc,GAAG,EAAE,CAAC;wBACpB,iBAAY,GAAG,CAAC,CAAC;oBA+FrB,CAAC;oBA9FG,YAAY,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAY,EAAE,QAAQ;wBACpD,IAAI,QAAQ,IAAI,EAAE,EAAE;4BAChB,kBAAkB,CAAC,QAAQ,CAAC,YAAY,IAAI,CAAC,CAAC;4BAC9C,IAAI,kBAAkB,CAAC,QAAQ,CAAC,YAAY,IAAI,CAAC,EAAE;gCAC/C,CAAC,CAAC,yBAAyB,CAAC,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;gCACtD,CAAC,CAAC,wBAAwB,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,gMAAgM,GAAG,kBAAkB,CAAC,QAAQ,CAAC,YAAY,GAAG,yBAAyB,CAAC,CAAC;6BAClU;iCACI;gCACD,CAAC,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;6BACrE;4BACD,IAAI,SAAyD,CAAC;4BAC9D,SAAS,GAAG,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,YAAY,CAAC,UAAU,CAAC;4BACtE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;4BAChF,OAAO,KAAK,CAAC;yBAChB;oBAmEL,CAAC;oBACD,SAAS,CAAC,OAAO,EAAE,QAAQ;wBACvB,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,MAAM,EAAE,CAAC;wBAC1C,kBAAkB,CAAC,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,kBAAkB,CAAC,QAAQ,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;oBAEnI,CAAC;oBAED,MAAM,CAAC,QAAQ;wBACX,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE;4BAC7B,IAAI,CAAC,QAAQ,GAAG,IAAI,kBAAkB,EAAE,CAAC;yBAC5C;wBACD,OAAO,IAAI,CAAC,QAAQ,CAAC;oBACzB,CAAC;iBACJ;gBAjGY,2BAAkB,qBAiG9B,CAAA;YACL,CAAC,EAnGgB,QAAQ,GAAR,iBAAQ,KAAR,iBAAQ,QAmGxB;QACL,CAAC,EArGgB,QAAQ,GAAR,aAAQ,KAAR,aAAQ,QAqGxB;IACL,CAAC,EAvGgB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAuGpB;AACL,CAAC,EAzGS,OAAO,KAAP,OAAO,QAyGhB"}
|
||||
+1
@@ -0,0 +1 @@
|
||||
var Bizgaze;(function(n){let t;(function(n){let t;(function(n){let t;(function(n){class t extends Unibase.Platform.Core.BaseComponent{constructor(){super(...arguments);this.AddedSerialNos=[];this.Scannedcount=0}ScanSerailNo(n){if(n!=""){t.instance.Scannedcount+=1;t.instance.Scannedcount==1?($(".txtAutoComplete_itemid").attr("disabled","true"),$(".section_ScanSerialNos").find(".card-header").html('<div class="row"><div class="col-2"><span>Scan SerialNos<span><\/div><div class="col-4"><span class="mr-10"><a class="btn mr-20 btn-sm btn-primary btn-rounded text-white" id = "ScannedCount">'+t.instance.Scannedcount+"<\/a><\/span><\/div><\/div>")):$("#ScannedCount").text(t.instance.Scannedcount);let n;return n=Unibase.Platform.Automation.Enums.NotifyAlerts.CouponBeep,Unibase.Platform.Automation.Components.Notifier.Instance().playAudio(n),!1}}removerow(n,i){n.closest(".Serialno-row").remove();t.instance.AddedSerialNos.splice(t.instance.AddedSerialNos.findIndex(n=>n==i),1)}static Instance(){return this.instance===undefined&&(this.instance=new t),this.instance}}n.FiveStepValidation=t})(t=n.Controls||(n.Controls={}))})(t=n.Transact||(n.Transact={}))})(t=n.Apps||(n.Apps={}))})(Bizgaze||(Bizgaze={}));
|
||||
@@ -0,0 +1,260 @@
|
||||
var Bizgaze;
|
||||
(function (Bizgaze) {
|
||||
let Apps;
|
||||
(function (Apps) {
|
||||
let Transact;
|
||||
(function (Transact) {
|
||||
let Controls;
|
||||
(function (Controls) {
|
||||
class GenerateMasterCode extends Unibase.Platform.Core.BaseComponent {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.AddedSerialNos = [];
|
||||
this.ScannedCount = 0;
|
||||
this.FormId = 0;
|
||||
this.PackCount = 0;
|
||||
}
|
||||
bindCartonDetails() {
|
||||
GenerateMasterCode.instance.AddedSerialNos = [];
|
||||
GenerateMasterCode.instance.ScannedCount = 0;
|
||||
GenerateMasterCode.instance.PackCount = 0;
|
||||
GenerateMasterCode.instance.FormId = 0;
|
||||
$(".section_QRCode").find("#divContainer").remove();
|
||||
var html = '<div id="divContainer"></div>';
|
||||
$(".section_QRCode").append(html);
|
||||
$(".txt_name").on("keypress", function () {
|
||||
return Bizgaze.Apps.Transact.Controls.GenerateMasterCode.Instance().isNumberKey(event);
|
||||
});
|
||||
$('.btnSection_StartScanning').unbind().click(function () {
|
||||
GenerateMasterCode.instance.AddedSerialNos = [];
|
||||
GenerateMasterCode.instance.ScannedCount = 0;
|
||||
if ($(".ddl_cascading_packcount option:selected").text() == "") {
|
||||
Unibase.Platform.Forms.Components.FormViewer.Instance().showError("Please Enter Packcount");
|
||||
return false;
|
||||
}
|
||||
else if ($(".txt_name").val() == "" && $(".ddl_cascading_packcount option:selected").text() == "Others") {
|
||||
Unibase.Platform.Forms.Components.FormViewer.Instance().showError("Please Enter Packcount");
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
var uniqueid = 'Bizgaze_Transact_GenerateMasterCode_ScanSerialNumbers_CreateForm';
|
||||
Unibase.Platform.Forms.Managers.FormManager.Instance().getFormbyUniqueId(uniqueid).then(function (response) {
|
||||
var successCallBack = {
|
||||
CallBack: function (id) {
|
||||
Bizgaze.Apps.Transact.Controls.GenerateMasterCode.instance.getQrCode(id);
|
||||
},
|
||||
Parameters: null,
|
||||
};
|
||||
var formviewerObj = {
|
||||
FormId: response.result.FormId,
|
||||
AppConfigurationId: 0,
|
||||
Pk_Value: 0,
|
||||
PortletWidgetId: 0,
|
||||
OnSuccess: successCallBack,
|
||||
OnFail: null,
|
||||
OnLoad: null,
|
||||
};
|
||||
Unibase.Platform.Forms.Components.FormViewer.instance.init(formviewerObj);
|
||||
GenerateMasterCode.instance.FormId = response.result.FormId;
|
||||
setTimeout(function () {
|
||||
$(".labelSection_cartondetails").empty();
|
||||
$(".labelSection_cartondetails").addClass('col-sm-12');
|
||||
var _value = $(".ddl_cascading_packcount option:selected").text();
|
||||
if (_value == "Others" || _value == "others") {
|
||||
_value = $(".txt_name").val();
|
||||
$("#boxespercarton").text('');
|
||||
$("#boxespercarton").text(_value);
|
||||
}
|
||||
GenerateMasterCode.instance.PackCount = _value;
|
||||
var html2 = '<div class="panel-body"><input type="hidden" id="hdn_masterserialno" value="0">' +
|
||||
'<ul class="list-group product-code details"><li class="list-group-item pa-10 clear added-row"><div class="col-sm-12 row"><div class="col-sm-7"><strong>Product Code</strong>' +
|
||||
'</div><div class="col-sm-1"><span>:</span></div><div class="pull-right col-md-4"><span>' + $(".txtAutoComplete_itemid option:selected").text() + ' </span></div></div></li>' +
|
||||
'<li class="list-group-item pa-10 clear added-row"><div class="col-sm-12 row"><div class="col-sm-7"><strong>Boxes per Carton </strong></div><div class="col-sm-1"><span>:</span></div><div class="pull-right col-sm-4" id="boxespercarton">' + _value + '</div></div></li><li class="list-group-item pa-10 clear added-row"><div class="col-sm-12 row"><div class="col-sm-7"><strong>Secondary QR Code</strong></div><div class="col-sm-1"><span>:</span></div><div class="pull-right col-sm-4"> <span id="spn_mastercode"></span></div></div></li><li class="list-group-item pa-10 clear added-row"><div class="col-sm-12 row"><div class="col-sm-7"><strong>Total Boxes Scanned</strong></div><div class="col-sm-1"><span>:</span></div><div class="pull-right col-sm-4"><span id="spn_scanned"></span></div></div></li></ul></div>';
|
||||
$(".labelSection_cartondetails").append(html2);
|
||||
Unibase.Forms.Controls.Scan.Instance().data = [];
|
||||
Unibase.Forms.Controls.Scan.Instance().setparameter = [];
|
||||
Unibase.Forms.Controls.Scan.Instance().setparameter = [
|
||||
{ "ColumnName": "itemid", "Value": Number($(".txtAutoComplete_itemid").val()) }
|
||||
];
|
||||
if ($(".labelSection_cartondetails").find(".product-code").length > 0) {
|
||||
$(".section_ScanSerialNos").removeClass('hidden');
|
||||
}
|
||||
else {
|
||||
$(".section_ScanSerialNos").addClass('hidden');
|
||||
}
|
||||
$("#form-container-" + response.result.FormId).find("#btnDynamicSave").attr('disabled', "true");
|
||||
}, 1000);
|
||||
});
|
||||
$("#btnDynamicSave").addClass('hidden');
|
||||
$(".section_ScanSerialNos").removeClass('hidden');
|
||||
$(".txt_name").attr('disabled', "true");
|
||||
$(".txtAutoComplete_itemid").attr('disabled', "true");
|
||||
$(".ddl_cascading_packcount").attr('disabled', "true");
|
||||
}
|
||||
});
|
||||
}
|
||||
isNumberKey(evt) {
|
||||
if (evt.which != 8 && evt.which != 0 && (evt.which < 48 || evt.which > 57)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
ScanSerailNo(serialno, container, propobj, callback) {
|
||||
if (serialno != "") {
|
||||
var BranchId = 0;
|
||||
if ($(".ddl_cascading_packcount option:selected").val() == undefined) {
|
||||
Unibase.Platform.Forms.Components.FormViewer.Instance().showError("Please Select PackCount");
|
||||
return false;
|
||||
}
|
||||
else if ($(".txt_name").val() == "" && $(".ddl_cascading_packcount option:selected").text() == "Others") {
|
||||
Unibase.Platform.Forms.Components.FormViewer.Instance().showError("Please Enter Packcount");
|
||||
return false;
|
||||
}
|
||||
else if (GenerateMasterCode.instance.AddedSerialNos.filter(x => x == serialno).length == 1) {
|
||||
Unibase.Platform.Forms.Components.FormViewer.Instance().showError("Serial No Added");
|
||||
return false;
|
||||
}
|
||||
else if (Unibase.Platform.Membership.Infos.Identity.getCurrentUser().settings == null) {
|
||||
Unibase.Platform.Forms.Components.FormViewer.Instance().showError("Please Configure Default Branch");
|
||||
return false;
|
||||
}
|
||||
else if (Unibase.Platform.Membership.Infos.Identity.getSetting("companyid") == null || Unibase.Platform.Membership.Infos.Identity.getSetting("companyid") == undefined) {
|
||||
Unibase.Platform.Forms.Components.FormViewer.Instance().showError("Please Configure Default Branch");
|
||||
return false;
|
||||
}
|
||||
if (Unibase.Platform.Membership.Infos.Identity.getCurrentUser().settings != null) {
|
||||
var companySetting = Unibase.Platform.Membership.Infos.Identity.getCurrentUser().settings.find(x => x.settingName == "companyid");
|
||||
if (companySetting != null) {
|
||||
BranchId = Number(Unibase.Platform.Membership.Infos.Identity.getCurrentUser().settings.find(x => x.settingName == "branchid").settingValue);
|
||||
}
|
||||
}
|
||||
GenerateMasterCode.instance.ScannedCount += 1;
|
||||
$("#spn_scanned").text(GenerateMasterCode.instance.ScannedCount);
|
||||
if ($(".divCustomProperties_name").hasClass("hidden")) {
|
||||
if (GenerateMasterCode.instance.ScannedCount >= Number($(".ddl_cascading_packcount option:selected").text())) {
|
||||
$("#scan_control").addClass('hidden');
|
||||
$("#form-container-" + GenerateMasterCode.instance.FormId).find('#btnDynamicSave').removeAttr('disabled');
|
||||
}
|
||||
}
|
||||
else if (GenerateMasterCode.instance.ScannedCount >= Number($(".txt_name").val())) {
|
||||
$("#scan_control").addClass('hidden');
|
||||
$("#form-container-" + GenerateMasterCode.instance.FormId).find('#btnDynamicSave').removeAttr('disabled');
|
||||
}
|
||||
let audiotype;
|
||||
audiotype = Unibase.Platform.Automation.Enums.NotifyAlerts.CouponBeep;
|
||||
Unibase.Platform.Automation.Components.Notifier.Instance().playAudio(audiotype);
|
||||
if (GenerateMasterCode.instance.ScannedCount == 1) {
|
||||
var postdata = {
|
||||
CurrentWarehouseId: BranchId,
|
||||
ItemId: Number($(".txtAutoComplete_itemid option:selected").val()),
|
||||
Quantity: 0,
|
||||
SerialNo: serialno,
|
||||
};
|
||||
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/transact/managers/inventory/dcmanager.js", function () {
|
||||
Bizgaze.Apps.Transact.Managers.DCManager.Instance().generateMasterSerialNo(postdata).then(function (responce) {
|
||||
var data = JSON.parse(responce.result);
|
||||
Unibase.Forms.Controls.Scan.Instance().data[0].currentparentname = data.SerialNo;
|
||||
if ($(".divCustomProperties_name").hasClass("hidden")) {
|
||||
Unibase.Forms.Controls.Scan.Instance().data[0].otherscount = Number($(".ddl_cascading_packcount option:selected").text());
|
||||
}
|
||||
else {
|
||||
Unibase.Forms.Controls.Scan.Instance().data[0].otherscount = Number($(".txt_name").val());
|
||||
}
|
||||
$("#spn_mastercode").empty();
|
||||
$("#spn_mastercode").text(data.SerialNo);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
ScrapSerialNo() {
|
||||
var instance = this;
|
||||
if (Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_stagename").Value == "Scrapped") {
|
||||
$("#li_DetailSetting_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_Scrap").addClass("hidden");
|
||||
}
|
||||
else {
|
||||
$("#li_DetailSetting_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_Scrap").removeClass("hidden");
|
||||
$(".DetailSetting_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_Scrap").click(function () {
|
||||
var postdata = {
|
||||
stockid: Unibase.Themes.Providers.DetailHelper.recordId
|
||||
};
|
||||
instance.navigationHelper.showLoading();
|
||||
Bizgaze.Apps.Transact.Managers.DCManager.Instance().scrappedSNo(postdata).then(function (responce) {
|
||||
instance.navigationHelper.hideLoading();
|
||||
if (responce.result != null) {
|
||||
MessageHelper.Instance().showSuccess(responce.message, '');
|
||||
$("#li_DetailSetting_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_Scrap").addClass("hidden");
|
||||
var obj = Unibase.Themes.Compact.Components.Details.Instance();
|
||||
obj._recordId = Unibase.Themes.Compact.Components.Details.Instance()._recordId;
|
||||
obj._installedAppId = Unibase.Themes.Compact.Components.Details.Instance()._installedAppId;
|
||||
Unibase.Themes.Compact.Components.Details.Instance().loadPortlets(obj);
|
||||
}
|
||||
else {
|
||||
MessageHelper.Instance().showError(responce.message, "div_message");
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
getQrCode(stockId) {
|
||||
if ($(".section_QRCode").hasClass('hidden')) {
|
||||
$(".section_QRCode").removeClass('hidden');
|
||||
}
|
||||
Bizgaze.Apps.Transact.Managers.DCManager.Instance().getserialNo(stockId).then(function (responce) {
|
||||
$('.Serialno-row').remove();
|
||||
var html = '<li class="list-group-item pa-10 clear Serialno-row added-row"><div class="row"><div class="col-sm-12 row div_itemserialnos"><div class="col-sm-10 ml-35 div_Serialno"><strong class="txt_SerialNo">' + responce.result.SerialNo + '</strong></div><div class="pull-right col-md-1"><a class="btn_Addedserialno_angle text-dark" href="javascript:;" onclick="javascript: return Bizgaze.Apps.Transact.Controls.GenerateMasterCode.Instance().printQRCode(' + responce.result.StockId + ')"><i class="fa fa-print" aria-hidden="true"></i></a></div><div id="print_qrcode"></div></li>';
|
||||
$(".section_QRCode").find("#divContainer").append(html);
|
||||
});
|
||||
}
|
||||
printQRCode(stockid) {
|
||||
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile('libs/qrcode/qrcode.js', function () {
|
||||
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile('libs/qrcode/loadqrcode.js', function () {
|
||||
Bizgaze.Apps.Transact.Managers.DCManager.Instance().getserialNo(stockid).then(function (responce) {
|
||||
var html = `<div class="card">
|
||||
<div class="QRCodeDiv">
|
||||
<div class="col-sm-12" style="text-align:center;">
|
||||
<div id="GenerateQRCode" class="text-center">
|
||||
</div>
|
||||
</div>
|
||||
<div style="text-align:center"> <strong> ` + responce.result.SerialNo + ` </strong> </div>
|
||||
<div style="text-align:center"> <p> No. of Boxes : <strong> ` + GenerateMasterCode.instance.PackCount + ` </strong> </p> </div>
|
||||
<div style="text-align:center"> <p> Product Code : <strong> ` + responce.result.SKU + ` </strong> </p> </div>
|
||||
<div style="text-align:center; margin-bottom:10px"> <p> Product Name : <strong> ` + responce.result.ItemName + ` </strong> </p> </div>
|
||||
</div>
|
||||
</div>`;
|
||||
var content = '<html><head><title>Print</title><link rel="stylesheet" href="lib/bizgaze/print.css" /><link rel="stylesheet" href="lib/bootstrap/bootstrap-theme.min.css" /></head><body>';
|
||||
content += html;
|
||||
content += "<script> $(document).ready(function(){ loadqrcode.load_qrcode('" + responce.result.SerialNo + "', 'GenerateQRCode'); }); </script>";
|
||||
content += '</body></html>';
|
||||
$("#print_qrcode").html(content);
|
||||
setTimeout(function () {
|
||||
Bizgaze.Apps.Transact.Controls.GenerateMasterCode.Instance().printPopup($('#print_qrcode').html());
|
||||
}, 1500);
|
||||
$("#print_qrcode").addClass('hidden');
|
||||
return true;
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
printPopup(data) {
|
||||
$('.QRCodeDiv').remove();
|
||||
var mywindow = window.open('', 'my Print', 'height=400,width=850');
|
||||
var content = '<html><head><title>Print</title><link rel="stylesheet" href="lib/bizgaze/print.css" /><link rel="stylesheet" href="lib/bootstrap/bootstrap-theme.min.css" /></head><body>';
|
||||
content += data;
|
||||
content += "<script>print();</script>";
|
||||
content += '</body></html>';
|
||||
mywindow.document.write(content);
|
||||
return true;
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === undefined) {
|
||||
this.instance = new GenerateMasterCode();
|
||||
}
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
Controls.GenerateMasterCode = GenerateMasterCode;
|
||||
})(Controls = Transact.Controls || (Transact.Controls = {}));
|
||||
})(Transact = Apps.Transact || (Apps.Transact = {}));
|
||||
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
|
||||
})(Bizgaze || (Bizgaze = {}));
|
||||
File diff suppressed because one or more lines are too long
+12
File diff suppressed because one or more lines are too long
@@ -0,0 +1,178 @@
|
||||
var Bizgaze;
|
||||
(function (Bizgaze) {
|
||||
let Apps;
|
||||
(function (Apps) {
|
||||
let Transact;
|
||||
(function (Transact) {
|
||||
let Controls;
|
||||
(function (Controls) {
|
||||
class scannedserialnos extends Unibase.Platform.Core.BaseComponent {
|
||||
init(formpropertyid, prop, callback) {
|
||||
return ``;
|
||||
}
|
||||
loadControl(containerid, prop) {
|
||||
var instance = this;
|
||||
$(".btn_Save_Form").addClass("hidden");
|
||||
var html = '<div class="Scanned_SerialNos card Section mt-20"><div class="card-header" id="section_SerialNos">Scanned Serial Numbers</div><div class="card-body"><div class="">' +
|
||||
'<div class="panel-body Active_serialnos"><ul class="scanned-serialnos added-row list-group"></ul></div></div></div></div>';
|
||||
$("#" + containerid).html(html);
|
||||
this.scannedSerialNos(containerid);
|
||||
$('#btn_CloseForm').off('click');
|
||||
$('#btn_CloseForm').click(function () {
|
||||
Unibase.Platform.Helpers.NavigationHelper.Instance().closePopUp();
|
||||
var detailInstance = Unibase.Themes.Compact.Components.Details.Instance();
|
||||
var panel = "#" + detailInstance._containerId;
|
||||
var obj = Unibase.Themes.Compact.Components.Details.Instance();
|
||||
obj._recordId = Unibase.Themes.Providers.DetailHelper.recordId;
|
||||
obj._installedAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
|
||||
var InstalledAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
|
||||
detailInstance.loadAppDefaultWidget(obj, panel, detailInstance._containerId, function () {
|
||||
detailInstance.loadDefaultWidgets(obj._installedAppId, panel);
|
||||
detailInstance.LoadApprovals(obj._recordId, obj._installedAppId);
|
||||
});
|
||||
});
|
||||
}
|
||||
loadControlSettings(controlsettingjson, formpropertyid) {
|
||||
return ``;
|
||||
}
|
||||
loadPropertySettings(propertysettings, formpropertyid, DocPropertyName) {
|
||||
return ``;
|
||||
}
|
||||
bindEditFormDetails(formpropertyid, propval, DocPropertyName) {
|
||||
alert('bindEditFormDetails');
|
||||
return ``;
|
||||
}
|
||||
scannedSerialNos(containerid) {
|
||||
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/transact/managers/inventory/dcmanager.js", function () {
|
||||
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/transact/enums/enum.js", function () {
|
||||
Bizgaze.Apps.Transact.Managers.DCManager.Instance().getScannedSerialNos(Number($("#hf_pk_value").val())).then(function (responce) {
|
||||
if (responce.result.length > 0) {
|
||||
for (var i = 0; i < responce.result.length; i++) {
|
||||
var instance = this;
|
||||
var rowid = moment().valueOf();
|
||||
var hiddenclass = "";
|
||||
var html = '<li class="list-group-item pa-10 clear Serialno-row ' + hiddenclass + ' added-row li_' + rowid + ' serialno_' + responce.result[i].StockId + '"><input type="hidden" id="hf_rowid" value="' + rowid + '"><input type="hidden" id="hf_stocktypeid' + rowid + '" value="' + responce.result[i].StockTypeId + '">' +
|
||||
'<div class="row"><input type="hidden" id="hdn_stockid_' + responce.result[i].StockId + '" value="' + responce.result[i].StockId + '"><input type="hidden" id="hdn_stockstatusid_' + rowid + '" value="' + responce.result[i].StockStatusId + '"><input type="hidden" id="hdn_stockid_' + rowid + '" value="' + responce.result[i].StockId + '"><input type="hidden" id="hdn_parentstockId_' + rowid + '" value="' + responce.result[i].CurrentParentId + '">';
|
||||
if (responce.result[i].StockTypeId == Bizgaze.Apps.Transact.Enums.StockType.Package) {
|
||||
html += '<div class="col-sm-5 ml-10 div_Serialno divserialno_' + responce.result[i].CurrentParentId + '"><a class="btn_parestserialno_angle' + rowid + ' text-dark" href="javascript:;" onclick="javascript: return Bizgaze.Apps.Transact.Controls.scannedserialnos.Instance().showItemSerialNos(' + responce.result[i].StockId + ',' + rowid + ')"><i class="fa fa-angle-down hidden"></i><i class="fa fa-angle-right"></i><span class="ml-10"><a class="serial-link mt-10 txtSerialNo_' + rowid + '" " id="txt_' + responce.result[i].StockId + '" href="javascript:;" >' + responce.result[i].SerialNo + '</a></span></a></div>';
|
||||
html += '<div class="col-sm-5"><small id="parent_info' + responce.result[i].CurrentParentId + '" style = "color:red;">Master Serial No</small></div>';
|
||||
html += '<div class="div_Itemserialnos_' + responce.result[i].StockId + '"><ul class="itemscanned-serialnos added-row list-group"></ul></div>';
|
||||
}
|
||||
else {
|
||||
html += '<div class="col-sm-12 row div_itemserialnos' + rowid + '"><div class="col-sm-10 ml-35 div_Serialno divserialno_' + responce.result[i].CurrentParentId + '">';
|
||||
html += '<strong class="textcolumn txt_' + responce.result[i].SerialNo + ' txtSerialNo_' + rowid + '" id="txt_' + responce.result[i].StockId + '">' + responce.result[i].SerialNo + '</strong></div>';
|
||||
}
|
||||
if (responce.result[i].StockTypeId == Bizgaze.Apps.Transact.Enums.StockType.Package) {
|
||||
html += '<div class="pull-right col-md-1"><a class="fa fa-trash-o m-t fa-md fa-lg pull-right" style ="color:red;" title = "Delete SerialNo" onclick="javascript: return Bizgaze.Apps.Transact.Controls.scannedserialnos.Instance().deleteSerialNo(' + responce.result[i].StockId + ',' + rowid + ')"></a></div>';
|
||||
}
|
||||
html += '</li>';
|
||||
if (responce.result[i].StockTypeId == 1) {
|
||||
html += '</div>';
|
||||
}
|
||||
html += '</div>';
|
||||
$('.scanned-serialnos:last').append(html);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$("#section_SerialNos").addClass('hidden');
|
||||
var html = '<div class="row mb-20 col-12 text-center" id="div_scanneditems"><strong class="col-12 text-center" style="color:black">No Scanned Serial Numbers</strong></div>';
|
||||
$(".Scanned_SerialNos").find(".card-body").after(html);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
showItemSerialNos(stockid, rowid) {
|
||||
$(".btn_parestserialno_angle" + rowid).find(".fa-angle-down").toggleClass("hidden");
|
||||
$(".btn_parestserialno_angle" + rowid).find(".fa-angle-right").toggleClass("hidden");
|
||||
$(".itemserialno_" + stockid).remove();
|
||||
if (!$(".btn_parestserialno_angle" + rowid).find(".fa-angle-down").hasClass('hidden')) {
|
||||
this.getScannedItemSerialNos(stockid, Number($("#hf_pk_value").val()));
|
||||
}
|
||||
}
|
||||
getScannedItemSerialNos(stockid, dcitemid) {
|
||||
Bizgaze.Apps.Transact.Managers.DCManager.Instance().getItemScannedSerialNos(Number($("#hf_pk_value").val()), stockid).then(function (responce) {
|
||||
debugger;
|
||||
for (var i = 0; i < responce.result.length; i++) {
|
||||
var instance = this;
|
||||
var rowid = moment().valueOf();
|
||||
var hiddenclass = "";
|
||||
var html = '<li class="list-group-item pa-10 clear Serialno-row ' + hiddenclass + ' added-row li_' + rowid + ' itemserialno_' + responce.result[i].CurrentParentId + '"><input type="hidden" id="hf_rowid" value="' + rowid + '"><input type="hidden" id="hf_stocktypeid' + rowid + '" value="' + responce.result[i].StockTypeId + '">' +
|
||||
'<div class="row"><input type="hidden" id="hdn_stockid_' + responce.result[i].StockId + '" value="' + responce.result[i].StockId + '"><input type="hidden" id="hdn_stockstatusid_' + rowid + '" value="' + responce.result[i].StockStatusId + '"><input type="hidden" id="hdn_stockid_' + rowid + '" value="' + responce.result[i].StockId + '"><input type="hidden" id="hdn_parentstockId_' + rowid + '" value="' + responce.result[i].CurrentParentId + '">';
|
||||
html += '<div class="col-sm-12 row div_itemserialnos' + rowid + '"><div class="col-sm-10 ml-35 div_Serialno divserialno_' + responce.result[i].CurrentParentId + '"><a class="text-dark" href="javascript:;"><i class="fa fa-dot-circle-o" aria-hidden="true"></i></a><span class="ml-10"></span>';
|
||||
html += '<strong class="textcolumn txt_' + responce.result[i].SerialNo + ' txtSerialNo_' + rowid + '" id="txt_' + responce.result[i].StockId + '">' + responce.result[i].SerialNo + '</strong></div>';
|
||||
html += '</li>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
$(".serialno_" + stockid).after(html);
|
||||
}
|
||||
});
|
||||
}
|
||||
deleteSerialNo(stockid, rowid) {
|
||||
bootbox.confirm("Are You Sure,Item Serial No's will be Deleted. If You Delete Master Serial No.", function (result) {
|
||||
if (result) {
|
||||
var postdata = {
|
||||
DcItemId: Number($("#hf_pk_value").val()),
|
||||
StockId: stockid,
|
||||
};
|
||||
Bizgaze.Apps.Transact.Managers.DCManager.Instance().deleteSerialNo(postdata).then(function (responce) {
|
||||
if (responce.errors == null) {
|
||||
MessageHelper.Instance().showSuccess(responce.message, "");
|
||||
$(".scanned-serialnos").find(".serialno_" + stockid).remove();
|
||||
$(".scanned-serialnos").find(".itemserialno_" + stockid).remove();
|
||||
}
|
||||
else {
|
||||
Unibase.Platform.Forms.Components.FormViewer.Instance().showError(responce.message);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
deleteSerialNobyDcItemId(DcItemId) {
|
||||
var instance = this;
|
||||
instance.fileCacheHelper.loadJsFile("apps/transact/managers/inventory/dcmanager.js", function () {
|
||||
bootbox.confirm("Do you want to Delete SerialNumbers?", function (result) {
|
||||
if (result) {
|
||||
var postdata = {
|
||||
DcItemId: DcItemId,
|
||||
DcId: Unibase.Themes.Providers.DetailHelper.recordId,
|
||||
DcTypeId: Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_dctypeid").Value,
|
||||
IsTransfer: Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_istransfer").Value,
|
||||
};
|
||||
var DcTypeId = Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_dctypeid").Value;
|
||||
var IsTransfer = Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_istransfer").Value;
|
||||
Bizgaze.Apps.Transact.Managers.DCManager.Instance().deleteSerialNobyDcItemId(postdata).then(function (responce) {
|
||||
if (responce.errors == null) {
|
||||
var detailInstance = Unibase.Themes.Compact.Components.Details.Instance();
|
||||
var panel = "#" + detailInstance._containerId;
|
||||
var obj = Unibase.Themes.Compact.Components.Details.Instance();
|
||||
obj._recordId = Unibase.Themes.Providers.DetailHelper.recordId;
|
||||
obj._installedAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
|
||||
var InstalledAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
|
||||
detailInstance.loadAppDefaultWidget(obj, panel, detailInstance._containerId, function () {
|
||||
detailInstance.loadDefaultWidgets(obj._installedAppId, panel);
|
||||
detailInstance.LoadApprovals(obj._recordId, obj._installedAppId);
|
||||
});
|
||||
MessageHelper.Instance().showSuccess("Serial Numbers Deleted Successfully", "");
|
||||
}
|
||||
else {
|
||||
MessageHelper.Instance().showError(responce.message, "div_message");
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === undefined) {
|
||||
this.instance = new scannedserialnos();
|
||||
}
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
Controls.scannedserialnos = scannedserialnos;
|
||||
})(Controls = Transact.Controls || (Transact.Controls = {}));
|
||||
})(Transact = Apps.Transact || (Apps.Transact = {}));
|
||||
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
|
||||
})(Bizgaze || (Bizgaze = {}));
|
||||
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
@@ -0,0 +1,41 @@
|
||||
var Bizgaze;
|
||||
(function (Bizgaze) {
|
||||
let Apps;
|
||||
(function (Apps) {
|
||||
let Transact;
|
||||
(function (Transact) {
|
||||
let Controls;
|
||||
(function (Controls) {
|
||||
class scannedserialnos_setting {
|
||||
loadSettingHtml() {
|
||||
return ``;
|
||||
}
|
||||
bindControlData(controldatajson) {
|
||||
return "";
|
||||
}
|
||||
SaveControlData(controldatajson) {
|
||||
return "";
|
||||
}
|
||||
loadControlPropertiesHtml(Container) {
|
||||
return ``;
|
||||
}
|
||||
bindPropertySettings(prop) {
|
||||
var propertySettings = prop.PropertySettings;
|
||||
return "";
|
||||
}
|
||||
savePropertySettings(prop) {
|
||||
var propertySettings = prop.PropertySettings;
|
||||
return "";
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === undefined) {
|
||||
this.instance = new scannedserialnos_setting();
|
||||
}
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
Controls.scannedserialnos_setting = scannedserialnos_setting;
|
||||
})(Controls = Transact.Controls || (Transact.Controls = {}));
|
||||
})(Transact = Apps.Transact || (Apps.Transact = {}));
|
||||
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
|
||||
})(Bizgaze || (Bizgaze = {}));
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"scannedserialnos.setting.js","sourceRoot":"","sources":["scannedserialnos.setting.ts"],"names":[],"mappings":"AAAA,IAAU,OAAO,CAqChB;AArCD,WAAU,OAAO;IACb,IAAiB,IAAI,CAmCpB;IAnCD,WAAiB,IAAI;QACjB,IAAiB,QAAQ,CAiCxB;QAjCD,WAAiB,QAAQ;YACrB,IAAiB,QAAQ,CA+BxB;YA/BD,WAAiB,QAAQ;gBACrB,MAAa,wBAAwB;oBACjC,eAAe;wBACX,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,eAAe,CAAC,eAAoB;wBAEhC,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,eAAe,CAAC,eAAoB;wBAChC,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,yBAAyB,CAAC,SAAS;wBAC/B,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,oBAAoB,CAAC,IAAgB;wBACjC,IAAI,gBAAgB,GAA6B,IAAI,CAAC,gBAAgB,CAAC;wBACvE,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,oBAAoB,CAAC,IAAgB;wBACjC,IAAI,gBAAgB,GAA6B,IAAI,CAAC,gBAAgB,CAAC;wBACvE,OAAO,EAAE,CAAC;oBACd,CAAC;oBAED,MAAM,CAAC,QAAQ;wBACX,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE;4BAC7B,IAAI,CAAC,QAAQ,GAAG,IAAI,wBAAwB,EAAE,CAAC;yBAClD;wBACD,OAAO,IAAI,CAAC,QAAQ,CAAC;oBACzB,CAAC;iBACJ;gBA7BY,iCAAwB,2BA6BpC,CAAA;YACL,CAAC,EA/BgB,QAAQ,GAAR,iBAAQ,KAAR,iBAAQ,QA+BxB;QACL,CAAC,EAjCgB,QAAQ,GAAR,aAAQ,KAAR,aAAQ,QAiCxB;IACL,CAAC,EAnCgB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAmCpB;AACL,CAAC,EArCS,OAAO,KAAP,OAAO,QAqChB"}
|
||||
+1
@@ -0,0 +1 @@
|
||||
var Bizgaze;(function(n){let t;(function(n){let t;(function(n){let t;(function(n){class t{loadSettingHtml(){return``}bindControlData(){return""}SaveControlData(){return""}loadControlPropertiesHtml(){return``}bindPropertySettings(n){var t=n.PropertySettings;return""}savePropertySettings(n){var t=n.PropertySettings;return""}static Instance(){return this.instance===undefined&&(this.instance=new t),this.instance}}n.scannedserialnos_setting=t})(t=n.Controls||(n.Controls={}))})(t=n.Transact||(n.Transact={}))})(t=n.Apps||(n.Apps={}))})(Bizgaze||(Bizgaze={}));
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user