Add php files

This commit is contained in:
2025-05-12 15:44:39 +00:00
parent c951760058
commit 82d5804ac4
9534 changed files with 2638137 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/**
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
*/
global $app_strings;
$dashletMeta['MyEcmTransactionsDashlet'] = array('module' => 'EcmTransactions',
'title' => 'Wychodzące płatności',
'description' => 'A customizable view into InvoiceOuts',
'category' => 'Module Views');
?>

View File

@@ -0,0 +1,134 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* Skeleton Task Dashlet
*
* Author: Blake Robertson
* Date: December 15th, 2010
*
* How to use this file...
* - Change anywhere the text skeleton (two occurances class name and constructor name)
* - Change anywhere CHANGEME appears to the appropriate values.
* - Customize the where
*
********************************************************************************/
require_once('include/Dashlets/DashletGeneric.php');
global $sumaw;
class MyEcmTransactionsDashlet extends DashletGeneric {
function process() {
global $current_language, $app_list_strings, $image_path, $current_user;
// NOTE: date_*_flag = 1 when the date is NULL which is the opposite you'd think...
// DATES Past Start Date
// 'custom_where' => ' AND ((Date(tasks.date_start) <= Date(Now())) OR (tasks.date_start_flag=1)))',
// OVERDUE TASKS
// 'custom_where' => ' AND ((Date(tasks.date_start) <= Date(Now()) AND (tasks.date_due_flag=1)) OR (Date(tasks.date_due) <= Date(Now())) )',
// Tasks assigned to me by other people!
// Other changes, show the column "Created By" instead of Start Date.
// 'custom_where' => ' AND tasks.created_by != "' . $current_user->id . '"',
// Tasks I created for other people.
// Other changes, show the column assigned_to instead of start date., uncheck the "My Items" by default
// 'custom_where' => ' AND tasks.created_by = "' . $current_user->id . '" AND tasks.assigned_user_id != "' . $current_user->id . '"',
$lvsParams = array(
'custom_select' => '',
'custom_from' => '',
'custom_where' => ' and ecmtransactions.settled=0 and ecmtransactions.type3=1 ',
'distinct' => true
);
$dane=parent::process($lvsParams);
$sumaw=0;
for($i=0;$i<count($dane['data']);$i++){
$sumaw+=$dane['data'][$i]['VALUE'];
}
// echo $sumaw;
$this->sumap='<table style="width:276px;"><tr><td style="width:106px;">Suma:</td><td style="width:170px;text-align:right;"><b>'.number_format($sumaw,2,",",".").'</b></td></tr></table>';
$lvsParams['overrideOrder'] = true;
$lvsParams['orderBy'] = 'payment_date';
//$lvsParams['sortOrder'] = 'ASC';
$dane=parent::process($lvsParams);
}
function MyEcmTransactionsDashlet($id, $def = null) {
$this->sumap='Suma: '.$sumaw;
///echo $sum.'aa';
global $current_user, $app_strings;
// require_once('MyEcmTransactionsDashletOptions.tpl');
// Uncomment line below if you don't want dashlet restricted to items you own
// $def = array( 'myItemsOnly' => false );
$def['extabutton']=1;
parent::DashletGeneric($id, $def);
//echo $id;
if(empty($def['title'])) $this->title = 'Wychodzące płatności';
// This is the filter criteria, it's usually in a .data.php file, i moved it here so i'd have less files to modify.
$this->searchFields = array('name' => array('default' => ''),
// 'priority' => array('default' => ''),
'type' => array('default' => array('1', '0')),
'payment_date' => array('default' => ''),
'status' => array('default' => ''),
// 'team_id' => array('default' => '', 'label' => 'LBL_TEAMS'),
'assigned_user_id' => array('type' => 'assigned_user_name',
'label' => 'LBL_ASSIGNED_TO' )
);
// 'default' => $current_user->name
if(empty($def['filters'])){
if(isset($this->searchFields['status'])){
if(!empty($this->searchFields['status']['default'])){
$this->filters['status'] = $this->searchFields['status']['default'];
}
}
}
// This is the columns that show up in the list view, customize accordinly.
$this->columns = array(
'name' => array('width' => '8',
'label' => 'LBL_SUBJECT',
'link' => true,
'default' => true),
'value' => array('width' => '8',
'label' => 'Kwota',
'align'=>'right',
'default' => true),
'parent_id'=>array(
'width'=>0,
'label'=>'&nbsp;',
'customCode'=>'&nbsp;',
'default'=>true,
'sortable'=>false,
),
'parent_name' => array(
'width' => '20',
'label' => 'Konrahent',
'default' => true,
'id'=>'parent_id',
'module'=>'Accounts',
'link'=>true),
'payment_date' => array('width' => '8',
'label' => 'Termin płatności',
'default' => true),
'options' => array('width' => '2',
'label' => 'Opcje',
'default' => true),
);
$this->seedBean = new EcmTransaction();
$this->lvs->quickViewLinks = false;
}
}
?>

View File

@@ -0,0 +1,46 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/**
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
*/
global $app_strings;
$dashletMeta['MyEcmTransactionsDashlet2'] = array('module' => 'EcmTransactions',
'title' => 'Przychodzące płatności',
'description' => 'A customizable view into InvoiceOuts',
'category' => 'Module Views');
?>

View File

@@ -0,0 +1,135 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* Skeleton Task Dashlet
*
* Author: Blake Robertson
* Date: December 15th, 2010
*
* How to use this file...
* - Change anywhere the text skeleton (two occurances class name and constructor name)
* - Change anywhere CHANGEME appears to the appropriate values.
* - Customize the where
*
********************************************************************************/
require_once('include/Dashlets/DashletGeneric.php');
global $sumaw;
class MyEcmTransactionsDashlet2 extends DashletGeneric {
function process() {
global $current_language, $app_list_strings, $image_path, $current_user;
// NOTE: date_*_flag = 1 when the date is NULL which is the opposite you'd think...
// DATES Past Start Date
// 'custom_where' => ' AND ((Date(tasks.date_start) <= Date(Now())) OR (tasks.date_start_flag=1)))',
// OVERDUE TASKS
// 'custom_where' => ' AND ((Date(tasks.date_start) <= Date(Now()) AND (tasks.date_due_flag=1)) OR (Date(tasks.date_due) <= Date(Now())) )',
// Tasks assigned to me by other people!
// Other changes, show the column "Created By" instead of Start Date.
// 'custom_where' => ' AND tasks.created_by != "' . $current_user->id . '"',
// Tasks I created for other people.
// Other changes, show the column assigned_to instead of start date., uncheck the "My Items" by default
// 'custom_where' => ' AND tasks.created_by = "' . $current_user->id . '" AND tasks.assigned_user_id != "' . $current_user->id . '"',
$date = new DateTime(date('Y-m-d', time()));
$d=$date->format('Y-m-d');
$date->modify('+5 days');
$d2=$date->format('Y-m-d');
$lvsParams = array(
'custom_select' => '',
'custom_from' => ' inner join accounts aa on aa.id=ecmtransactions.parent_id',
'custom_where' => ' and ecmtransactions.settled=0 and aa.account_type="rec"',
'distinct' => true
);
$dane=parent::process($lvsParams);
$sumaw=0;
for($i=0;$i<count($dane['data']);$i++){
$sumaw+=$dane['data'][$i]['VALUE'];
}
$this->sumap='<table style="width:276px;"><tr><td style="width:106px;">Suma:</td><td style="width:170px;text-align:right;"><b>'.number_format($sumaw,2,",",".").'</b></td></tr></table>';
$lvsParams['overrideOrder'] = true;
$lvsParams['orderBy'] = 'payment_date';
$lvsParams['sortOrder'] = 'ASC';
$dane=parent::process($lvsParams);
}
function MyEcmTransactionsDashlet2($id, $def = null) {
//$this->sumap='Suma: '.$sumaw;
//echo $sum;
global $current_user, $app_strings;
// require_once('MyEcmTransactionsDashlet2Options.tpl');
// Uncomment line below if you don't want dashlet restricted to items you own
// $def = array( 'myItemsOnly' => false );
parent::DashletGeneric($id, $def);
if(empty($def['title'])) $this->title = 'Przychodzące płatności';
// This is the filter criteria, it's usually in a .data.php file, i moved it here so i'd have less files to modify.
$this->searchFields = array('name' => array('default' => ''),
// 'priority' => array('default' => ''),
'type' => array('default' => array('1', '0')),
'payment_date' => array('default' => ''),
'status' => array('default' => ''),
// 'team_id' => array('default' => '', 'label' => 'LBL_TEAMS'),
'assigned_user_id' => array('type' => 'assigned_user_name',
'label' => 'LBL_ASSIGNED_TO' )
);
// 'default' => $current_user->name
if(empty($def['filters'])){
if(isset($this->searchFields['status'])){
if(!empty($this->searchFields['status']['default'])){
$this->filters['status'] = $this->searchFields['status']['default'];
}
}
}
// This is the columns that show up in the list view, customize accordinly.
$this->columns = array(
'name' => array('width' => '8',
'label' => 'LBL_SUBJECT',
'link' => true,
'default' => true),
'value' => array('width' => '8',
'label' => 'Kwota',
'align'=>'right',
'default' => true),
'parent_id'=>array(
'width'=>0,
'label'=>'&nbsp;',
'customCode'=>'&nbsp;',
'default'=>true,
'sortable'=>false,
),
'parent_name' => array(
'width' => '20',
'label' => 'Konrahent',
'default' => true,
'id'=>'parent_id',
'module'=>'Accounts',
'link'=>true),
'payment_date' => array('width' => '8',
'label' => 'Termin płatności',
'default' => true),
'options' => array('width' => '2',
'label' => 'Opcje',
'default' => true),
);
$this->seedBean = new EcmTransaction();
$this->lvs->quickViewLinks = false;
}
}
?>

View File

