All files / helpers/status translateOutboundOrderHelpers.js

93.22% Statements 55/59
93.65% Branches 59/63
100% Functions 4/4
93.22% Lines 55/59

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169      17x 16x   2x   1x   1x   1x   1x   1x   1x   1x   1x   1x   1x   1x   1x   1x   1x   1x 1x                                           14x 13x   1x   1x   1x   1x   1x   1x   1x   1x   1x   1x   3x   1x 1x                                   11x 10x   1x   1x   1x   1x   1x   1x   1x   1x   1x   1x   1x 1x                                 4x 3x   1x   1x   1x   1x 1x                            
import { t } from '../i18n';
 
function outboundOrderStatus(status) {
  if (status || status === 0) {
    switch (status) {
      case 1:
        return t('BEE1946' /* Pendente Alocação */);
      case 2:
        return t('BEE1947' /* Pendente Corte de Cabos */);
      case 3:
        return t('BEE1365' /* Pendente Separação */);
      case 4:
        return t('BEE1367' /* Em Separação */);
      case 5:
        return t('BEE1948' /* Pendente Conferência */);
      case 6:
        return t('BEE1949' /* Pendente Docas */);
      case 7:
        return t('BEE1773' /* Pendente Romaneio */);
      case 8:
        return t('BEE1769' /* Pendente Consolidação */);
      case 9:
        return t('BEE2963' /* Pendente de Faturamento */);
      case 10:
        return t('BEE1833' /* Finalizado */);
      case 11:
        return t('BEE176' /* Divergência */);
      case 12:
        return t('BEE64' /* Cancelado */);
      case 13:
        return t('BEE1899' /* Devolvido */);
      case 14:
        return t('BEE3687' /* Pendente Retirada */);
      default:
        return status;
    }
  } else Eif (!status) {
    return [
      { value: 1, label: t('BEE1946' /* Pendente Alocação */) },
      { value: 2, label: t('BEE1947' /* Pendente Corte de Cabos */) },
      { value: 3, label: t('BEE1365' /* Pendente Separação */) },
      { value: 4, label: t('BEE1367' /* Em Separação */) },
      { value: 5, label: t('BEE1948' /* Pendente Conferência */) },
      { value: 6, label: t('BEE1949' /* Pendente Docas */) },
      { value: 7, label: t('BEE1773' /* Pendente Romaneio */) },
      { value: 8, label: t('BEE1769' /* Pendente Consolidação */) },
      { value: 9, label: t('BEE2963' /* Pendente de Faturamento */) },
      { value: 10, label: t('BEE1833' /* Finalizado */) },
      { value: 11, label: t('BEE176' /* Divergência */) },
      { value: 12, label: t('BEE64' /* Cancelado */) },
      { value: 13, label: t('BEE1899' /* Devolvido */) },
      { value: 14, label: t('BEE3687' /* Pendente Retirada */) },
    ];
  }
 
  return '';
}
 
function outboundOrderProductStatus(status) {
  if (status || status === 0) {
    switch (status) {
      case 1:
        return t('BEE1946' /* Pendente Alocação */);
      case 2:
        return t('BEE1947' /* Pendente Corte de Cabos */);
      case 3:
        return t('BEE1803' /* Corte Finalizado */);
      case 4:
        return t('BEE1365' /* Pendente Separação */);
      case 5:
        return t('BEE1368' /* Separado */);
      case 6:
        return t('BEE1948' /* Pendente Conferência */);
      case 7:
        return t('BEE1833' /* Finalizado */);
      case 8:
        return t('BEE176' /* Divergência */);
      case 9:
        return t('BEE64' /* Cancelado */);
      case 10:
        return t('BEE1899' /* Devolvido */);
      default:
        return status;
    }
  } else Eif (!status) {
    return [
      { value: 1, label: t('BEE1946' /* Pendente Alocação */) },
      { value: 2, label: t('BEE1947' /* Pendente Corte de Cabos */) },
      { value: 3, label: t('BEE1803' /* Corte Finalizado */) },
      { value: 4, label: t('BEE1365' /* Pendente Separação */) },
      { value: 5, label: t('BEE1368' /* Separado */) },
      { value: 6, label: t('BEE1948' /* Pendente Conferência */) },
      { value: 7, label: t('BEE1833' /* Finalizado */) },
      { value: 8, label: t('BEE176' /* Divergência */) },
      { value: 9, label: t('BEE64' /* Cancelado */) },
      { value: 10, label: t('BEE1899' /* Devolvido */) },
    ];
  }
 
  return '';
}
 
function outboundOrderProductAllocationStatus(status) {
  if (status || status === 0) {
    switch (status) {
      case 1:
        return t('BEE1947' /* Pendente Corte de Cabos */);
      case 2:
        return t('BEE1803' /* Corte Finalizado */);
      case 3:
        return t('BEE1365' /* Pendente Separação */);
      case 4:
        return t('BEE1368' /* Separado */);
      case 5:
        return t('BEE1948' /* Pendente Conferência */);
      case 6:
        return t('BEE1833' /* Finalizado */);
      case 7:
        return t('BEE176' /* Divergência */);
      case 8:
        return t('BEE64' /* Cancelado */);
      case 9:
        return t('BEE1899' /* Devolvido */);
      default:
        return status;
    }
  } else Eif (!status) {
    return [
      { value: 1, label: t('BEE1947' /* Pendente Corte de Cabos */) },
      { value: 2, label: t('BEE1803' /* Corte Finalizado */) },
      { value: 3, label: t('BEE1365' /* Pendente Separação */) },
      { value: 4, label: t('BEE1368' /* Separado */) },
      { value: 5, label: t('BEE1948' /* Pendente Conferência */) },
      { value: 6, label: t('BEE1833' /* Finalizado */) },
      { value: 7, label: t('BEE176' /* Divergência */) },
      { value: 8, label: t('BEE64' /* Cancelado */) },
      { value: 9, label: t('BEE1899' /* Devolvido */) },
    ];
  }
 
  return '';
}
 
function outboundOrderPickingType(type) {
  if (type || type === 0) {
    switch (type) {
      case 1:
        return t('BEE1454' /* Onda */);
      case 2:
        return t('BEE1378' /* Documento */);
      default:
        return '';
    }
  } else Eif (!type) {
    return [
      { value: 1, label: t('BEE1454' /* Onda */) },
      { value: 2, label: t('BEE1378' /* Documento */) },
    ];
  }
  return '';
}
 
export default {
  outboundOrderStatus,
  outboundOrderProductStatus,
  outboundOrderProductAllocationStatus,
  outboundOrderPickingType,
};