r283 - in trunk/chorem-webmotion/src/main: java/org/chorem/webmotion/actions resources webapp/WEB-INF/jsp
Author: jcouteau Date: 2012-12-05 18:13:07 +0100 (Wed, 05 Dec 2012) New Revision: 283 Url: http://chorem.org/projects/chorem/repository/revisions/283 Log: refs #862 : Add buttons to change quotation status Modified: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/SalesAction.java trunk/chorem-webmotion/src/main/resources/mapping trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardQuotationAccepted.jsp trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardQuotationDraft.jsp trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardQuotationLead.jsp trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardQuotationSent.jsp Modified: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/SalesAction.java =================================================================== --- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/SalesAction.java 2012-12-05 13:26:03 UTC (rev 282) +++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/SalesAction.java 2012-12-05 17:13:07 UTC (rev 283) @@ -209,4 +209,49 @@ "previousYearSentQuotation", previousYearSentQuotation, "sentQuotationProgression", sentQuotationProgression); } + + public Render send(ChoremClient client, String id) { + Quotation quotation = client.restore(Quotation.class, id); + + quotation.setStatus(QuotationStatus.SENT.name()); + quotation.setPostedDate(new Date()); + + client.store(quotation); + + return renderView("sales.jsp"); + + } + + public Render accept(ChoremClient client, String id) { + Quotation quotation = client.restore(Quotation.class, id); + + quotation.setStatus(QuotationStatus.ACCEPTED.name()); + + client.store(quotation); + + return renderView("sales.jsp"); + + } + + public Render start(ChoremClient client, String id) { + Quotation quotation = client.restore(Quotation.class, id); + + quotation.setStatus(QuotationStatus.STARTED.name()); + + client.store(quotation); + + return renderView("sales.jsp"); + + } + + public Render answer(ChoremClient client, String id) { + Quotation quotation = client.restore(Quotation.class, id); + + quotation.setStatus(QuotationStatus.DRAFT.name()); + + client.store(quotation); + + return renderView("sales.jsp"); + + } } Modified: trunk/chorem-webmotion/src/main/resources/mapping =================================================================== --- trunk/chorem-webmotion/src/main/resources/mapping 2012-12-05 13:26:03 UTC (rev 282) +++ trunk/chorem-webmotion/src/main/resources/mapping 2012-12-05 17:13:07 UTC (rev 283) @@ -52,4 +52,4 @@ * /hr/vacationRequest/save action:HrAction.saveVacationRequest * /sales view:sales.jsp * /sales/{method} action:SalesAction.{method} - +* /sales/{method}/{id} action:SalesAction.{method} \ No newline at end of file Modified: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardQuotationAccepted.jsp =================================================================== --- trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardQuotationAccepted.jsp 2012-12-05 13:26:03 UTC (rev 282) +++ trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardQuotationAccepted.jsp 2012-12-05 17:13:07 UTC (rev 283) @@ -39,6 +39,7 @@ <th>Prix jour moyen</th> <th>Montant</th> <th>Date d'acceptation</th> + <th>Actions</th> </tr> </thead> <c:forEach var="q" items="${quotations}"> @@ -53,6 +54,7 @@ <td class="currency"><f:formatNumber type="currency" value="${q.amount / q.estimatedDays}"/></td> <td class="currency"><w:display wikitty="${q.wikitty}" fqfield="Quotation.amount" label=""/></td> <td><!--w:display wikitty="${q.wikitty}" fqfield="Quotation.acceptedDate" label=""/--></td> + <td><a class="btn btn-success" href="<c:url value="/sales/start/${q.wikittyId}"/>">Start</a></td> </tr> </tbody> </c:forEach> Modified: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardQuotationDraft.jsp =================================================================== --- trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardQuotationDraft.jsp 2012-12-05 13:26:03 UTC (rev 282) +++ trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardQuotationDraft.jsp 2012-12-05 17:13:07 UTC (rev 283) @@ -40,6 +40,7 @@ <th>Prix jour moyen</th> <th>Montant</th> <th>Date limite d'envoi</th> + <th>Action</th> </tr> </thead> <c:forEach var="q" items="${quotations}"> @@ -55,6 +56,7 @@ <td class="currency"><f:formatNumber type="currency" value="${q.amount / q.estimatedDays}"/></td> <td class="currency"><w:display wikitty="${q.wikitty}" fqfield="Quotation.amount" label=""/></td> <td><w:display wikitty="${q.wikitty}" fqfield="Quotation.postedDate" label=""/></td> + <td><a class="btn btn-success" href="<c:url value="/sales/send/${q.wikittyId}"/>">Send</a></td> </tr> </tbody> </c:forEach> Modified: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardQuotationLead.jsp =================================================================== --- trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardQuotationLead.jsp 2012-12-05 13:26:03 UTC (rev 282) +++ trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardQuotationLead.jsp 2012-12-05 17:13:07 UTC (rev 283) @@ -37,6 +37,7 @@ <th>Fournisseur</th> <th>Taux de conversion</th> <th>Montant</th> + <th>Actions</th> </tr> </thead> <c:forEach var="q" items="${quotations}"> @@ -49,6 +50,7 @@ <td><w:display wikitty="${q.wikitty}" fqfield="Quotation.supplier" label=""/></td> <td class="percent"><w:display wikitty="${q.wikitty}" fqfield="Quotation.conversionHope" label=""/></td> <td class="currency"><w:display wikitty="${q.wikitty}" fqfield="Quotation.amount" label=""/></td> + <td><a class="btn btn-success" href="<c:url value="/sales/answer/${q.wikittyId}"/>">Answer</a></td> </tr> </tbody> </c:forEach> Modified: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardQuotationSent.jsp =================================================================== --- trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardQuotationSent.jsp 2012-12-05 13:26:03 UTC (rev 282) +++ trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardQuotationSent.jsp 2012-12-05 17:13:07 UTC (rev 283) @@ -40,6 +40,7 @@ <th>Prix jour moyen</th> <th>Montant</th> <th>Date d'envoi</th> + <th>Actions</th> </tr> </thead> <c:forEach var="q" items="${quotations}"> @@ -55,6 +56,7 @@ <td class="currency"><f:formatNumber type="currency" value="${q.amount / q.estimatedDays}"/></td> <td class="currency"><w:display wikitty="${q.wikitty}" fqfield="Quotation.amount" label=""/></td> <td><w:display wikitty="${q.wikitty}" fqfield="Quotation.postedDate" label=""/></td> + <td><a class="btn btn-success" href="<c:url value="/sales/accept/${q.wikittyId}"/>">Accept</a></td> </tr> </tbody> </c:forEach>
participants (1)
-
jcouteau@users.chorem.org