OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 156 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 156 Rev 174
Line 193... Line 193...
193
                    // On remplit les cellules du tableau
193
                    // On remplit les cellules du tableau
194
                    parseTableauXML(tableChild, spreadSheet, rowLanguage);
194
                    parseTableauXML(tableChild, spreadSheet, rowLanguage);
195
                }
195
                }
196
            } catch (Exception e) {
196
            } catch (Exception e) {
197
                ExceptionHandler.handle("Impossible de remplir le document " + templateId + " " + ((rowLanguage == null) ? "" : rowLanguage.getString("CHEMIN")), e);
197
                ExceptionHandler.handle("Impossible de remplir le document " + templateId + " " + ((rowLanguage == null) ? "" : rowLanguage.getString("CHEMIN")), e);
-
 
198
                e.printStackTrace();
198
                return null;
199
                return null;
199
            }
200
            }
200
 
201
 
201
            if (meta != null) {
202
            if (meta != null) {
202
                meta.applyTo(spreadSheet.getPackage().getMeta(true));
203
                meta.applyTo(spreadSheet.getPackage().getMeta(true));
Line 442... Line 443...
442
                }
443
                }
443
 
444
 
444
            }
445
            }
445
            calc.setRemise(valRemiseHTReel, totalAvtRemise);
446
            calc.setRemise(valRemiseHTReel, totalAvtRemise);
446
 
447
 
-
 
448
            // Fix TVA si nécessaire pour facture fournisseur
-
 
449
            if (row.getTable().contains("TVA_ADJUSTMENT")) {
-
 
450
                BigDecimal tvaFix = row.getBigDecimal("TVA_ADJUSTMENT");
-
 
451
                calc.addTVAAdjust(tvaFix);
-
 
452
            }
-
 
453
 
447
            for (int i = 0; i < rows.size(); i++) {
454
            for (int i = 0; i < rows.size(); i++) {
448
                SQLRowAccessor sqlRow = rows.get(i);
455
                SQLRowAccessor sqlRow = rows.get(i);
449
                calc.addLine(sqlRow, sqlRow.getForeign("ID_ARTICLE"), i, i == rows.size() - 1);
456
                calc.addLine(sqlRow, sqlRow.getForeign("ID_ARTICLE"), i, i == rows.size() - 1);
450
            }
457
            }
451
 
458
 
Line 488... Line 495...
488
                }
495
                }
489
                rowValsPort.putRowValues("ID_ARTICLE").put("ID_COMPTE_PCE", rowDefaultCptPort.getID()).put("ID_COMPTE_PCE_ACHAT", rowDefaultCptPort.getID());
496
                rowValsPort.putRowValues("ID_ARTICLE").put("ID_COMPTE_PCE", rowDefaultCptPort.getID()).put("ID_COMPTE_PCE_ACHAT", rowDefaultCptPort.getID());
490
 
497
 
491
                calc.addLine(rowValsPort, rowValsPort.getForeign("ID_ARTICLE"), 1, false);
498
                calc.addLine(rowValsPort, rowValsPort.getForeign("ID_ARTICLE"), 1, false);
492
            }
499
            }
-
 
500
            if (row.getTable().contains("FRAIS_DOCUMENT_HT") && row.getTable().contains("ID_TAXE_FRAIS_DOCUMENT")) {
-
 
501
                BigDecimal fraisDoc = BigDecimal.valueOf(row.getLong("FRAIS_DOCUMENT_HT")).movePointLeft(2);
-
 
502
                SQLRowAccessor tvafraisDoc = row.getForeign("ID_TAXE_FRAIS_DOCUMENT");
-
 
503
                if (tvafraisDoc != null && fraisDoc.signum() != 0 && !tvafraisDoc.isUndefined()) {
-
 
504
                    SQLRowValues rowValsfraisDoc = new SQLRowValues(tableElt);
-
 
505
                    rowValsfraisDoc.put("T_PV_HT", fraisDoc);
-
 
506
                    rowValsfraisDoc.put("QTE", 1);
-
 
507
                    rowValsfraisDoc.put("ID_TAXE", tvafraisDoc.getIDNumber());
-
 
508
                    rowValsfraisDoc.put("SERVICE", Boolean.TRUE);
-
 
509
                    rowValsfraisDoc.put("ID_FAMILLE_ARTICLE", null);
-
 
510
                    calc.addLine(rowValsfraisDoc, null, 1, false);
-
 
511
                }
-
 
512
            }
-
 
513
 
493
            calc.checkResult();
514
            calc.checkResult();
494
            Map<SQLRowAccessor, Tuple2<BigDecimal, BigDecimal>> taxeCalc = calc.getMapHtTVARowTaux();
515
            Map<SQLRowAccessor, Tuple2<BigDecimal, BigDecimal>> taxeCalc = calc.getMapHtTVARowTaux();
495
            for (SQLRowAccessor sqlRow : taxeCalc.keySet()) {
516
            for (SQLRowAccessor sqlRow : taxeCalc.keySet()) {
496
                Tuple2<BigDecimal, BigDecimal> v = taxeCalc.get(sqlRow);
517
                Tuple2<BigDecimal, BigDecimal> v = taxeCalc.get(sqlRow);
497
                Map<String, Object> m = new HashMap<>();
518
                Map<String, Object> m = new HashMap<>();