Commit 1b34bf554edc31e85819ea1a2b807b05ce36e997

Authored by Eric Fernandez
1 parent ba93008bf5
Exists in master and in 1 other branch develop

fix moneda calcular precio

src/js/businessService.js
... ... @@ -23,6 +23,11 @@ angular.module('focaCrearRemito')
23 23 idVendedor: idVendedor
24 24 };
25 25 crearRemitoService.crearEstadoParaRemito(estado);
  26 + },
  27 + calcularArticulos: function(articulos, cotizacion) {
  28 + for(var i = 0; i < articulos.length; i++) {
  29 + articulos[i].precio = articulos[i].precio / cotizacion;
  30 + }
26 31 }
27 32 };
28 33 }]);
src/js/controller.js
... ... @@ -100,16 +100,16 @@ angular.module(&#39;focaCrearRemito&#39;) .controller(&#39;remitoController&#39;,
100 100 removeCabecera('Cotizacion:');
101 101 var cabeceras = [
102 102 {
103   - label: 'Moneda',
  103 + label: 'Moneda:',
104 104 valor: notaPedido.cotizacion[0].moneda[0].DETALLE
105 105 },
106 106 {
107   - label: 'Fecha cotizacion',
  107 + label: 'Fecha cotizacion:',
108 108 valor: $filter('date')(notaPedido.cotizacion[0].FECHA,
109 109 'dd/MM/yyyy')
110 110 },
111 111 {
112   - label: 'Cotizacion',
  112 + label: 'Cotizacion:',
113 113 valor: notaPedido.cotizacion[0].VENDEDOR
114 114 },
115 115 {
... ... @@ -148,7 +148,6 @@ angular.module(&#39;focaCrearRemito&#39;) .controller(&#39;remitoController&#39;,
148 148 } else {
149 149 return 'Ingreso Manual';
150 150 }
151   -
152 151 }
153 152  
154 153 if(notaPedido.flete === 1) {
... ... @@ -166,6 +165,8 @@ angular.module(&#39;focaCrearRemito&#39;) .controller(&#39;remitoController&#39;,
166 165 cabeceras.push(cabeceraBomba);
167 166 }
168 167 $scope.articulosTabla = notaPedido.articulosNotaPedido;
  168 + remitoBusinessService.calcularArticulos($scope.articulosTabla,
  169 + notaPedido.cotizacion[0].VENDEDOR);
169 170 if(notaPedido.precioCondicion.length > 0) {
170 171 $scope.idLista = notaPedido.precioCondicion[0].idListaPrecio;
171 172 } else {
... ... @@ -203,16 +204,16 @@ angular.module(&#39;focaCrearRemito&#39;) .controller(&#39;remitoController&#39;,
203 204 removeCabecera('Cotizacion:');
204 205 var cabeceras = [
205 206 {
206   - label: 'Moneda',
  207 + label: 'Moneda:',
207 208 valor: remito.cotizacion[0].moneda[0].DETALLE
208 209 },
209 210 {
210   - label: 'Fecha cotizacion',
  211 + label: 'Fecha cotizacion:',
211 212 valor: $filter('date')(remito.cotizacion[0].FECHA,
212 213 'dd/MM/yyyy')
213 214 },
214 215 {
215   - label: 'Cotizacion',
  216 + label: 'Cotizacion:',
216 217 valor: remito.cotizacion[0].VENDEDOR
217 218 },
218 219 {
... ... @@ -269,6 +270,8 @@ angular.module(&#39;focaCrearRemito&#39;) .controller(&#39;remitoController&#39;,
269 270 cabeceras.push(cabeceraBomba);
270 271 }
271 272 $scope.articulosTabla = remito.articulosRemito;
  273 + remitoBusinessService.calcularArticulos($scope.articulosTabla,
  274 + remito.cotizacion[0].VENDEDOR);
272 275 if(remito.precioCondicion.length > 0) {
273 276 $scope.idLista = remito.precioCondicion[0].idListaPrecio;
274 277 } else {
src/views/remito.html
... ... @@ -172,12 +172,12 @@
172 172 class="selectable"
173 173 ng-click="idLista == -1 && cambioEdit(articulo, 'precio')"
174 174 ng-hide="articulo.editPrecio"
175   - ng-bind="articulo.precio | currency: remito.moneda.simbolo : 4">
  175 + ng-bind="articulo.precio | currency: remito.moneda.SIMBOLO : 4">
176 176 </i>
177 177 </td>
178 178 <td
179 179 class="col text-right"
180   - ng-bind="(articulo.precio * articulo.cantidad) | currency: remito.moneda.simbolo">
  180 + ng-bind="(articulo.precio * articulo.cantidad) | currency: remito.moneda.SIMBOLO">
181 181 </td>
182 182 <td class="text-center">
183 183 <button
... ... @@ -224,7 +224,7 @@
224 224 <td class="col text-right">
225 225 <input
226 226 class="form-control"
227   - ng-value="articuloACargar.precio | currency: remito.moneda.simbolo : 4"
  227 + ng-value="articuloACargar.precio | currency: remito.moneda.SIMBOLO : 4"
228 228 ng-show="idLista != -1"
229 229 readonly
230 230 >
... ... @@ -242,7 +242,7 @@
242 242 <td class="col text-right">
243 243 <input
244 244 class="form-control"
245   - ng-value="getSubTotal() | currency: remito.moneda.simbolo"
  245 + ng-value="getSubTotal() | currency: remito.moneda.SIMBOLO"
246 246 readonly
247 247 ></td>
248 248 <td class="text-center align-middle">
... ... @@ -273,7 +273,7 @@
273 273 <h3>Total:</h3>
274 274 </td>
275 275 <td class="table-celda-total text-right no-border-top" colspan="1">
276   - <h3>{{getTotal() | currency: remito.moneda.simbolo}}</h3>
  276 + <h3>{{getTotal() | currency: remito.moneda.SIMBOLO}}</h3>
277 277 </td>
278 278 <td class="text-right no-border-top">
279 279 <button
... ... @@ -335,11 +335,11 @@
335 335 <span ng-bind="'x' + articulo.cantidad"></span>
336 336 </div>
337 337 <div class="col-3 px-1 text-right">
338   - <span ng-bind="articulo.precio | currency: remito.moneda.simbolo : 4"></span>
  338 + <span ng-bind="articulo.precio | currency: remito.moneda.SIMBOLO : 4"></span>
339 339 </div>
340 340 <div class="col px-1 text-right">
341 341 <span
342   - ng-bind="(articulo.precio * articulo.cantidad) | currency: remito.moneda.simbolo"
  342 + ng-bind="(articulo.precio * articulo.cantidad) | currency: remito.moneda.SIMBOLO"
343 343 >
344 344 </span>
345 345 </div>
... ... @@ -387,11 +387,11 @@
387 387 >
388 388 </div>
389 389 <div class="col-3 px-1 text-right">
390   - <span ng-bind="articuloACargar.precio | currency: remito.moneda.simbolo : 4"></span>
  390 + <span ng-bind="articuloACargar.precio | currency: remito.moneda.SIMBOLO : 4"></span>
391 391 </div>
392 392 <div class="col px-1 text-right">
393 393 <span
394   - ng-bind="getSubTotal() | currency: remito.moneda.simbolo"
  394 + ng-bind="getSubTotal() | currency: remito.moneda.SIMBOLO"
395 395 >
396 396 </span>
397 397 </div>
... ... @@ -449,7 +449,7 @@
449 449 <h3>Total:</h3>
450 450 </td>
451 451 <td class="table-celda-total text-right no-border-top">
452   - <h3>{{getTotal() | currency: remito.moneda.simbolo}}</h3>
  452 + <h3>{{getTotal() | currency: remito.moneda.SIMBOLO}}</h3>
453 453 </td>
454 454 </tr>
455 455 </tfoot>