@@ -0,0 +1,93 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
global $sugar_version, $sugar_config, $current_user, $app_strings, $mod_strings, $current_user, $app_list_strings;
require_once('modules/EcmTransactions/EcmTransaction.php');
require_once('modules/EcmTransactions/Forms.php');
require_once ('include/time.php');
require_once('include/json_config.php');
$json_config = new json_config();
//ACLAction::addActions('EcmTransactions', 'EcmTransactions');
$focus = new EcmTransaction();
if(isset($_REQUEST['record']))$focus->retrieve($_REQUEST['record']);
echo '<script type="text/javascript" src="modules/EcmTransactions/js/DetailView.js"></script>';
require_once('include/MVC/View/SugarView.php');
if(file_exists('modules/EcmTransactions/view/DetailView/view.detail.my.php')) {
require_once('modules/EcmTransactions/view/DetailView/view.detail.my.php');
$detail = new ViewDetailMy();
$detail->ss = new Sugar_Smarty();
$detail->module = 'EcmTransactions';
}
else{
require_once('include/MVC/View/views/view.detail.php');
$detail = new ViewDetail();
$detail->ss = new Sugar_Smarty();
$detail->module = 'EcmTransactions';
}
global $app_list_strings;
$db = $GLOBALS['db'];
if($focus->record_type!=''){
$mod=substr($focus->record_type, 0, -1);
$doc = new $mod();
$doc->retrieve($focus->record_id);
if($mod=='Document'){
$detail->ss->assign('ASSIGNED_DOCUMENT', '<a target="new" href="index.php?module='.$focus->record_type.'&action=DetailView&record='.$focus->record_id.'">'.$doc->document_name.'</a>');
} else {
$detail->ss->assign('ASSIGNED_DOCUMENT', '<a target="new" href="index.php?module='.$focus->record_type.'&action=DetailView&record='.$focus->record_id.'">'.$doc->document_no.'</a>');
}
}
$can_edit = true;
//get transactions
$res = $db->query("
select t.id, t.name, rel.value from ecmtransactions_rel as rel
inner join ecmtransactions as t
on t.id = rel.ecmtransaction_a_id
where rel.ecmtransaction_b_id='$focus->id'");
$trans = '<table style="width: 40%">';
while ($row = $db->fetchByAssoc($res)) {
$can_edit = false;
$row['value'] = format_number($row['value']);
$trans.='<tr style="width: 100%">';
$trans.='<td><a target="new" href="index.php?module=EcmTransactions&action=DetailView&record='.$row['id'].'">'.$row['name'].'</a></td>';
$trans.='<td style="text-align: right">'.$row['value'].'</td>';
$trans.='</tr>';
}
$res = $db->query("
select t.id, t.name, rel.value from ecmtransactions_rel as rel
inner join ecmtransactions as t
on t.id = rel.ecmtransaction_b_id
where rel.ecmtransaction_a_id='$focus->id'");
while ($row = $db->fetchByAssoc($res)) {
$can_edit = false;
$row['value'] = format_number($row['value']);
$trans.='<tr style="width: 100%">';
$trans.='<td><a target="new" href="index.php?module=EcmTransactions&action=DetailView&record='.$row['id'].'">'.$row['name'].'</a></td>';
$trans.='<td style="text-align: right">'.$row['value'].'</td>';
$trans.='</tr>';
}
$trans.='</table>';
$detail->ss->assign('RELATED_TRANSACTIONS', $trans);
$detail->ss->assign('CAN_EDIT', $can_edit);
$detail->ss->assign("MOD",$mod_strings);
$detail->bean = $focus;
$detail->preDisplay();
unset($detail->defs['templateMeta']['form']['buttons'][2]);
echo $detail->display();
echo '<div id="subpanels_div">';
require_once('subpanels.php');
echo '</div>';
?>

View File

@@ -0,0 +1,382 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: TODO: To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
require_once('data/SugarBean.php');
require_once('include/utils.php');
class EcmTransaction extends SugarBean {
var $field_name_map = array();
var $id;
var $date_entered;
var $date_modified;
var $modified_user_id;
var $assigned_user_id;
var $name;
var $value;
var $type;
var $record_id;
var $description;
var $parent_id;
var $link;
var $parent_name;
var $payment_date;
var $module_dir = 'EcmTransactions';
var $table_name = "ecmtransactions";
var $object_name = "EcmTransaction";
var $new_schema = true;
var $additional_column_fields = array('assigned_user_name', 'assigned_user_id');
function EcmTransaction() {
parent::SugarBean();
$this->setupCustomFields('EcmTransactions');
foreach($this->field_defs as $field){
$this->field_name_map[$field['name']] = $field;
}
}
function get_summary_text(){
return $this->name;
}
function create_list_query($order_by, $where, $show_deleted = 0){
$custom_join = $this->custom_fields->getJOIN();
$query ="SELECT ";
$query.="ecmtransactions.*,users.user_name as assigned_user_name";
if($custom_join)$query.=$custom_join['select'];
$query.=" FROM ecmtransactions ";
$query.="LEFT JOIN users ON ecmtransactions.assigned_user_id=users.id";
$query.=" ";
if($custom_join)$query.=$custom_join['join'];
$where_auto='1=1';
if($show_deleted==0)$where_auto=" $this->table_name.deleted=0 ";
elseif($show_deleted==1)$where_auto=" $this->table_name.deleted=1 ";
if($where!="")$query.="where $where AND ".$where_auto;
else $query.="where ".$where_auto;
if(substr_count($order_by,'.')>0)$query .= " ORDER BY $order_by";
elseif($order_by != "")$query .= " ORDER BY $order_by";
else $query .= " ORDER BY ecmtransactions.name";
return $query;
}
function create_export_query($order_by,$where){
$custom_join = $this->custom_fields->getJOIN();
$query ="SELECT ";
$query.="ecmtransactions.*,users.user_name as assigned_user_name";
if($custom_join)$query.=$custom_join['select'];
$query.=" FROM ecmtransactions ";
$query.="LEFT JOIN users ON ecmtransactions.assigned_user_id=users.id";
$query.=" ";
if($custom_join)$query.=$custom_join['join'];
$where_auto='1=1';
if($show_deleted==0)$where_auto=" $this->table_name.deleted=0 ";
elseif($show_deleted==1)$where_auto=" $this->table_name.deleted=1 ";
if($where!="")$query.="where $where AND ".$where_auto;
else $query.="where ".$where_auto;
if(substr_count($order_by,'.')>0)$query .= " ORDER BY $order_by";
elseif($order_by != "")$query .= " ORDER BY $order_by";
else $query .= " ORDER BY ecmtransactions.name";
return $query;
}
function fill_in_additional_list_fields(){
}
function fill_in_additional_detail_fields(){
parent::fill_in_additional_detail_fields();
}
function get_list_view_data(){
global $current_language;
$the_array=parent::get_list_view_data();https://system.saas-systems.pl/index.php?module=EcmTransactions&action=Popup&query=true&from=EcmNewKpKws&parent_id_advanced=edd6f25a-cbbb-ccbd-825e-544f6008be33&parent_name_advanced=%22EKOMER%20-%20K.Wr%C3%B3blewska%22%20Sp%C3%B3%C5%82ka%20Jawna&currency_id_advanced=PLN&settled_advanced=0&type_advanced=1&hide_clear_button=true&mode=MultiSelect&create=true&metadata=undefined
$app_list_strings=return_app_list_strings_language($current_language);
$mod_strings=return_module_language($current_language,'EcmTransactions');
$the_array['NAME']=(($this->name == "") ? "<em>blank</em>" : $this->name);
$the_array['ENCODED_NAME']=$this->name;
$a=new Account();
$b=new EcmTransaction;
$b->retrieve($this->id);
$a->retrieve($b->parent_id);
if($_REQUEST['module']=='Home' || $_REQUEST['action']=='Popup'){
$the_array ['VALUE']=$this->getRelations();
}
$the_array ['PARENT_NAME'] ='<a href="index.php?action=DetailView&module=Accounts&record='.$b->parent_id.'&offset=5&stamp=1398339446031915300">'.$a->name.'</a>';
$the_array ['OPTIONS']='<input type="checkbox" id="transaction_checkbox" value="'.$this->id.'">';
return $the_array;
}
function build_generic_where_clause($the_query_string){
$where_clauses=array();
$the_query_string=PearDatabase::quote(from_html($the_query_string));
array_push($where_clauses,"ecmtransactions.name like '$the_query_string%'");
$the_where="";
foreach($where_clauses as $clause){
if($the_where!="")$the_where.=" or ";
$the_where.=$clause;
}
return $the_where;
}
function set_notification_body($xtpl,$ecmtransaction)
{
global $mod_strings,$app_list_strings;
$xtpl->assign("ECMPAYMENT_SUBJECT",$ecmtransaction->name);
return $xtpl;
}
function bean_implements($interface){
switch($interface){
case 'ACL':return true;
}
return false;
}
function RemoveRelations(){
if($this->id!=''){
$db=$GLOBALS['db'];
$zap=$db->query("select * from ecmtransactions_rel where (ecmtransaction_a_id='".$this->id."' OR ecmtransaction_b_id='".$this->id."')");
while($res=$db->fetchByAssoc($zap)){
$db->query("update ecmtransactions set settled=0 where id='".$res['ecmtransaction_a_id']."'");
$db->query("update ecmtransactions set settled=0 where id='".$res['ecmtransaction_b_id']."'");
$db->query("delete from ecmtransactions_rel where id='".$res['id']."'");
}
$db->query("update ecmtransactions set settled=0 where id='".$this->id."'");
}
}
function prepareDataCustomMa($smartyO,$curO){
$id= explode('|',$_REQUEST['toRelId']);
array_pop($id);
$tmp=new EcmTransaction();
$curO->description="Zapłata do: ";
foreach ($id as $v){
$tmp->retrieve($v);
$curO->description.=$tmp->name.', ';
}
unset($tmp);
$amount= explode('|',$_REQUEST['toRelVal']);
array_pop($amount);
$curO->value=0;
foreach ($amount as $v){
$curO->value+=$v;
}
$curO->value=$curO->value;
$curO->register_date=date("d.m.Y");
$smartyO->assign('TORELVAL',$_REQUEST['toRelVal']);
$smartyO->assign('TORELID',$_REQUEST['toRelId']);
}
function createRelationM($id, $value, $payment) {
$db = $GLOBALS['db'];
global $current_user;
$db->query("
INSERT INTO ecmtransactions_rel VALUES (
'".create_guid()."',
'".date("Y-m-d H:i:s")."',
'".$current_user->id."',
'$id',
'$payment',
'$value'
)
");
//check is settled
//winien
$res = $db->fetchByAssoc($db->query("
SELECT (abs(t.value)-sum(rel.value)) as unsettled FROM ecmtransactions AS t
INNER JOIN ecmtransactions_rel AS rel
ON (rel.ecmtransaction_a_id=t.id OR rel.ecmtransaction_b_id=t.id)
WHERE t.id='$id'
"));
echo "
SELECT (abs(t.value)-sum(rel.value)) as unsettled FROM ecmtransactions AS t
INNER JOIN ecmtransactions_rel AS rel
ON (rel.ecmtransaction_a_id=t.id OR rel.ecmtransaction_b_id=t.id)
WHERE t.id='$id'
";
echo 'WINIEN '.$row['unsettled'].'...';
if ($res['unsettled']==0)
$db->query("UPDATE ecmtransactions SET settled='1' WHERE id='$id'");
//ma
$res = $db->fetchByAssoc($db->query("
SELECT (abs(t.value)-sum(rel.value)) as unsettled FROM ecmtransactions AS t
INNER JOIN ecmtransactions_rel AS rel
ON (rel.ecmtransaction_a_id=t.id OR rel.ecmtransaction_b_id=t.id)
WHERE t.id='$payment'
"));
echo 'MA '.$row['unsettled'].'...';
if ($res['unsettled']==0)
$db->query("UPDATE ecmtransactions SET settled='1' WHERE id='$payment'");
echo "
SELECT (abs(t.value)-sum(rel.value)) as unsettled FROM ecmtransactions AS t
INNER JOIN ecmtransactions_rel AS rel
ON (rel.ecmtransaction_a_id=t.id OR rel.ecmtransaction_b_id=t.id)
WHERE t.id='$payment'
";
echo '1';
return;
}
function createRelation($id, $value, $payment) {
$db = $GLOBALS['db'];
global $current_user;
$db->query("
INSERT INTO ecmtransactions_rel VALUES (
'".create_guid()."',
'".date("Y-m-d H:i:s")."',
'".$current_user->id."',
'$id',
'$payment',
'$value'
)
");
//check is settled
//winien
$res = $db->fetchByAssoc($db->query("
SELECT (t.value-sum(rel.value)) as unsettled FROM ecmtransactions AS t
INNER JOIN ecmtransactions_rel AS rel
ON (rel.ecmtransaction_a_id=t.id OR rel.ecmtransaction_b_id=t.id)
WHERE t.id='$id'
"));
if ($res['unsettled']==0)
$db->query("UPDATE ecmtransactions SET settled='1' WHERE id='$id'");
//ma
$res = $db->fetchByAssoc($db->query("
SELECT (t.value-sum(rel.value)) as unsettled FROM ecmtransactions AS t
INNER JOIN ecmtransactions_rel AS rel
ON (rel.ecmtransaction_a_id=t.id OR rel.ecmtransaction_b_id=t.id)
WHERE t.id='$payment'
"));
if ($res['unsettled']==0)
$db->query("UPDATE ecmtransactions SET settled='1' WHERE id='$payment'");
}
function saveRelationsCustomMa($id){
$db = $GLOBALS['db'];
$tmp=$this->createArray();
for($i=0;count($tmp)>$i;$i++){
$this->createRelation($tmp[$i]['id'],$tmp[$i]['amount'],$id);
}
$db->query("UPDATE ecmtransactions SET settled='1' WHERE id='$id'");
}
function saveRelationsCustomWinien($id){
$db = $GLOBALS['db'];
$tmp=$this->createArray();
for($i=0;count($tmp)>$i;$i++){
$this->createRelation($tmp[$i]['id'],$tmp[$i]['amount'],$id);
}
$db->query("UPDATE ecmtransactions SET settled='1' WHERE id='$id'");
}
function getRelations(){
$res=$this->db->query("select value from ecmtransactions_rel where ecmtransaction_a_id='".$this->id."' or ecmtransaction_b_id='".$this->id."'");
if($this->value<0){
$tmp=$this->value;
while ($data=$this->db->fetchByAssoc($res)){
$tmp+=abs($data['value']);
}
} else {
$tmp=$this->value;
while ($data=$this->db->fetchByAssoc($res)){
$tmp-=abs($data['value']);
}
}
return $tmp;
}
function mergeArray($id,$amount){
$new=Array();
for($i=0;count($id)>$i;$i++){
$new[$i]['id']=$id[$i];
$new[$i]['amount']=$amount[$i];
}
return $new;
}
function createArray(){
$id= explode('|',$_REQUEST['toRelId']);
array_pop($id);
$amount= explode('|',$_REQUEST['toRelVal']);
array_pop($amount);
return $this->mergeArray($id,$amount);
}
function save($check_notify=FALSE){
//$this->register_date = $this->payment_date;
$id=parent::save($check_notify);
mysql_query("delete from ecmtransactions_ecminvoiceouts where ecmtransaction_id='".$id."'");
for($i=0;$i<100;$i++){
if($_REQUEST['inv_id'.$i]){
mysql_query("insert into ecmtransactions_ecminvoiceouts(id,ecmtransaction_id,ecminvoiceout_id,date_entered,date_modified,deleted,created_by,modified_user_id) values('".create_guid()."','".$id."','".$_REQUEST['inv_id'.$i]."','".date("Y-m-d H:i:s")."','".date("Y-m-d H:i:s")."','0','".$_SESSION['authenticated_user_id']."','".$_SESSION['authenticated_user_id']."')");
}
}
$db = $GLOBALS['db'];
$db->query("UPDATE ecmtransactions SET settled='0' WHERE id='".$this->id."'");
if($_REQUEST['toRelVal']!='' && $_REQUEST['toRelId']!='' && $this->type=='1')$this->saveRelationsCustomMa($id);
if($_REQUEST['toRelVal']!='' && $_REQUEST['toRelId']!='' && $this->type=='0')$this->saveRelationsCustomWinien($id);
if($check_notify==false)header("Location: index.php?module=EcmPaymentStates&action=AccountPaymentStates&account_id=".$this->parent_id);
return $id;
}
}
?>

View File

@@ -0,0 +1,73 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
require_once('include/EditView/QuickCreate.php');
require_once('modules/EcmTransactions/EcmTransaction.php');
require_once('include/javascript/javascript.php');
class EcmTransactionsQuickCreate extends QuickCreate {
var $javascript;
function process() {
global $current_user, $timedate, $app_list_strings, $current_language, $mod_strings;
$mod_strings = return_module_language($current_language, 'EcmTransactions');
parent::process();
$this->ss->assign("PRIORITY_OPTIONS", get_select_options_with_id($app_list_strings['ecmtransaction_priority_dom'], $app_list_strings['ecmtransaction_priority_default_key']));
$this->ss->assign("STATUS_OPTIONS", get_select_options_with_id($app_list_strings['ecmtransaction_status_dom'], $app_list_strings['ecmtransaction_status_default_key']));
$this->ss->assign("TYPE_OPTIONS", get_select_options_with_id($app_list_strings['ecmtransaction_type_dom'],$app_list_strings['ecmtransaction_type_default_key']));
if($this->viaAJAX) { // override for ajax call
$this->ss->assign('saveOnclick', "onclick='if(check_form(\"ecmtransactionsQuickCreate\")) return SUGAR.subpanelUtils.inlineSave(this.form.id, \"ecmtransactions\"); else return false;'");
$this->ss->assign('cancelOnclick', "onclick='return SUGAR.subpanelUtils.cancelCreate(\"subpanel_ecmtransactions\")';");
}
$this->ss->assign('viaAJAX', $this->viaAJAX);
$this->javascript = new javascript();
$this->javascript->setFormName('ecmtransactionsQuickCreate');
$focus = new EcmTransaction();
$this->javascript->setSugarBean($focus);
$this->javascript->addAllFields('');
$this->ss->assign('additionalScripts', $this->javascript->getScript(false));
}
}
?>

View File

@@ -0,0 +1,193 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
global $sugar_version, $sugar_config, $current_user, $app_strings, $mod_strings, $current_user;
require_once('modules/EcmTransactions/EcmTransaction.php');
require_once('modules/EcmTransactions/Forms.php');
require_once ('include/time.php');
require_once('include/json_config.php');
$json_config = new json_config();
$focus = new EcmTransaction();
$focus->payment_date = date('d.m.Y');
$focus->register_date = date('d.m.Y');
if(isset($_REQUEST['record']) && $_REQUEST['record'] != '') {
$focus->retrieve($_REQUEST['record']);
$focus->format_all_fields();
// $focus->value=number_format($focus->value,2,',','.');
}
if (isset($_REQUEST['parent_id']) && $_REQUEST['parent_id']!='') {
$a = new Account();
$a->retrieve($_REQUEST['parent_id']);
$focus->id=create_guid();
$focus->parent_id = $a->id;
$focus->parent_name = $a->name;
$focus->payment_date = date('d.m.Y');
$focus->register_date = date('d.m.Y');
global $current_user;
$focus->assigned_user_id = $current_user->id;
$focus->assigned_user_name = $current_user->full_name;
$focus->format_all_fields();
unset($a);
}
require_once('include/MVC/View/SugarView.php');
require_once('modules/EcmTransactions/view/EditView/view.edit.my.php');
$edit = new ViewEditMy();
$edit->ss = new Sugar_Smarty();
$edit->module = 'EcmTransactions';
$edit->bean = $focus;
$edit->tplFile = 'include/EditView/EditViewClassic.tpl';
/*
$w=mysql_query("select document_no,register_date,id,total from ecminvoiceouts where deleted='0'");
$i=0;
$inv='<table cellspacing="0" cellpadding="0" border="0" width="100%">';
while($r=mysql_fetch_array($w)){
//if($i%3==0)
$inv.='<tr>';
$inv.='<td><input type="checkbox" name="inv[]" value="'.$r['id'].'"';
$ww=mysql_query("select id from ecmtransactions_ecminvoiceouts where ecminvoiceout_id='".$r['id']."' and ecmtransaction_id='".$focus->id."' and deleted='0'");
if(mysql_num_rows($ww)>0)$inv.=" checked";
$inv.='> <a href="index.php?module=EcmInvoiceOuts&action=DetailView&record='.$r['id'].'">'.$r['document_no'].'</a> - '.$GLOBALS['timedate']->to_display_date($r['register_date']).' - '.number_format($r['total'],2,",",".").'</td>';
//if($i%3==2)
$inv.='</tr>';
$i++;
}
$inv.='</table>';
$inv.='
<div id="invoices">
</div>*/
/*$inv.='
<script language="javascript">
function openPopupSelect(i){
return open_popup("EcmInvoiceOuts", 600, 400, "", true, false, {"call_back_function":"set_return","form_name":"EditView","field_to_name_array":{"id":"inv_id"+i,"document_no":"inv_name"+i}}, "single", true);
}
function addRow(i){
document.getElementById(\'inv\'+i).style.display=\'block\';
document.getElementById(\'inv_no\').value=parseInt(i)+1;
}
</script>';
$w=mysql_query("select ecminvoiceout_id as iid,ecmtransaction_id as pid from ecmtransactions_ecminvoiceouts where deleted='0' and ecmtransaction_id='".$focus->id."'");
echo mysql_error();
$inv.='<input type="hidden" id="inv_no" value="'.mysql_num_rows($w).'"/>
<input type="button" onclick="addRow(document.getElementById(\'inv_no\').value);" class="button" value="Add"/>
<div id="invoices">';
$i=0;
while($r=mysql_fetch_array($w)){
$rr=mysql_fetch_array(mysql_query("select document_no from ecminvoiceouts where id='".$r['iid']."' and deleted='0'"));
if($rr['document_no']){
$inv.='<div id="inv'.$i.'"><input class="sqsEnabled" name="inv_name'.$i.'" tabindex="" id="inv_name'.$i.'" size="" value="'.$rr['document_no'].'" title="" type="text"><input name="inv_id'.$i.'" id="inv_id'.$i.'" value="'.$r['iid'].'" type="hidden">&nbsp;<input onclick="openPopupSelect('.$i.');" class="button" type="button" id="select'.$i.'" value="Select" />&nbsp;<input onclick=document.getElementById("inv'.$i.'").innerHTML=""; class="button" type="button" id="del'.$i.'" value="Delete" /></div>
<script>
if(typeof sqs_objects == \'undefined\'){var sqs_objects = new Array;}sqs_objects[\'inv_name'.$i.'\']={"method":"query","modules":["EcmInvoiceOuts"],"group":"or","field_list":["document_no","id"],"populate_list":["inv_name'.$i.'","inv_id'.$i.'"],"conditions":[{"name":"document_no","op":"like_custom","end":"%","value":""}],"required_list":["inv_id'.$i.'"],"order":"document_no","limit":"30","no_match_text":"No Match"};
</script>';
$i++;
}
}
$inv.='</div>';
for($l=$i;$l<100;$l++){
$inv.='<div id="inv'.$l.'" style="display:none;"><input class="sqsEnabled" name="inv_name'.$l.'" tabindex="" id="inv_name'.$l.'" size="" value="" title="" type="text"><input name="inv_id'.$l.'" id="inv_id'.$l.'" value="" type="hidden">&nbsp;<input onclick="openPopupSelect('.$l.');" class="button" type="button" id="select'.$l.'" value="Select" />&nbsp;<input onclick=document.getElementById("inv'.$l.'").innerHTML=""; class="button" type="button" id="del'.$l.'" value="Delete" /></div><script>if(typeof sqs_objects == \'undefined\'){var sqs_objects = new Array;}sqs_objects[\'inv_name'.$l.'\']={"method":"query","modules":["EcmInvoiceOuts"],"group":"or","field_list":["document_no","id"],"populate_list":["inv_name'.$l.'","inv_id'.$i.'"],"conditions":[{"name":"document_no","op":"like_custom","end":"%","value":""}],"required_list":["inv_id'.$l.'"],"order":"document_no","limit":"30","no_match_text":"No Match"};</script>';
}*/
echo $focus->parent_name;
if($_REQUEST['type']==1){ $selected='selected'; $focus->link=1;
$a='<option label="Ma" value="1" '.$selected.'>Ma</option></select>';
$typess='<select name="type" id="type" title="" tabindex="105" '.$disabled.'>'.$a.'</option>';}
if($_REQUEST['type']==0) {
$selected1='selected'; $focus->link=1;
$a='<option label="Winien" value="0" '.$selected1.'>';
$typess='<select name="type" id="type" title="" tabindex="105" '.$disabled.'>'.$a.'Winien</option>';}
if(!isset($_REQUEST['type'])){
if($focus->type!=null){
if($focus->type==0){ $typess='<select name="type" id="type" title="" tabindex="105" '.$disabled.'><option label="Winien" value="0" selected>Winien</option></select>';
} else {
$typess='<select name="type" id="type" title="" tabindex="105" '.$disabled.'><option label="Ma" value="1" selected>Ma</option></select>'; }
} else {
$focus->link=0; $typess='<select name="type" id="type" title="" tabindex="105" '.$disabled.'><option label="Ma" value="1" '.$selected.'>Ma</option><option label="Winien" value="0" '.$selected1.'>Winien</option></select>';}
}
if(isset($focus->id) && $_REQUEST['fromAccountPaymentStates']==''){
$canc='<input type="button" id="canc" onclick="location.href=';
$canc.="'index.php?module=EcmTransactions&action=DetailView&record=";
$canc.=$focus->id;
$canc.="'";
$canc.='" value="Anuluj">';
}
if($_REQUEST['fromAccountPaymentStates']!=''){
$canc='<input type="button" id="canc" onclick="location.href=';
$canc.="'index.php?module=EcmPaymentStates&action=AccountPaymentStates&account_id=".$_REQUEST['parent_id'];
$canc.="'";
$canc.='" value="Anuluj">';
} else {
$canc='<input type="button" id="canc" onclick="location.href=';
$canc.="'index.php?module=EcmTransactions";
$canc.="'";
$canc.='" value="Anuluj">';
}
/*
*
*
*
*/
if($_REQUEST['toRelId']!='' && $_REQUEST['toRelVal']!='') $focus->prepareDataCustomMa($edit->ss,$focus);
$edit->ss->assign("CANCEL",$canc);
$edit->ss->assign("TYPESS",$typess);
$edit->ss->assign("INVOICES",$inv);
if ($_REQUEST['fromAccountPaymentStates'] && $_REQUEST['fromAccountPaymentStates']=="1")
$edit->ss->assign("FROMACCOUNTPAYMENTSTATES", "1");
$edit->preDisplay();
echo $edit->display();
if(isset($focus->id) || isset($_REQUEST['parent_id'])){
echo "<script>";
if($_REQUEST['type']==0 || $focus->type==0){
/*
echo " var sel = document.getElementById('type2');
sel.options[3].selected=true;
for (var i=0;i<sel.length;i++)
{
if(sel.options[i].value[0]!='W'){
sel.options[i].style.display='none';
} else {
sel.options[i].style.display='block';
}
if(sel.options[i].value=='".$focus->type2."'){
sel.options[i].selected=true;
}
}"; */
}
if($_REQUEST['type']==1 || $focus->type==1){
/*
echo " var sel = document.getElementById('type2');
for (var i=0;i<sel.length;i++)
{
if(sel.options[i].value[0]!='M'){
sel.options[i].style.display='none';
} else {
sel.options[i].style.display='block';
sel.options[i].selected=true;
}
if(sel.options[i].value=='".$focus->type2."'){
sel.options[i].selected=true;
}
}"; */
}
echo "document.getElementById('parent_name').size='54';
document.getElementById('parent_name').readOnly=true;
document.getElementById('btn_parent_name').style.display='none';
document.getElementById('btn_clr_parent_name').style.display='none';</script>";
}
?>

View File

@@ -0,0 +1,37 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
*********************************************************************************/
//require_once('include/EditView/SideQuickCreate.php');

View File

@@ -0,0 +1,13 @@
<?php
class LogicHook {
//Test Logic Function
function before_delete_method(&$focus, $event, $arguments) {
$db = $GLOBALS['db'];
$zap = $db->query("select * from ecmtransactions_rel where (ecmtransaction_a_id='" . $focus->id . "' OR ecmtransaction_b_id='" . $focus->id . "')");
while ($res = $db->fetchByAssoc($zap)) {
$db->query("");
}
}
}

View File

@@ -0,0 +1,52 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: TODO To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
global $mod_strings;
if(ACLController::checkAccess('EcmTransactions', 'edit', true))
$module_menu[] =array("index.php?module=EcmTransactions&action=EditView&return_module=EcmTransactions&return_action=DetailView", 'Utwórz transakcję',"CreateEcmTransactions", 'EcmTransactions');
if(ACLController::checkAccess('EcmTransactions', 'list', true))
$module_menu[]=array("index.php?module=EcmTransactions&action=index&return_module=EcmTransactions&return_action=DetailView", 'Transakcje',"EcmTransactions", 'EcmTransactions');
if(ACLController::checkAccess('EcmTransactions','list', true)) $module_menu[]=array('#', '<span style="display: none">wp_shortcut_fill_0</span>', '');
$module_menu[]=array("index.php?module=EcmTransactions&action=mz_importBankStatement", 'Import wyciągu',"EcmTransactions", 'EcmTransactions');
?>

View File

@@ -0,0 +1,8 @@
<?php
if($_REQUEST['record']!=''){
$t=new EcmTransaction();
$t->retrieve($_REQUEST['record']);
$t->RemoveRelations();
}
header('Location: index.php?module=EcmTransactions&action=DetailView&record='.$_REQUEST['record']);
?>

141
modules/EcmTransactions/Save.php Executable file
View File

@@ -0,0 +1,141 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*****************************************************************************
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/rpl.php. Software distributed under the
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
* either express or implied.
*
* You may:
* a) Use and distribute this code exactly as you received without payment or
* a royalty or other fee.
* b) Create extensions for this code, provided that you make the extensions
* publicly available and document your modifications clearly.
* c) Charge for a fee for warranty or support or for accepting liability
* obligations for your customers.
*
* You may NOT:
* a) Charge for the use of the original code or extensions, including in
* electronic distribution models, such as ASP (Application Service
* Provider).
* b) Charge for the original source code or your extensions other than a
* nominal fee to cover distribution costs where such distribution
* involves PHYSICAL media.
* c) Modify or delete any pre-existing copyright notices, change notices,
* or License text in the Licensed Software
* d) Assert any patent claims against the Licensor or Contributors, or
* which would in any way restrict the ability of any third party to use the
* Licensed Software.
*
* You must:
* a) Document any modifications you make to this code including the nature of
* the change, the authors of the change, and the date of the change.
* b) Make the source code for any extensions you deploy available via an
* Electronic Distribution Mechanism such as FTP or HTTP download.
* c) Notify the licensor of the availability of source code to your extensions
* and include instructions on how to acquire the source code and updates.
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
* reproduce, perform, modify, sublicense, and distribute your extensions.
*
* The Original Code is: CommuniCore
* Olavo Farias
* 2006-04-7 olavo.farias@gmail.com
*
* The Initial Developer of the Original Code is CommuniCore.
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
* All Rights Reserved.
********************************************************************************/
require_once("modules/EcmTransactions/EcmTransaction.php");
require_once('include/formbase.php');
$focus = new EcmTransaction();
if(isset($_POST['record']) && $_POST['record'] != '') {
$focus->retrieve($_POST['record']);
}
if(!$focus->ACLAccess('Save')){
ACLController::displayNoAccess(true);
sugar_cleanup(true);
}
$check_notify = FALSE;
foreach($focus->column_fields as $field){
if(isset($_POST[$field])){
$value = $_POST[$field];
$focus->$field = $value;
}
}
foreach($focus->additional_column_fields as $field){
if(isset($_POST[$field])){
$value = $_POST[$field];
$focus->$field = $value;
}
}
$focus->save($check_notify);
$return_id = $focus->id;
echo $return_id;
if ($_REQUEST['fromAccountPaymentStates'] && $_REQUEST['fromAccountPaymentStates']=="1")
//back to Account Payment States
header("Location:index.php?module=EcmPaymentStates&action=AccountPaymentStates&account_id=$focus->parent_id");
else
//tranaction DetailView
handleRedirect($return_id,'EcmTransactions');
?>

View File

@@ -0,0 +1,68 @@
<?php
require_once("helper.php");
/*
ini_set('display_errors',1);
$csv = array();
$lines = file('rap3.csv', FILE_IGNORE_NEW_LINES);
foreach ($lines as $key => $value)
{
$csv[$key] = str_getcsv($value);
}
echo '<pre>';
print_r($csv);
echo '</pre>';
$link = mysql_connect('localhost', 'root', '5z#JaL');
$db_selected = mysql_select_db('crm', $link);
foreach($csv as $key)
{
if($key[2]=='Przekazany'){
$r=mysql_query("INSERT INTO nr_faktury
(`nr_faktury`)
VALUES
('".$key[1]."');");
}
}
*/
$link = mysql_connect('localhost', 'root', '5z#JaL');
$db_selected = mysql_select_db('crm', $link);
$r=mysql_query("select p.id,p.document_no,p.total,p.paid,p.register_date,p.payment_date,p.total,p.ecminvoiceout_id, p.ecmpayment_id,p.account_id from ecmpayments_ecminvoiceouts as p inner join ecminvoiceouts as i on p.ecminvoiceout_id=i.id and i.type!='canceled' where p.deleted='0' and p.date_entered > '2011-12-31' order by p.date_entered");
$i=0;
while($dane=mysql_fetch_assoc($r)){
$req=mysql_query( "select p.id, p.name,p.value from ecmpayments_ecminvoiceouts_rel as r inner join ecmpayments as p on p.id=r.ecmpayment_id where r.ee_id='" . $dane ['id'] . "'" );
while($dane2=mysql_fetch_assoc($req)){
$szukaj=mysql_query("select * from ecmtransactions where name='".$dane2['name']."' and value='".$dane2['value']."'");
$i++;
//echo $i.': '.$dane ['id'];
//echo' <a href="https://192.168.1.131/crm/index.php?module=EcmPayments&action=DetailView&record=' . $dane2 ['id'] . '" target="new">' . $dane2 ['name'] . '</a><br>';
$szukaj_p=mysql_query("select * from ecmtransactions where name='".$dane['document_no']."' and value='".$dane['total']."'");
echo $i.': '.$dane ['id'];
$dane4=mysql_fetch_assoc($szukaj_p);
$dane3=mysql_fetch_assoc($szukaj);
if(mysql_num_rows($szukaj_p)>0 && mysql_num_rows($szukaj)>0){
// $cos=mysql_query("insert into ecmpayments2_ecminvoiceouts(id,ecmpayment_id,ecminvoiceout_id,date_entered,paid,created_by,modified_user_id,deleted,account_id) values('".create_guid()."','".$dane4 ['id']."','".$dane3 ['id']."','".$dane['register_date']."','1','2e72f487-d92b-954e-f50c-528b10ce81c9','2e72f487-d92b-954e-f50c-528b10ce81c9','0','".$dane['account_id']."');");
//echo "insert into ecmpayments2_ecminvoiceouts(id,ecmpayment_id,ecminvoiceout_id,date_entered,paid,created_by,modified_user_id,deleted,account_id) values('".create_guid()."','".$dane4 ['id']."','".$dane3 ['id']."','".$dane['register_date']."','1','2e72f487-d92b-954e-f50c-528b10ce81c9','2e72f487-d92b-954e-f50c-528b10ce81c9','0','".$dane['account_id']."'<br>";
echo' <a href="https://192.168.1.131/crm/index.php?module=EcmTransactions&action=DetailView&record=' . $dane4 ['id'] . '" target="new">' . $dane4 ['name'] . '</a>';
echo' <a href="https://192.168.1.131/crm/index.php?module=EcmTransactions&action=DetailView&record=' . $dane3 ['id'] . '" target="new">' . $dane3 ['name'] . '</a><br>';
}
/*
while($dane4=mysql_fetch_assoc($szukaj_p)){
echo' <a href="https://192.168.1.131/crm/index.php?module=EcmTransactions&action=DetailView&record=' . $dane4 ['id'] . '" target="new">' . $dane4 ['name'] . '</a>';
} /*
while($dane3=mysql_fetch_assoc($szukaj)){
//echo $i.': '.$dane ['id'];
echo' <a href="https://192.168.1.131/crm/index.php?module=EcmTransactions&action=DetailView&record=' . $dane3 ['id'] . '" target="new">' . $dane3 ['name'] . '</a><br>';
//echo' <a href="https://192.168.1.131/crm/index.php?module=EcmPayments&action=DetailView&record=' . $dane2 ['id'] . '" target="new">' . $dane2 ['name'] . '</a><br>';
}
*/
}
}
echo $i;
?>

View File

@@ -0,0 +1,71 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: Contains field arrays that are used for caching
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
$fields_array['EcmTransaction']=array(
'column_fields'=>array(
"id",
"date_entered",
"date_modified",
"modified_user_id",
"assigned_user_id",
"name",
"description",
"value",
"type",
"parent_id",
"payment_date",
),
'list_fields'=>array(
'id',
'assigned_user_name',
'assigned_user_id',
'name',
'type',
'description',
'value',
'parent_id',
'payment_date',
),
'required_fields' => array('name'=>1),
);
?>

View File

@@ -0,0 +1,98 @@
<?php
ini_set('max_execution_time',-1);
ini_set('memory_limit',-1);
$w=$GLOBALS['db']->query("select id,payment_date,name,parent_name,register_date,value
from ecmtransactions WHERE payment_date<'".date('Y-m-d')."' and type=0 and deleted=0 and (settled='' or settled is null) order by payment_date asc");
$i=0;
echo "<pre>";
$data=null;
while($r=$GLOBALS['db']->fetchByAssoc($w)){
$tmp = array();
$tmp['payment_date']=$r['payment_date'];
$tmp['name']=$r['name'];
$tmp['parent_name']=$r['parent_name'];
$tmp['register_date']=$r['register_date'];
if($r['parent_name']=='BSL SP. Z O.O.')continue;
if($r['parent_name']=='BSL TRUCK PAWEŁ BARTYŚ')continue;
$t = new EcmTransaction();
$t->retrieve($r['id']);
$tmp['value']=$r['value'];
$tmp['value2']=$t->getRelations();
$tmp['value3']=$r['value']-$t->getRelations();
$datetime1 = new DateTime(date('Y-m-d'));
$datetime2 = new DateTime($tmp['payment_date']);
$interval = $datetime1->diff($datetime2);
$tmp['diff']= abs($interval->format('%R%a')).' dni';
unset($t);
$data[]=$tmp;
}
//echo '<br>'.create_guid();
$es = new EcmSysInfo();
$content= "<h2>Raport nierozliczonych transakcji</h2>".$es->getName()."<br>Data wydruku: ".date("d.m.Y.")."<br><hr><table style='width:100%;font-size:7pt;'><tr>
<td>Termin płatności</td>
<td>Kontrahent</td>
<td>Nr dokumentu</td>
<td>Data dokumentu</td>
<td>Dni po terminie</td>
<td>Kwota</td>
<td>Nierozliczone</td>
<td>Rozliczone</td></tr>";
foreach ($data as $k=>$v){
$content.='<tr>
<td>'.date('d.m.Y',strtotime($v['payment_date'])).'</td>
<td>'.$v['parent_name'].'</td>
<td>'.$v['name'].'</td>
<td>'.($v['register_date']!='01.01.1970' ? date('d.m.Y',strtotime($v['register_date'])) : '').'</td>
<td>'.$v['diff'].'</td>
<td style="text-align:right;">'.format_number($v['value']).'</td>
<td style="text-align:right;">'.format_number($v['value2']).'</td>
<td style="text-align:right;">'.format_number($v['value3']).'</td>
</tr>';
}
$content.="</table>";
require_once 'include/ECM/EcmSendPdfButton/EcmSendPdfButton.inc';
$t = new EcmSendPdfButton('Users', $usr_id,$itemail,$type);
#$t->setAdress('outtervision@gmail.com');
$t->setAdress('ela_t@bsltparts.pl ');
$t->setAdress('pawel_b@bsltruck.pl');
$t->setAdress('windykacja@bsltruck.pl');
#$t->setAdress('ryszard.lisiecki@saas-systems.pl');
$t->setSubject('Raport nierozliczonych transakcji');
$t->setBody(from_html('Lista w załączniku.'));
include_once ("include/MPDF57/mpdf.php");
$mPDF = new mPDF ( 'pl', 'A4', 9, 'arial', 10, 10,5, 1, 14, 20);
$mPDF->setAutoTopMargi = 'stretch';
$mPDF->setAutoBottomMargin = 'stretch';
$mPDF->mirrorMargins = 1;
$mPDF->setFooter('Strona {PAGENO}');
$mPDF->WriteHTML($content);
$mPDF->Output('upload/raport_trans_'.date('d_m_Y').'.pdf', "F");
$t->setAttachment('upload/raport_trans_'.date('d_m_Y').'.pdf');
$success = false;
$success= $t->sendEmail();
?>

View File

@@ -0,0 +1,89 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: Defines the English language pack for the base application.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
$mod_strings = array (
'LBL_ASSIGNED_DOCUMENT' => 'Assigned document',
'LBL_INVOICES' => 'Invoices',
'LBL_PAYMENT_DATE' => 'Payment Date',
'LBL_PARENT_ID' => 'Account',
'LBL_PARENT_NAME' => 'Account',
'LBL_ASSIGNED_TO_ID' => 'Assigned To',
'LBL_VALUE' => 'Value',
'LBL_MODULE_NAME' => 'Payments',
'LBL_MODULE_TITLE' => 'Payments: Home',
'LBL_MODULE_ID' => 'Payments',
'LBL_SEARCH_FORM_TITLE' => 'Payments Search',
'LBL_LIST_FORM_TITLE' => 'Payments List',
'LBL_NEW_FORM_TITLE' => 'New Payment',
'LBL_SUBJECT' => 'Subject:',
'LBL_ECMPAYMENT' => 'Payments:',
'LBL_CURRENCY_VALUE'=>'Currency value',
'LBL_CURRENCY'=>'Currency',
'LBL_ECMPAYMENT_SUBJECT' => 'Payment Subject:',
'LBL_LIST_SUBJECT' => 'Name',
'LBL_LIST_LAST_MODIFIED' => 'Last Modified',
'LNK_NEW_ECMPAYMENT' => 'Create Payment',
'LNK_ECMPAYMENT_LIST' => 'Payments',
'ERR_DELETE_RECORD' => 'You must specify a record number in order to delete the vat.',
'LBL_LIST_MY_ECMPAYMENTS' => 'My Assigned Payments',
'LBL_CREATED_BY' => 'Created by:',
'LBL_DATE_CREATED' => 'Create Date:',
'LBL_MODIFIED_BY' => 'Last Modified by:',
'LBL_DATE_LAST_MODIFIED' => 'Modify Date:',
'LBL_DEFAULT_SUBPANEL_TITLE' => 'Payments',
'LBL_SYSTEM_ID' => 'System ID',
'LBL_LIST_ASSIGNED_TO_NAME' => 'Assigned User',
'LBL_LIST_VALUE' => 'Value',
'LBL_TYPE' => 'Type',
'LBL_NAME_DO'=>'Document No',
'LBL_ASSIGNED_TO_NAME' => 'Assigned to',
);
?>

View File

@@ -0,0 +1,79 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: Defines the English language pack for the base application.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
$mod_strings = array (
'LBL_ASSIGNED_TO_ID' => 'Assigned To',
'LBL_VALUE' => 'Value',
'LBL_MODULE_NAME' => 'Vat',
'LBL_MODULE_TITLE' => 'Vat: Home',
'LBL_MODULE_ID' => 'Vat',
'LBL_SEARCH_FORM_TITLE' => 'Vat Search',
'LBL_LIST_FORM_TITLE' => 'Vat List',
'LBL_NEW_FORM_TITLE' => 'New Vat',
'LBL_SUBJECT' => 'Subject:',
'LBL_ECMPAYMENT' => 'Vat:',
'LBL_ECMPAYMENT_SUBJECT' => 'Vat Subject:',
'LBL_LIST_SUBJECT' => 'Name',
'LBL_LIST_LAST_MODIFIED' => 'Last Modified',
'LNK_NEW_ECMPAYMENT' => 'Create Vat',
'LNK_ECMPAYMENT_LIST' => 'Vat',
'ERR_DELETE_RECORD' => 'You must specify a record number in order to delete the vat.',
'LBL_LIST_MY_ECMPAYMENTS' => 'My Assigned Vat',
'LBL_CREATED_BY' => 'Created by:',
'LBL_DATE_CREATED' => 'Create Date:',
'LBL_MODIFIED_BY' => 'Last Modified by:',
'LBL_DATE_LAST_MODIFIED' => 'Modify Date:',
'LBL_DEFAULT_SUBPANEL_TITLE' => 'Vat',
'LBL_SYSTEM_ID' => 'System ID',
'LBL_LIST_ASSIGNED_TO_NAME' => 'Assigned User',
'LBL_LIST_VALUE' => 'Value',
'LBL_ASSIGNED_TO_NAME' => 'Assigned to',
);
?>

View File

@@ -0,0 +1,89 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: Defines the English language pack for the base application.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
$mod_strings = array (
'LBL_ASSIGNED_DOCUMENT' => 'Powiązany dokument',
'LBL_INVOICES' => 'Faktury',
'LBL_PAYMENT_DATE' => 'Data / Termin zapłaty',
'LBL_REGISTER_DATE' => 'Data dokumentu',
'LBL_PARENT_ID' => 'Kontrahent',
'LBL_PARENT_NAME' => 'Kontrahent',
'LBL_ASSIGNED_TO_ID' => 'Przypisane Do',
'LBL_VALUE' => 'Wartość',
'LBL_MODULE_NAME' => 'Transakcje',
'LBL_MODULE_TITLE' => 'Transakcje: Strona Główna',
'LBL_MODULE_ID' => 'Transakcje',
'LBL_SEARCH_FORM_TITLE' => 'Płatności Wyszukiwanie',
'LBL_LIST_FORM_TITLE' => 'Lista Stawek Vat',
'LBL_NEW_FORM_TITLE' => 'Nowa Płatność',
'LBL_SUBJECT' => 'Tytuł:',
'LBL_ECMPAYMENT' => 'Płatność:',
'LBL_ECMPAYMENT_SUBJECT' => 'Nazwa Płatności:',
'LBL_LIST_SUBJECT' => 'Nazwa',
'LBL_LIST_LAST_MODIFIED' => 'Ostatnia Modyfikacja',
'LNK_NEW_ECMPAYMENT' => 'Utwórz Płatność',
'LNK_ECMPAYMENT_LIST' => 'Płatności',
'ERR_DELETE_RECORD' => 'Podaj numer rekordu aby usunąć stawkę vat.',
'LBL_LIST_MY_ECMPAYMENTS' => 'Moje Przypisane Płatności',
'LBL_CURRENCY_VALUE'=>'Kurs waluty',
'LBL_CURRENCY'=>'Waluta',
'LBL_CREATED_BY' => 'Utworzone Przez:',
'LBL_DATE_CREATED' => 'Data Utworzenia:',
'LBL_MODIFIED_BY' => 'Ostatnio Modyfikowane Przez:',
'LBL_DATE_LAST_MODIFIED' => 'Data Modyfikacji:',
'LBL_REMOVE_RELATIONS' => 'Usuń powiązania',
'LBL_RELATED_TRANSACTIONS' => 'Powiązane transackcje',
'LBL_DEFAULT_SUBPANEL_TITLE' => 'Płatności',
'LBL_SYSTEM_ID' => 'System ID',
'LBL_LIST_ASSIGNED_TO_NAME' => 'Przypisany Użytkownik',
'LBL_LIST_VALUE' => 'Wartość',
'LBL_TYPE' => 'Typ',
'LBL_NAME_DO'=>'Nr dokumentu',
'LBL_ASSIGNED_TO_NAME' => 'Przypisane Do',
);
?>

View File

@@ -0,0 +1,44 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$searchFields['EcmTransactions'] =
array (
'name' => array( 'query_type'=>'default'),
'value' => array( 'query_type'=>'default'),
'current_user_only'=> array('query_type'=>'default','db_field'=>array('assigned_user_id'),'my_items'=>true),
'assigned_user_id'=> array('query_type'=>'default'),
);
?>

View File

@@ -0,0 +1,64 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
*********************************************************************************/
require_once('include/utils.php');
function additionalDetailsEcmTransaction($fields) {
static $mod_strings;
global $app_strings;
if(empty($mod_strings)) {
global $current_language;
$mod_strings = return_module_language($current_language, 'EcmTransactions');
}
$overlib_string = '';
if(!empty($fields['DATE_ENTERED']))
$overlib_string .= '<b>'. $app_strings['LBL_DATE_ENTERED'] . '</b> ' . $fields['DATE_ENTERED'] . '<br>';
if(!empty($fields['NAME']))
$overlib_string .= '<b>'. $mod_strings['LBL_NAME'] . '</b> ' . $fields['NAME'] . '<br>';
return array('fieldToAddTo' => 'NAME',
'string' => $overlib_string,
'editLink' => "index.php?action=EditView&module=EcmTransactions&return_module=EcmTransactions&record={$fields['ID']}",
'viewLink' => "index.php?action=DetailView&module=EcmTransactions&return_module=EcmTransactions&record={$fields['ID']}");
}
?>

View File

@@ -0,0 +1,108 @@
<?php
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$viewdefs ['EcmTransactions'] ['DetailView'] = array (
'templateMeta' => array (
'form' => array (
'buttons' => array (
array (
'customCode' => '{if $CAN_EDIT == true}<input type="hidden" id="can_delete" value="1"><input title="{$APP.LBL_EDIT_BUTTON_TITLE}" accessKey="{$APP.LBL_EDIT_BUTTON_KEY}" class="button" onclick="this.form.return_module.value=\'EcmTransactions\'; this.form.return_action.value=\'DetailView\'; this.form.return_id.value=\'{$id}\'; this.form.action.value=\'EditView\';" type="submit" name="Edit" id="edit_button" value="{$APP.LBL_EDIT_BUTTON_LABEL}"> {/if}'
),
array (
'customCode' => '{if $CAN_EDIT != true}<input type="hidden" id="can_delete" value="0"> <input title="{$APP.LBL_REMOVE_RELATIONS}" accessKey="{$MOD.LBL_REMOVE_RELATIONS}" class="button" onclick="this.form.return_module.value=\'EcmTransactions\'; this.form.return_action.value=\'DetailView\'; this.form.record.value=\'{$id}\'; this.form.action.value=\'RemoveRelations\';" type="submit" name="Edit" id="edit_button" value="{$MOD.LBL_REMOVE_RELATIONS}"> {/if}'
),
'DELETE',
)
),
'maxColumns' => '2',
'widths' => array (
array (
'label' => '10',
'field' => '30'
),
array (
'label' => '10',
'field' => '30'
)
)
),
'panels' => array (
array (
'parent_name',
'assigned_user_name'
),
array (
'name',
'type2'
),
array (
'register_date',
array (
'name' => 'currency_id',
'label' => 'LBL_CURRENCY'
),
),
array (
'payment_date',
'currency_value'
),
array (
'value'
),
array (
'description',
''
),
array (
'type',
array (
'customCode' => '{$ASSIGNED_DOCUMENT}',
'label' => 'LBL_ASSIGNED_DOCUMENT',
),
),
array (
array (
'customCode' => '{$RELATED_TRANSACTIONS}',
'label' => 'LBL_RELATED_TRANSACTIONS'
)
)
)
);
?>

View File

@@ -0,0 +1,130 @@
<?php
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$viewdefs['EcmTransactions']['EditView'] = array(
'templateMeta' => array(
'form' => array(
'buttons' => array(
array(
'customCode' => '<input tabindex="70" title="Zapisz [Alt+S]" accesskey="S" class="button primary" onclick="this.form.action.value=
\'Save\'; return check_form(\'EditView\');" type="submit" name="button" value="Zapisz">'
),
array(
'customCode' => '{$CANCEL}'
)
)
,
'hidden' => array(
'<input type="hidden" name="fromAccountPaymentStates" id="fromAccountPaymentStates" value="{$FROMACCOUNTPAYMENTSTATES}">',
'<input type="hidden" name="toRelVal" id="toRelVal" value="{$TORELVAL}">',
'<input type="hidden" name="toRelId" id="toRelId" value="{$TORELID}">',
'<script src="include/JSON.js?s=bed8cd35065048ceebdc639ebe305e2c&c=1"></script>',
'<script src="modules/EcmTransactions/js/EditView.js"></script>'
)
),
'maxColumns' => '2',
'widths' => array(
array(
'label' => '10',
'field' => '30'
),
array(
'label' => '10',
'field' => '30'
)
)
),
'panels' => array(
'default' => array(
array(
array(
'name' => 'parent_name',
'tabindex' => '10'
),
'assigned_user_name'
),
array(
array(
'name' => 'name',
'tabindex' => '20'
),
'type2'
),
array(
array(
'name' => 'register_date',
'tabindex' => '30'
),
'currency_value'
),
array(
array(
'name' => 'payment_date',
'tabindex' => '40'
),
array(
'name' => 'currency_id',
'label' => 'LBL_CURRENCY'
)
),
array(
array(
'name' => 'value',
'tabindex' => '50'
),
'type3'
),
array(
array(
'name' => 'description',
'tabindex' => '60'
),
),
array(
array(
'customCode' => '{$TYPESS}',
'label' => 'Strona'
)
)
)
)
);
?>

View File

@@ -0,0 +1,72 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/**
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
*/
$listViewDefs['EcmTransactions'] = array(
'NAME' => array(
'width' => '12',
'label' => 'LBL_LIST_SUBJECT',
'default' => true,
'link' => true),
'PARENT_NAME' => array(
'width' => '20',
'label' => 'LBL_PARENT_NAME',
'link' => true,
'id' => 'PARENT_ID',
'module' => 'Accounts',
'default' => true),
'VALUE' => array(
'width' => '10',
'label' => 'LBL_LIST_VALUE',
'align'=>'right',
'sumType' => 'sum',
'default' => true),
'REGISTER_DATE' => array(
'width' => '10',
'label' => 'LBL_REGISTER_DATE',
'default' => true),
'PAYMENT_DATE' => array(
'width' => '10',
'label' => 'LBL_PAYMENT_DATE',
'default' => true),
);
?>

View File

@@ -0,0 +1,51 @@
<?php
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*
* Created on Jun 1, 2007
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
$metafiles['EcmTransactions'] = array(
'detailviewdefs' => 'modules/EcmTransactions/metadata/detailviewdefs.php',
'editviewdefs' => 'modules/EcmTransactions/metadata/editviewdefs.php',
'listviewdefs' => 'modules/EcmTransactions/metadata/listviewdefs.php',
'searchdefs' => 'modules/EcmTransactions/metadata/searchdefs.php',
'popupdefs' => 'modules/EcmTransactions/metadata/popupdefs.php',
'searchfields' => 'modules/EcmTransactions/metadata/SearchFields.php',
);
?>

View File

@@ -0,0 +1,100 @@
<?php
if (! defined('sugarEntry') || ! sugarEntry)
die('Not A Valid Entry Point');
/**
* *******************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc.
* Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
* ******************************************************************************
*/
$popupMeta = array(
'moduleMain' => 'EcmTransaction',
'varName' => 'ECMPAYMENT',
'orderBy' => 'ecmtransactions.name',
'whereClause' => 'ecmtransactions.settled=0',
'listviewdefs' => array(
'NAME' => array(
'width' => '32',
'label' => 'LBL_LIST_SUBJECT',
'default' => true,
'link' => true
),
'VALUE' => array(
'width' => '10',
'label' => 'LBL_LIST_VALUE',
'align' => 'right',
'default' => true
),
'ASSIGNED_USER_NAME' => array(
'width' => '9',
'label' => 'LBL_LIST_ASSIGNED_USER',
'default' => true
)
),
'searchdefs' => array(
'name',
'value',
'type',
'parent_id' => array(
'name' => 'parent_id',
'label' => ''
),
'settled' => array(
'name' => 'settled',
'value'=>'0',
'label' => '',
),
'currency_id',
array(
'name' => 'assigned_user_id',
'type' => 'enum',
'label' => 'LBL_ASSIGNED_TO',
'function' => array(
'name' => 'get_user_array',
'params' => array(
false
)
)
)
)
);
echo '<script type="text/javascript"
src="include/jQuery/jquery-1.11.2.min.js"></script>';
echo '<script type="text/javascript"
src="modules/EcmTransactions/js/hidesearch.js"></script>';
?>

View File

@@ -0,0 +1,66 @@
<?php
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*
* Created on May 29, 2007
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
$searchdefs['EcmTransactions'] = array(
'templateMeta' => array(
'maxColumns' => '3',
'widths' => array('label' => '10', 'field' => '30'),
),
'layout' => array(
'basic_search' => array(
'name',
'parent_name',
'value',
'register_date',
'payment_date','type2','type',
array('name'=>'current_user_only', 'label'=>'LBL_CURRENT_USER_FILTER', 'type'=>'bool'),
),
'advanced_search' => array(
'name',
'parent_name',
'register_date',
'payment_date','type2','type',
'value',
array('name' => 'assigned_user_id', 'type' => 'enum', 'label' => 'LBL_ASSIGNED_TO', 'function' => array('name' => 'get_user_array', 'params' => array(false))),
),
),
);
?>

View File

@@ -0,0 +1,65 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/**
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
*/
$GLOBALS['studioDefs']['EcmTransactions'] = array(
'LBL_DETAILVIEW'=>array(
'template'=>'xtpl',
'template_file'=>'modules/EcmTransactions/DetailView.html',
'php_file'=>'modules/EcmTransactions/DetailView.php',
'type'=>'DetailView',
),
'LBL_EDITVIEW'=>array(
'template'=>'xtpl',
'template_file'=>'modules/EcmTransactions/EditView.html',
'php_file'=>'modules/EcmTransactions/EditView.php',
'type'=>'EditView',
),
'LBL_LISTVIEW'=>array(
'template'=>'listview',
'meta_file'=>'modules/EcmTransactions/listviewdefs.php',
'type'=>'ListView',
),
'LBL_SEARCHFORM'=>array(
'template'=>'xtpl',
'template_file'=>'modules/EcmTransactions/SearchForm.html',
'php_file'=>'modules/EcmTransactions/ListView.php',
'type'=>'SearchForm',
),
);

View File

@@ -0,0 +1,49 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/**
* Layout definition for EcmTransactions
*
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
*/
$layout_defs['EcmTransactions']['subpanel_setup'] = array(
'documents' => array(
'order' => 130,
'module' => 'Documents',
'subpanel_name' => 'default',
'get_subpanel_data' => 'documents',
'title_key' => 'Dokumenty',
),
);
?>

View File

@@ -0,0 +1,91 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/**
* Subpanel Layout definition for EcmTransactions
*
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
*/
$subpanel_layout = array(
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateButton'),
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'EcmTransactions'),
),
'where' => '',
'list_fields' => array(
'ecmtransaction_number'=>array(
'vname' => 'LBL_LIST_NUMBER',
'width' => '5%',
),
'name'=>array(
'vname' => 'LBL_LIST_SUBJECT',
'widget_class' => 'SubPanelDetailViewLink',
'width' => '50%',
),
'status'=>array(
'vname' => 'LBL_LIST_STATUS',
'width' => '15%',
),
'type'=>array(
'vname' => 'LBL_LIST_TYPE',
'width' => '15%',
),
'priority'=>array(
'vname' => 'LBL_LIST_PRIORITY',
'width' => '11%',
),
'assigned_user_name' => array (
'name' => 'assigned_user_name',
'vname' => 'LBL_LIST_ASSIGNED_TO_NAME',
),
'edit_button'=>array(
'widget_class' => 'SubPanelEditButton',
'module' => 'EcmTransactions',
'width' => '4%',
),
'remove_button'=>array(
'widget_class' => 'SubPanelRemoveButton',
'module' => 'EcmTransactions',
'width' => '5%',
),
),
);
?>

View File

@@ -0,0 +1,260 @@
<?php
/*
* author: Michał Zieliński, mz@bim-it.pl
* created: 2015-09-10
* last modified date: 2015-09-15 by MZ
*/
$process = "0";
if ($_REQUEST['process'])
$process = $_REQUEST['process'];
$ss = new Sugar_Smarty();
//show options
if ($process == "0") {
$si = new EcmSysInfo();
$ss->assign("BANKS",$si->getBanks());
$ss->assign("CUR", $app_list_strings['currency_dom']);
$ss->assign("DATE", date("d.m.Y"));
$ss->display ( 'modules/EcmTransactions/tpls/importBankStatement/options.tpl' );
return;
}
//read
if ($process == "1") {
if ($_FILES['file']['error'] == '0') {
//statement name
$si = new EcmSysInfo();
foreach ($si->getBanks() as $k=>$v)
if ($v['ID'] == $_REQUEST['bank']) $b = $v['NAMESHORT'];
$statement_name = $b.' - '.$_REQUEST['statement_date'];
$data = readCSV($_FILES['file']['tmp_name'], $_REQUEST['bank'], $statement_name);
$ss->assign("DATA", $data);
$ss->assign("STATEMENT_NAME", $statement_name);
$ss->assign("STATEMENT_DATE", $_REQUEST['statement_date']);
$ss->display('modules/EcmTransactions/tpls/importBankStatement/list.tpl');
} else {
die('Błąd odczytu pliku - czy plik został wybrany?');
}
}
//save
if ($process == "2") {
$data = json_decode(base64_decode($_REQUEST['transactions_data']));
$ids = array(); //array with new transactions ids
foreach ($data as $t) {
//warning! $t is stdObject NOT ARRAY
//firstly try to save bank account
if ($t->account_id!="")
saveBankAccount($t->account_id, $t->account);
//next save transaction
$ids[] = saveTransaction($t, $_REQUEST['statement_name'], $_REQUEST['statement_date']);
}
$ss->assign('DATA', $ids);
$ss->display('modules/EcmTransactions/tpls/importBankStatement/afterSave.tpl');
}
function saveTransaction($data, $statement_name, $statement_date) {
global $current_user;
$t = new EcmTransaction ();
$t->name = $statement_name;
$t->created_by = $current_user->id;
$t->deleted = 0;
$t->assigned_user_id = $current_user->id;
if ($data->account_id != "") {
$a = new Account();
$a->retrieve($data->account_id);
$t->parent_name = $a->name;
$t->type2='2';
$p_name = $a->name;
$t->parent_id = $a->id;
unset($a);
}
$t->type = 1;
$t->type2 = 1;
$t->type3='2';
$t->payment_date = $data->date;
$t->register_date = $statement_date;
$t->currency_id = 'PLN';
$t->value = unformat_number($data->value);
if ($data->desc && $data->desc!=""){
$t->description = $data->desc;
$t->name = "PKO - ".$t->description;
}
$id = $t->save (true);
return array('id' => $id, 'name' => $statement_name, 'value' => $data->value, 'account_id'=>$data->account_id, 'account_name'=>$p_name);
}
function saveBankAccount($account_id, $account) {
$db = $GLOBALS['db'];
$acc_res = $db->query("
SELECT ab.account_id, a.name FROM account_banks AS ab
INNER JOIN accounts AS a
ON a.id=ab.account_id
WHERE a.deleted='0' AND TRIM(REPLACE(ab.account, ' ', '')) = '".trim(str_replace(" ", "", $account))."'");
if ($acc_res->num_rows == 0) {
//save
global $current_user;
$db->query("INSERT INTO account_banks VALUES ('".create_guid()."','".date('Y-m-d H:m:s')."','".$current_user->id."', '$account', '', 'Utworzone podczas importu transakcji', '0', '$account_id' )");
}
}
function readCSV($filename, $bank, $statement_name) {
$fp = fopen($filename, 'rb');
$fp2 = fopen('logi.txt', 'a');
$data = array();
$format = getFormats($bank);
if (!is_array($format))
die('Brak określonego formatu pliku dla wybranego banku');
$sum = 0;
$i=0;
global $timedate;
while ( ($line = fgets($fp)) !== false) {
fwrite($fp2,$line);
$i++;
if ($format['startLine'] && $i < $format['startLine'])
continue;
if ($format['charset'])
$line = iconv($format['charset'],"UTF-8",$line);
$l = explode($format['delimiter'], $line);
$tmp = array();
if (isset($format['account'])) {
$tmp['account'] = str_replace("Nazwa nadawcy: ","",$l[$format['account']]);
$tmp['account'] = preg_replace("/[^0-9]/", "", $tmp['account']);
} else
die('Niepoprawnie zdefiniowany format wyciągu');
if (isset($format['date'])) {
$date = $l[$format['date']];
if ($format['fieldSorrounder'])
$date = str_replace($format['fieldSorrounder'], "", $date);
$date = implode(".",array_reverse(explode("-",$date)));
$tmp['date'] = $date;
} else die('Niepoprawnie zdefiniowany format wyciągu');
if (isset($format['value'])) {
$value = $l[$format['value']];
if ($format['fieldSorrounder'])
$value = str_replace($format['fieldSorrounder'], "", $value);
if ($format['number_delimiter']!='.')
$value=str_replace($format['number_delimiter'], '.', $value);
$sum+=$value;
if($value>0){
$side='1';
} else {
$side='0';
}
$tmp['value'] = format_number($value);
} else die('Niepoprawnie zdefiniowany format wyciągu');
if (isset($format['desc'])) {
$tmp['desc'] = $l[$format['desc']];
if ($format['fieldSorrounder'])
$tmp['desc'] = str_replace($format['fieldSorrounder'], "", $tmp['desc']);
if (isset($format['desc_trim']))
$tmp['desc'] = str_replace($format['desc_trim'], "", $tmp['desc']);
}
if (isset($format['desc_trim'])){
$desc = searchTitle($format['desc_trim'], $l);
$tmp['desc'] = $desc;
}
//try get account
$db = $GLOBALS['db'];
$acc_res = $db->query("
SELECT ab.account_id, a.name FROM account_banks AS ab
INNER JOIN accounts AS a
ON a.id=ab.account_id
WHERE a.deleted='0' AND ab.deleted='0' AND TRIM(REPLACE(ab.account, ' ', '')) = '".trim(str_replace(" ", "", $tmp['account']))."'");
if ($acc_res->num_rows == 1) {
$acc = $db->fetchByAssoc($acc_res);
$tmp['account_found'] = "1";
$tmp['account_name'] = $acc['name'];
$tmp['account_id'] = $acc['account_id'];
} else {
$tmp['account_found'] = "0";
$tmp['account_id'] = "";
if (isset($format['payer'])) {
$tmp['payer'] = $l[$format['payer']];
if (isset($format['payer_trim']))
$tmp['payer'] = str_replace($format['payer_trim'], "", $tmp['payer']);
}
}
$date_unformated= implode("-", array_reverse(explode(".", $date)));
//check if transaction could exists
$query = "SELECT * FROM ecmtransactions WHERE payment_date='".$date_unformated."'
AND value='".unformat_number($tmp['value'])."'
AND deleted='0' and type='$side'";
if ($tmp['account_found'] == "1")
$query.=" AND parent_id='".$tmp['account_id']."'";
$trans_res = $db->query($query);
if ($trans_res->num_rows > 0) {
$tmp['transaction_exists'] = "1";
$tmp['transactions'] = array();
while ($trans_row = $db->fetchByAssoc($trans_res)) {
$tmp2 = array();
$tmp2['id'] = $trans_row['id'];
$tmp2['desc'] = $trans_row['name'].'&nbsp;&nbsp&nbsp'.format_number($trans_row['value']);
$tmp['transactions'][] = $tmp2;
}
}
$tmp['uniqID']=uniqid();
$data[] = $tmp;
}
//add sum row
$tmp = array();
$tmp['sum'] = "1";
$tmp['sum_val'] = format_number($sum);
$data[] = $tmp;
fclose($fp2);
return $data;
}
function searchTitle($what,$elements){
if(count($elements)>0){
foreach ($elements as $key=>$val){
$pos = strpos($val, $what);
if($pos!==false){
$return=str_replace('"', "", $val);
$return=str_replace($what, "", $return);
return $return;
}
}
} else {
return false;
}
}
function getFormats($bank) {
//banks file format settings
$formats = array();
//Reifaisen
$formats['20'] = array (
'delimiter' => '","',
'startLine' => 2,
'fieldSorrounder' => '"',
'number_delimiter' => '.',
'account' => 6,
'value' => 3,
'date' => 0,
'desc' => 14,
'payer' => 7,
'payer_trim' => 'Dane adr. rach. przeciwst.: ',
'desc_trim' => 'Tytuł: ',
'charset' => 'ISO-8859-2',
);
return $formats[$bank];
}

View File

View File

@@ -0,0 +1,39 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
if(isset($_REQUEST['record']) && $_REQUEST['record'] != '') {
global $sugar_version, $sugar_config, $current_user, $app_strings, $mod_strings;
if(!isset($focus)) {
require_once('modules/EcmTransactions/EcmTransaction.php');
$focus = new EcmTransaction();
$focus->retrieve($_REQUEST['record']);
$focus->format_all_fields();
}
require_once('include/SubPanel/SubPanelTiles.php');
$subpanel = new SubPanelTiles($focus, "EcmTransactions");
echo $subpanel->display();
}
?>

View File

@@ -0,0 +1,66 @@
<?php
$d="3551/10 371,21
3552/10 1207,23
3553/10 1092,37
3560/10 1745,96
3571/10 557,87
3572/10 2911,19
3574/10 339,8
3575/10 1081,52
3577/10 372,14
3581/10 363,37
3582/10 622,65
3583/10 1012,1
3584/10 663,4
3585/10 361,26
3587/10 952,9
3596/10 893,54
3598/10 558,6
3604/10 456,62
3605/10 1343,44
3614/10 2529,62
3615/10 5634,4
3616/10 3273,71
3620/10 2086,01
3666/10 865,04
3667/10 766,68
3685/10 1297,68
3687/10 1737,53
3688/10 1258,01
FK1008/10 -174,95
FK802/10 -1327,37
3546/10 684,4
3550/10 778,69
3555/10 991,33
3556/10 514,06
3561/10 1149,26
3562/10 1110,45
3603/10 430,3
3610/10 640,52
3612/10 242,09";
/*$d="865/10 -124,93 103,87
878/10 -1,46 3,9
877/10 -149,82 -95,78
207/10 -409,35 -409,36
295/10 -116,2 5,46
867/10 -19,34 27,98
872/10 -8,05 95,79
871/10 -32,99 -3,25
864/10 -119,99 -76,71
873/10 -6,77 22,07
876/10 -64,78 -2,48
875/10 -199,96 -127,84
870/10 -3,66 9,76
869/10 -60,51 47,55
868/10 -74,91 60,17
863/10 -35,99 41,89
874/10 -234,24 47,36";*/
$dd=explode("
",$d);
for($i=0;$i<count($dd);$i++){
$e=explode(" ",$dd[$i]);
if(eregi("FK",$e[0]))$no="FVKOR ".str_replace("FK","",$e[0]);
else $no="FV ".$e[0];
echo "update ecmtransactions_ecminvoiceouts set total=".(float)str_replace(",",".",$e[1])." where document_no like '".$no."';<br>";
}
?>

View File

@@ -0,0 +1,262 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$dictionary['EcmTransaction']=array(
'table'=>'ecmtransactions',
'audited'=>false,
'comment'=>'EcmTransactions',
'duplicate_merge'=>true ,
'unified_search'=>true,
'fields'=>array(
'name'=>array(
'name'=>'name',
'vname'=>'LBL_NAME_DO',
'type'=>'varchar',
'len'=>'255',
'required' => true,
),
'description'=>array(
'name'=>'description',
'vname'=>'LBL_DESCRIPTION',
'type'=>'text',
),
'value'=>array(
'name'=>'value',
'vname'=>'LBL_VALUE',
'type' => 'decimal',
'len' => '15,2',
'required' => true,
),
'documents' => array (
'name' => 'documents',
'type' => 'link',
'relationship' => 'transactions_documents',
'source' => 'non-db',
'vname' => 'LBL_NOTES'
),
'parent_name' => array(
'name'=> 'parent_name',
'id_name'=>'parent_id',
'vname'=>'LBL_PARENT_NAME',
'type'=>'relate',
'group'=>'parent_name',
'dbtype' => 'varchar',
'size' => '30',
'width'=>'30',
'len' => '255',
'module' => 'Accounts',
'massupdate' => false,
'required' => true,
),
'currency_id' => array (
'name' => 'currency_id',
'type' => 'enum',
'options' => 'currency_dom',
'label' => 'LBL_CURRENCY'
),
'currency_value' => array (
'name' => 'currency_value',
'type'=>'decimal',
'len'=>'15,2',
'vname' => 'LBL_CURRENCY_VALUE',
'reportable' => false,
'required' => false
),
'parent_index' => array(
'name'=> 'parent_index',
'id_name'=>'parent_id',
'vname'=>'LBL_PARENT_NAME',
'type'=>'relate',
'group'=>'parent_index',
'dbtype' => 'varchar',
'size' => '30',
'width'=>'30',
'len' => '255',
'module' => 'Accounts',
'massupdate' => false,
'required' => false,
),
'type' => array (
'name' => 'type',
'vname' => 'Strona',
'type' => 'enum',
'options' => 'transaction_type_dom',
'size' => '3',
),
'type2' => array (
'name' => 'type2',
'vname' => 'Kategoria',
'type' => 'enum',
'options' => 'transaction_type2_dom',
'size' => '3',
),
'type3' => array (
'name' => 'type3',
'vname' => 'Typ',
'type' => 'enum',
'options' => 'transaction_type3_dom',
'size' => '2',
'default'=>2,
'noeditable'=>true,
),
'record_type' => array (
'name' => 'record_type',
'vname' => 'LBL_TYPE',
'type' => 'enum',
'options' => 'record_t_type_dom',
'size' => '3',
),
'record_id' => array (
'name' => 'record_id',
'vname' => 'LBL_TYPE',
'type' => 'varchar',
),
'paid' => array (
'name' => 'paid',
'vname' => 'LBL_PAID',
'type' => 'bool',
),
'settled' => array (
'name' => 'settled',
'vname' => 'LBL_PAID',
'type' => 'varchar',
),
'parent_id' => array (
'name' => 'parent_id',
'type' => 'id',
'module' => 'Accounts',
'vname' => 'LBL_PARENT_ID',
'group'=>'parent_name',
'massupdate' => false,
'reportable'=>false,
'required' => true,
),
'payment_date' => array (
'name' => 'payment_date',
'vname' => 'LBL_PAYMENT_DATE',
'type' => 'date',
'reportable' => false,
'showFormats' => true,
'massupdate' => false,
'required' => true,
),
'register_date' => array (
'name' => 'register_date',
'vname' => 'LBL_REGISTER_DATE',
'type' => 'date',
'reportable' => false,
'showFormats' => true,
'massupdate' => false,
'required' => true,
),
'notes' => array (
'name' => 'notes',
'type' => 'link',
'relationship' => 'ecmtransactions_notes',
'source'=>'non-db',
'vname'=>'LBL_NOTES'
),
),
'indices'=>array(
array('name'=>'idx_ecmtransaction_id_del','type'=>'index','fields'=>array('id','deleted')),
array('name'=>'idx_ecmtransaction_assigned_del','type'=>'index','fields'=>array( 'deleted', 'assigned_user_id')),
),
'relationships'=>array(
'ecmtransactions_assigned_user'=>array(
'lhs_module'=>'Users',
'lhs_table'=>'users',
'lhs_key'=>'id',
'rhs_module'=>'EcmTransactions',
'rhs_table'=>'ecmtransactions',
'rhs_key'=>'assigned_user_id',
'relationship_type'=>'one-to-many'
),
'ecmtransactions_notes' => array (
'lhs_module' => 'EcmTransactions',
'lhs_table' => 'ecmtransactions',
'lhs_key' => 'id',
'rhs_module' => 'Notes',
'rhs_table' => 'notes',
'rhs_key' => 'parent_id',
'relationship_type' => 'one-to-many',
'relationship_role_column' => 'parent_type',
'relationship_role_column_value' => 'EcmTransactions'
),
'ecmtransactions_modified_user'=>array(
'lhs_module'=>'Users',
'lhs_table'=>'users',
'lhs_key'=>'id',
'rhs_module'=>'EcmTransactions',
'rhs_table'=>'ecmtransactions',
'rhs_key'=>'modified_user_id',
'relationship_type'=>'one-to-many'
),
'transactions_documents' => array (
'lhs_module' => 'EcmTransactions',
'lhs_table' => 'ecmtransactions',
'lhs_key' => 'id',
'rhs_module' => 'Documents',
'rhs_table' => 'documents',
'rhs_key' => 'parent_id',
'relationship_type' => 'one-to-many',
'relationship_role_column' => 'parent_type',
'relationship_role_column_value' => 'EcmTransactions'
),
'ecmtransactions_created_by'=>array(
'lhs_module'=>'Users',
'lhs_table'=>'users',
'lhs_key'=>'id',
'rhs_module'=>'EcmTransactions',
'rhs_table'=>'ecmtransactions',
'rhs_key'=>'created_by',
'relationship_type'=>'one-to-many'
),
),
'optimistic_locking'=>true,
);
require_once('include/SugarObjects/VardefManager.php');
VardefManager::createVardef('EcmTransactions','EcmTransaction', array('default','assignable'));
?>

View File

@@ -0,0 +1,95 @@
<?php
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
* *******************************************************************************/
/*
* Created on Apr 13, 2007
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
require_once('include/DetailView/DetailView2.php');
class ViewDetailMy extends SugarView{
var $type ='detail';
var $dv;
var $tplFile = 'include/DetailView/DetailView.tpl';
function ViewDetailMy(){
$this->options['show_subpanels'] = true;
parent::SugarView();
}
function preDisplay(){
$metadataFile = null;
$foundViewDefs = false;
if(file_exists('custom/modules/' . $this->module . '/metadata/detailviewdefs.php')){
$metadataFile = 'custom/modules/' . $this->module . '/metadata/detailviewdefs.php';
$foundViewDefs = true;
}else{
if(file_exists('custom/modules/'.$this->module.'/metadata/metafiles.php')){
require_once('custom/modules/'.$this->module.'/metadata/metafiles.php');
if(!empty($metafiles[$this->module]['detailviewdefs'])){
$metadataFile = $metafiles[$this->module]['detailviewdefs'];
$foundViewDefs = true;
}
}elseif(file_exists('modules/'.$this->module.'/metadata/metafiles.php')){
require_once('modules/'.$this->module.'/metadata/metafiles.php');
if(!empty($metafiles[$this->module]['detailviewdefs'])){
$metadataFile = $metafiles[$this->module]['detailviewdefs'];
$foundViewDefs = true;
}
}
}
$GLOBALS['log']->debug("metadatafile=". $metadataFile);
if(!$foundViewDefs && file_exists('modules/'.$this->module.'/metadata/detailviewdefs.php')){
$metadataFile = 'modules/'.$this->module.'/metadata/detailviewdefs.php';
}
$this->dv = new DetailView2();
$this->dv->ss =& $this->ss;
$this->dv->setup($this->module, $this->bean, $metadataFile, $this->tplFile);
}
function display(){
if(empty($this->bean->id)){
global $app_strings;
sugar_die($app_strings['ERROR_NO_RECORD']);
}
$this->dv->process();
echo $this->dv->display();
}
}

View File

@@ -0,0 +1,79 @@
<?php
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
* *******************************************************************************/
/*
* Created on Apr 13, 2007
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
require_once('include/EditView/EditView2.php');
class ViewEditMy extends SugarView{
var $ev;
var $type ='edit';
var $useForSubpanel = false; //boolean variable to determine whether view can be used for subpanel creates
var $showTitle = true;
var $tplFile = 'include/EditView/EditView.tpl';
function ViewEditMy(){
parent::SugarView();
}
function preDisplay(){
$metadataFile = null;
$foundViewDefs = false;
if(file_exists('custom/modules/' . $this->module . '/metadata/editviewdefs.php')){
$metadataFile = 'custom/modules/' . $this->module . '/metadata/editviewdefs.php';
$foundViewDefs = true;
}
$GLOBALS['log']->debug("metadatafile=". $metadataFile);
if(!$foundViewDefs && file_exists('modules/'.$this->module.'/metadata/editviewdefs.php')){
$metadataFile = 'modules/'.$this->module.'/metadata/editviewdefs.php';
}
$this->ev = new EditView();
$this->ev->ss =& $this->ss;
$this->ev->setup($this->module, $this->bean, $metadataFile, $this->tplFile);
}
function display(){
$this->ev->process();
echo $this->ev->display($this->showTitle);
}
}
?>