You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 line
2.5KB

  1. @extends('layout')
  2. @includes('includes/small-feature')
  3. <div class="container mx-auto px-8 py-8 md:py-16">
  4. <h1 class="text-3xl font-bold">
  5. Withdraw stock &mdash; {{ $item->name }}
  6. </h1>
  7. @if(count($stock) === 0)
  8. <p class="text-gray-500 my-4">There's no stock anywhere to withdraw from.</p>
  9. @endif
  10. @if(count($stock) > 0)
  11. <form
  12. method="post"
  13. action="{{ $withdrawAction }}"
  14. class="flex flex-col w-full space-y-4 max-w-xl my-4"
  15. >
  16. @if(session()->has('withdraw_errors'))
  17. <ol class="list-disc text-red-500">
  18. @foreach(session('withdraw_errors') as $field => $errors)
  19. @foreach($errors as $error)
  20. <li>{{ $error }}</li>
  21. @endforeach
  22. @endforeach
  23. </ol>
  24. @endif
  25. <input type="hidden" name="csrf" value="{{ $csrf }}" />
  26. <label for="location_id" class="flex flex-col w-full">
  27. <span class="flex">Location:</span>
  28. <select
  29. id="location_id"
  30. name="location_id"
  31. class="bg-gray-50 rounded-lg p-2 text-gray-900"
  32. >
  33. @foreach($stock as $row)
  34. <option value="{{ $row->location_id }}">{{ $row->location->code }} &mdash; {{ $row->location->name }} ({{ $row->quantity }} available)</option>
  35. @endforeach
  36. </select>
  37. </label>
  38. <label for="quantity" class="flex flex-col w-full">
  39. <span class="flex">Quantity:</span>
  40. <input
  41. id="quantity"
  42. name="quantity"
  43. type="number"
  44. class="bg-gray-50 rounded-lg p-2 text-gray-900"
  45. placeholder="1"
  46. />
  47. </label>
  48. <label for="notes" class="flex flex-col w-full">
  49. <span class="flex">Notes (optional):</span>
  50. <input
  51. id="notes"
  52. name="notes"
  53. type="text"
  54. class="bg-gray-50 rounded-lg p-2 text-gray-900"
  55. />
  56. </label>
  57. <button
  58. type="submit"
  59. class="bg-indigo-500 rounded-lg p-2 text-white"
  60. >
  61. Withdraw
  62. </button>
  63. </form>
  64. @endif
  65. </div>

Powered by TurnKey Linux.