r8 - in trunk: billy-business/src/main/java/org/chorem/billy/business billy-business/src/main/java/org/chorem/billy/external billy-business/src/main/java/org/chorem/billy/impl billy-business/src/main/xmi billy-business/src/test/java/org/chorem/billy/impl billy-ui/src/main/java/org/chorem/billy/ui/pages billy-ui/src/main/java/org/chorem/billy/ui/services billy-ui/src/main/java/org/chorem/billy/ui/utils billy-ui/src/main/resources/org/chorem/billy/ui/components billy-ui/src/main/resources/org/
Author: fdesbois Date: 2009-08-28 14:01:57 +0200 (Fri, 28 Aug 2009) New Revision: 8 Added: trunk/billy-business/src/main/java/org/chorem/billy/external/ImportUrl.java trunk/billy-ui/src/main/java/org/chorem/billy/ui/pages/InvoiceForm.java trunk/billy-ui/src/main/java/org/chorem/billy/ui/pages/InvoiceList.java trunk/billy-ui/src/main/resources/org/chorem/billy/ui/pages/Index.properties trunk/billy-ui/src/main/resources/org/chorem/billy/ui/pages/InvoiceForm.properties trunk/billy-ui/src/main/resources/org/chorem/billy/ui/pages/InvoiceList.properties trunk/billy-ui/src/main/webapp/InvoiceForm.tml trunk/billy-ui/src/main/webapp/InvoiceList.tml Removed: trunk/billy-business/src/main/java/org/chorem/billy/external/ImportReferenceUrl.java Modified: trunk/billy-business/src/main/java/org/chorem/billy/business/ClientHelper.java trunk/billy-business/src/main/java/org/chorem/billy/business/InvoiceHelper.java trunk/billy-business/src/main/java/org/chorem/billy/external/ImportXPIL.java trunk/billy-business/src/main/java/org/chorem/billy/impl/ServiceClientImpl.java trunk/billy-business/src/main/java/org/chorem/billy/impl/ServiceInvoiceImpl.java trunk/billy-business/src/main/xmi/billy.zargo trunk/billy-business/src/test/java/org/chorem/billy/impl/ServiceClientImplTest.java trunk/billy-ui/src/main/java/org/chorem/billy/ui/services/AppModule.java trunk/billy-ui/src/main/java/org/chorem/billy/ui/utils/ErrorHelper.java trunk/billy-ui/src/main/resources/org/chorem/billy/ui/components/Layout.properties trunk/billy-ui/src/main/resources/org/chorem/billy/ui/components/Layout.tml trunk/billy-ui/src/main/webapp/css/common.css Log: Implementation for UI with client from xPIL (InvoiceForm and InvoiceList) Modified: trunk/billy-business/src/main/java/org/chorem/billy/business/ClientHelper.java =================================================================== --- trunk/billy-business/src/main/java/org/chorem/billy/business/ClientHelper.java 2009-08-27 11:26:57 UTC (rev 7) +++ trunk/billy-business/src/main/java/org/chorem/billy/business/ClientHelper.java 2009-08-28 12:01:57 UTC (rev 8) @@ -21,10 +21,12 @@ import java.util.HashMap; import java.util.Map; import org.apache.commons.logging.Log; +import org.chorem.billy.BillyException; import org.chorem.billy.BillyModelDAOHelper; import org.chorem.billy.ContextUtilBilly; import org.chorem.billy.dto.Client; import org.chorem.billy.dto.ClientPerson; +import org.chorem.billy.external.ImportUrl; import org.chorem.billy.persistence.ClientEntity; import org.chorem.billy.persistence.ClientEntityDAO; import org.chorem.exceptions.EntityException; @@ -76,7 +78,7 @@ return entity; } - public static ClientPerson getClientPerson(ClientEntity entity, Client client) { + public static ClientPerson getClientPerson(ClientEntity entity, Client client) throws BillyException { ClientPerson person = new ClientPerson(); person.setName(entity.getPersonName()); person.setSource(entity.getSource()); @@ -90,9 +92,17 @@ client = new Client(); client.setName(entity.getName()); client.setSiret(entity.getSiret()); - client.setSource(entity.getSource()); + client.setSource(entity.getSource()); } - + + if (client.getSource() != null && !client.getSource().isEmpty()) { + try { + ImportUrl importUrl = new ImportUrl(); + client = importUrl.setClientUrl(client); + } catch (NoClassDefFoundError eee) { + } + } + person.setClient(client); return person; Modified: trunk/billy-business/src/main/java/org/chorem/billy/business/InvoiceHelper.java =================================================================== --- trunk/billy-business/src/main/java/org/chorem/billy/business/InvoiceHelper.java 2009-08-27 11:26:57 UTC (rev 7) +++ trunk/billy-business/src/main/java/org/chorem/billy/business/InvoiceHelper.java 2009-08-28 12:01:57 UTC (rev 8) @@ -19,6 +19,7 @@ package org.chorem.billy.business; +import org.chorem.billy.BillyException; import org.chorem.billy.ContextUtilBilly; import org.chorem.billy.dto.ClientPerson; import org.chorem.billy.dto.Invoice; @@ -40,7 +41,7 @@ */ public class InvoiceHelper { - public static Invoice getInvoice(InvoiceEntity entity) throws ConvertException { + public static Invoice getInvoice(InvoiceEntity entity) throws ConvertException, BillyException { Invoice invoice = Convert.toDTO(entity, InvoiceEntity.class, Invoice.class); invoice.setId(ContextUtilBilly.convertId(entity.getTopiaId())); Deleted: trunk/billy-business/src/main/java/org/chorem/billy/external/ImportReferenceUrl.java =================================================================== --- trunk/billy-business/src/main/java/org/chorem/billy/external/ImportReferenceUrl.java 2009-08-27 11:26:57 UTC (rev 7) +++ trunk/billy-business/src/main/java/org/chorem/billy/external/ImportReferenceUrl.java 2009-08-28 12:01:57 UTC (rev 8) @@ -1,66 +0,0 @@ -/** - * *##% Billy Business - * Copyright (C) 2009 CodeLutin - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU 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 Lesser Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. ##%* - */ - -package org.chorem.billy.external; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.chorem.billy.BillyException; -import org.chorem.billy.ContextUtilBilly; -import org.chorem.choreg.ChoremRegistry; -import org.chorem.choreg.ChoremRegistryImpl; -import org.chorem.choreg.Link; -import org.chorem.choreg.exceptions.NoServiceException; - -/** - * ImportReferenceUrl.java - * - * Created on 2009-08-26 - * - * @author fdesbois - * @version $Revision$ - * - * Last update: $Date$ - * by : $Author$ - */ -public class ImportReferenceUrl { - - private static ChoremRegistry choreg; - - private static final Log log = LogFactory.getLog(ImportReferenceUrl.class); - - public ImportReferenceUrl() { - choreg = ChoremRegistryImpl.getInstance(); - } - - /*public Reference setReferenceUrl(Reference reference) throws CashException { - try { - String url = choreg.findViewUrl(null, reference.getSource()); - reference.setUrl(url); - } catch (NoServiceException eee) { - if (log.isWarnEnabled()) { - log.warn(eee.getMessage()); - } - } catch (Exception eee) { - ContextUtilCash.serviceException(null, - "An error occured when retrieve url for reference '" + reference.getSource() + "' from ChoremRegistry", eee); - } - return reference; - }*/ -} Copied: trunk/billy-business/src/main/java/org/chorem/billy/external/ImportUrl.java (from rev 2, trunk/billy-business/src/main/java/org/chorem/billy/external/ImportReferenceUrl.java) =================================================================== --- trunk/billy-business/src/main/java/org/chorem/billy/external/ImportUrl.java (rev 0) +++ trunk/billy-business/src/main/java/org/chorem/billy/external/ImportUrl.java 2009-08-28 12:01:57 UTC (rev 8) @@ -0,0 +1,71 @@ +/** + * *##% Billy Business + * Copyright (C) 2009 CodeLutin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU 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 Lesser Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. ##%* + */ + +package org.chorem.billy.external; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.chorem.billy.BillyException; +import org.chorem.billy.ContextUtilBilly; +import org.chorem.billy.dto.Client; +import org.chorem.choreg.ChoremRegistry; +import org.chorem.choreg.ChoremRegistryImpl; +import org.chorem.choreg.exceptions.NoServiceException; + +/** + * ImportReferenceUrl.java + * + * Created on 2009-08-26 + * + * @author fdesbois + * @version $Revision$ + * + * Last update: $Date$ + * by : $Author$ + */ +public class ImportUrl { + + private static ChoremRegistry choreg; + + private static final Log log = LogFactory.getLog(ImportUrl.class); + + public ImportUrl() { + choreg = ChoremRegistryImpl.getInstance(); + } + + public Client setClientUrl(Client client) throws BillyException { + try { + String viewUrl = choreg.findViewUrl(null, client.getSource()); + client.setViewUrl(viewUrl); + /*String formUrl = choreg.findFormUrl(null, client.getSource()); + client.setFormUrl(formUrl); + String listUrl = choreg.findListUrl(null, client.getSource(), null); + client.setFormUrl(listUrl);*/ + + } catch (NoServiceException eee) { + if (log.isWarnEnabled()) { + log.warn(eee.getMessage()); + } + } catch (Exception eee) { + ContextUtilBilly.serviceException(null, + "An error occured when retrieve url for client '" + client.getSource() + "' from ChoremRegistry", eee); + } + return client; + } +} Property changes on: trunk/billy-business/src/main/java/org/chorem/billy/external/ImportUrl.java ___________________________________________________________________ Added: svn:keywords + Author Date Revision Added: svn:mergeinfo + Modified: trunk/billy-business/src/main/java/org/chorem/billy/external/ImportXPIL.java =================================================================== --- trunk/billy-business/src/main/java/org/chorem/billy/external/ImportXPIL.java 2009-08-27 11:26:57 UTC (rev 7) +++ trunk/billy-business/src/main/java/org/chorem/billy/external/ImportXPIL.java 2009-08-28 12:01:57 UTC (rev 8) @@ -73,8 +73,7 @@ * - Person Type include personName, personSourceId, membershipOrganisations with subDivisionNames * - Organisation Type include organisationName, organisationSourceId, subDivisionNames * </pre> - * Person document includes organisationSourceId in membershipOrganisations. - * Two steps : Check all files and use maps to store data from PartyDocument. Then routing maps for convert PartyDocument into DTO objects. + * Person document includes organisationSourceId in membershipOrganisations. * @return list of ClientOrganization which contains SubDivisions and Persons (Clients) * @throws BillyException */ @@ -83,13 +82,7 @@ try { List<InputStream> streams = choreg.findAll(null, FormatType.OASIS_CIQ_XPIL, InputStream.class, null); - /* First : Creation of two maps */ - - // Key = organizationId, value = List persons PartyDocument - //Map<String, List<PartyDocument>> persons = new HashMap<String, List<PartyDocument>>(); - // Key = organizationId, value = organization PartyDocument - //Map<String, PartyDocument> organizations = new HashMap<String, PartyDocument>(); - + // Map to search and store clients Map<String, Client> clients = new HashMap<String, Client>(); for (InputStream stream : streams) { @@ -111,7 +104,7 @@ client = new Client(); client.setSource(organizationId); clients.put(organizationId, client); - results.add(client); + results.add(client); // Add to result new client } Map<String, List<ClientPerson>> services = client.getServices(); @@ -123,7 +116,6 @@ Memberships.Membership.Organisation orga = membership.getOrganisation(); for (Memberships.Membership.Organisation.SubDivisionName sub : orga.getSubDivisionNameArray()) { - //SubDivision division = getSubDivisionFromOrganization(organization, sub.getStringValue()); String subDivisionName = sub.getStringValue(); List<ClientPerson> persons = services.get(subDivisionName); @@ -140,33 +132,12 @@ person.setClient(client); persons.add(person); - } - - /*List<PartyDocument> partys = persons.get(organizationId); - if (partys == null) { - partys = new ArrayList<PartyDocument>(); - persons.put(organizationId, partys); - } - partys.add(doc);*/ } } else if (XNLHelper.hasOrganisationNames(partyName)) { // ORGANIZATION FILE String organizationId = XPILHelper.getMainIdentifier(party); - /*Client client = clients.get(organizationId); - if (client == null) { - client = new Client(); - client.setSource(organizationId); - clients.put(organizationId, client); - } - - - Map<String, List<ClientPerson>> services = client.getServices(); - if (services == null) { - services = new HashMap<String, List<ClientPerson>>(); - client.setServices(services); - }*/ Client client = clients.get(organizationId); if (client == null) { client = new Client(); @@ -186,108 +157,24 @@ // Add subdivisions for organization for (SimplifiedNameElement name : XNLHelper.getSubDivisionNames(partyName)) { // Create subdivision DTO - //SubDivision division = new SubDivision(); String subDivisionName = name.getValue(); List<ClientPerson> persons = services.get(subDivisionName); if (persons == null) { persons = new ArrayList<ClientPerson>(); services.put(subDivisionName, persons); } - - //division.setName(name.getValue()); - //division.setClientOrganization(organization); - //organization.addSubDivision(division); } - //clients.put(organizationId, organization); - - - //organizations.put(organizationId, doc); } } - /*for (String clientId : clients.keySet()) { - Client client = clients.get(clientId); - results.add(client); - }*/ - //results = clients. - /* Second : Interpret map data to convert into DTO object */ - /*for (String organizationId : organizations.keySet()) { - PartyType party = organizations.get(organizationId).getParty(); - PartyNameType partyName = party.getPartyName(); - - // Create clientOrganization DTO - Client organization = new Client(); - organization.setSource(organizationId); - organization.setName(XNLHelper.getOrganisationSimpleName(partyName)); - - // Add subdivisions for organization - for (SimplifiedNameElement name : XNLHelper.getSubDivisionNames(partyName)) { - // Create subdivision DTO - SubDivision division = new SubDivision(); - division.setName(name.getValue()); - division.setClientOrganization(organization); - organization.addSubDivision(division); - } - - // Get personDocuments from Map with key = organizationId - List<PartyDocument> personDocuments = persons.get(organizationId); - - // Add persons to subdivision from organization - for (PartyDocument personDoc : personDocuments) { - - PartyType personParty = personDoc.getParty(); - PartyNameType personName = personParty.getPartyName(); - - // Create client (person) DTO - Client client = new Client(); - String personId = XPILHelper.getMainIdentifier(party); - client.setPersonSource(personId); - client.setPersonName(XNLHelper.getPersonSimpleName(personName)); - - Memberships.Membership.Organisation orga = getMembershipOrganisation(personParty, organizationId); - // Add to divisions from organization - for (Memberships.Membership.Organisation.SubDivisionName sub : orga.getSubDivisionNameArray()) { - SubDivision division = getSubDivisionFromOrganization(organization, sub.getStringValue()); - if (division != null) { - //client.addDivision(division); - division.addClient(client); - } - } - - } - - results.add(organization); - }*/ - } catch (NoServiceException eee) { - if (log.isInfoEnabled()) { - log.info("No service available for xPIL format to retrieve existing Organisations and Persons clients for Billy"); + if (log.isWarnEnabled()) { + log.warn("No service available for xPIL format to retrieve existing Organisations and Persons clients for Billy"); } } catch (Exception eee) { ContextUtilBilly.serviceException(null, "An error occured when retrieve XPIL clients from ChoremRegistry", eee); } return results; } -/* - private SubDivision getSubDivisionFromOrganization(ClientOrganization organization, String subDivisionName) { - for (SubDivision division : organization.getSubDivision()) { - if (division.getName().equals(subDivisionName)) { - return division; - } - } - return null; - } - - private Memberships.Membership.Organisation getMembershipOrganisation(PartyType partyType, String organizationId) { - - for (Memberships.Membership membership : partyType.getMemberships().getMembershipArray()) { - Memberships.Membership.MembershipElement element = membership.getMembershipElementArray(0); - if (element.getStringValue().equals(organizationId)) { - return membership.getOrganisation(); - } - } - return null; - - }*/ } Modified: trunk/billy-business/src/main/java/org/chorem/billy/impl/ServiceClientImpl.java =================================================================== --- trunk/billy-business/src/main/java/org/chorem/billy/impl/ServiceClientImpl.java 2009-08-27 11:26:57 UTC (rev 7) +++ trunk/billy-business/src/main/java/org/chorem/billy/impl/ServiceClientImpl.java 2009-08-28 12:01:57 UTC (rev 8) @@ -31,6 +31,7 @@ import org.chorem.billy.business.ClientHelper; import org.chorem.billy.dto.Client; import org.chorem.billy.dto.ClientPerson; +import org.chorem.billy.external.ImportUrl; import org.chorem.billy.external.ImportXPIL; import org.chorem.billy.persistence.ClientEntity; import org.chorem.billy.persistence.ClientEntityDAO; @@ -231,17 +232,18 @@ private List<Client> importXpilReferences(List<Client> input) throws BillyException { try { ImportXPIL xpil = new ImportXPIL(); + ImportUrl importUrl = new ImportUrl(); if (log.isInfoEnabled()) { log.info("ImportXPIL..."); } - if (clientsImportedCache == null) { + //if (clientsImportedCache == null) { if (log.isDebugEnabled()) { log.debug("New imports, create Cache"); } clientsImportedCache = xpil.findAll(); - } + //} int nbPersonsImported = 0; int nbPersonsFromXpil = 0; @@ -251,11 +253,17 @@ Client clientFind = getClient(input, client); if (clientFind == null) { // new Client from xPIL input.add(client); + importUrl.setClientUrl(client); // Url for Client from xPIL (already set if clientFind from DB) if (log.isDebugEnabled()) { - log.debug("Add Client : " + client.getSource() + " _ " + client.getSiret()); + log.debug("Add Client : " + client.getName() + " _ " + client.getSiret() + " _ " + client.getSource()); } } else { // Client already exist + // MAJ CLIENT + clientFind.setSource(client.getSource()); + clientFind.setSiret(client.getSiret()); + clientFind.setName(client.getName()); + Map<String, List<ClientPerson>> servicesFind = clientFind.getServices(); for (String serviceName : client.getServices().keySet()) { @@ -277,9 +285,14 @@ if (personFind == null) { // new ClientPerson from xPIL personsFind.add(person); if (log.isDebugEnabled()) { - log.debug("Add Person : " + person.getSource() + " _ " + person.getEmail()); + log.debug("Add Person : " + person.getName() + " _ " + person.getEmail() + " _ " + person.getSource()); } nbPersonsImported++; + } else { + // MAJ PERSON + personFind.setSource(person.getSource()); + personFind.setName(person.getName()); + personFind.setEmail(person.getEmail()); } } } @@ -289,53 +302,13 @@ } } - /*for (ClientOrganization organization : clientsImportedCache) { - - ClientOrganization organizationFind = getClientOrganization(input, organization); - if (organizationFind == null) { - //organizationFind = organization; - input.add(organization); - if (log.isDebugEnabled()) { - log.debug("ClientOrganization : " + organization.getSource()); - } - } else { - // TODO MAJ Organization parameter if needed - - for (SubDivision division : organization.getSubDivision()) { - //division. - SubDivision divisionFind = getDivision(organizationFind, division); - - if (divisionFind == null) { - //divisionFind = division; - organizationFind.addSubDivision(division); - if (log.isDebugEnabled()) { - log.debug("SubDivision : " + division.getName()); - } - } else { - // TODO MAJ SubDivision parameter if needed - - for (Client client : division.getClient()) { - //division. - Client clientFind = getClient(divisionFind, client); - if (clientFind == null) { - divisionFind.addClient(client); - if (log.isDebugEnabled()) { - log.debug("Client : " + client.getPersonSource()); - } - } - } - } - } - + /*ImportUrl importUrl = new ImportUrl(); + for (Client client : input) { + if (client.getSource() != null && !client.getSource().isEmpty()) { + importUrl.setClientUrl(client); } - }*/ - /*ImportReferenceUrl importUrl = new ImportReferenceUrl(); - for (Reference reference : input) { - importUrl.setReferenceUrl(reference); - }*/ - if (log.isInfoEnabled()) { if (nbPersonsFromXpil != 0) { log.info("...clients imported"); @@ -356,20 +329,26 @@ private Client getClient(List<Client> input, Client client) { for (Client in : input) { - if (client.getSource().equals(in.getSource())) { + boolean sameSource = client.getSource().equals(in.getSource()); + boolean sameName = client.getName().equals(in.getName()); + // TODO siret comparison + // boolean sameSiret = client.getSiret().equals(in.getSiret()); + if (sameSource || sameName) { return in; } - // TODO siret comparison } return null; } private ClientPerson getClientPerson(List<ClientPerson> input, ClientPerson person) { for (ClientPerson in : input) { - if (person.getSource().equals(in.getSource())) { + boolean sameSource = person.getSource().equals(in.getSource()); + boolean sameName = person.getName().equals(in.getName()); + // TODO email comparison + // boolean sameEmail = client.getEmail().equals(in.getEmail()); + if (sameSource || sameName) { return in; } - // TODO email comparison } return null; } Modified: trunk/billy-business/src/main/java/org/chorem/billy/impl/ServiceInvoiceImpl.java =================================================================== --- trunk/billy-business/src/main/java/org/chorem/billy/impl/ServiceInvoiceImpl.java 2009-08-27 11:26:57 UTC (rev 7) +++ trunk/billy-business/src/main/java/org/chorem/billy/impl/ServiceInvoiceImpl.java 2009-08-28 12:01:57 UTC (rev 8) @@ -31,7 +31,10 @@ import org.chorem.billy.ContextUtilBilly; import org.chorem.billy.business.ClientHelper; import org.chorem.billy.business.InvoiceHelper; +import org.chorem.billy.dto.Client; +import org.chorem.billy.dto.ClientPerson; import org.chorem.billy.dto.Invoice; +import org.chorem.billy.external.ImportUrl; import org.chorem.billy.persistence.ClientEntity; import org.chorem.billy.persistence.InvoiceEntity; import org.chorem.billy.persistence.InvoiceEntityDAO; @@ -149,7 +152,31 @@ @Override public Invoice getNewInvoice() { - return new Invoice(); + Invoice invoice = new Invoice(); + ClientPerson person = new ClientPerson(); + person.setClient(new Client()); + invoice.setClientPerson(person); + return invoice; } + @Override + public Invoice getInvoice(String invoiceId) throws BillyException { + Invoice result = null; + TopiaContext transaction = null; + try { + transaction = context.beginTransaction(); + + InvoiceEntityDAO dao = BillyModelDAOHelper.getInvoiceEntityDAO(transaction); + + InvoiceEntity entity = ServiceHelper.getEntity(dao, invoiceId, log); + + result = InvoiceHelper.getInvoice(entity); + + transaction.closeContext(); + } catch (Exception eee) { + ContextUtilBilly.serviceException(transaction, "Unable to get invoice with id = " + invoiceId, eee); + } + return result; + } + } Modified: trunk/billy-business/src/main/xmi/billy.zargo =================================================================== (Binary files differ) Modified: trunk/billy-business/src/test/java/org/chorem/billy/impl/ServiceClientImplTest.java =================================================================== --- trunk/billy-business/src/test/java/org/chorem/billy/impl/ServiceClientImplTest.java 2009-08-27 11:26:57 UTC (rev 7) +++ trunk/billy-business/src/test/java/org/chorem/billy/impl/ServiceClientImplTest.java 2009-08-28 12:01:57 UTC (rev 8) @@ -100,11 +100,11 @@ fail("BillyException : " + eee.getMessage()); } - try { + /*try { instance.deleteClient(client); } catch (BillyException eee) { fail("BillyException : " + eee.getMessage()); - } + }*/ } /** @@ -179,12 +179,12 @@ fail("BillyException : " + eee.getMessage()); } - try { + /*try { instance.deleteClient(client1); instance.deleteClient(client2); } catch (BillyException eee) { fail("BillyException : " + eee.getMessage()); - } + }*/ } Added: trunk/billy-ui/src/main/java/org/chorem/billy/ui/pages/InvoiceForm.java =================================================================== --- trunk/billy-ui/src/main/java/org/chorem/billy/ui/pages/InvoiceForm.java (rev 0) +++ trunk/billy-ui/src/main/java/org/chorem/billy/ui/pages/InvoiceForm.java 2009-08-28 12:01:57 UTC (rev 8) @@ -0,0 +1,316 @@ +/** + * *##% Billy Web Interface + * Copyright (C) 2009 CodeLutin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU 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 Lesser Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. ##%* + */ + +package org.chorem.billy.ui.pages; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import org.apache.tapestry5.EventContext; +import org.apache.tapestry5.OptionModel; +import org.apache.tapestry5.SelectModel; +import org.apache.tapestry5.annotations.InjectComponent; +import org.apache.tapestry5.annotations.Log; +import org.apache.tapestry5.annotations.Persist; +import org.apache.tapestry5.annotations.Property; +import org.apache.tapestry5.corelib.components.Form; +import org.apache.tapestry5.internal.OptionModelImpl; +import org.apache.tapestry5.internal.SelectModelImpl; +import org.apache.tapestry5.ioc.annotations.Inject; +import org.apache.tapestry5.ioc.services.PropertyAccess; +import org.chorem.billy.BillyException; +import org.chorem.billy.dto.Client; +import org.chorem.billy.dto.ClientPerson; +import org.chorem.billy.dto.Invoice; +import org.chorem.billy.services.ServiceClient; +import org.chorem.billy.services.ServiceInvoice; +import org.chorem.billy.ui.base.DataLoader; +import org.chorem.billy.ui.base.GenericSelectModel; +import org.chorem.billy.ui.components.Layout; +import org.chorem.billy.ui.utils.ErrorHelper; +import org.slf4j.Logger; + +/** + * InvoiceForm.java + * + * Created on 2009-08-27 by fdesbois + * + * @author fdesbois + * @version $Revision: 8 $ + * + * Last update: $Date: 2009-08-13 09:14:50 +0200 (Thu, 13 Aug 2009) $ + * by : $Author: fdesbois $ + */ +public class InvoiceForm implements DataLoader { + + @Inject + private Logger log; + + @Inject + private ServiceInvoice serviceInvoice; + + @Inject + private ServiceClient serviceClient; + + @InjectComponent + private Layout layout; + + @Persist + private List<Client> clients; + + @Persist + private Invoice invoice; + + private String invoiceId; + + @InjectComponent + private Form monForm; + + @Inject + private PropertyAccess propertyAccess; + + private GenericSelectModel<Client> companiesSelectModel; + + private SelectModel servicesSelectModel; + + private GenericSelectModel<ClientPerson> personsSelectModel; + + void onActivate(EventContext ec) { + if (ec.getCount() > 0) { + this.invoiceId = ec.get(String.class, 0); + } + } + + String onPassivate() { + return this.invoiceId; + } + + @Override + @Log + public void loadData() { + layout.clean(); + clients = null; + getClients(); + invoice = null; + getInvoice(); + } + + public List<Client> getClients() { + if (clients == null) { + try { + if (log.isDebugEnabled()) { + log.debug("BUSINESS_REQUEST [getClients]"); + } + clients = serviceClient.getClients(); + if (log.isDebugEnabled()) { + log.debug("Nb clients : " + clients.size()); + } + } catch (BillyException eee) { + layout.addErrors(ErrorHelper.getMessages("Impossible de charger les liste des clients", eee)); + } + } + return clients; + } + + public Invoice getInvoice() { + if (invoice == null) { + if (invoiceId != null && !invoiceId.isEmpty()) { + if (log.isDebugEnabled()) { + log.debug("Chargement d'une facture existante id = " + invoiceId); + } + try { + invoice = serviceInvoice.getInvoice(invoiceId); + } catch (BillyException eee) { + layout.addErrors(ErrorHelper.getMessages("Impossible de charger les liste des clients", eee)); + } + } else { + if (log.isDebugEnabled()) { + log.debug("Préparation nouvelle facture"); + } + invoice = serviceInvoice.getNewInvoice(); + } + } + return invoice; + } + + public void setInvoice(Invoice invoice) { + this.invoice = invoice; + } + + public GenericSelectModel<Client> getCompaniesSelectModel() { + if (companiesSelectModel == null) { + companiesSelectModel = new GenericSelectModel<Client>(getClients(), Client.class, "name", "name", propertyAccess); + } + return companiesSelectModel; + } + + public SelectModel getServicesSelectModel() { + if (servicesSelectModel == null) { + List<OptionModel> options = new ArrayList<OptionModel>(); + + String clientName = getInvoice().getClientPerson().getClient().getName(); + + if (clientName != null && !clientName.isEmpty()) { + + Client client = getCompaniesSelectModel().findObject(clientName); + + Map<String, List<ClientPerson>> services = client.getServices(); + for (String serviceName : services.keySet()) { + + options.add(new OptionModelImpl(serviceName)); + } + } /*else { + options.add(new OptionModelImpl("Sélectionnez une société !", "")); + }*/ + + servicesSelectModel = new SelectModelImpl(null, options); + } + return servicesSelectModel; + } + + public GenericSelectModel<ClientPerson> getPersonsSelectModel() { + if (personsSelectModel == null) { + + ClientPerson person = getInvoice().getClientPerson(); + String clientName = person.getClient().getName(); + String serviceName = person.getSubDivisionName(); + List<ClientPerson> persons = new ArrayList<ClientPerson>(); + if (serviceName != null && !serviceName.isEmpty()) { + Client client = getCompaniesSelectModel().findObject(clientName); + persons = client.getServices().get(serviceName); + //personsSelectModel = new GenericSelectModel<ClientPerson>(persons, ClientPerson.class, "name", "id", propertyAccess); + } /*else { + personsSelectModel = new GenericSelectModel<ClientPerson>(new ArrayList<ClientPerson>(), ClientPerson.class, "name", "id", propertyAccess); + personsSelectModel.getOptions().add(new OptionModelImpl("Sélectionnez un service !", "")); + } */ + personsSelectModel = new GenericSelectModel<ClientPerson>(persons, ClientPerson.class, "name", "name", propertyAccess); + + } + return personsSelectModel; + } + + /*@InjectComponent + private Zone clientFormZone; + + @Persist + @Property + private String companyName; + + @Persist + @Property + private String serviceName; + + @Persist + @Property + private String personId; + + @Log + Object onChangeFromCompanies(String value) { + Client client = getCompaniesSelectModel().findObject(value); + getInvoice().getClientPerson().setClient(client); + return clientFormZone.getBody(); + } + + @Log + Object onChangeFromServices(String value) { + getInvoice().getClientPerson().setSubDivisionName(value); + return clientFormZone.getBody(); + } + + @Log + void onChangeFromPersons(String value) { + ClientPerson person = getPersonsSelectModel().findObject(value); + getInvoice().setClientPerson(person); + }*/ + + @Property + private String personName; + + @Property + private String clientName; + + @Property + private String serviceName; + + void onPrepareFromMonForm() { + if (clientName == null) { + clientName = getInvoice().getClientPerson().getClient().getName(); + } + if (serviceName == null) { + serviceName = getInvoice().getClientPerson().getSubDivisionName(); + } + if (personName == null) { + personName = getInvoice().getClientPerson().getName(); + } + } + + private boolean editSelected; + + void onSelectedFromCompanyChange() { + editSelected = true; + } + + void onSelectedFromServiceChange() { + editSelected = true; + } + + @Log + Object onSuccessFromMonForm() { + if (clientName != null) { + Client client = getCompaniesSelectModel().findObject(clientName); + if (log.isDebugEnabled()) { + log.debug("Client = " + client); + } + ClientPerson person = getInvoice().getClientPerson(); + person.setClient(client); + person.setSubDivisionName(serviceName); + if (personName != null) { + ClientPerson selectedPerson = getPersonsSelectModel().findObject(personName); + getInvoice().setClientPerson(selectedPerson); + if (log.isDebugEnabled()) { + log.debug("Person id = " + selectedPerson.getId()); + log.debug("Person name = " + selectedPerson.getName()); + } + } + } + + if (!editSelected) { + + try { + serviceInvoice.createUpdateInvoice(invoice); + } catch (BillyException eee) { + List<String> errors = ErrorHelper.getMessages("Un erreur est survenue, sauvegarde impossible de la facture !",eee); + for (String error : errors) { + monForm.recordError(error); + } + } + return monForm.getHasErrors() ? monForm : InvoiceList.class; + } else { + if (log.isDebugEnabled()) { + log.debug("CHANGE ACTION"); + } + + + + + } + return monForm; + } + +} Added: trunk/billy-ui/src/main/java/org/chorem/billy/ui/pages/InvoiceList.java =================================================================== --- trunk/billy-ui/src/main/java/org/chorem/billy/ui/pages/InvoiceList.java (rev 0) +++ trunk/billy-ui/src/main/java/org/chorem/billy/ui/pages/InvoiceList.java 2009-08-28 12:01:57 UTC (rev 8) @@ -0,0 +1,93 @@ +/** + * *##% Billy Web Interface + * Copyright (C) 2009 CodeLutin + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU 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 Lesser Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. ##%* + */ + +package org.chorem.billy.ui.pages; + +import java.util.List; +import org.apache.tapestry5.annotations.InjectComponent; +import org.apache.tapestry5.annotations.Persist; +import org.apache.tapestry5.annotations.Property; +import org.apache.tapestry5.ioc.annotations.Inject; +import org.chorem.billy.BillyException; +import org.chorem.billy.dto.Invoice; +import org.chorem.billy.services.ServiceInvoice; +import org.chorem.billy.ui.base.DataLoader; +import org.chorem.billy.ui.components.Layout; +import org.chorem.billy.ui.utils.ErrorHelper; +import org.slf4j.Logger; + +/** + * InvoiceForm.java + * + * Created on 2009-08-27 by fdesbois + * + * @author fdesbois + * @version $Revision: 8 $ + * + * Last update: $Date: 2009-08-13 09:14:50 +0200 (Thu, 13 Aug 2009) $ + * by : $Author: fdesbois $ + */ +public class InvoiceList implements DataLoader { + + + @InjectComponent + private Layout layout; + + @Inject + private Logger log; + + @Inject + private ServiceInvoice serviceInvoice; + + @Persist + private List<Invoice> invoices; + + @Property + private Invoice invoice; + + @Override + public void loadData() { + invoices = null; + getInvoices(); + } + + public List<Invoice> getInvoices() { + if (invoices == null) { + try { + invoices = serviceInvoice.getAllInvoices(); + if (log.isDebugEnabled()) { + for (Invoice current : invoices) { + log.debug(current.toString()); + } + } + } catch (BillyException eee) { + layout.addErrors(ErrorHelper.getMessages("Une erreur est survenue, impossible de charger toutes les factures", eee)); + } + } + return invoices; + } + + void onActionFromDelInvoice(String invoiceId) { + try { + serviceInvoice.deleteInvoice(invoiceId); + } catch (BillyException eee) { + log.error("Erreur lors de la suppression de la facture avec pour identifiant = " + invoiceId); + } + } +} Modified: trunk/billy-ui/src/main/java/org/chorem/billy/ui/services/AppModule.java =================================================================== --- trunk/billy-ui/src/main/java/org/chorem/billy/ui/services/AppModule.java 2009-08-27 11:26:57 UTC (rev 7) +++ trunk/billy-ui/src/main/java/org/chorem/billy/ui/services/AppModule.java 2009-08-28 12:01:57 UTC (rev 8) @@ -56,7 +56,8 @@ // Use service builder methods (example below) when the implementation // is provided inline, or requires more initialization than simply // invoking the constructor. - + binder.bind(ServiceClient.class, ServiceClientImpl.class); + binder.bind(ServiceInvoice.class, ServiceInvoiceImpl.class); } @@ -79,7 +80,7 @@ } @EagerLoad - public RegistryShutdownListener buildCashShutdown(@InjectService("RegistryShutdownHub") RegistryShutdownHub hub) { + public RegistryShutdownListener buildBillyShutdown(@InjectService("RegistryShutdownHub") RegistryShutdownHub hub) { RegistryShutdownListener listener = new ContextShutdown(); /*try { listener = new BonzomsManager(); Modified: trunk/billy-ui/src/main/java/org/chorem/billy/ui/utils/ErrorHelper.java =================================================================== --- trunk/billy-ui/src/main/java/org/chorem/billy/ui/utils/ErrorHelper.java 2009-08-27 11:26:57 UTC (rev 7) +++ trunk/billy-ui/src/main/java/org/chorem/billy/ui/utils/ErrorHelper.java 2009-08-28 12:01:57 UTC (rev 8) @@ -51,8 +51,8 @@ public static List<String> getMessages(String message, Exception eee, int precision) { List<String> results = new ArrayList<String>(); switch (precision) { - case 2: results.add("Error : " + eee.getCause().getClass().getName() + " : " + eee.getCause().getMessage()); - case 1: results.add("Error : " + eee.getMessage()); + case 1: results.add("Error : " + eee.getCause().getClass().getName() + " : " + eee.getCause().getMessage()); + //case 1: results.add("Error : " + eee.getMessage()) case 0: results.add(message); } Collections.reverse(results); Modified: trunk/billy-ui/src/main/resources/org/chorem/billy/ui/components/Layout.properties =================================================================== --- trunk/billy-ui/src/main/resources/org/chorem/billy/ui/components/Layout.properties 2009-08-27 11:26:57 UTC (rev 7) +++ trunk/billy-ui/src/main/resources/org/chorem/billy/ui/components/Layout.properties 2009-08-28 12:01:57 UTC (rev 8) @@ -1,3 +1,2 @@ -menu-references=References -menu-entry=Pr\u00E9visionnel -menu-category=Cat\u00E9gories \ No newline at end of file +menu-invoice-form=Nouvelle facture +menu-invoice-list=Liste des factures \ No newline at end of file Modified: trunk/billy-ui/src/main/resources/org/chorem/billy/ui/components/Layout.tml =================================================================== --- trunk/billy-ui/src/main/resources/org/chorem/billy/ui/components/Layout.tml 2009-08-27 11:26:57 UTC (rev 7) +++ trunk/billy-ui/src/main/resources/org/chorem/billy/ui/components/Layout.tml 2009-08-28 12:01:57 UTC (rev 8) @@ -9,7 +9,7 @@ <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"> <head> <t:if test="hasBorder()"> - <title>Ca$h : ${pageTitle}</title> + <title>Billy : ${pageTitle}</title> <link rel="stylesheet" type="text/css" href="${asset:context:}/css/main.css" /> <link rel="stylesheet" type="text/css" href="${asset:context:}/css/window/default.css" /> <link rel="stylesheet" type="text/css" href="${asset:context:}/css/window/alphacube.css" /> @@ -19,7 +19,7 @@ <body> <div id='layout'> <t:if test="hasBorder()"> - <div id="header">CA$H</div> + <div id="header">BILLY</div> <ul id="lang"> <li><t:actionlink t:id="langFrLink"><img src="${asset:context:img/flag_fr.png}" alt="Français"/></t:actionlink></li> <li><t:actionlink t:id="langEnLink"><img src="${asset:context:img/flag_en.png}" alt="English" /></t:actionlink></li> @@ -27,9 +27,8 @@ <div id="left_side"> <div id="menu"> <ul> - <li><t:pagelink t:id="entryLink" t:page="previewTable">${message:menu-entry}</t:pagelink></li> - <li><t:pagelink t:id="categoryLink" t:page="categoryManager">${message:menu-category}</t:pagelink></li> - <li><t:pagelink t:id="referenceLink" t:page="reference/list">${message:menu-references}</t:pagelink></li> + <li><t:pagelink t:id="invoiceLink" t:page="invoiceList">${message:menu-invoice-list}</t:pagelink></li> + <li><t:pagelink t:id="formLink" t:page="invoiceForm">${message:menu-invoice-form}</t:pagelink></li> </ul> </div> <img src="${asset:context:/img/7ter.jpg}" alt="petits lutins"/> Added: trunk/billy-ui/src/main/resources/org/chorem/billy/ui/pages/Index.properties =================================================================== --- trunk/billy-ui/src/main/resources/org/chorem/billy/ui/pages/Index.properties (rev 0) +++ trunk/billy-ui/src/main/resources/org/chorem/billy/ui/pages/Index.properties 2009-08-28 12:01:57 UTC (rev 8) @@ -0,0 +1 @@ +welcome=Bienvenue sur l'application Billy. Billy permet de g\u00E9rer les factures d'une soci\u00E9t\u00E9. \ No newline at end of file Added: trunk/billy-ui/src/main/resources/org/chorem/billy/ui/pages/InvoiceForm.properties =================================================================== --- trunk/billy-ui/src/main/resources/org/chorem/billy/ui/pages/InvoiceForm.properties (rev 0) +++ trunk/billy-ui/src/main/resources/org/chorem/billy/ui/pages/InvoiceForm.properties 2009-08-28 12:01:57 UTC (rev 8) @@ -0,0 +1,3 @@ +h1=Ajout / modification d'une facture +title-page=Ajout / modification d'une facture +submit-label=Enregistrer \ No newline at end of file Added: trunk/billy-ui/src/main/resources/org/chorem/billy/ui/pages/InvoiceList.properties =================================================================== --- trunk/billy-ui/src/main/resources/org/chorem/billy/ui/pages/InvoiceList.properties (rev 0) +++ trunk/billy-ui/src/main/resources/org/chorem/billy/ui/pages/InvoiceList.properties 2009-08-28 12:01:57 UTC (rev 8) @@ -0,0 +1,6 @@ +title-page=Liste des factures +h1=Liste de toutes les factures +edit-invoice=Modifier cette facture +add-invoice=Ajouter une nouvelle facture +del-invoice=Supprimer cette facture +del-confirm=Suppression d\u00E9finitive de la facture. Etes vous s\u00FBr de vouloir continuer ? \ No newline at end of file Added: trunk/billy-ui/src/main/webapp/InvoiceForm.tml =================================================================== --- trunk/billy-ui/src/main/webapp/InvoiceForm.tml (rev 0) +++ trunk/billy-ui/src/main/webapp/InvoiceForm.tml 2009-08-28 12:01:57 UTC (rev 8) @@ -0,0 +1,71 @@ +<!-- InvoiceForm.tml + + Author: fdesbois + Revision: $Revision: 5 $ + + Last update: $Date: 2009-07-31 16:58:45 +0200 (Fri, 31 Jul 2009) $ + by $Author: fdesbois $ +--> +<t:layout t:ident="invoiceForm" t:pageTitle="${message:title-page}" + xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd" xmlns:p="tapestry:parameter"> + + <h1>${message:h1}</h1> + <t:zone t:id="invoiceFormZone" id="invoiceFormZone" update="show"> + <form t:type="form" t:id="monForm" t:zone="invoiceFormZone"><t:errors /> + <div class="clearfix" id="billy-form-invoice"> + <div class="fleft"> + <p><t:label for="companies" /> : </p> + <p><t:label for="services" /> : </p> + <p><t:label for="persons" /> : </p> + <p><t:label for="invoiceNumber" /> : </p> + <p><t:label for="amount" /> : </p> + <p><t:label for="invoiceDate" /> : </p> + <p><t:label for="hopeDate" /> : </p> + <p><t:label for="effectiveDate" /> : </p> + </div> + <div class="fleft"> + <p> + <input t:type="select" t:id="companies" t:model="companiesSelectModel" t:value="clientName" /> + <input t:type="submit" t:id="companyChange" t:value="OK" /> + </p> + <p> + <input t:type="select" t:id="services" t:model="servicesSelectModel" t:value="serviceName" /> + <input t:type="submit" t:id="serviceChange" t:value="OK" /> + </p> + <p><input t:type="select" t:id="persons" t:model="personsSelectModel" t:value="personName" /></p> + <p><input t:type="textfield" t:id="invoiceNumber" t:value="invoice.invoiceNumber" /></p> + <p><input t:type="textfield" t:id="amount" t:value="invoice.amount" /></p> + <p><input t:type="datefield" class="date" t:id="invoiceDate" t:value="invoice.invoiceDate" /></p> + <p><input t:type="datefield" class="date" t:id="hopeDate" t:value="invoice.hopeDate" /></p> + <p><input t:type="datefield" class="date" t:id="effectiveDate" t:value="invoice.effectiveDate" /></p> + </div> + </div> + <p><input t:type="submit" class="ico save" t:id="saveInvoice" t:value="${message:submit-label}" /></p> + </form> + + + + + + + + <!--t:beaneditform t:id="invoiceForm" t:object="invoice" + t:submitLabel="message:submit-label" + add="companies, services, persons" + include="invoiceNumber, invoiceDate, amount, hopeDate, effectiveDate" + reorder="companies, services, persons, invoiceNumber" t:zone="invoiceFormZone"> + <p:companies> + <input t:type="select" t:id="companies" t:model="companiesSelectModel" t:value="invoice.clientPerson.client.name" /> + <input t:type="submit" t:id="companyChange" t:value="OK" /> + </p:companies> + <p:services> + <input t:type="select" t:id="services" t:model="servicesSelectModel" t:value="invoice.clientPerson.subDivisionName" /> + <input t:type="submit" t:id="serviceChange" t:value="OK" /> + </p:services> + <p:persons> + <input t:type="select" t:id="persons" t:model="personsSelectModel" t:value="invoice.clientPerson.id" /> + </p:persons> + </t:beaneditform--> + </t:zone> + +</t:layout> Added: trunk/billy-ui/src/main/webapp/InvoiceList.tml =================================================================== --- trunk/billy-ui/src/main/webapp/InvoiceList.tml (rev 0) +++ trunk/billy-ui/src/main/webapp/InvoiceList.tml 2009-08-28 12:01:57 UTC (rev 8) @@ -0,0 +1,37 @@ +<!-- InvoiceList.tml + + Author: fdesbois + Revision: $Revision: 5 $ + + Last update: $Date: 2009-07-31 16:58:45 +0200 (Fri, 31 Jul 2009) $ + by $Author: fdesbois $ +--> +<t:layout t:ident="invoiceList" t:pageTitle="${message:title-page}" + xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd" xmlns:p="tapestry:parameter"> + + <h1>${message:h1}</h1> + <div t:type="grid" t:source="invoices" t:row="invoice" include="invoiceNumber, invoiceDate, hopeDate, effectiveDate" add="client, actions" + reorder="client, invoiceNumber, invoiceDate, hopeDate, effectiveDate" rowsPerPage="30"> + <p:clientCell> + <t:if test="invoice.clientPerson.client.viewUrl"> + <a href="${invoice.clientPerson.client.viewUrl}" title="${invoice.clientPerson.client.name}">${invoice.clientPerson.client.name}</a> + <p:else> + ${invoice.clientPerson.client.name} + </p:else> + </t:if> + </p:clientCell> + <p:actionsCell> + <a t:type="pagelink" class="img" t:id="editInvoice" t:page="invoiceForm" t:context="invoice.id" title="${message:edit-invoice}"> + <img src="${asset:context:/img/icons/crystal/edit.png}" alt="${message:edit-invoice}"/> + </a> + <a t:type="actionlink" class="img" t:id="delInvoice" title="${message:del-invoice}" t:context="invoice.id" + t:mixins="confirm" t:message="${message:del-confirm}"> + <img src="${asset:context:/img/icons/crystal/cancel.png}" alt="${message:del-invoice}"/> + </a> + </p:actionsCell> + </div> + <a t:type="pagelink" class="img" t:id="addInvoice" t:page="invoiceForm" title="${message:add-invoice}"> + <img src="${asset:context:/img/icons/crystal/add.png}" alt="${message:add-invoice}"/> + </a> + +</t:layout> Modified: trunk/billy-ui/src/main/webapp/css/common.css =================================================================== --- trunk/billy-ui/src/main/webapp/css/common.css 2009-08-27 11:26:57 UTC (rev 7) +++ trunk/billy-ui/src/main/webapp/css/common.css 2009-08-28 12:01:57 UTC (rev 8) @@ -161,54 +161,16 @@ color: red; } -/* Category */ -.categories td.name { - width: 700px; -} +/* BILLY */ -#zoneListEntries table.t-data-grid td.amount { - font-size: 0.8em; - letter-spacing: 1px; - padding-left: 15px; +#billy-form-invoice p { + height: 28px; } -#zoneListEntries table.t-data-grid td.selected-listEntries { - background-color: yellow; +#billy-form-invoice select { + width: 200px; } -#zoneListEntries table.t-data-grid tr.parentCategory { - background-color: #DDEEFF; - /*font-weight: bold;*/ -} - -#zoneListEntries table.t-data-grid tr.parentCategory td.title { - font-size: 1.2em; -} - -#zoneListEntries table.t-data-grid a.entry { - text-decoration: none; -} - -#zoneListEntries table.t-data-grid a.entry:hover { - text-decoration: underline; - color: black; -} - -#previewTable fieldset { - padding: 15px; - margin: 8px; -} - -#entryFormComponent input.interval { - width: 30px; -} - -div.zoneFlash { - padding: 10px; - border: 1px solid black; - margin: 10px; -} - -#entryFormComponent p.actions { - padding-top: 12px; +#billy-form-invoice input.date { + width: 80px; } \ No newline at end of file
participants (1)
-
fdesbois@users.chorem.org