Author: bpoussin Date: 2013-02-20 12:45:41 +0100 (Wed, 20 Feb 2013) New Revision: 308 Url: http://chorem.org/projects/chorem/repository/revisions/308 Log: fixes #884: Remove Invoiceable extension and replace it by FinancialTransaction Added: trunk/chorem-entities/src/main/java/org/chorem/entities/ExpenseClaimStatus.java trunk/chorem-entities/src/main/java/org/chorem/entities/InvoiceStatus.java Modified: trunk/chorem-entities/src/main/java/org/chorem/ChoremAction.java trunk/chorem-entities/src/main/java/org/chorem/ChoremClient.java trunk/chorem-entities/src/main/java/org/chorem/ChoremConfigAction.java trunk/chorem-entities/src/main/java/org/chorem/ChoremConfigOption.java trunk/chorem-entities/src/main/java/org/chorem/ChoremMain.java trunk/chorem-entities/src/main/java/org/chorem/ImportChoremTopia.java trunk/chorem-entities/src/main/java/org/chorem/entities/InvoiceMigration.java trunk/chorem-entities/src/main/java/org/chorem/entities/InvoiceableUtil.java trunk/chorem-entities/src/main/resources/chorem.properties trunk/chorem-entities/src/main/xmi/chorem-model.properties trunk/chorem-entities/src/main/xmi/chorem-model.zargo trunk/chorem-entities/src/test/java/org/chorem/entities/InvoiceableUtilTest.java trunk/pom.xml Modified: trunk/chorem-entities/src/main/java/org/chorem/ChoremAction.java =================================================================== --- trunk/chorem-entities/src/main/java/org/chorem/ChoremAction.java 2013-02-20 11:38:15 UTC (rev 307) +++ trunk/chorem-entities/src/main/java/org/chorem/ChoremAction.java 2013-02-20 11:45:41 UTC (rev 308) @@ -88,6 +88,21 @@ System.out.println("... reindexation done"); } + /** + * Vide tous les objets + */ + @ApplicationConfig.Action.Step(0) + public void removeObject(String extName) { + System.out.println("##### EFFACEMENT TOTAL DES OBJECT AVEC L'EXTENSION '"+extName+"' #####"); + ChoremClient proxy = ChoremClient.getClient(config); + WikittyQuery query = new WikittyQueryMaker() + .exteq(extName).end() + .setLimit(WikittyQuery.MAX); + WikittyQueryResult<String> ids = proxy.findAllByQuery(query); + proxy.delete(ids.getAll()); + System.out.println("... delete of " + ids.size() + " objects done"); + } + public void configInfo() { config.printConfig(); } Modified: trunk/chorem-entities/src/main/java/org/chorem/ChoremClient.java =================================================================== --- trunk/chorem-entities/src/main/java/org/chorem/ChoremClient.java 2013-02-20 11:38:15 UTC (rev 307) +++ trunk/chorem-entities/src/main/java/org/chorem/ChoremClient.java 2013-02-20 11:45:41 UTC (rev 308) @@ -167,10 +167,12 @@ exts.addAll(org.chorem.entities.EmployeeAbstract.extensions); exts.addAll(org.chorem.entities.EmployeeHRAbstract.extensions); exts.addAll(org.chorem.entities.EvaluationAbstract.extensions); + exts.addAll(org.chorem.entities.ExpenseClaimAbstract.extensions); + exts.addAll(org.chorem.entities.FinancialTransactionAbstract.extensions); exts.addAll(org.chorem.entities.GoalAbstract.extensions); exts.addAll(org.chorem.entities.IntervalAbstract.extensions); exts.addAll(org.chorem.entities.InterviewAbstract.extensions); - exts.addAll(org.chorem.entities.InvoiceableAbstract.extensions); +// exts.addAll(org.chorem.entities.InvoiceableAbstract.extensions); exts.addAll(org.chorem.entities.InvoiceAbstract.extensions); exts.addAll(org.chorem.entities.MissionAbstract.extensions); exts.addAll(org.chorem.entities.NoteAbstract.extensions); Modified: trunk/chorem-entities/src/main/java/org/chorem/ChoremConfigAction.java =================================================================== --- trunk/chorem-entities/src/main/java/org/chorem/ChoremConfigAction.java 2013-02-20 11:38:15 UTC (rev 307) +++ trunk/chorem-entities/src/main/java/org/chorem/ChoremConfigAction.java 2013-02-20 11:45:41 UTC (rev 308) @@ -38,6 +38,7 @@ INFO(ChoremAction.class.getName() + "#configInfo", "-i", "--config-info" , "--configInfo"), CLEAN(ChoremAction.class.getName() + "#clean", "--clean"), CLEAR(ChoremAction.class.getName() + "#clear", "--clear"), + REMOVE_OBJECT(ChoremAction.class.getName() + "#removeObject", "--removeObject"), REINDEX(ChoremAction.class.getName() + "#reindex", "--reindex"), IMPORT_PERSON(ImportChoremTopia.class.getName() + "#importPerson", "-ip", "--import-person", "--importPerson"), Modified: trunk/chorem-entities/src/main/java/org/chorem/ChoremConfigOption.java =================================================================== --- trunk/chorem-entities/src/main/java/org/chorem/ChoremConfigOption.java 2013-02-20 11:38:15 UTC (rev 307) +++ trunk/chorem-entities/src/main/java/org/chorem/ChoremConfigOption.java 2013-02-20 11:45:41 UTC (rev 308) @@ -23,6 +23,7 @@ package org.chorem; import org.nuiton.util.ApplicationConfig; + import static org.nuiton.i18n.I18n._; /** Modified: trunk/chorem-entities/src/main/java/org/chorem/ChoremMain.java =================================================================== --- trunk/chorem-entities/src/main/java/org/chorem/ChoremMain.java 2013-02-20 11:38:15 UTC (rev 307) +++ trunk/chorem-entities/src/main/java/org/chorem/ChoremMain.java 2013-02-20 11:45:41 UTC (rev 308) @@ -42,8 +42,10 @@ static public void main(String[] args) throws Exception { // args = "--clear -ic /tmp/chorem-company.csv -ip /tmp/chorem-person.csv -ie /tmp/chorem-employee.csv --import-contract-type /tmp/chorem-contracttype.csv --import-contract /tmp/chorem-contract.csv --commit".split(" "); -// args = "-ii /tmp/bill.csv --import-costs /tmp/cost.csv --commit".split(" "); - args = "--reindex".split(" "); +// args = "-ic /tmp/chorem-company.csv --commit".split(" "); +// args = "--removeObject Invoice".split(" "); + args = "-ii /tmp/bill.csv --import-costs /tmp/cost.csv --commit".split(" "); +// args = "--reindex".split(" "); System.out.println(String.format("Launching ChoremMain ... (args: %s)", Arrays.toString(args))); // getConfig do all: parse and doAllAction ApplicationConfig config = ChoremConfig.getConfig(null, args); Modified: trunk/chorem-entities/src/main/java/org/chorem/ImportChoremTopia.java =================================================================== --- trunk/chorem-entities/src/main/java/org/chorem/ImportChoremTopia.java 2013-02-20 11:38:15 UTC (rev 307) +++ trunk/chorem-entities/src/main/java/org/chorem/ImportChoremTopia.java 2013-02-20 11:45:41 UTC (rev 308) @@ -34,6 +34,7 @@ import java.util.Set; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.DateUtils; +import org.apache.commons.lang3.time.FastDateFormat; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.entities.Category; @@ -43,6 +44,8 @@ import org.chorem.entities.ContactDetailsImpl; import org.chorem.entities.Employee; import org.chorem.entities.EmployeeImpl; +import org.chorem.entities.FinancialTransaction; +import org.chorem.entities.FinancialTransactionImpl; import org.chorem.entities.Invoice; import org.chorem.entities.InvoiceImpl; import org.chorem.entities.Person; @@ -121,7 +124,7 @@ protected Map<String, PersonImpl> persons = new HashMap<String, PersonImpl>(); protected Map<String, EmployeeImpl> employees = new HashMap<String, EmployeeImpl>(); protected Map<String, InvoiceImpl> invoices = new HashMap<String, InvoiceImpl>(); - protected Map<String, InvoiceImpl> costs = new HashMap<String, InvoiceImpl>(); + protected Map<String, FinancialTransactionImpl> costs = new HashMap<String, FinancialTransactionImpl>(); protected Map<String, CategoryImpl> categories = new HashMap<String, CategoryImpl>(); // a ne pas stocker dans wikitty @@ -533,11 +536,12 @@ InvoiceImpl invoice = new InvoiceImpl(); invoice.setCategory(categories.get(category)); - invoice.setSupplier(codeLutinId); - invoice.setCustomer(company); + invoice.setBeneficiary(codeLutinId); + invoice.setPayer(company); invoice.setReference(number); invoice.setAmount(amount); - invoice.setPostedDate(issuedate); + invoice.setVAT(19.6); + invoice.setEmittedDate(issuedate); invoice.setExpectedDate(hopedate); invoice.setPaymentDate(realdate); @@ -568,8 +572,8 @@ System.out.println(String.format("%s invoices loaded", invoices.size())); } - protected String invoiceToKey(Invoice c) { - String result = c.getCategory() + ";" + c.getPaymentDate() + ";" + c.getName() + ";" + c.getAmount(); + protected String invoiceToKey(FinancialTransaction c) { + String result = c.getCategory() + ";" + c.getPaymentDate() + ";" + c.getReference() + ";" + c.getAmount(); return result; } @@ -581,14 +585,14 @@ // Pour les invoices existantes WikittyQuery invoicesQuery = new WikittyQueryMaker() - .exteq(Invoice.EXT_INVOICE).end().setLimit(WikittyQuery.MAX); - WikittyQueryResult<Invoice> invoicesResult = - proxy.findAllByQuery(Invoice.class, invoicesQuery); + .exteq(FinancialTransaction.EXT_FINANCIALTRANSACTION).end().setLimit(WikittyQuery.MAX); + WikittyQueryResult<FinancialTransaction> invoicesResult = + proxy.findAllByQuery(FinancialTransaction.class, invoicesQuery); Set<String> knowInvoices = new HashSet<String>(); Set<String> passedInvoices = new HashSet<String>(); Set<String> rejectedInvoices = new HashSet<String>(); Set<String> treatedInvoices = new HashSet<String>(); - for (Invoice c : invoicesResult) { + for (FinancialTransaction c : invoicesResult) { // on fait une concatenation pour optimiser les futurs recherche knowInvoices.add(invoiceToKey(c)); } @@ -622,6 +626,8 @@ frais = c.getWikittyId(); } + FastDateFormat formatDate = FastDateFormat.getInstance("yyyy-MM-dd"); + FileReader in = new FileReader(filename); // separateur ';' String delimiter '"', skip first line (header) CSVReader reader = new CSVReader(in, ';', '"', 1); @@ -640,13 +646,13 @@ unknowCategories.add(category); } - InvoiceImpl invoice = new InvoiceImpl(); - invoice.setName(tag); + FinancialTransactionImpl invoice = new FinancialTransactionImpl(); + invoice.setReference(tag + " " + (date==null?"":formatDate.format(date))); invoice.setDescription(tag); invoice.setCategory(categoryNameId.get(category)); - invoice.setCustomer(codeLutinId); + invoice.setPayer(codeLutinId); invoice.setAmount(amount); - invoice.setPostedDate(date); + invoice.setEmittedDate(date); invoice.setExpectedDate(date); invoice.setPaymentDate(date); Copied: trunk/chorem-entities/src/main/java/org/chorem/entities/ExpenseClaimStatus.java (from rev 305, trunk/chorem-entities/src/main/java/org/chorem/entities/TaskStatus.java) =================================================================== --- trunk/chorem-entities/src/main/java/org/chorem/entities/ExpenseClaimStatus.java (rev 0) +++ trunk/chorem-entities/src/main/java/org/chorem/entities/ExpenseClaimStatus.java 2013-02-20 11:45:41 UTC (rev 308) @@ -0,0 +1,39 @@ +/* + * #%L + * Chorem entities + * $Id:$ + * $HeadURL:$ + * %% + * Copyright (C) 2011 - 2012 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package org.chorem.entities; + +/** + * + * @author poussin + * @version $Revision$ + * + * Last update: $Date$ + * by : $Author$ + */ +public enum ExpenseClaimStatus { + + UNCHARGEABLE, // non refacturable (valeur par defaut) + CHARGEABLE, // refacturable + CHARGED // refacturee + +} Modified: trunk/chorem-entities/src/main/java/org/chorem/entities/InvoiceMigration.java =================================================================== --- trunk/chorem-entities/src/main/java/org/chorem/entities/InvoiceMigration.java 2013-02-20 11:38:15 UTC (rev 307) +++ trunk/chorem-entities/src/main/java/org/chorem/entities/InvoiceMigration.java 2013-02-20 11:45:41 UTC (rev 308) @@ -28,20 +28,11 @@ */ -import java.beans.PropertyChangeListener; -import java.math.BigDecimal; -import java.util.Collection; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.Set; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.ChoremClient; import org.nuiton.util.VersionUtil; import org.nuiton.wikitty.WikittyService; import org.nuiton.wikitty.WikittyUtil; -import org.nuiton.wikitty.entities.FieldType; import org.nuiton.wikitty.entities.Wikitty; import org.nuiton.wikitty.entities.WikittyExtension; import org.nuiton.wikitty.services.WikittyExtensionMigrationRename; @@ -59,22 +50,56 @@ */ protected void migrateFieldVTA(Wikitty old, Wikitty result) { + FinancialTransactionHelper.addExtension(result); String oldFieldName = WikittyUtil.getFQFieldName( Invoice.EXT_INVOICE, "VTA"); String newFieldName = WikittyUtil.getFQFieldName( - Invoice.EXT_INVOICE, Invoice.FIELD_INVOICE_VAT); + FinancialTransaction.EXT_FINANCIALTRANSACTION, "VAT"); Object v = old.getFqField(oldFieldName); result.setFqField(newFieldName, v); } - + + protected void migrateToFinancialTransactional(Wikitty old, Wikitty result) { + result.removeExtension("Invoiceable"); + + FinancialTransactionHelper.addExtension(result); + + result.setFqField(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_REFERENCE, + old.getFieldAsObject("Invoice", "reference")); + result.setFqField(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_DESCRIPTION, + old.getFieldAsObject("Invoice", "description")); + result.setFqField(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_AMOUNT, + old.getFieldAsObject("Invoice", "amount")); + + // VAT peut etre null si on avait un tres vieux objet avec 'VTA' + if (null != old.getFieldAsObject("Invoice", "VAT")) { + result.setFqField(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_VAT, + old.getFieldAsObject("Invoice", "VAT")); + } + + result.setFqField(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_EMITTEDDATE, + old.getFieldAsObject("Invoice", "postedDate")); + result.setFqField(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_EXPECTEDDATE, + old.getFieldAsObject("Invoice", "expectedDate")); + result.setFqField(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_PAYMENTDATE, + old.getFieldAsObject("Invoice", "paymentDate")); + result.setFqField(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_PAYER, + old.getFieldAsObject("Invoice", "customer")); + result.setFqField(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_BENEFICIARY, + old.getFieldAsObject("Invoice", "supplier")); + result.setFqField(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_CATEGORY, + old.getFieldAsObject("Invoice", "category")); + result.setFqField(FinancialTransaction.FQ_FIELD_FINANCIALTRANSACTION_TARGET, + old.getFieldAsObject("Invoiceable", "target")); + } @Override public Wikitty migrate(WikittyService service, Wikitty wikitty, WikittyExtension oldExt, WikittyExtension newExt) { Wikitty result = super.migrate(service, wikitty, oldExt, newExt); - + if (Invoice.EXT_INVOICE.equals(newExt.getName())) { String oldVersion = oldExt.getVersion(); String newVersion = newExt.getVersion(); @@ -82,6 +107,10 @@ && !VersionUtil.smallerThan(newVersion, "15.0")) { migrateFieldVTA(wikitty, result); + } else if (!VersionUtil.greaterThan("15.0", oldVersion) + && !VersionUtil.smallerThan(newVersion, "16.0")) { + + migrateToFinancialTransactional(wikitty, result); } } Copied: trunk/chorem-entities/src/main/java/org/chorem/entities/InvoiceStatus.java (from rev 305, trunk/chorem-entities/src/main/java/org/chorem/entities/TaskStatus.java) =================================================================== --- trunk/chorem-entities/src/main/java/org/chorem/entities/InvoiceStatus.java (rev 0) +++ trunk/chorem-entities/src/main/java/org/chorem/entities/InvoiceStatus.java 2013-02-20 11:45:41 UTC (rev 308) @@ -0,0 +1,38 @@ +/* + * #%L + * Chorem entities + * $Id:$ + * $HeadURL:$ + * %% + * Copyright (C) 2011 - 2012 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package org.chorem.entities; + +/** + * + * @author poussin + * @version $Revision$ + * + * Last update: $Date$ + * by : $Author$ + */ +public enum InvoiceStatus { + + ACCEPTED, // valeur par defaut + CANCELED // facture annulee + +} Modified: trunk/chorem-entities/src/main/java/org/chorem/entities/InvoiceableUtil.java =================================================================== --- trunk/chorem-entities/src/main/java/org/chorem/entities/InvoiceableUtil.java 2013-02-20 11:38:15 UTC (rev 307) +++ trunk/chorem-entities/src/main/java/org/chorem/entities/InvoiceableUtil.java 2013-02-20 11:45:41 UTC (rev 308) @@ -28,7 +28,6 @@ import org.apache.commons.logging.LogFactory; import org.nuiton.wikitty.ScriptEvaluator; import org.nuiton.wikitty.WikittyClient; -import org.nuiton.wikitty.WikittyProxy; /** * Classe permettant de rassembler les methodes utils pour l'evaluation des @@ -42,32 +41,32 @@ */ public class InvoiceableUtil { - /** to use log facility, just put in your code: log.info(\"...\"); */ - static private Log log = LogFactory.getLog(InvoiceableUtil.class); - - static public boolean evalCondition(WikittyClient client, Invoiceable invoiceable) { - Map<String, Object> bindings = new HashMap<String, Object>(); - bindings.put("wikittyClient", client); - bindings.put("invoiceable", invoiceable); - Object resultEval = ScriptEvaluator.eval(null, - invoiceable.getName(), invoiceable.getCondition(), - invoiceable.getMimetype(), bindings); - boolean result= Boolean.TRUE.equals(resultEval); - return result; - } - - static public double evalValue(WikittyClient client, Invoiceable invoiceable) { - Map<String, Object> bindings = new HashMap<String, Object>(); - bindings.put("wikittyClient", client); - bindings.put("invoiceable", invoiceable); - Object resultEval = ScriptEvaluator.eval(null, - invoiceable.getName(), invoiceable.getValue(), - invoiceable.getMimetype(), bindings); - - double result = 0; - if (resultEval instanceof Number) { - result = ((Number) resultEval).doubleValue(); - } - return result; - } +// /** to use log facility, just put in your code: log.info(\"...\"); */ +// static private Log log = LogFactory.getLog(InvoiceableUtil.class); +// +// static public boolean evalCondition(WikittyClient client, Invoiceable invoiceable) { +// Map<String, Object> bindings = new HashMap<String, Object>(); +// bindings.put("wikittyClient", client); +// bindings.put("invoiceable", invoiceable); +// Object resultEval = ScriptEvaluator.eval(null, +// invoiceable.getName(), invoiceable.getCondition(), +// invoiceable.getMimetype(), bindings); +// boolean result= Boolean.TRUE.equals(resultEval); +// return result; +// } +// +// static public double evalValue(WikittyClient client, Invoiceable invoiceable) { +// Map<String, Object> bindings = new HashMap<String, Object>(); +// bindings.put("wikittyClient", client); +// bindings.put("invoiceable", invoiceable); +// Object resultEval = ScriptEvaluator.eval(null, +// invoiceable.getName(), invoiceable.getValue(), +// invoiceable.getMimetype(), bindings); +// +// double result = 0; +// if (resultEval instanceof Number) { +// result = ((Number) resultEval).doubleValue(); +// } +// return result; +// } } Modified: trunk/chorem-entities/src/main/resources/chorem.properties =================================================================== --- trunk/chorem-entities/src/main/resources/chorem.properties 2013-02-20 11:38:15 UTC (rev 307) +++ trunk/chorem-entities/src/main/resources/chorem.properties 2013-02-20 11:45:41 UTC (rev 308) @@ -35,7 +35,8 @@ wikitty.WikittyService.components=org.nuiton.wikitty.services.WikittyServiceStorage,\ org.nuiton.wikitty.services.WikittyServiceNotifier,\ org.nuiton.wikitty.services.WikittyServiceCached,\ -org.nuiton.wikitty.services.WikittyServiceSecurity +org.nuiton.wikitty.services.WikittyServiceAuthentication,\ +org.nuiton.wikitty.services.WikittyServiceAuthorisation wikitty.WikittyServiceStorage.components=org.nuiton.wikitty.jdbc.WikittyExtensionStorageJDBC,\ org.nuiton.wikitty.jdbc.WikittyStorageJDBC,\ org.nuiton.wikitty.storage.solr.WikittySearchEngineSolr Modified: trunk/chorem-entities/src/main/xmi/chorem-model.properties =================================================================== --- trunk/chorem-entities/src/main/xmi/chorem-model.properties 2013-02-20 11:38:15 UTC (rev 307) +++ trunk/chorem-entities/src/main/xmi/chorem-model.properties 2013-02-20 11:45:41 UTC (rev 308) @@ -115,42 +115,51 @@ # # Interview (a mettre ici) # + # +# FinancialTransaction +# +org.chorem.entities.FinancialTransaction.class.tagvalue.version=3.0 +org.chorem.entities.FinancialTransaction.class.tagvalue.preload=FinancialTransaction.payer;FinancialTransaction.beneficiary;FinancialTransaction.target;FinancialTransaction.category +org.chorem.entities.FinancialTransaction.class.tagvalue.toString=%FinancialTransaction.reference|noref$s - %FinancialTransaction.description|nodescription$s - %FinancialTransaction.amount|noamount$s +org.chorem.entities.FinancialTransaction.class.tagvalue.sortOrder=FinancialTransaction.emittedDate desc,FinancialTransaction.expectedDate,FinancialTransaction.paymentDate,FinancialTransaction.reference,FinancialTransaction.amount +org.chorem.entities.FinancialTransaction.attribute.reference.tagvalue.help=La r\u00e9f\u00e9rence +org.chorem.entities.FinancialTransaction.attribute.reference.tagvalue.notNull=true +org.chorem.entities.FinancialTransaction.attribute.description.tagvalue.help=la description de la facture (ce sur quoi elle porte) +org.chorem.entities.FinancialTransaction.attribute.description.tagvalue.subtype=text/rst +org.chorem.entities.FinancialTransaction.attribute.amount.tagvalue.help=Le montant HT de la facture +org.chorem.entities.FinancialTransaction.attribute.amount.tagvalue.subtype=currency +org.chorem.entities.FinancialTransaction.attribute.VAT.tagvalue.help=La TVA \u00e0 appliquer \u00e0 la facture +org.chorem.entities.FinancialTransaction.attribute.emittedDate.tagvalue.help=La date de prise en compte (l'année fiscale) +org.chorem.entities.FinancialTransaction.attribute.expectedDate.tagvalue.help=La date souhait\u00e9e de paiement +org.chorem.entities.FinancialTransaction.attribute.paymentDate.tagvalue.help=La date de paiement r\u00e9elle +org.chorem.entities.FinancialTransaction.attribute.beneficiary.tagvalue.help=La société ou la personne qui recoit l'argent +org.chorem.entities.FinancialTransaction.attribute.beneficiary.tagvalue.allowed=Company,Person,Employee +org.chorem.entities.FinancialTransaction.attribute.payer.tagvalue.help=La société ou la personne qui paie +org.chorem.entities.FinancialTransaction.attribute.payer.tagvalue.allowed=Company,Person,Employee +org.chorem.entities.FinancialTransaction.attribute.category.tagvalue.help=La cat\u00e9gorie de cette facture +org.chorem.entities.FinancialTransaction.attribute.target.tagvalue.help=L'objet sur lequel la facture s'appliquera +org.chorem.entities.FinancialTransaction.attribute.target.tagvalue.allowed=Accepted,Project + +# # Invoice # -org.chorem.entities.Invoice.class.tagvalue.version=15.0 -org.chorem.entities.Invoice.class.tagvalue.preload=Invoice.customer;Invoice.supplier -org.chorem.entities.Invoice.class.tagvalue.toString=%Invoice.reference|noref$s - %Invoice.description|nodescription$s - %Invoice.amount|noamount$s -org.chorem.entities.Invoice.class.tagvalue.sortOrder=Invoice.postedDate desc,Invoice.expectedDate,Invoice.paymentDate,Invoice.reference,Invoice.amount -org.chorem.entities.Invoice.attribute.reference.tagvalue.help=La r\u00e9f\u00e9rence de la facture -org.chorem.entities.Invoice.attribute.description.tagvalue.help=la description de la facture (ce sur quoi elle porte) -org.chorem.entities.Invoice.attribute.description.tagvalue.subtype=text/rst -org.chorem.entities.Invoice.attribute.amount.tagvalue.help=Le montant HT de la facture -org.chorem.entities.Invoice.attribute.amount.tagvalue.subtype=currency -org.chorem.entities.Invoice.attribute.VAT.tagvalue.help=La TVA \u00e0 appliquer \u00e0 la facture -org.chorem.entities.Invoice.attribute.postedDate.tagvalue.help=La date d'envoi au client -org.chorem.entities.Invoice.attribute.expectedDate.tagvalue.help=La date souhait\u00e9e de paiement -org.chorem.entities.Invoice.attribute.paymentDate.tagvalue.help=La date de paiement r\u00e9elle -org.chorem.entities.Invoice.attribute.supplier.tagvalue.help=La personne chez Code Lutin qui g\u00e8re la facturation -org.chorem.entities.Invoice.attribute.parent.tagvalue.allowed=Company,Person,Employee -org.chorem.entities.Invoice.attribute.customer.tagvalue.help=La personne chez le client \u00e0 qui ont a envoyer la facture +org.chorem.entities.Invoice.class.tagvalue.version=17.0 +org.chorem.entities.Invoice.class.tagvalue.toString=%FinancialTransaction.reference|noref$s (%Invoice.status$s) - %FinancialTransaction.description|nodescription$s - %FinancialTransaction.amount|noamount$s +org.chorem.entities.Invoice.attribute.status.tagvalue.help=Le statut de la facture +org.chorem.entities.Invoice.attribute.status.tagvalue.allowed=ACCEPTED,CANCELED +org.chorem.entities.Invoice.attribute.status.tagvalue.default=ACCEPTED + # -# Invoiceable +# ExpenseClaim # -org.chorem.entities.Invoiceable.class.tagvalue.version=12.0 -org.chorem.entities.Invoiceable.class.tagvalue.preload=Invoiceable.target;Invoiceable.category -org.chorem.entities.Invoiceable.class.tagvalue.toString=%Invoiceable.name|noname$s -org.chorem.entities.Invoiceable.class.tagvalue.sortOrder=Invoiceable.name -org.chorem.entities.Invoiceable.attribute.name.tagvalue.help=Nom de ce facturable (si n\u00e9cessaire) ex: "facture VSR" -org.chorem.entities.Invoiceable.attribute.target.tagvalue.help=L'objet sur lequel la facture s'appliquera -org.chorem.entities.Invoiceable.attribute.condition.tagvalue.help=Script qui lorsqu'il est \u00e9valu\u00e9 \u00e0 TRUE cr\u00e9e la facture -org.chorem.entities.Invoiceable.attribute.condition.tagvalue.subtype=application/javascript -org.chorem.entities.Invoiceable.attribute.value.tagvalue.help=Script qui permet de calculer le montant de la facture -org.chorem.entities.Invoiceable.attribute.value.tagvalue.subtype=application/javascript -org.chorem.entities.Invoiceable.attribute.recurrence.tagvalue.help=Script qui permet de calculer la r\u00e9currence de cette facture -org.chorem.entities.Invoiceable.attribute.recurrence.tagvalue.subtype=application/javascript -org.chorem.entities.Invoiceable.attribute.mimetype.tagvalue.help=Langage utilis\u00e9 pour les scripts (ex: application/javascript) -org.chorem.entities.Invoiceable.attribute.category.tagvalue.help=La cat\u00e9gorie de cette facture +org.chorem.entities.ExpenseClaim.class.tagvalue.version=1.0 +org.chorem.entities.ExpenseClaim.attribute.kind.tagvalue.help=Le type de dépense +org.chorem.entities.ExpenseClaim.attribute.kind.tagvalue.choiceQuery=SELECT ExpenseClaim.kind WHERE extension=ExpenseClaim +org.chorem.entities.ExpenseClaim.attribute.status.tagvalue.help=Le statut de la note de frais +org.chorem.entities.ExpenseClaim.attribute.status.tagvalue.allowed=UNCHARGEABLE,CHARGEABLE,CHARGED +org.chorem.entities.ExpenseClaim.attribute.status.tagvalue.default=UNCHARGEABLE + # # Mission (a mettre ici) # Modified: trunk/chorem-entities/src/main/xmi/chorem-model.zargo =================================================================== (Binary files differ) Modified: trunk/chorem-entities/src/test/java/org/chorem/entities/InvoiceableUtilTest.java =================================================================== --- trunk/chorem-entities/src/test/java/org/chorem/entities/InvoiceableUtilTest.java 2013-02-20 11:38:15 UTC (rev 307) +++ trunk/chorem-entities/src/test/java/org/chorem/entities/InvoiceableUtilTest.java 2013-02-20 11:45:41 UTC (rev 308) @@ -24,6 +24,7 @@ import org.junit.Test; import org.nuiton.wikitty.WikittyClient; + import static org.junit.Assert.*; /** @@ -32,46 +33,46 @@ */ public class InvoiceableUtilTest { - /** - * Test of evalCondition method, of class InvoiceableUtil. - */ - @Test - public void testEvalCondition() { - System.out.println("evalCondition"); - - WikittyClient proxy = null; - Invoiceable invoiceable = new InvoiceableImpl(); - invoiceable.setMimetype("application/javascript"); - invoiceable.setCondition("'coucou'.equals(invoiceable.getName())"); - - { - invoiceable.setName("coucou"); - boolean expResult = true; - boolean result = InvoiceableUtil.evalCondition(proxy, invoiceable); - assertEquals(expResult, result); - } - { - invoiceable.setName("not coucou"); - boolean expResult = false; - boolean result = InvoiceableUtil.evalCondition(proxy, invoiceable); - assertEquals(expResult, result); - } - } - - /** - * Test of evalValue method, of class InvoiceableUtil. - */ - @Test - public void testEvalValue() { - System.out.println("evalValue"); - - WikittyClient proxy = null; - Invoiceable invoiceable = new InvoiceableImpl(); - invoiceable.setMimetype("application/javascript"); - invoiceable.setValue("10*10"); - - double expResult = 100; - double result = InvoiceableUtil.evalValue(proxy, invoiceable); - assertEquals(expResult, result, 0.0); - } +// /** +// * Test of evalCondition method, of class InvoiceableUtil. +// */ +// @Test +// public void testEvalCondition() { +// System.out.println("evalCondition"); +// +// WikittyClient proxy = null; +// Invoiceable invoiceable = new InvoiceableImpl(); +// invoiceable.setMimetype("application/javascript"); +// invoiceable.setCondition("'coucou'.equals(invoiceable.getName())"); +// +// { +// invoiceable.setName("coucou"); +// boolean expResult = true; +// boolean result = InvoiceableUtil.evalCondition(proxy, invoiceable); +// assertEquals(expResult, result); +// } +// { +// invoiceable.setName("not coucou"); +// boolean expResult = false; +// boolean result = InvoiceableUtil.evalCondition(proxy, invoiceable); +// assertEquals(expResult, result); +// } +// } +// +// /** +// * Test of evalValue method, of class InvoiceableUtil. +// */ +// @Test +// public void testEvalValue() { +// System.out.println("evalValue"); +// +// WikittyClient proxy = null; +// Invoiceable invoiceable = new InvoiceableImpl(); +// invoiceable.setMimetype("application/javascript"); +// invoiceable.setValue("10*10"); +// +// double expResult = 100; +// double result = InvoiceableUtil.evalValue(proxy, invoiceable); +// assertEquals(expResult, result, 0.0); +// } } Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2013-02-20 11:38:15 UTC (rev 307) +++ trunk/pom.xml 2013-02-20 11:45:41 UTC (rev 308) @@ -104,9 +104,8 @@ <servletApiVersion>2.5</servletApiVersion> <jspApiVersion>2.0</jspApiVersion> <h2Version>1.2.134</h2Version> - <webmotionVersion>2.3.3</webmotionVersion> + <webmotionVersion>2.3.4-SNAPSHOT</webmotionVersion> <jstlVersion>1.2</jstlVersion> - <nuitonJsVersion>0.1-SNAPSHOT</nuitonJsVersion> <!-- license to use --> <license.licenseName>agpl_v3</license.licenseName> @@ -119,20 +118,7 @@ <dependencyManagement> <dependencies> - <dependency> - <groupId>org.debux.webmotion</groupId> - <artifactId>webmotion</artifactId> - <version>${webmotionVersion}</version> - </dependency> - - <dependency> - <groupId>org.debux.webmotion</groupId> - <artifactId>webmotion-extra-sitemesh</artifactId> - <version>2.3.3</version> - </dependency> - - <dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> <version>${jstlVersion}</version> @@ -221,29 +207,46 @@ <dependency> <groupId>org.nuiton.js</groupId> <artifactId>nuiton-js-wro</artifactId> - <version>${nuitonJsVersion}</version> - </dependency> + <version>0.1-SNAPSHOT</version> + </dependency> <dependency> <groupId>org.nuiton.js</groupId> <artifactId>nuiton-js-jquery</artifactId> <version>1.8.3-1-SNAPSHOT</version> - </dependency> + </dependency> <dependency> <groupId>org.nuiton.js</groupId> <artifactId>nuiton-js-jquery-ui</artifactId> <version>1.9.2-1-SNAPSHOT</version> - </dependency> + </dependency> <dependency> <groupId>org.nuiton.js</groupId> <artifactId>nuiton-js-jqplot</artifactId> <version>1.0.4r1121-1-SNAPSHOT</version> - </dependency> + </dependency> <dependency> <groupId>org.nuiton.js</groupId> <artifactId>nuiton-js-bootstrap</artifactId> <version>2.2.2-1-SNAPSHOT</version> - </dependency> + </dependency> + <dependency> + <groupId>org.nuiton.js</groupId> + <artifactId>nuiton-js-jquery-tokeninput</artifactId> + <version>1.6.0.0-1-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.debux.webmotion</groupId> + <artifactId>webmotion</artifactId> + <version>${webmotionVersion}</version> + </dependency> + + <dependency> + <groupId>org.debux.webmotion</groupId> + <artifactId>webmotion-extra-sitemesh</artifactId> + <version>${webmotionVersion}</version> + </dependency> + </dependencies> </dependencyManagement>