Fully agree with you here @cayma
Bumping this as well. It does not necessarily âbotherâ me, but our Inventory guys have to go through an extra click every time they receive a part into a shelf/bin that already has the same part in order to add the suffix. I like the suffixes -1 -2 -3 etc added, but I see @sisyfosâs wanting to have this automatically be added without having to go through an extra screen.
Agreed that its an unnecessary extra screen and click - why not just automatically add the suffix? If this isnât what all Cetec users want, @cetecerp2 please make it a config setting to bypass this or something.
Ok So now I have checked the relevant Code for this and rewrote the function so that you can implement it into Cetec.
in the putaway form just add thisâŚ
You may have to add what the âUse_Suffix_For_Duplicate_Put_Awayâ setting is set to into the bin record of course
$.ajax({
method: "GET",
url: "https://thesnusbrothers.cetecerp.com/inv/get_bins",
data: $("#put_away_form").serialize(),
dataType: 'json',
success: function(data) {
var arrayLength = data.length;
var is_ok = 1;
for (var i = 0; i < arrayLength; i++) {
var bin_record = data[i];
if (bin_record.bin.toUpperCase() === target.toUpperCase()) {
// Automatically create a new bin with an incremented suffix if use_bin_suffix is true
if (bin_record.Use_Suffix_For_Duplicate_Put_Away = 1) {
var highestSuffix = 0;
// Find the highest suffix number for existing bins
for (var j = 0; j < arrayLength; j++) {
var existingBin = data[j].bin;
var match = existingBin.match(new RegExp("^" + target + "-(\\d+)$", "i"));
if (match) {
var suffix = parseInt(match[1], 10);
if (suffix > highestSuffix) {
highestSuffix = suffix;
}
}
}
var newSuffix = highestSuffix + 1; // Increment the highest suffix
var newBinName = target + "-" + newSuffix;
$("#bin").val(newBinName);
}
else {
var message = "<b>Target Bin " + target + " already exists! Do you want to: </b> <br /> ";
message += "<table data-cy='bin_popup_table' width=100%> ";
if (bin_record.block_bin_merge != 1) {
message += "<tr><td> Merge the Bin? <span class=alert>Traceability will be lost for: " + from_bin + " & Costs Averaged</span></td><td> <button class='button' id='merge_bin' name=merge_bin value=1>Merge</button> </td></tr>";
}
message += "<tr><td> Create a new Bin with a suffix? (e.g. " + target + "-1) </td><td> <button class='button' id='bin_suffix' name=create_new value=1>Create New</button> </td></tr>";
message += "<tr><td> Specify a different Bin? </td><td><button class='close_confirm button' id=different_bin name=different_bin value=1>Specify Different</button> </td></tr>";
message += "</table>";
message += "<button class='button2 close_confirm' id=close_confirm>Close</button>";
$("#confirm_merge").html(message);
$.colorbox({width: "650px", height: '300px', inline: true, href: "#confirm_merge"});
is_ok = 0;
$("#bin_submit").attr("disabled", false).val("Submit");
}
break;
}
}
if (is_ok) {
$("#put_away_form").submit();
}
},
failure: function(data) {
console.error("Failed to fetch bins:", data);
},
});
Now @cetecerp2 Can you please make it happen!
//H
@cetecerp2
Now it has been 13 days since i posted this and no reply from support!
Can we have an answer!
//H