Skip to content

Commit

Permalink
cari, kasa ve banka hareket raporlarina Devir alani eklendi, closes #36
Browse files Browse the repository at this point in the history
…, closes #37.
  • Loading branch information
mdpinar committed May 31, 2015
1 parent 3f7dff1 commit 4c6fc68
Show file tree
Hide file tree
Showing 18 changed files with 454 additions and 325 deletions.
1 change: 1 addition & 0 deletions app/controllers/bank/reports/TransReport.java
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ public static Result generate() {
field = "b.name";
label = Messages.get("bank.account");
repPar.reportName = "TransReportAccountBasedDetailed";
repPar.paramMap.put("FIRST_DATE", params.startDate);
}

repPar.paramMap.put("GROUP_FIELD", field);
Expand Down
18 changes: 0 additions & 18 deletions app/controllers/contact/reports/TransReport.java
Original file line number Diff line number Diff line change
Expand Up @@ -204,84 +204,66 @@ public static Result generate() {
String field = "";
String label = "";
String type = "String";

String subqueryToFindTransfer = "";
String subqueryToFindTransferTemp =
"select sum(st.debt - st.credit) from contact_trans st where #main_condition and st.trans_date < " + DateUtils.formatDateForDB(params.startDate) + " and st.exc_code = t.exc_code";

if (params.reportType.equals("Monthly")) {
field = "t.trans_month";
label = Messages.get("trans.month");
subqueryToFindTransfer = subqueryToFindTransferTemp.replace("#main_condition", "st.trans_month = t.trans_month");
}
if (params.reportType.equals("Yearly")) {
field = "t.trans_year";
label = Messages.get("trans.year");
type = "Integer";
subqueryToFindTransfer = subqueryToFindTransferTemp.replace("#main_condition", "st.trans_year = t.trans_year");
}
if (params.reportType.equals("Daily")) {
field = "t.trans_date";
label = Messages.get("date");
type = "Date";
subqueryToFindTransfer = subqueryToFindTransferTemp.replace("#main_condition", "st.trans_date = t.trans_date");
}
if (params.reportType.equals("ReceiptType")) {
field = "t._right";
label = Messages.get("trans.type");
type = "Right";
subqueryToFindTransfer = subqueryToFindTransferTemp.replace("#main_condition", "st._right = t._right");
}
if (params.reportType.equals("Maturity")) {
field = "t.maturity";
label = Messages.get("maturity");
type = "Date";
subqueryToFindTransfer = subqueryToFindTransferTemp.replace("#main_condition", "st.maturity = t.maturity");
}
if (params.reportType.equals("PrivateCode")) {
field = "pc.name";
label = Messages.get("private_code");
subqueryToFindTransfer = subqueryToFindTransferTemp.replace("#main_condition", "st.private_code_id = t.private_code_id");
}
if (params.reportType.equals("TransPoint")) {
field = "tp.name";
label = Messages.get("trans.point");
subqueryToFindTransfer = subqueryToFindTransferTemp.replace("#main_condition", "st.trans_point_id = t.trans_point_id");
}
if (params.reportType.equals("TransSource")) {
field = "ts.name";
label = Messages.get("trans.source");
subqueryToFindTransfer = subqueryToFindTransferTemp.replace("#main_condition", "st.trans_source_id = t.trans_source_id");
}
if (params.reportType.equals("Category")) {
field = "cc.name";
label = Messages.get("category");
subqueryToFindTransfer = subqueryToFindTransferTemp.replace("#main_condition", "sc.category_id = c.category_id");
}
if (params.reportType.equals("Seller")) {
field = "s.name";
label = Messages.get("seller");
subqueryToFindTransfer = subqueryToFindTransferTemp.replace("#main_condition", "sc.seller_id = c.seller_id");
}
if (params.reportType.equals("City")) {
field = "c.city";
label = Messages.get("city");
subqueryToFindTransfer = subqueryToFindTransferTemp.replace("#main_condition", "sc.city = c.city");
}
if (params.reportType.startsWith("ExtraFields")) {
Integer extraFieldsId = Integer.parseInt(""+params.reportType.charAt(params.reportType.length()-1));
field = "ef"+extraFieldsId+".name";
AdminExtraFields aef = AdminExtraFields.findById(Module.contact.name(), extraFieldsId);
label = aef.name;
subqueryToFindTransfer = subqueryToFindTransferTemp.replace("#main_condition", "sc.extra_field"+extraFieldsId+"_id = c.extra_field"+extraFieldsId+"_id");
}
if (params.reportType.equals("Contact")) {
field = "c.name";
label = Messages.get("contact.name");
repPar.reportName = "TransReportContactBasedDetailed";
repPar.paramMap.put("FIRST_DATE", params.startDate);
} else {
repPar.paramMap.put("SUBQUERY_TO_FIND_TRANSFER", subqueryToFindTransfer);
}

repPar.paramMap.put("GROUP_FIELD", field);
Expand Down
1 change: 1 addition & 0 deletions app/controllers/safe/reports/TransReport.java
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ public static Result generate() {
field = "s.name";
label = Messages.get("safe");
repPar.reportName = "TransReportSafeBasedDetailed";
repPar.paramMap.put("FIRST_DATE", params.startDate);
}

repPar.paramMap.put("GROUP_FIELD", field);
Expand Down
2 changes: 2 additions & 0 deletions app/models/AbstractBaseTrans.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.joda.time.Days;

import play.data.format.Formats.DateTime;
import play.data.validation.Constraints;
import play.i18n.Messages;
import utils.CacheUtils;
import utils.DocNoUtils;
Expand Down Expand Up @@ -55,6 +56,7 @@ public abstract class AbstractBaseTrans extends BaseModel {
@Column(name = "_right")
public Right right;

@Constraints.Required
@DateTime(pattern = "dd/MM/yyyy")
public Date transDate = new Date();

Expand Down
2 changes: 1 addition & 1 deletion app/views/stocks/stock/form.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
)

@for(aef <- models.AdminExtraFields.listAll(enums.Module.stock.name())) {
@tools.dropdowns.stock_extra_field(_form, aef.id, aef.idno, aef.name, aef.isRequired, hasAddNewButton=false)
@tools.dropdowns.stock_extra_field(_form, aef.id, aef.idno, aef.name, aef.isRequired)
}

@if(global.Profiles.chosen().gnel_hasExchangeSupport) {
Expand Down
2 changes: 1 addition & 1 deletion app/views/tools/dropdowns/contact_extra_field.scala.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@(form: Form[_], extraFieldId: Integer, idno: Integer, msgKey: String, isRequired: Boolean = false, hasAddNewButton:Boolean = true)

@standart(form, ContactExtraFields.options(extraFieldId), enums.Right.CARI_EKSTRA_ALANLAR, "extraField", Messages(msgKey),
hasBlankOption=(! isRequired), hasAddNewButton=hasAddNewButton, additionIdForBase=""+idno, additionForCreate=""+extraFieldId) {
hasBlankOption=(! isRequired), hasAddNewButton=hasAddNewButton, additionIdForBase=""+idno) {

<script type="text/javascript">
function setSimpleControllerFor_extraField@(idno)() {
Expand Down
12 changes: 3 additions & 9 deletions app/views/tools/dropdowns/standart.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,14 @@
* Generate dropdown info selector according twitter bootsrap rules *
*******************************************************************@

@(form: Form[_], options: Map[String, String], right: enums.Right, base: String, title: String, hasBlankOption: Boolean = true, hasAddNewButton:Boolean = true, additionIdForBase: String="", additionForCreate: String="")(content: Html)
@(form: Form[_], options: Map[String, String], right: enums.Right, base: String, title: String, hasBlankOption: Boolean = true, hasAddNewButton:Boolean = true, additionIdForBase: String="")(content: Html)

<script type="text/javascript">
function tidyUp_@(base+additionIdForBase)() {
var baseId = null;
@if(! additionForCreate.isEmpty) {baseId = @additionForCreate};
setSimpleControllerFor_@(base+additionIdForBase)();
if (baseId != null) {
simple_create(baseId);
} else {
simple_create();
}
simple_create(@additionIdForBase);
$('#simple\\-title').html('@Messages("definition.of", title)');
$('#simple\\-ajax\\-form').attr('action', '/@(right.module.name)s/@base');
$('#simple\\-ajax\\-form').attr('action', '/@(right.module.name)s/extra_fields');
}
</script>

Expand Down
2 changes: 1 addition & 1 deletion app/views/tools/dropdowns/stock_extra_field.scala.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@(form: Form[_], extraFieldId: Integer, idno: Integer, msgKey: String, isRequired: Boolean = false, hasAddNewButton:Boolean = true)

@standart(form, StockExtraFields.options(extraFieldId), enums.Right.STOK_EKSTRA_ALANLAR, "extraField", Messages(msgKey),
hasBlankOption=(! isRequired), hasAddNewButton=hasAddNewButton, additionIdForBase=""+idno, additionForCreate=""+extraFieldId) {
hasBlankOption=(! isRequired), hasAddNewButton=hasAddNewButton, additionIdForBase=""+idno) {

<script type="text/javascript">
function setSimpleControllerFor_extraField@(idno)() {
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import play.Project._

name := "seyhan"

version := "1.0.8"
version := "1.0.9"

libraryDependencies ++= Seq(
jdbc,
Expand Down
Loading

0 comments on commit 4c6fc68

Please sign in to comment.