From 938907fe20dd472b954fdfe3d0e7eda31a301d90 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Mon, 17 Apr 2017 20:20:53 +0100 Subject: [PATCH] Added financial year start date (#1141), various fixes on date & time --- application/controllers/Config.php | 3 +- .../language/ar-EG/datepicker_lang.php | 3 +- .../language/de-CH/datepicker_lang.php | 3 +- application/language/de/datepicker_lang.php | 3 +- application/language/en/config_lang.php | 5 ++ application/language/en/datepicker_lang.php | 5 +- application/language/es/datepicker_lang.php | 3 +- application/language/fr/datepicker_lang.php | 3 +- .../language/hr-HR/datepicker_lang.php | 3 +- .../language/hu-HU/datepicker_lang.php | 3 +- application/language/id/datepicker_lang.php | 3 +- .../language/nl-BE/datepicker_lang.php | 3 +- .../language/pt-BR/datepicker_lang.php | 3 +- application/language/ru/datepicker_lang.php | 3 +- application/language/sv/datepicker_lang.php | 3 +- application/language/th/datepicker_lang.php | 3 +- application/language/tr/datepicker_lang.php | 3 +- application/language/zh/datepicker_lang.php | 3 +- application/views/configs/locale_config.php | 16 +++++- application/views/partial/daterangepicker.php | 50 ++++++++++++------- database/3.0.2_to_3.1.0.sql | 5 ++ database/database.sql | 3 +- database/migrate_phppos_dist.sql | 3 +- database/tables.sql | 3 +- 24 files changed, 84 insertions(+), 54 deletions(-) diff --git a/application/controllers/Config.php b/application/controllers/Config.php index 0fc114602..d8fa36fea 100644 --- a/application/controllers/Config.php +++ b/application/controllers/Config.php @@ -317,7 +317,8 @@ class Config extends Secure_Controller 'payment_options_order' => $this->input->post('payment_options_order'), 'date_or_time_format' => $this->input->post('date_or_time_format'), 'cash_decimals' => $this->input->post('cash_decimals'), - 'cash_rounding_code' => $this->input->post('cash_rounding_code') + 'cash_rounding_code' => $this->input->post('cash_rounding_code'), + 'financial_year' => $this->input->post('financial_year') ); $result = $this->Appconfig->batch_save($batch_save_data); diff --git a/application/language/ar-EG/datepicker_lang.php b/application/language/ar-EG/datepicker_lang.php index 16cab25aa..aa47311f0 100644 --- a/application/language/ar-EG/datepicker_lang.php +++ b/application/language/ar-EG/datepicker_lang.php @@ -10,9 +10,8 @@ $lang["datepicker_last_7"] = "أخر سبعة أيام"; $lang["datepicker_last_month"] = "أخر شهر"; $lang["datepicker_last_year"] = "السنة الماضية"; $lang["datepicker_same_month_to_same_day_last_year"] = "نفس الشهر حتى اليوم من السنة الماضية"; -$lang["datepicker_same_month_to_today"] = "هذا الشهر حتى اليوم"; $lang["datepicker_this_month"] = "هذا الشهر"; -$lang["datepicker_this_month_last_year"] = "نفس الشهر من العام الماضي"; +$lang["datepicker_same_month_last_year"] = "نفس الشهر من العام الماضي"; $lang["datepicker_this_year"] = "السنة الحالية"; $lang["datepicker_to"] = "إلى"; $lang["datepicker_today"] = "اليوم"; diff --git a/application/language/de-CH/datepicker_lang.php b/application/language/de-CH/datepicker_lang.php index e5cbfaef8..a70711d18 100644 --- a/application/language/de-CH/datepicker_lang.php +++ b/application/language/de-CH/datepicker_lang.php @@ -10,9 +10,8 @@ $lang["datepicker_last_7"] = "Letzte 7 Tage"; $lang["datepicker_last_month"] = "Letzter Monat"; $lang["datepicker_last_year"] = "Letztes Jahr"; $lang["datepicker_same_month_to_same_day_last_year"] = "Dieser Monat bis Heute letzten Jahres"; -$lang["datepicker_same_month_to_today"] = "Dieser Monat bis heute"; $lang["datepicker_this_month"] = "Dieser Monat"; -$lang["datepicker_this_month_last_year"] = "Dieser Monat letzten Jahres"; +$lang["datepicker_same_month_last_year"] = "Dieser Monat letzten Jahres"; $lang["datepicker_this_year"] = "Dieses Jahr"; $lang["datepicker_to"] = "To"; $lang["datepicker_today"] = "Heute"; diff --git a/application/language/de/datepicker_lang.php b/application/language/de/datepicker_lang.php index 0835ff935..259fb480d 100644 --- a/application/language/de/datepicker_lang.php +++ b/application/language/de/datepicker_lang.php @@ -10,9 +10,8 @@ $lang["datepicker_last_7"] = "Letzte 7 Tage"; $lang["datepicker_last_month"] = "Letzter Monat"; $lang["datepicker_last_year"] = "Letztes Jahr"; $lang["datepicker_same_month_to_same_day_last_year"] = "Dieser Monat bis Heute letzten Jahres"; -$lang["datepicker_same_month_to_today"] = "Dieser Monat bis heute"; $lang["datepicker_this_month"] = "Dieser Monat"; -$lang["datepicker_this_month_last_year"] = "Dieser Monat letzten Jahres"; +$lang["datepicker_same_month_last_year"] = "Dieser Monat letzten Jahres"; $lang["datepicker_this_year"] = "Dieses Jahr"; $lang["datepicker_to"] = "Bis"; $lang["datepicker_today"] = "Heute"; diff --git a/application/language/en/config_lang.php b/application/language/en/config_lang.php index f057e3fd9..9cff527d9 100644 --- a/application/language/en/config_lang.php +++ b/application/language/en/config_lang.php @@ -104,6 +104,11 @@ $lang["config_email_smtp_port"] = "SMTP Port"; $lang["config_email_smtp_timeout"] = "SMTP Timeout (s)"; $lang["config_email_smtp_user"] = "SMTP Username"; $lang["config_fax"] = "Fax"; +$lang["config_financial_year"] = "Financial Year Start"; +$lang["config_financial_year_jan"] = "1st of January"; +$lang["config_financial_year_apr"] = "1st of April"; +$lang["config_financial_year_jul"] = "1st of July"; +$lang["config_financial_year_oct"] = "1st of October"; $lang["config_general"] = "General"; $lang["config_general_configuration"] = "General Configuration"; $lang["config_info"] = "Information"; diff --git a/application/language/en/datepicker_lang.php b/application/language/en/datepicker_lang.php index cf51ef1c2..53694c65c 100644 --- a/application/language/en/datepicker_lang.php +++ b/application/language/en/datepicker_lang.php @@ -7,12 +7,13 @@ $lang["datepicker_custom"] = "Custom"; $lang["datepicker_from"] = "From"; $lang["datepicker_last_30"] = "Last 30 Days"; $lang["datepicker_last_7"] = "Last 7 Days"; +$lang["datepicker_last_financial_year"] = "Last Financial Year"; $lang["datepicker_last_month"] = "Last Month"; $lang["datepicker_last_year"] = "Last Year"; +$lang["datepicker_same_month_last_year"] = "Same Month Last Year"; $lang["datepicker_same_month_to_same_day_last_year"] = "Same Month To Same Day Last Year"; -$lang["datepicker_same_month_to_today"] = "This Month To Today"; +$lang["datepicker_this_financial_year"] = "This Financial Year"; $lang["datepicker_this_month"] = "This Month"; -$lang["datepicker_this_month_last_year"] = "Same Month Last Year"; $lang["datepicker_this_year"] = "This Year"; $lang["datepicker_to"] = "To"; $lang["datepicker_today"] = "Today"; diff --git a/application/language/es/datepicker_lang.php b/application/language/es/datepicker_lang.php index 267bb5479..e61cd5de2 100644 --- a/application/language/es/datepicker_lang.php +++ b/application/language/es/datepicker_lang.php @@ -10,9 +10,8 @@ $lang["datepicker_last_7"] = "Últimos 7 Días"; $lang["datepicker_last_month"] = "Mes Anterior"; $lang["datepicker_last_year"] = "Año Anterior"; $lang["datepicker_same_month_to_same_day_last_year"] = "Este mes hasta hoy, del año pasado"; -$lang["datepicker_same_month_to_today"] = "Este Mes hasta hoy"; $lang["datepicker_this_month"] = "Este Mes"; -$lang["datepicker_this_month_last_year"] = "Este Mes hace un año"; +$lang["datepicker_same_month_last_year"] = "Este Mes hace un año"; $lang["datepicker_this_year"] = "Este Año"; $lang["datepicker_to"] = "Hasta"; $lang["datepicker_today"] = "Hoy"; diff --git a/application/language/fr/datepicker_lang.php b/application/language/fr/datepicker_lang.php index 7a8306b1c..6d27c6c24 100644 --- a/application/language/fr/datepicker_lang.php +++ b/application/language/fr/datepicker_lang.php @@ -10,9 +10,8 @@ $lang["datepicker_last_7"] = "Ces 7 derniers jours"; $lang["datepicker_last_month"] = "Le mois dernier"; $lang["datepicker_last_year"] = "L'année passée"; $lang["datepicker_same_month_to_same_day_last_year"] = "Même mois au même jour que l'an dernier"; -$lang["datepicker_same_month_to_today"] = "Ce mois-ci à aujourd'hui"; $lang["datepicker_this_month"] = "Ce mois"; -$lang["datepicker_this_month_last_year"] = "Même mois de l'Année Dernière"; +$lang["datepicker_same_month_last_year"] = "Même mois de l'Année Dernière"; $lang["datepicker_this_year"] = "Cette Année"; $lang["datepicker_to"] = "To"; $lang["datepicker_today"] = "Aujourd'hui"; diff --git a/application/language/hr-HR/datepicker_lang.php b/application/language/hr-HR/datepicker_lang.php index 889955c9b..97848068c 100644 --- a/application/language/hr-HR/datepicker_lang.php +++ b/application/language/hr-HR/datepicker_lang.php @@ -10,9 +10,8 @@ $lang["datepicker_last_7"] = "Zadnjih 7 dana"; $lang["datepicker_last_month"] = "Zadnji mjesec"; $lang["datepicker_last_year"] = "Zadnja godina"; $lang["datepicker_same_month_to_same_day_last_year"] = "Ovaj mjesec do danas prošle godine"; -$lang["datepicker_same_month_to_today"] = "Ovaj mjesec do danas"; $lang["datepicker_this_month"] = "Ovaj mjesec"; -$lang["datepicker_this_month_last_year"] = "Ovaj mjesec prošle godine"; +$lang["datepicker_same_month_last_year"] = "Ovaj mjesec prošle godine"; $lang["datepicker_this_year"] = "Ova godina"; $lang["datepicker_to"] = "Do"; $lang["datepicker_today"] = "Danas"; diff --git a/application/language/hu-HU/datepicker_lang.php b/application/language/hu-HU/datepicker_lang.php index 444df5c31..8a3e2e152 100644 --- a/application/language/hu-HU/datepicker_lang.php +++ b/application/language/hu-HU/datepicker_lang.php @@ -10,9 +10,8 @@ $lang["datepicker_last_7"] = "Utolsó 7 nap"; $lang["datepicker_last_month"] = "Múlt hónap"; $lang["datepicker_last_year"] = "Múlt év"; $lang["datepicker_same_month_to_same_day_last_year"] = "Ez a hónap, mai nap, múlt évben"; -$lang["datepicker_same_month_to_today"] = "Ez a hónap, mai napig"; $lang["datepicker_this_month"] = "Ez a hónap"; -$lang["datepicker_this_month_last_year"] = "Ez a hónap, múlt évben"; +$lang["datepicker_same_month_last_year"] = "Ez a hónap, múlt évben"; $lang["datepicker_this_year"] = "Ezév"; $lang["datepicker_to"] = "Ig"; $lang["datepicker_today"] = "Ma"; diff --git a/application/language/id/datepicker_lang.php b/application/language/id/datepicker_lang.php index 2c4620b25..27cfa8cce 100644 --- a/application/language/id/datepicker_lang.php +++ b/application/language/id/datepicker_lang.php @@ -10,9 +10,8 @@ $lang["datepicker_last_7"] = "7 Hari Terakhir"; $lang["datepicker_last_month"] = "Bulan lalu"; $lang["datepicker_last_year"] = "Tahun lalu"; $lang["datepicker_same_month_to_same_day_last_year"] = "Bulan yang sama untuk hari yang sama tahun yang lalu"; -$lang["datepicker_same_month_to_today"] = "Bulan ini sampai hari ini"; $lang["datepicker_this_month"] = "Bulan ini"; -$lang["datepicker_this_month_last_year"] = "Bulan yang sama tahun kemarin"; +$lang["datepicker_same_month_last_year"] = "Bulan yang sama tahun kemarin"; $lang["datepicker_this_year"] = "Tahun ini"; $lang["datepicker_to"] = "sampai"; $lang["datepicker_today"] = "Hari ini"; diff --git a/application/language/nl-BE/datepicker_lang.php b/application/language/nl-BE/datepicker_lang.php index b84428340..f901afd88 100644 --- a/application/language/nl-BE/datepicker_lang.php +++ b/application/language/nl-BE/datepicker_lang.php @@ -10,9 +10,8 @@ $lang["datepicker_last_7"] = "Vorige 7 Dagen"; $lang["datepicker_last_month"] = "Vorige Maand"; $lang["datepicker_last_year"] = "Vorig Jaar"; $lang["datepicker_same_month_to_same_day_last_year"] = "Dezelfde maand op dezelfde dag vorig jaar"; -$lang["datepicker_same_month_to_today"] = "Deze maand tot vandaag"; $lang["datepicker_this_month"] = "Deze Maand"; -$lang["datepicker_this_month_last_year"] = "Dezelfde maand vorig jaar"; +$lang["datepicker_same_month_last_year"] = "Dezelfde maand vorig jaar"; $lang["datepicker_this_year"] = "Dit Jaar"; $lang["datepicker_to"] = "To"; $lang["datepicker_today"] = "Vandaag"; diff --git a/application/language/pt-BR/datepicker_lang.php b/application/language/pt-BR/datepicker_lang.php index db708847d..7050bb9eb 100644 --- a/application/language/pt-BR/datepicker_lang.php +++ b/application/language/pt-BR/datepicker_lang.php @@ -10,9 +10,8 @@ $lang["datepicker_last_7"] = "Últimos 7 Dias"; $lang["datepicker_last_month"] = "Último Mês"; $lang["datepicker_last_year"] = "Último ano"; $lang["datepicker_same_month_to_same_day_last_year"] = "Este mês Para Hoje Último Ano"; -$lang["datepicker_same_month_to_today"] = "Deste mês para hoje"; $lang["datepicker_this_month"] = "Este Mês"; -$lang["datepicker_this_month_last_year"] = "Este mês último ano"; +$lang["datepicker_same_month_last_year"] = "Este mês último ano"; $lang["datepicker_this_year"] = "Este Ano"; $lang["datepicker_to"] = "Para"; $lang["datepicker_today"] = "Hoje"; diff --git a/application/language/ru/datepicker_lang.php b/application/language/ru/datepicker_lang.php index c7b7051ce..b6f3f8330 100644 --- a/application/language/ru/datepicker_lang.php +++ b/application/language/ru/datepicker_lang.php @@ -10,9 +10,8 @@ $lang["datepicker_last_7"] = "Последние 7 дней"; $lang["datepicker_last_month"] = "Последний месяц"; $lang["datepicker_last_year"] = "в прошлом году"; $lang["datepicker_same_month_to_same_day_last_year"] = "Same Month To Same Day Last Year"; -$lang["datepicker_same_month_to_today"] = "This Month To Today"; $lang["datepicker_this_month"] = "В этом месяце"; -$lang["datepicker_this_month_last_year"] = "Same Month Last Year"; +$lang["datepicker_same_month_last_year"] = "Same Month Last Year"; $lang["datepicker_this_year"] = "В этом году"; $lang["datepicker_to"] = "To"; $lang["datepicker_today"] = "сегодня"; diff --git a/application/language/sv/datepicker_lang.php b/application/language/sv/datepicker_lang.php index 54142afb0..d251948d4 100644 --- a/application/language/sv/datepicker_lang.php +++ b/application/language/sv/datepicker_lang.php @@ -10,9 +10,8 @@ $lang["datepicker_last_7"] = ""; $lang["datepicker_last_month"] = ""; $lang["datepicker_last_year"] = ""; $lang["datepicker_same_month_to_same_day_last_year"] = ""; -$lang["datepicker_same_month_to_today"] = ""; +$lang["datepicker_same_month_last_year"] = ""; $lang["datepicker_this_month"] = ""; -$lang["datepicker_this_month_last_year"] = ""; $lang["datepicker_this_year"] = ""; $lang["datepicker_to"] = ""; $lang["datepicker_today"] = ""; diff --git a/application/language/th/datepicker_lang.php b/application/language/th/datepicker_lang.php index ef50ab076..8f549471e 100644 --- a/application/language/th/datepicker_lang.php +++ b/application/language/th/datepicker_lang.php @@ -10,9 +10,8 @@ $lang["datepicker_last_7"] = "7 วันสุดท้าย"; $lang["datepicker_last_month"] = "เดือนที่แล้ว"; $lang["datepicker_last_year"] = "ปีที่แล้ว"; $lang["datepicker_same_month_to_same_day_last_year"] = "Same Month To Same Day Last Year"; -$lang["datepicker_same_month_to_today"] = "This Month To Today"; $lang["datepicker_this_month"] = "เดือนนี้"; -$lang["datepicker_this_month_last_year"] = "Same Month Last Year"; +$lang["datepicker_same_month_last_year"] = "Same Month Last Year"; $lang["datepicker_this_year"] = "ปีนี้"; $lang["datepicker_to"] = "To"; $lang["datepicker_today"] = "วันนี้"; diff --git a/application/language/tr/datepicker_lang.php b/application/language/tr/datepicker_lang.php index 7d79c59c3..3736953b8 100644 --- a/application/language/tr/datepicker_lang.php +++ b/application/language/tr/datepicker_lang.php @@ -10,9 +10,8 @@ $lang["datepicker_last_7"] = "Son 7 Gün"; $lang["datepicker_last_month"] = "Geçen Ay"; $lang["datepicker_last_year"] = "Geçen Yıl"; $lang["datepicker_same_month_to_same_day_last_year"] = "Geçen Sene Aynı Aydan Aynı Güne"; -$lang["datepicker_same_month_to_today"] = "Bu Aydan Bugüne"; $lang["datepicker_this_month"] = "Bu Ay"; -$lang["datepicker_this_month_last_year"] = "Geçen Sene Aynı Ay"; +$lang["datepicker_same_month_last_year"] = "Geçen Sene Aynı Ay"; $lang["datepicker_this_year"] = "Bu Yıl"; $lang["datepicker_to"] = "To"; $lang["datepicker_today"] = "Bugün"; diff --git a/application/language/zh/datepicker_lang.php b/application/language/zh/datepicker_lang.php index d9839d622..f93d8582a 100644 --- a/application/language/zh/datepicker_lang.php +++ b/application/language/zh/datepicker_lang.php @@ -10,9 +10,8 @@ $lang["datepicker_last_7"] = "過去七天"; $lang["datepicker_last_month"] = "上個月"; $lang["datepicker_last_year"] = "去年"; $lang["datepicker_same_month_to_same_day_last_year"] = "Same Month To Same Day Last Year"; -$lang["datepicker_same_month_to_today"] = "This Month To Today"; $lang["datepicker_this_month"] = "這個月"; -$lang["datepicker_this_month_last_year"] = "Same Month Last Year"; +$lang["datepicker_same_month_last_year"] = "Same Month Last Year"; $lang["datepicker_this_year"] = "今年"; $lang["datepicker_to"] = "To"; $lang["datepicker_today"] = "今天"; diff --git a/application/views/configs/locale_config.php b/application/views/configs/locale_config.php index d49e6b42e..30cd49c4d 100644 --- a/application/views/configs/locale_config.php +++ b/application/views/configs/locale_config.php @@ -82,7 +82,7 @@ '2' => '2', '3' => '3' ), - $this->config->item('quantity_decimals'), array('class' => 'form-control input-sm')); + $this->config->item('quantity_decimals'), array('class' => 'form-control input-sm')); ?> @@ -298,6 +298,20 @@ +
+ lang->line('config_financial_year'), 'financial_year', array('class' => 'control-label col-xs-2')); ?> +
+ $this->lang->line('config_financial_year_jan'), + '4' => $this->lang->line('config_financial_year_apr'), + '7' => $this->lang->line('config_financial_year_jul'), + '10' => $this->lang->line('config_financial_year_oct') + ), + $this->config->item('financial_year'), array('class' => 'form-control input-sm')); + ?> +
+
+ 'submit_form', 'id' => 'submit_form', diff --git a/application/views/partial/daterangepicker.php b/application/views/partial/daterangepicker.php index 509acc89f..7b7a72378 100644 --- a/application/views/partial/daterangepicker.php +++ b/application/views/partial/daterangepicker.php @@ -36,7 +36,7 @@ "config->item('dateformat'), mktime(0,0,0,date("m"),1,date("Y")-1));?>", "config->item('dateformat'), mktime(0,0,0,date("m"),date("d")+1,date("Y")-1)-1);?>" ], - "lang->line("datepicker_this_month_last_year"); ?>": [ + "lang->line("datepicker_same_month_last_year"); ?>": [ "config->item('dateformat'), mktime(0,0,0,date("m"),1,date("Y")-1));?>", "config->item('dateformat'), mktime(0,0,0,date("m")+1,1,date("Y")-1)-1);?>" ], @@ -52,8 +52,16 @@ "config->item('dateformat'), mktime(0,0,0,1,1,date("Y")-1));?>", "config->item('dateformat'), mktime(0,0,0,1,1,date("Y"))-1);?>" ], + "lang->line("datepicker_this_financial_year"); ?>": [ + "config->item('dateformat'), mktime(0,0,0,$this->config->item('financial_year'),1,date("Y")));?>", + "config->item('dateformat'), mktime(0,0,0,date("m"),1,date("Y")+1)-1);?>" + ], + "lang->line("datepicker_last_financial_year"); ?>": [ + "config->item('dateformat'), mktime(0,0,0,$this->config->item('financial_year'),1,date("Y")-1));?>", + "config->item('dateformat'), mktime(0,0,0,$this->config->item('financial_year'),1,date("Y"))-1);?>" + ], "lang->line("datepicker_all_time"); ?>": [ - "config->item('dateformat'), mktime(0,0,0,01,01,2010));?>", + "config->item('dateformat'), mktime(0,0,0,1,1,2010));?>", "config->item('dateformat'), mktime(0,0,0,date("m"),date("d")+1,date("Y"))-1);?>" ], }, @@ -112,51 +120,59 @@ "ranges": { "lang->line("datepicker_today"); ?>": [ "config->item('dateformat')." ".$this->config->item('timeformat'), mktime(0,0,0,date("m"),date("d"),date("Y")));?>", - "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(23,59,59,date("m"),date("d"),date("Y"))-1);?>" + "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(23,59,59,date("m"),date("d"),date("Y")));?>" ], "lang->line("datepicker_today_last_year"); ?>": [ "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(0,0,0,date("m"),date("d"),date("Y")-1));?>", - "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(23,59,59,date("m"),date("d"),date("Y")-1)-1);?>" + "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(23,59,59,date("m"),date("d"),date("Y")-1));?>" ], "lang->line("datepicker_yesterday"); ?>": [ "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(0,0,0,date("m"),date("d")-1,date("Y")));?>", - "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(23,59,59,date("m"),date("d")-1,date("Y"))-1);?>" + "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(23,59,59,date("m"),date("d")-1,date("Y")));?>" ], "lang->line("datepicker_last_7"); ?>": [ "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(0,0,0,date("m"),date("d")-6,date("Y")));?>", - "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(23,59,59,date("m"),date("d"),date("Y"))-1);?>" + "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(23,59,59,date("m"),date("d"),date("Y")));?>" ], "lang->line("datepicker_last_30"); ?>": [ "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(0,0,0,date("m"),date("d")-29,date("Y")));?>", - "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(23,59,59,date("m"),date("d"),date("Y"))-1);?>" + "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(23,59,59,date("m"),date("d"),date("Y")));?>" ], "lang->line("datepicker_this_month"); ?>": [ "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(0,0,0,date("m"),1,date("Y")));?>", - "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(23,59,59,date("m")+1,0,date("Y"))-1);?>" + "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(23,59,59,date("m"),date("d"),date("Y")));?>" ], "lang->line("datepicker_same_month_to_same_day_last_year"); ?>": [ "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(0,0,0,date("m"),1,date("Y")-1));?>", - "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(23,59,59,date("m"),date("d"),date("Y")-1)-1);?>" + "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(23,59,59,date("m"),date("d"),date("Y")-1));?>" ], - "lang->line("datepicker_this_month_last_year"); ?>": [ + "lang->line("datepicker_same_month_last_year"); ?>": [ "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(0,0,0,date("m"),1,date("Y")-1));?>", - "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(23,59,59,date("m")+1,0,date("Y")-1)-1);?>" + "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(23,59,59,date("m")+1,0,date("Y")-1));?>" ], "lang->line("datepicker_last_month"); ?>": [ "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(0,0,0,date("m")-1,1,date("Y")));?>", - "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(23,59,59,date("m"),0,date("Y"))-1);?>" + "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(23,59,59,date("m"),0,date("Y")));?>" ], "lang->line("datepicker_this_year"); ?>": [ "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(0,0,0,1,1,date("Y")));?>", - "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(23,59,59,date("m"),1,date("Y")+1)-1);?>" + "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(23,59,59,date("m")+1,0,date("Y")));?>" ], "lang->line("datepicker_last_year"); ?>": [ "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(0,0,0,1,1,date("Y")-1));?>", - "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(23,59,59,1,0,date("Y"))-1);?>" + "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(23,59,59,12,31,date("Y")-1));?>" + ], + "lang->line("datepicker_this_financial_year"); ?>": [ + "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(0,0,0,$this->config->item('financial_year'),1,date("Y")));?>", + "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(23,59,59,date("m")+1,0,date("Y")));?>" + ], + "lang->line("datepicker_last_financial_year"); ?>": [ + "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(0,0,0,$this->config->item('financial_year'),1,date("Y")-1));?>", + "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(23,59,59,$this->config->item('financial_year'),0,date("Y")));?>" ], "lang->line("datepicker_all_time"); ?>": [ - "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(0,0,0,01,01,2010));?>", - "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(23,59,59,date("m"),date("d"),date("Y"))-1);?>" + "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(0,0,0,1,1,2010));?>", + "config->item('dateformat')." ".$this->config->item('timeformat'),mktime(23,59,59,date("m"),date("d"),date("Y")));?>" ], }, "locale": { @@ -206,4 +222,4 @@ }); \ No newline at end of file +?> diff --git a/database/3.0.2_to_3.1.0.sql b/database/3.0.2_to_3.1.0.sql index 5bc301684..ec9465759 100644 --- a/database/3.0.2_to_3.1.0.sql +++ b/database/3.0.2_to_3.1.0.sql @@ -211,3 +211,8 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ALTER TABLE `ospos_people` ADD INDEX `email` (`email`); + +-- add financial year start into config + +INSERT INTO `ospos_app_config` (`key`, `value`) VALUES +('financial_year','1'); diff --git a/database/database.sql b/database/database.sql index 531f8f1e7..71c0699b7 100644 --- a/database/database.sql +++ b/database/database.sql @@ -93,7 +93,8 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('date_or_time_format',''), ('customer_reward_enable',''), ('default_origin_tax_code', ''), -('cash_decimals', '2'); +('cash_decimals', '2'), +('financial_year','1'); -- -------------------------------------------------------- diff --git a/database/migrate_phppos_dist.sql b/database/migrate_phppos_dist.sql index 440959a16..0622dda35 100644 --- a/database/migrate_phppos_dist.sql +++ b/database/migrate_phppos_dist.sql @@ -93,7 +93,8 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('date_or_time_format',''), ('customer_reward_enable',''), ('default_origin_tax_code', ''), -('cash_decimals', '2'); +('cash_decimals', '2'), +('financial_year','1'); -- -------------------------------------------------------- diff --git a/database/tables.sql b/database/tables.sql index 97b79b163..fe99ce183 100644 --- a/database/tables.sql +++ b/database/tables.sql @@ -93,7 +93,8 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('date_or_time_format',''), ('customer_reward_enable',''), ('default_origin_tax_code', ''), -('cash_decimals', '2'); +('cash_decimals', '2'), +('financial_year','1'); -- --------------------------------------------------------