OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Compare Revisions

Regard whitespace Rev 179 → Rev 180

/trunk/OpenConcerto/src/org/openconcerto/erp/generationDoc/provider/TotalCommandeClientProvider.java
24,7 → 24,7
public class TotalCommandeClientProvider implements SpreadSheetCellValueProvider {
 
public enum TypeTotalCommandeClientProvider {
HT, TTC;
HT, TTC, TVA;
};
 
private final TypeTotalCommandeClientProvider type;
40,9 → 40,16
for (SQLRowAccessor sqlRowAccessor : rows) {
if (!sqlRowAccessor.isForeignEmpty("ID_COMMANDE_CLIENT")) {
SQLRowAccessor rowCmd = sqlRowAccessor.getForeign("ID_COMMANDE_CLIENT");
total += (this.type == TypeTotalCommandeClientProvider.HT ? rowCmd.getLong("T_HT") : rowCmd.getLong("T_TTC"));
if (this.type == TypeTotalCommandeClientProvider.HT) {
total += rowCmd.getLong("T_HT");
} else if (this.type == TypeTotalCommandeClientProvider.TVA) {
total += rowCmd.getLong("T_TVA");
} else if (this.type == TypeTotalCommandeClientProvider.TTC) {
total += rowCmd.getLong("T_TTC");
}
 
}
}
return new BigDecimal(total).movePointLeft(2);
}
 
49,6 → 56,7
public static void register() {
SpreadSheetCellValueProviderManager.put("sales.account.command.total", new TotalCommandeClientProvider(TypeTotalCommandeClientProvider.HT));
SpreadSheetCellValueProviderManager.put("sales.account.command.total.ttc", new TotalCommandeClientProvider(TypeTotalCommandeClientProvider.TTC));
SpreadSheetCellValueProviderManager.put("sales.account.command.total.tva", new TotalCommandeClientProvider(TypeTotalCommandeClientProvider.TVA));
}
 
}