feat: allow on_shelf items in transit batch transfer
Transit shelf registration is effectively an off-shelf operation. Allow not_shelved, on_shelf, and their mix when target is a transit shelf. Only transferred items are blocked since they are already in transit. Also fix conflict color logic: transferred items now correctly show as red (conflict) for both transit and normal shelf targets. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -19,15 +19,15 @@ extension _RegistrationSubmitPart on _RegistrationPageState {
|
|||||||
|
|
||||||
setState(() => _isSubmitting = true);
|
setState(() => _isSubmitting = true);
|
||||||
|
|
||||||
// For transit target: block if any scanned item already has a location
|
// For transit target: block if any scanned item is already transferred
|
||||||
|
// (on_shelf items are allowed — transit registration acts as off-shelf)
|
||||||
if (_isTransitTarget) {
|
if (_isTransitTarget) {
|
||||||
if (_hasAnyLocatedInScanned()) {
|
final transferredItems = _findTransferredItemsInScanned();
|
||||||
final onShelfItems = _findOnShelfItemsInScanned();
|
if (transferredItems.isNotEmpty) {
|
||||||
final transferredItems = _findTransferredItemsInScanned();
|
|
||||||
setState(() => _isSubmitting = false);
|
setState(() => _isSubmitting = false);
|
||||||
_feedbackService.trigger(FeedbackEvent.submitFailure);
|
_feedbackService.trigger(FeedbackEvent.submitFailure);
|
||||||
_showLocationConflictDialog(
|
_showLocationConflictDialog(
|
||||||
onShelfItems: onShelfItems,
|
onShelfItems: [],
|
||||||
transferredItems: transferredItems,
|
transferredItems: transferredItems,
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -110,9 +110,10 @@ Color registrationBarColor({
|
|||||||
required bool isTransitTarget,
|
required bool isTransitTarget,
|
||||||
}) {
|
}) {
|
||||||
if (isScanned) {
|
if (isScanned) {
|
||||||
return status == 'on_shelf' && !isTransitTarget
|
final isConflict = isTransitTarget
|
||||||
? Colors.red
|
? status == 'transferred'
|
||||||
: const Color(0xFF43A047);
|
: (status == 'on_shelf' || status == 'transferred');
|
||||||
|
return isConflict ? Colors.red : const Color(0xFF43A047);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (status) {
|
switch (status) {
|
||||||
@@ -131,9 +132,10 @@ Color registrationRowBgColor({
|
|||||||
required bool isTransitTarget,
|
required bool isTransitTarget,
|
||||||
}) {
|
}) {
|
||||||
if (isScanned) {
|
if (isScanned) {
|
||||||
return status == 'on_shelf' && !isTransitTarget
|
final isConflict = isTransitTarget
|
||||||
? Colors.red.shade50
|
? status == 'transferred'
|
||||||
: const Color(0xFFF1F8E9);
|
: (status == 'on_shelf' || status == 'transferred');
|
||||||
|
return isConflict ? Colors.red.shade50 : const Color(0xFFF1F8E9);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (status) {
|
switch (status) {
|
||||||
|
|||||||
Reference in New Issue
Block a user