init
This commit is contained in:
@@ -0,0 +1,117 @@
|
||||
<?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 $current_user;
|
||||
|
||||
$dashletData['MyEcmReturnsDashlet']['searchFields'] = array('name' => array('default' => ''),
|
||||
'date_entered' => array('default' => ''),
|
||||
'status' => array('default' => ''),
|
||||
'assigned_user_id' => array('type' => 'assigned_user_name',
|
||||
'default' => $current_user->name));
|
||||
$dashletData['MyEcmReturnsDashlet']['columns'] = array(
|
||||
'STATUS' => array(
|
||||
'width' => '1',
|
||||
'label' => ' ',
|
||||
'default' => true,
|
||||
),
|
||||
'DOCUMENT_NO' => array(
|
||||
'width' => '8',
|
||||
'label' => 'LBL_DOCUMENT_NO',
|
||||
'sortable' => true,
|
||||
'link' => true,
|
||||
'default' => true,
|
||||
),
|
||||
'NAME' => array(
|
||||
'width' => '15',
|
||||
'label' => 'LBL_NAME',
|
||||
'sortable' => true,
|
||||
'link' => false,
|
||||
//'customCode' => '<a href="index.php?module=EcmReturns&action=EditView&record={$ID}">{$NAME}</a>',
|
||||
'default' => true,
|
||||
),
|
||||
'REGISTER_DATE'=>array(
|
||||
'width'=>15,
|
||||
'label'=>'LBL_REGISTER_DATE',
|
||||
'default'=>true,
|
||||
'sortable'=>true,
|
||||
),
|
||||
'PARENT_ID'=>array(
|
||||
'width'=>0,
|
||||
'label'=>' ',
|
||||
'customCode'=>' ',
|
||||
'default'=>true,
|
||||
'sortable'=>false,
|
||||
),
|
||||
'PARENT_NAME' => array(
|
||||
'width' => '15',
|
||||
'label' => 'LBL_PARENT_NAME',
|
||||
'default' => true,
|
||||
'id'=>'PARENT_ID',
|
||||
'module'=>'Accounts',
|
||||
'link'=>true,
|
||||
),
|
||||
'TOTAL' => array(
|
||||
'width' => '10',
|
||||
'label' => 'LBL_TOTAL',
|
||||
'default' => true,
|
||||
'align' => 'left',
|
||||
),
|
||||
|
||||
'ASSIGNED_USER_NAME' => array(
|
||||
'width' => '10',
|
||||
'label' => 'LBL_LIST_ASSIGNED_USER',
|
||||
'default' => true
|
||||
),
|
||||
'OPTIONS' => array(
|
||||
'width' => '5',
|
||||
'label' => ' ',
|
||||
'link' => false,
|
||||
'default' => true,
|
||||
'sortable' => false,
|
||||
'align' => 'right',
|
||||
),
|
||||
|
||||
'date_entered' => array('width' => '15',
|
||||
'label' => 'LBL_DATE_ENTERED'),
|
||||
|
||||
|
||||
);
|
||||
|
||||
k
|
||||
?>
|
||||
@@ -0,0 +1,47 @@
|
||||
<?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['MyEcmReturnsDashlet'] = array('module' => 'EcmReturns',
|
||||
'title' => translate('LBL_DASHLET_MY_ECMQUOTES', 'EcmReturns'),
|
||||
'description' => 'A customizable view into Quotes',
|
||||
'category' => 'Module Views',
|
||||
'hidden' => true);
|
||||
?>
|
||||
@@ -0,0 +1,61 @@
|
||||
<?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/Dashlets/DashletGeneric.php');
|
||||
require_once('modules/EcmReturns/EcmReturn.php');
|
||||
|
||||
class MyEcmReturnsDashlet extends DashletGeneric {
|
||||
function MyEcmReturnsDashlet($id, $def = null) {
|
||||
global $current_user, $app_strings;
|
||||
require('modules/EcmReturns/Dashlets/MyEcmReturnsDashlet/MyEcmReturnsDashlet.data.php');
|
||||
|
||||
parent::DashletGeneric($id, $def);
|
||||
|
||||
if(empty($def['title'])) $this->title = translate('LBL_DASHLET_MY_ECMQUOTES', 'EcmReturns');
|
||||
|
||||
$this->searchFields = $dashletData['MyEcmReturnsDashlet']['searchFields'];
|
||||
$this->columns = $dashletData['MyEcmReturnsDashlet']['columns'];
|
||||
|
||||
$this->seedBean = new EcmReturn();
|
||||
$this->lvs->quickViewLinks = false;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
81
modules/EcmReturns/DetailView.php
Normal file
81
modules/EcmReturns/DetailView.php
Normal file
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
if (! defined ( 'sugarEntry' ) || ! sugarEntry)
|
||||
die ( 'Not A Valid Entry Point' );
|
||||
|
||||
global $sugar_version, $sugar_config, $current_user, $app_strings, $mod_strings;
|
||||
|
||||
require_once ('modules/EcmReturns/EcmReturn.php');
|
||||
|
||||
|
||||
require_once ('include/time.php');
|
||||
|
||||
require_once ('include/json_config.php');
|
||||
|
||||
//add jquery
|
||||
echo '<link rel="stylesheet" type="text/css" href="include/jQuery/jquery-table/jquery.appendGrid-1.3.1.css"/>';
|
||||
echo '<link rel="stylesheet" type="text/css" href="include/jQuery/jquery-ui/themes/base/jquery-ui.css"/>';
|
||||
echo '<script type="text/javascript"
|
||||
src="include/jQuery/jquery-2.1.0.min.js"></script>';
|
||||
echo '<script type="text/javascript"
|
||||
src="include/jQuery/jquery-table/jquery.appendGrid-1.3.1.js"></script>';
|
||||
echo '<script type="text/javascript"
|
||||
src="include/jQuery/jquery-ui/ui/jquery-ui.js"></script>';
|
||||
|
||||
$json_config = new json_config ();
|
||||
|
||||
$focus = new EcmReturn ();
|
||||
|
||||
if (isset ( $_REQUEST ['record'] )) {
|
||||
$focus->retrieve ( $_REQUEST ['record'] );
|
||||
$focus->format_all_fields ();
|
||||
$OPT ['status'] = $focus->status;
|
||||
}
|
||||
|
||||
require_once ('include/MVC/View/SugarView.php');
|
||||
|
||||
require_once ('modules/EcmReturns/views/DetailView/view.detail.my.php');
|
||||
|
||||
//create position list table
|
||||
$pl = $focus->getPositionList();
|
||||
|
||||
$edit = new ViewDetailMy ();
|
||||
$edit->ss = new Sugar_Smarty ();
|
||||
$edit->module = 'EcmReturns';
|
||||
|
||||
|
||||
$can_edit = false;
|
||||
global $current_user;
|
||||
if ($focus->assigned_user_id == $current_user->id || is_admin($current_user))
|
||||
$can_edit = true;
|
||||
$edit->ss->assign("CAN_EDIT", $can_edit);
|
||||
|
||||
$edit->ss->assign("CREATED_BY_NAME", $focus->created_by_name);
|
||||
$edit->ss->assign("MODIFIED_BY_NAME", $focus->modified_by_name);
|
||||
|
||||
$edit->bean = $focus;
|
||||
$edit->tplFile = 'include/ECM/EcmViews/DetailView/Tabs/DetailView.tpl';
|
||||
|
||||
$edit->preDisplay ();
|
||||
|
||||
//check number
|
||||
$db = $GLOBALS['db'];
|
||||
|
||||
$res = $db->query("SELECT id FROM ecmreturns WHERE document_no='$focus->document_no'");
|
||||
if ($res->num_rows > 1) {
|
||||
echo '<h1 style="color: red;">Błąd numeracji, skontaktuj się z administratorem! Nie drukuj/publikuj dokumentu!</h1>';
|
||||
}
|
||||
$can_mk = false;
|
||||
$r = $db->fetchByAssoc($db->query("SELECT correct_id FROM ecmreturns WHERE id='".$focus->id."'"));
|
||||
if($r['correct_id']==''){
|
||||
$can_mk = true;
|
||||
}
|
||||
$edit->ss->assign("CREATE_CR", $can_mk);
|
||||
|
||||
echo $edit->display ();
|
||||
|
||||
require_once ('include/SubPanel/SubPanelTiles.php');
|
||||
$subpanel = new SubPanelTiles ( $focus, 'EcmReturns' );
|
||||
echo $subpanel->display ();
|
||||
//loading view
|
||||
echo '<link rel="stylesheet" type="text/css" href="modules/EcmReturns/javascript/helper.css" media="screen" /><div class="loading_panel"></div>';
|
||||
?>
|
||||
899
modules/EcmReturns/EcmReturn.php
Normal file
899
modules/EcmReturns/EcmReturn.php
Normal file
@@ -0,0 +1,899 @@
|
||||
<?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 ('data/SugarBean.php');
|
||||
require_once ('include/utils.php');
|
||||
class EcmReturn extends SugarBean {
|
||||
var $field_name_map = array ();
|
||||
// STANDARD FIELDS
|
||||
var $id;
|
||||
var $date_entered;
|
||||
var $date_modified;
|
||||
var $modified_user_id;
|
||||
var $assigned_user_id;
|
||||
var $name;
|
||||
var $description;
|
||||
// TABLE COLUMNS
|
||||
var $number;
|
||||
var $document_no;
|
||||
var $parent_type;
|
||||
var $parent_name;
|
||||
var $parent_id;
|
||||
var $type;
|
||||
var $status;
|
||||
var $register_date;
|
||||
var $parent_address_street;
|
||||
var $parent_address_city;
|
||||
var $parent_address_postalcode;
|
||||
var $parent_address_country;
|
||||
var $total_netto;
|
||||
var $total;
|
||||
var $discount;
|
||||
var $to_vatid;
|
||||
var $ecmlanguage;
|
||||
var $to_is_vat_free;
|
||||
var $header_text;
|
||||
var $footer_text;
|
||||
var $ads_text;
|
||||
var $template_id;
|
||||
var $template_name;
|
||||
var $email_id;
|
||||
var $parent_name_copy;
|
||||
var $parent_contact_name;
|
||||
var $parent_contact_title;
|
||||
var $ecmpaymentcondition_id;
|
||||
var $ecmpaymentcondition_name;
|
||||
var $ecmpaymentcondition_text;
|
||||
var $ecmdeliverycondition_id;
|
||||
var $ecmdeliverycondition_name;
|
||||
var $ecmdeliverycondition_text;
|
||||
var $validtill_date;
|
||||
var $order_origin;
|
||||
var $contact_id;
|
||||
var $contact_name;
|
||||
var $show_images_on_offers;
|
||||
var $currency_symbol;
|
||||
var $currency_id;
|
||||
var $show_ean;
|
||||
var $template;
|
||||
var $pdf;
|
||||
var $position_list;
|
||||
var $parser;
|
||||
var $account;
|
||||
var $contact;
|
||||
var $user;
|
||||
var $mfp;
|
||||
// added 4.03.2009
|
||||
var $pricebook_id;
|
||||
var $show_recipient_code;
|
||||
// RELATED FIELDS
|
||||
var $created_by;
|
||||
var $created_by_name;
|
||||
var $modified_by_name;
|
||||
var $assigned_user_name;
|
||||
// SUBPANELS RELATED
|
||||
// MODULE OBJECT DETAILS
|
||||
var $module_dir = "EcmReturns";
|
||||
var $table_name = "ecmreturns";
|
||||
var $object_name = "EcmReturn";
|
||||
// RELATED TABLE NAMES
|
||||
// USED TO RETRIEVE RELATED FIELDS FROM FORM POSTS.
|
||||
var $additional_column_fields = Array (
|
||||
'assigned_user_name',
|
||||
'assigned_user_id',
|
||||
'modified_user_id',
|
||||
'created_by'
|
||||
);
|
||||
// RELATIONSHIP FIELDS
|
||||
var $relationship_fields = Array (
|
||||
'note_id' => 'notes',
|
||||
'email_id' => 'emails'
|
||||
// 'account_id' => 'account',
|
||||
// 'contact_id' => 'contact',
|
||||
);
|
||||
function EcmReturn() {
|
||||
parent::SugarBean ();
|
||||
$this->setupCustomFields ( 'EcmReturns' );
|
||||
foreach ( $this->field_defs as $field ) {
|
||||
$this->field_name_map [$field ['name']] = $field;
|
||||
}
|
||||
}
|
||||
var $new_schema = true;
|
||||
function get_summary_text() {
|
||||
return "$this->name";
|
||||
}
|
||||
function create_list_query($order_by, $where, $show_deleted = 0) {
|
||||
// Fill in the assigned_user_name
|
||||
$custom_join = $this->custom_fields->getJOIN ();
|
||||
$query = "SELECT ";
|
||||
$query .= "ecmreturns.*
|
||||
,users.user_name as assigned_user_name";
|
||||
if ($custom_join) {
|
||||
$query .= $custom_join ['select'];
|
||||
}
|
||||
$query .= " FROM ecmreturns
|
||||
LEFT JOIN users
|
||||
ON ecmreturns.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 ";
|
||||
} else if ($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";
|
||||
} else if ($order_by != "")
|
||||
$query .= " ORDER BY $order_by";
|
||||
else
|
||||
$query .= " ORDER BY ecmreturns.name";
|
||||
return $query;
|
||||
}
|
||||
function create_export_query($order_by, $where) {
|
||||
$custom_join = $this->custom_fields->getJOIN ();
|
||||
$query = "SELECT
|
||||
ecmreturns.*,
|
||||
users.user_name assigned_user_name";
|
||||
if ($custom_join) {
|
||||
$query .= $custom_join ['select'];
|
||||
}
|
||||
$query .= " FROM ecmreturns ";
|
||||
$query .= " LEFT JOIN users
|
||||
ON ecmreturns.assigned_user_id=users.id";
|
||||
if ($custom_join) {
|
||||
$query .= $custom_join ['join'];
|
||||
}
|
||||
$query .= "";
|
||||
$where_auto = " ecmreturns.deleted=0
|
||||
";
|
||||
if ($where != "")
|
||||
$query .= " where $where AND " . $where_auto;
|
||||
else
|
||||
$query .= " where " . $where_auto;
|
||||
if ($order_by != "")
|
||||
$query .= " ORDER BY $order_by";
|
||||
else
|
||||
$query .= " ORDER BY ecmreturns.name";
|
||||
return $query;
|
||||
}
|
||||
function fill_in_additional_list_fields() {
|
||||
}
|
||||
function fill_in_additional_detail_fields() {
|
||||
// FILL IN THE ASSIGNED_USER_NAME
|
||||
$this->assigned_user_name = get_assigned_user_name ( $this->assigned_user_id );
|
||||
$this->created_by_name = get_assigned_user_name ( $this->created_by );
|
||||
$this->modified_by_name = get_assigned_user_name ( $this->modified_user_id );
|
||||
/*
|
||||
* $result = $this->db->query ( "SELECT status, parent_id, contact_id, template_id, assigned_user_id FROM ecmreturns WHERE id='$this->id'" ); if (is_resource ( $result )) { $row = $this->db->fetchByAssoc ( $result ); if ($row) { $this->status = $row ['status']; $this->parent_id = $row ['parent_id']; $this->contact_id = $row ['contact_id']; $this->template_id = $row ['template_id']; $this->assigned_user_id = $row ['assigned_user_id']; } }
|
||||
*/
|
||||
/*
|
||||
* $query = "select `number`, `template_id` from `ecmreturns` where `id`='$this->id' limit 1"; $r = $this->db->query($query); if($r) { $r = $this->db->fetchByAssoc($r); $this->template_id = $r['template_id']; $this->number = $r['number']; $this->setTemplate(); $this->document_no = $this->formatNumber(); }
|
||||
*/
|
||||
}
|
||||
function get_list_view_data() {
|
||||
global $current_language;
|
||||
$this->fill_in_additional_detail_fields ();
|
||||
$app_list_strings = return_app_list_strings_language ( $current_language );
|
||||
$mod_strings = return_module_language ( $current_language, 'EcmReturns' );
|
||||
$the_array = parent::get_list_view_data ();
|
||||
// THE NEW LISTVIEW CODE ONLY FETCHES COLUMNS THAT WE'RE DISPLAYING AND NOT ALL
|
||||
// THE COLUMNS SO WE NEED THESE CHECKS.
|
||||
$this->retrieve ( $this->id );
|
||||
$the_array ['NAME'] = (($this->name == "") ? "<em>blank</em>" : $this->name);
|
||||
$the_array ['TOTAL'] = format_number ( $this->total_netto );
|
||||
// create image options
|
||||
$op = '<a href="index.php?module=EcmReturns&action=createPDF&to_pdf=1&show_img=1&show_ean=0&show_ean2=0&show_recipient_code=0&record=' . $this->id . '" target="new"/><img src="modules/EcmReturns/images/pdf.gif"/></a>';
|
||||
$the_array ['OPTIONS'] = $op;
|
||||
|
||||
return $the_array;
|
||||
}
|
||||
function getStatusMenuInfo($inJSON = true) {
|
||||
global $app_list_strings;
|
||||
$arr = array ();
|
||||
foreach ( $app_list_strings ['ecmreturns_status_dom'] as $key => $value ) {
|
||||
$arr [$key] = array (
|
||||
'enabled' => '<div><img src="modules/EcmReturns/images/' . $key . '.gif" />' . $value . '</div>',
|
||||
'disabled' => '<div><img src="modules/EcmReturns/images/' . $key . '.gif" />' . $value . '</div>'
|
||||
);
|
||||
}
|
||||
$json = getJSONobj ();
|
||||
if ($inJSON)
|
||||
return str_replace ( '"', '\"', $json->encode ( $arr ) );
|
||||
else
|
||||
return $arr;
|
||||
}
|
||||
function create_new_list_query($order_by, $where, $filter = array(), $params = array(), $show_deleted = 0, $join_type = '', $return_array = false, $parentbean, $singleSelect = false) {
|
||||
echo '<script type="text/javascript" src="include/ECM/EcmPreviewPDF/EcmPreviewPDF.js"></script>';
|
||||
echo '<script type="text/javascript" src="modules/EcmReturns/ListView.js"></script>';
|
||||
echo '<link rel="stylesheet" type="text/css" href="modules/EcmReturns/ListView.css" />';
|
||||
echo '<script language="javascript"> var EcmReturnsStatusMenu = ' . $this->getStatusMenuInfo () . '; </script>';
|
||||
return parent::create_new_list_query ( $order_by, $where, $filter, $params, $show_deleted, $join_type, $return_array, $parentbean, $singleSelect );
|
||||
}
|
||||
static function CreateImgStatus($id, $status) {
|
||||
global $app_list_strings;
|
||||
return '<span id="statusListEcmReturn_' . $id . '" style="display:inline;"><img src="modules/EcmReturns/images/' . $status . '.gif" title="' . $app_list_strings ['ecmreturns_status_dom'] [$status] . '" /></span>';
|
||||
}
|
||||
|
||||
/**
|
||||
* BUILDS A GENERIC SEARCH BASED ON THE QUERY STRING USING OR.
|
||||
* DO NOT INCLUDE ANY $THIS-> BECAUSE THIS IS CALLED ON WITHOUT HAVING THE CLASS INSTANTIATED.
|
||||
*/
|
||||
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, "ecmreturns.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, $simplemodule) {
|
||||
global $mod_strings, $app_list_strings;
|
||||
$xtpl->assign ( "NAME", $simplemodule->name );
|
||||
$xtpl->assign ( "DESCRIPTION", $simplemodule->description );
|
||||
return $xtpl;
|
||||
}
|
||||
function bean_implements($interface) {
|
||||
switch ($interface) {
|
||||
case 'ACL' :
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function save($check_notify = FALSE) {
|
||||
global $current_user;
|
||||
if (! $this->id || $this->id == '') {
|
||||
// generate number
|
||||
$this->number = $this->generateNumber ();
|
||||
$this->document_no = $this->formatNumber ( $this->number );
|
||||
}
|
||||
$this->vats_summary = htmlspecialchars ( $this->vats_summary );
|
||||
$return_id = parent::save ( $check_notify );
|
||||
$this->savePositions ( $return_id );
|
||||
return $return_id;
|
||||
}
|
||||
// ***************************Start Managing Positions*************************//
|
||||
function constructInsertQuery($data, $table = '') {
|
||||
if ($table == '' && isset ( $this->object_name ) && $this->object_name != '') {
|
||||
$table = strtolower ( $this->object_name ) . "items";
|
||||
} else
|
||||
return "";
|
||||
$keys = array ();
|
||||
$values = array ();
|
||||
foreach ( $data as $key => $value ) {
|
||||
$keys [] = $key;
|
||||
if (is_array ( $value ))
|
||||
$values [] = $value [1] . str_replace ( "'", "\'", $value [0] ) . $value [1];
|
||||
else
|
||||
$values [] = "'" . str_replace ( "'", "\'", $value ) . "'";
|
||||
}
|
||||
$q = "insert into `$table` (`";
|
||||
$q .= implode ( '`, `', $keys );
|
||||
$q .= "`) values (";
|
||||
$q .= implode ( ", ", $values );
|
||||
$q .= ");";
|
||||
return $q;
|
||||
}
|
||||
function savePositions($id = null, $position_list = null) {
|
||||
global $current_user, $timedate;
|
||||
if ($position_list == null)
|
||||
$position_list = $this->position_list;
|
||||
if ($id == null)
|
||||
$id = $this->id;
|
||||
if (count ( $position_list ) > 0)
|
||||
$this->deleteAssignedPositions ( $id );
|
||||
$arr = array ();
|
||||
$position = 0;
|
||||
for($i = 0; $i < count ( $position_list ); $i ++) {
|
||||
if ($position_list [$i] ['name'] == '')
|
||||
continue;
|
||||
$p = $position_list [$i];
|
||||
if (! empty ( $p ['category_id'] ) || $p ['category_id'] == '') {
|
||||
require_once ("modules/EcmProducts/EcmProduct.php");
|
||||
$pr = new EcmProduct ();
|
||||
$pr->retrieve ( $p ['id'] );
|
||||
$p ['category_id'] = $pr->product_category_id;
|
||||
}
|
||||
$arr = array (
|
||||
'id' => create_guid (),
|
||||
'date_entered' => array (
|
||||
'NOW()',
|
||||
''
|
||||
),
|
||||
'date_modified' => array (
|
||||
'NOW()',
|
||||
''
|
||||
),
|
||||
'modified_user_id' => $current_user->id,
|
||||
'assigned_user_id' => $current_user->id,
|
||||
'created_by' => $current_user->id,
|
||||
'deleted' => '0',
|
||||
strtolower ( $this->object_name ) . '_id' => $id,
|
||||
'ecmproduct_id' => $p ['product_id'],
|
||||
'position' => $position,
|
||||
'code' => $p ['product_code'],
|
||||
'name' => $p ['name'],
|
||||
'quantity' => ((empty ( $p ['quantity'] ) || $p ['quantity'] == '') ? 0 : $p ['quantity']),
|
||||
'price_start' => ((empty ( $p ['price_start'] ) || $p ['price_start'] == '') ? 0 : $p ['price_start']),
|
||||
'total_netto' => ((empty ( $p ['total_netto'] ) || $p ['total_netto'] == '') ? 0 : $p ['total_netto']),
|
||||
'dd_unit_id' => $p ['unit_id'],
|
||||
'dd_unit_name' => $p ['unit_name'],
|
||||
'ecmvat_id' => $p ['ecmvat_id'],
|
||||
'ecmvat_name' => $p ['ecmvat_name'],
|
||||
'ecmvat_value' => $p ['ecmvat_value'],
|
||||
'ecmproductcategory_id' => $p ['category_id'],
|
||||
'recipient_code' => $p ['recipient_code'],
|
||||
'remarks' => $p ['remarks']
|
||||
);
|
||||
$this->db->query ( $this->constructInsertQuery ( $arr ) );
|
||||
$position ++;
|
||||
}
|
||||
}
|
||||
function getPosition($position) {
|
||||
if (! is_array ( $position ))
|
||||
return '';
|
||||
global $timedate;
|
||||
$return_array = array ();
|
||||
$return_array ['product_id'] = $position ['ecmproduct_id'];
|
||||
$return_array ['position'] = $position ['position'];
|
||||
$return_array ['product_code'] = $position ['code'];
|
||||
$return_array ['name'] = $position ['name'];
|
||||
$return_array ['quantity'] = $position ['quantity'];
|
||||
$return_array ['price_start'] = $position ['price_start'];
|
||||
$return_array ['price_netto'] = $position ['price_netto'];
|
||||
$return_array ['discount'] = $position ['discount'];
|
||||
$return_array ['total_netto'] = $position ['total_netto'];
|
||||
$return_array ['unit_id'] = $position ['dd_unit_id'];
|
||||
$return_array ['unit_name'] = $position ['dd_unit_name'];
|
||||
$return_array ['ecmvat_id'] = $position ['ecmvat_id'];
|
||||
$return_array ['ecmvat_name'] = $position ['ecmvat_name'];
|
||||
$return_array ['ecmvat_value'] = $position ['ecmvat_value'];
|
||||
$return_array ['recipient_code'] = $position ['recipient_code'];
|
||||
$return_array ['remarks'] = $position ['remarks'];
|
||||
return $return_array;
|
||||
}
|
||||
function getPositionList($array = false) {
|
||||
if (isset ( $this->id ) && $this->id != '') {
|
||||
$query = "SELECT * FROM `" . strtolower ( $this->object_name ) . "items` WHERE `" . strtolower ( $this->object_name ) . "_id`='" . $this->id . "' order by position asc";
|
||||
$r = $this->db->query ( $query );
|
||||
$return_array = array ();
|
||||
if ($r) {
|
||||
while ( $w = $this->db->fetchByAssoc ( $r ) ) {
|
||||
$return_array [] = $this->getPosition ( $w );
|
||||
}
|
||||
$json = getJSONobj ();
|
||||
return $array ? $return_array : $json->encode ( $return_array );
|
||||
}
|
||||
}
|
||||
return $array ? false : '[]';
|
||||
}
|
||||
function deleteAssignedPositions() {
|
||||
if (isset ( $this->id ) && $this->id != '') {
|
||||
$query = "DELETE FROM `" . strtolower ( $this->object_name ) . "items` WHERE `" . strtolower ( $this->object_name ) . "_id`='" . $this->id . "'";
|
||||
$r = $this->db->query ( $query );
|
||||
if ($r)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function formatPositions($position_list) {
|
||||
return;
|
||||
if (! is_array ( $position_list ) || count ( $position_list ) == 0)
|
||||
return false;
|
||||
global $app_list_strings;
|
||||
require_once ('modules/Currencies/Currency.php');
|
||||
foreach ( $position_list as $key => $value ) {
|
||||
$position_list [$key] ['unit_id'] = $app_list_strings ['ecmproducts_unit_dom'] [$value ['unit_id']];
|
||||
$position_list [$key] ['category_id'] = $app_list_strings ['ecmproducts_category_dom'] [$value ['category_id']];
|
||||
// $position_list[$key]['vat_id'] = format_number($value['vat_id']).'%';
|
||||
$position_list [$key] ['discount'] = format_number ( $value ['discount'] ) . '%';
|
||||
if (isset ( $currency ) && ($currency->id == $this->currency_id)) {
|
||||
} else {
|
||||
$currency = new Currency ();
|
||||
$currency->retrieve ( $this->currency_id );
|
||||
}
|
||||
$position_list [$key] ['price'] = format_number ( $value ['price'] ) . ' ' . $currency->iso4217;
|
||||
$position_list [$key] ['total'] = format_number ( $value ['total'] ) . ' ' . $currency->iso4217;
|
||||
// $position_list[$key]['price'] = format_number($value['price']).' PLN';
|
||||
// $position_list[$key]['total'] = format_number($value['total']).' PLN';
|
||||
$this->currency_symbol = $currency->iso4217;
|
||||
}
|
||||
return $position_list;
|
||||
}
|
||||
// ***************************End Managing Positions*************************//
|
||||
function ACLAccess($view, $is_owner = 'not_set') {
|
||||
global $current_user;
|
||||
$file = 'modules/EcmGroupSales/EcmGroupSale.php';
|
||||
if (file_exists ( $file )) {
|
||||
require_once ($file);
|
||||
$cc = EcmGroupSale::loadSettings ( true );
|
||||
} else
|
||||
return true;
|
||||
if (is_admin ( $current_user )) {
|
||||
switch ($view) {
|
||||
case 'confirming' :
|
||||
return ($this->status == "s20");
|
||||
case 'send_to_confirm' :
|
||||
return ($this->status == "s10");
|
||||
case 'pdf_toolbar' :
|
||||
return ($this->status != "s10" && $this->status != "s20" && $this->status != "s40");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if ($is_owner == 'not_set') {
|
||||
$is_owner = $this->isOwner ( $current_user->id );
|
||||
}
|
||||
// if we don't implent acls return true
|
||||
if (! $this->bean_implements ( 'ACL' ))
|
||||
return true;
|
||||
$view = strtolower ( $view );
|
||||
if ($cc ['user_manager_role']) { // Manager
|
||||
switch ($view) {
|
||||
case 'list' :
|
||||
case 'index' :
|
||||
case 'listview' :
|
||||
return ACLController::checkAccess ( $this->module_dir, 'list', true );
|
||||
case 'edit' :
|
||||
case 'save' :
|
||||
case 'popupeditview' :
|
||||
case 'editview' :
|
||||
return (ACLController::checkAccess ( $this->module_dir, 'edit', $is_owner ));
|
||||
case 'view' :
|
||||
case 'detail' :
|
||||
case 'detailview' :
|
||||
return ACLController::checkAccess ( $this->module_dir, 'view', $is_owner );
|
||||
case 'delete' :
|
||||
return ACLController::checkAccess ( $this->module_dir, 'delete', $is_owner );
|
||||
case 'export' :
|
||||
return ACLController::checkAccess ( $this->module_dir, 'export', $is_owner );
|
||||
case 'import' :
|
||||
return ACLController::checkAccess ( $this->module_dir, 'import', true );
|
||||
case 'send_to_confirm' :
|
||||
return ($this->status == "s10");
|
||||
case 'can_commit' :
|
||||
return true;
|
||||
case 'confirming' :
|
||||
return ($this->status == "s20");
|
||||
case 'auto_commiting' :
|
||||
return true;
|
||||
case 'pdf_toolbar' :
|
||||
return ($this->status != "s10" && $this->status != "s20" && $this->status != "s40");
|
||||
}
|
||||
} else if ($cc ['user_representative_extra_role']) { // Representative Extra
|
||||
switch ($view) {
|
||||
case 'list' :
|
||||
case 'index' :
|
||||
case 'listview' :
|
||||
return ACLController::checkAccess ( $this->module_dir, 'list', true );
|
||||
case 'edit' :
|
||||
return (ACLController::checkAccess ( $this->module_dir, 'edit', $is_owner ) && ($this->status == "s10" || $this->status == "s40"));
|
||||
case 'save' :
|
||||
case 'popupeditview' :
|
||||
case 'editview' :
|
||||
return (ACLController::checkAccess ( $this->module_dir, 'edit', $is_owner ));
|
||||
case 'view' :
|
||||
case 'detail' :
|
||||
case 'detailview' :
|
||||
return ACLController::checkAccess ( $this->module_dir, 'view', $is_owner );
|
||||
case 'delete' :
|
||||
return (ACLController::checkAccess ( $this->module_dir, 'delete', $is_owner ) && $this->status == "s10");
|
||||
case 'export' :
|
||||
return ACLController::checkAccess ( $this->module_dir, 'export', $is_owner );
|
||||
case 'import' :
|
||||
return ACLController::checkAccess ( $this->module_dir, 'import', true );
|
||||
case 'quote_to_sale' :
|
||||
case 'quote_to_invoice' :
|
||||
return ($this->status != "s10" && $this->status != "s20" && $this->status != "s40" && $this->status != "s60");
|
||||
case 'send_to_confirm' :
|
||||
return ($this->status == "s10");
|
||||
case 'send_email' :
|
||||
return ($this->status != "s10" && $this->status != "s20" && $this->status != "s40");
|
||||
case 'can_commit' :
|
||||
return true;
|
||||
case 'confirming' :
|
||||
return false;
|
||||
case 'auto_commiting' :
|
||||
return true;
|
||||
case 'pdf_toolbar' :
|
||||
return ($this->status != "s10" && $this->status != "s20" && $this->status != "s40");
|
||||
}
|
||||
} else if ($cc ['user_representative_role']) { // Representative
|
||||
switch ($view) {
|
||||
case 'list' :
|
||||
case 'index' :
|
||||
case 'listview' :
|
||||
return ACLController::checkAccess ( $this->module_dir, 'list', true );
|
||||
case 'edit' :
|
||||
return (ACLController::checkAccess ( $this->module_dir, 'edit', $is_owner ) && ($this->status == "s10" || $this->status == "s40"));
|
||||
case 'save' :
|
||||
case 'popupeditview' :
|
||||
case 'editview' :
|
||||
return (ACLController::checkAccess ( $this->module_dir, 'edit', $is_owner ));
|
||||
case 'view' :
|
||||
case 'detail' :
|
||||
case 'detailview' :
|
||||
return ACLController::checkAccess ( $this->module_dir, 'view', $is_owner );
|
||||
case 'delete' :
|
||||
return (ACLController::checkAccess ( $this->module_dir, 'delete', $is_owner ) && $this->status == "s10");
|
||||
case 'export' :
|
||||
return ACLController::checkAccess ( $this->module_dir, 'export', $is_owner );
|
||||
case 'import' :
|
||||
return ACLController::checkAccess ( $this->module_dir, 'import', true );
|
||||
case 'quote_to_sale' :
|
||||
case 'quote_to_invoice' :
|
||||
return ($this->status != "s10" && $this->status != "s20" && $this->status != "s40" && $this->status != "s60");
|
||||
case 'send_to_confirm' :
|
||||
return ($this->status == "s10");
|
||||
case 'send_email' :
|
||||
return ($this->status != "s10" && $this->status != "s20" && $this->status != "s40");
|
||||
case 'can_commit' :
|
||||
return false;
|
||||
case 'confirming' :
|
||||
return false;
|
||||
case 'auto_commiting' :
|
||||
return false;
|
||||
case 'pdf_toolbar' :
|
||||
return ($this->status != "s10" && $this->status != "s20" && $this->status != "s40");
|
||||
}
|
||||
}
|
||||
// if it is not one of the above views then it should be implemented on the page level
|
||||
return true;
|
||||
}
|
||||
function searchProductsToCorrectList($positions) {
|
||||
if ($this->type == '1')
|
||||
$search_price = true;
|
||||
else
|
||||
$search_price = false;
|
||||
|
||||
$account_id = $this->parent_id;
|
||||
$db = $GLOBALS ['db'];
|
||||
|
||||
$can_confirm = true; // we hope everything goes well :)
|
||||
$items = array (); // items on correct
|
||||
$errors = array(); //not found products
|
||||
foreach ( $positions as $pos ) {
|
||||
$quantity = $pos ['quantity']; // qty we need
|
||||
// search for invoice items
|
||||
$q = "SELECT ii.* FROM ecminvoiceoutitems AS ii
|
||||
INNER JOIN ecminvoiceouts AS i
|
||||
ON ii.ecminvoiceout_id=i.id
|
||||
WHERE i.type='normal'
|
||||
AND ii.ecmproduct_id='" . $pos ['product_id'] . "'
|
||||
AND i.parent_id='$account_id'
|
||||
AND i.canceled='0'
|
||||
AND i.deleted='0'
|
||||
AND ii.deleted='0'
|
||||
AND YEAR(i.register_date) > 2009 ";
|
||||
if ($search_price)
|
||||
$q .= "AND ii.price_netto='" . $pos ['price_start'] . "' ORDER BY i.register_date DESC";
|
||||
else
|
||||
$q .= "ORDER BY ii.price_netto DESC";
|
||||
$res = $db->query ( $q );
|
||||
|
||||
if ($pos['product_id'] == '674c36eb-e614-3658-9c90-54466f1e382a')
|
||||
echo $q.'<br>';
|
||||
|
||||
|
||||
// loop throw items and search good quantity
|
||||
while ( $row = $db->fetchByAssoc ( $res ) ) {
|
||||
$tmp = array ();
|
||||
$tmp ['old_ecminvoiceoutitem_id'] = $row ['id'];
|
||||
// any before corrects?
|
||||
$oi_q = "SELECT ii.id, ii.ecminvoiceout_id, ii.price_netto, ii.quantity FROM ecminvoiceoutitems as ii INNER JOIN ecminvoiceouts AS i ON i.id=ii.ecminvoiceout_id WHERE i.canceled='0' AND i.deleted='0' AND ii.ecminvoiceoutitem_id='" . $row ['id'] . "' order by ii.date_entered desc limit 0,1";
|
||||
$oi = $db->fetchByAssoc ( $db->query ( $oi_q ) );
|
||||
if (! is_null ( $oi ['id'] ) && $oi ['id'] != "") {
|
||||
if ($search_price)
|
||||
if ($io ['price_netto'] != $row ['price_netto'])
|
||||
continue;
|
||||
$row ['quantity'] = $oi ['quantity'];
|
||||
$tmp ['old_ecminvoiceoutitem_id'] = $oi ['id'];
|
||||
}
|
||||
|
||||
if ($row ['quantity'] == 0)
|
||||
continue; // no product
|
||||
|
||||
if ($row ['quantity'] >= $quantity) {
|
||||
// take all!
|
||||
$tmp ['quantity'] = $row ['quantity'] - $quantity;
|
||||
$tmp ['old_qty'] = $row ['quantity'];
|
||||
$quantity = 0;
|
||||
} else {
|
||||
// take as many as U can!
|
||||
$tmp ['quantity'] = 0;
|
||||
$tmp ['old_qty'] = $row ['quantity'];
|
||||
$quantity -= ($tmp ['old_qty'] - $tmp ['quantity']);
|
||||
}
|
||||
|
||||
// fill item array
|
||||
$tmp ['code'] = $row ['code'];
|
||||
$tmp ['name'] = $row ['name'];
|
||||
$tmp ['id'] = $row ['ecmproduct_id'];
|
||||
$tmp ['startprice'] = $row ['startprice'];
|
||||
$tmp ['discount'] = $row ['discount'];
|
||||
$tmp ['price'] = $row ['price'];
|
||||
$tmp ['price_netto'] = $row ['price_netto'];
|
||||
$tmp ['total_netto'] = $tmp ['price_netto'] * $tmp ['quantity'];
|
||||
$tmp ['total'] = $tmp ['price'] * $tmp ['quantity'];
|
||||
$tmp ['vat_id'] = $row ['ecmvat_id'];
|
||||
$tmp ['vat_name'] = $row ['ecmvat_name'];
|
||||
$tmp ['vat_value'] = $row ['ecmvat_value'];
|
||||
$tmp ['currency_id'] = $row ['currency_id'];
|
||||
$tmp ['currency_name'] = $row ['currency_name'];
|
||||
$tmp ['tax_code'] = $row ['tax_code'];
|
||||
$tmp ['recipient_code'] = $row ['recipient_code'];
|
||||
$tmp ['item_id'] = $row ['id'];
|
||||
$tmp ['unit_id'] = $row ['dd_unit_id'];
|
||||
$tmp ['unit_name'] = $app_list_strings ['ecmproducts_unit_dom'] [$row ['dd_unit_id']];
|
||||
|
||||
$tmp ['parent_doc_id'] = $this->id;
|
||||
$tmp ['parent_doc_type'] = 'EcmReturn';
|
||||
$tmp ['parent_doc_item_id'] = $pos ['id'];
|
||||
|
||||
$items [] = $tmp;
|
||||
if ($quantity == 0)
|
||||
break; // goto next product
|
||||
}
|
||||
unset ( $row );
|
||||
unset ( $res );
|
||||
|
||||
if ($quantity > 0 && $search_price) {
|
||||
echo 'Próbuje bez search price';
|
||||
// try without search price
|
||||
$q = "SELECT ii.* FROM ecminvoiceoutitems AS ii
|
||||
INNER JOIN ecminvoiceouts AS i
|
||||
ON ii.ecminvoiceout_id=i.id
|
||||
WHERE i.type='normal'
|
||||
AND ii.ecmproduct_id='" . $pos ['id'] . "'
|
||||
AND i.parent_id='$account_id'
|
||||
AND i.canceled='0'
|
||||
AND i.deleted='0'
|
||||
AND ii.deleted='0'
|
||||
AND YEAR(i.register_date) > 2009
|
||||
ORDER BY ii.price_netto DESC";
|
||||
|
||||
$res = $db->query ( $q );
|
||||
|
||||
// loop throw items and search good quantity
|
||||
while ( $row = $db->fetchByAssoc ( $res ) ) {
|
||||
$tmp = array ();
|
||||
$tmp ['old_ecminvoiceoutitem_id'] = $row ['id'];
|
||||
// any before corrects?
|
||||
$oi_q = "SELECT ii.id, ii.ecminvoiceout_id, ii.price_netto, ii.quantity FROM ecminvoiceoutitems as ii INNER JOIN ecminvoiceouts AS i ON i.id=ii.ecminvoiceout_id WHERE i.canceled='0' AND i.deleted='0' AND ii.ecminvoiceoutitem_id='" . $row ['id'] . "' order by ii.date_entered desc limit 0,1";
|
||||
$oi = $db->fetchByAssoc ( $db->query ( $oi_q ) );
|
||||
if (! is_null ( $oi ['id'] ) && $oi ['id'] != "") {
|
||||
$row ['quantity'] = $oi ['quantity'];
|
||||
$tmp ['old_ecminvoiceoutitem_id'] = $oi ['id'];
|
||||
}
|
||||
if ($row ['quantity'] == 0)
|
||||
continue; // no product
|
||||
|
||||
if ($row ['quantity'] >= $quantity) {
|
||||
// take all!
|
||||
$tmp ['quantity'] = $row ['quantity'] - $quantity;
|
||||
$tmp ['old_qty'] = $row ['quantity'];
|
||||
$quantity = 0;
|
||||
} else {
|
||||
// take as many as U can!
|
||||
$tmp ['quantity'] = 0;
|
||||
$tmp ['old_qty'] = $row ['quantity'];
|
||||
$quantity -= ($tmp ['old_qty'] - $tmp ['quantity']);
|
||||
}
|
||||
|
||||
// fill item array
|
||||
$tmp ['code'] = $row ['code'];
|
||||
$tmp ['name'] = $row ['name'];
|
||||
$tmp ['id'] = $row ['ecmproduct_id'];
|
||||
$tmp ['unit_id'] = $row ['dd_unit_id'];
|
||||
$tmp ['unit_name'] = $app_list_strings ['ecmproducts_unit_dom'] [$row ['dd_unit_id']];
|
||||
$tmp ['startprice'] = $row ['startprice'];
|
||||
$tmp ['discount'] = $row ['discount'];
|
||||
$tmp ['price_brutto'] = $row ['price_brutto'];
|
||||
$tmp ['price_netto'] = $row ['price_netto'];
|
||||
$tmp ['total_netto'] = $tmp ['price_netto'] * $tmp ['quantity'];
|
||||
$tmp ['total'] = $tmp ['price'] * $tmp ['quantity'];
|
||||
$tmp ['vat_id'] = $row ['ecmvat_id'];
|
||||
$tmp ['vat_name'] = $row ['ecmvat_name'];
|
||||
$tmp ['vat_value'] = $row ['ecmvat_value'];
|
||||
$tmp ['currency_id'] = $row ['currency_id'];
|
||||
$tmp ['currency_name'] = $row ['currency_name'];
|
||||
$tmp ['tax_code'] = $row ['tax_code'];
|
||||
$tmp ['recipient_code'] = $row ['recipient_code'];
|
||||
$tmp ['item_id'] = $row ['id'];
|
||||
$tmp ['unit_id'] = $row ['dd_unit_id'];
|
||||
$tmp ['unit_name'] = $app_list_strings ['ecmproducts_unit_dom'] [$row ['dd_unit_id']];
|
||||
|
||||
$tmp ['parent_doc_id'] = $this->id;
|
||||
$tmp ['parent_doc_type'] = 'EcmReturn';
|
||||
$tmp ['parent_doc_item_id'] = $pos ['id'];
|
||||
|
||||
//can't search product with user price
|
||||
$tmp['diffrent_price'] = true;
|
||||
|
||||
$items [] = $tmp;
|
||||
if ($quantity == 0)
|
||||
break; // goto next product
|
||||
}
|
||||
}
|
||||
if ($quantity > 0) {
|
||||
$errors[] = $pos ['product_code'];
|
||||
}
|
||||
}
|
||||
foreach ( $items as $k => $i ) {
|
||||
$inv = $db->fetchByAssoc ( $db->query ( "SELECT i.id, i.document_no FROM ecminvoiceoutitems AS ii
|
||||
INNER JOIN ecminvoiceouts AS i
|
||||
ON ii.ecminvoiceout_id = i.id
|
||||
AND ii.id = '" . $i ['item_id'] . "'" ) );
|
||||
|
||||
$items [$k] ['inv_document_no'] = $inv ['document_no'];
|
||||
$items [$k] ['inv_id'] = $inv ['id'];
|
||||
if (! is_null ( $i ['old_ecminvoiceoutitem_id'] ) && $i ['old_ecminvoiceoutitem_id'] != "") {
|
||||
$cor = $db->fetchByAssoc ( $db->query ( "SELECT i.id, i.document_no FROM ecminvoiceoutitems AS ii
|
||||
INNER JOIN ecminvoiceouts AS i
|
||||
ON ii.ecminvoiceout_id = i.id
|
||||
AND ii.id = '" . $i ['old_ecminvoiceoutitem_id'] . "'" ) );
|
||||
|
||||
$items [$k] ['cor_document_no'] = $cor ['document_no'];
|
||||
$items [$k] ['cor_id'] = $cor ['id'];
|
||||
} else {
|
||||
$items [$k] ['cor_document_no'] = '';
|
||||
$items [$k] ['cor_id'] = '';
|
||||
}
|
||||
unset ( $inv );
|
||||
unset ( $cor );
|
||||
}
|
||||
$items['items'] = $items;
|
||||
$items['errors'] = $errors;
|
||||
return $items;
|
||||
}
|
||||
function saveCorrect($items) {
|
||||
$i = new EcmInvoiceOut ();
|
||||
|
||||
$a = new Account ();
|
||||
$a->retrieve ( $this->parent_id );
|
||||
|
||||
$i->parent_id = $this->parent_id;
|
||||
$i->parent_name = $this->parent_name;
|
||||
$i->parent_address_street = $this->parent_address_street;
|
||||
$i->parent_address_city = $this->parent_address_city;
|
||||
$i->parent_address_postalcode = $this->parent_address_postalcode;
|
||||
$i->parent_address_country = $this->parent_address_country;
|
||||
$i->to_nip = $a->to_vatid;
|
||||
|
||||
$i->ecmpaymentcondition_id = $this->ecmpaymentcondition_id;
|
||||
$i->supplier_code = $a->supplier_code;
|
||||
$pc = new EcmPaymentCondition ();
|
||||
$pc->retrieve ( $this->ecmpaymentcondition_id );
|
||||
$i->ecmpaymentcondition_name = $pc->name;
|
||||
$i->payment_date = $GLOBALS ['timedate']->to_display_date ( date ( "Y-m-d", mktime () + 3600 * 24 * $pc->days ) );
|
||||
|
||||
/*
|
||||
* $s = new EcmSale (); $s->retrieve ( $r ['so_id'] ); // delivery address $i->parent_shipping_address_name = $s->parent_shipping_address_name; $i->parent_shipping_address_street = $s->parent_shipping_address_street; $i->parent_shipping_address_city = $s->parent_shipping_address_city; $i->parent_shipping_address_postalcode = $s->parent_shipping_address_postalcode; $i->parent_shipping_address_country = $s->parent_shipping_address_country;
|
||||
*/
|
||||
|
||||
$i->template_id = '97700b0d-fbe9-e366-4016-4b260f058a47';
|
||||
$i->template_name = "e5 Polska Sp. z o. o.";
|
||||
|
||||
$i->parent_contact_name = $this->parent_contact_name;
|
||||
$i->parent_contact_title = $this->parent_contact_title;
|
||||
$i->order_no = $this->name;
|
||||
$i->description = $this->description;
|
||||
$i->contact_id = $this->contact_id;
|
||||
$i->name = $r ['name'];
|
||||
$i->register_date = $GLOBALS ['timedate']->to_display_date ( date ( "Y-m-d" ) );
|
||||
$i->sell_date = $GLOBALS ['timedate']->to_display_date ( date ( "Y-m-d" ) );
|
||||
$i->status = "accepted";
|
||||
$i->type = "correct";
|
||||
global $current_user;
|
||||
$i->assigned_user_id = $current_user->id;
|
||||
$i->created_by = $current_user->id;
|
||||
$i->modified_user_id = $current_user->id;
|
||||
|
||||
$i->number = $i->generateNumberCorrect ();
|
||||
|
||||
$i->document_no = 'FVKOR ' . $i->formatNumberCorrect ();
|
||||
|
||||
$i->pdf_type = 'K';
|
||||
// $i->currency_id=$s->currency_id;
|
||||
|
||||
// set possition list
|
||||
$i->position_list = $items;
|
||||
$no = $i->save ();
|
||||
|
||||
$db = $GLOBALS ['db'];
|
||||
if ($no != '') {
|
||||
$db->query ( "update ecmreturns set correct_id='" . $no . "' where id='" . $this->id . "'" );
|
||||
}
|
||||
return $no;
|
||||
}
|
||||
|
||||
// mz generate number
|
||||
function generateNumber() {
|
||||
$db = $GLOBALS ['db'];
|
||||
$r = $db->fetchByAssoc ( $db->query ( "SELECT count(id) as c FROM ecmreturns WHERE deleted='0' AND YEAR(register_date)='" . date ( 'Y' ) . "'" ) );
|
||||
|
||||
if (! $r || ! $r ['c'] || $r ['c'] == '')
|
||||
$count = 0;
|
||||
else
|
||||
$count = intval ( $r ['c'] );
|
||||
|
||||
$count ++;
|
||||
|
||||
// has 5 digits?
|
||||
$tmp = strval ( $count );
|
||||
while ( strlen ( $tmp ) < 5 )
|
||||
$tmp = '0' . $tmp;
|
||||
|
||||
return date ( "Ymd" ) . $tmp;
|
||||
}
|
||||
function formatNumber($number) {
|
||||
$n = intval ( substr ( $number, 8, 5 ) );
|
||||
$y = substr ( $number, 2, 2 );
|
||||
|
||||
// has 3 digits?
|
||||
while ( strlen ( $n ) < 3 )
|
||||
$n = '0' . $n;
|
||||
|
||||
return 'ZW ' . $n . '/' . $y;
|
||||
}
|
||||
}
|
||||
?>
|
||||
72
modules/EcmReturns/EditView.php
Normal file
72
modules/EcmReturns/EditView.php
Normal file
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
if (! defined ( 'sugarEntry' ) || ! sugarEntry)
|
||||
die ( 'NotAValidEntryPoint' );
|
||||
|
||||
global $sugar_version, $sugar_config, $current_user, $app_strings, $mod_strings, $current_user, $app_list_strings;
|
||||
require_once ('modules/EcmReturns/EcmReturn.php');
|
||||
require_once ('include/time.php');
|
||||
|
||||
//add jquery
|
||||
echo '<link rel="stylesheet" type="text/css" href="include/jQuery/jquery-table/jquery.appendGrid-1.3.1.css"/>';
|
||||
echo '<link rel="stylesheet" type="text/css" href="include/jQuery/jquery-ui/themes/base/jquery-ui.css"/>';
|
||||
echo '<script type="text/javascript"
|
||||
src="include/jQuery/jquery-2.1.0.min.js"></script>';
|
||||
echo '<script type="text/javascript"
|
||||
src="include/jQuery/jquery-table/jquery.appendGrid-1.3.1.js"></script>';
|
||||
echo '<script type="text/javascript"
|
||||
src="include/jQuery/jquery-ui/ui/jquery-ui.js"></script>';
|
||||
|
||||
// $cq=$current_user->getPreference('confirm_quotes');
|
||||
|
||||
$new_number = false;
|
||||
$duplicate = false;
|
||||
$focus = new EcmReturn ();
|
||||
|
||||
if (isset ( $_REQUEST ['record'] ) && $_REQUEST['isDuplicate']=="false" ) {
|
||||
$focus->retrieve ( $_REQUEST ['record'] );
|
||||
if (isset ( $focus->id ) && $focus->id != '') {
|
||||
$focus->format_all_fields ();
|
||||
}
|
||||
}
|
||||
else if ($_REQUEST['isDuplicate']=="true") {
|
||||
$new_number=true;
|
||||
$duplicate=true;
|
||||
//get data
|
||||
$focus->retrieve($_REQUEST['return_id']);
|
||||
$focus->register_date = date("d.m.Y");
|
||||
$focus->validtill_date = date("d.m.Y");
|
||||
}
|
||||
else {
|
||||
$new_number=true;
|
||||
//dates
|
||||
$focus->register_date = date("d.m.Y");
|
||||
$focus->validtill_date = date("d.m.Y");
|
||||
//for subpanels??
|
||||
if (isset ( $_REQUEST ['contact_id'] ) && $_REQUEST ['contact_id'] != '' && isset ( $_REQUEST ['contact_name'] ) && $_REQUEST ['contact_name'] != '') {
|
||||
$_REQUEST ['parent_type'] = 'Contacts';
|
||||
$_REQUEST ['parent_name'] = $_REQUEST ['contact_name'];
|
||||
$_REQUEST ['parent_id'] = $_REQUEST ['contact_id'];
|
||||
$OPT ['check_parent_id'] = false;
|
||||
}
|
||||
|
||||
if (isset ( $_REQUEST ['account_id'] ) && $_REQUEST ['account_id'] != '' && isset ( $_REQUEST ['account_name'] ) && $_REQUEST ['account_name'] != '') {
|
||||
$_REQUEST ['parent_type'] = 'Accounts';
|
||||
$_REQUEST ['parent_name'] = $_REQUEST ['account_name'];
|
||||
$_REQUEST ['parent_id'] = $_REQUEST ['account_id'];
|
||||
$OPT ['check_parent_id'] = false;
|
||||
}
|
||||
}
|
||||
|
||||
require_once ('include/MVC/View/SugarView.php');
|
||||
require_once ('modules/EcmReturns/views/EditView/view.edit.ecmreturns.php');
|
||||
$edit = new ViewEditEcmReturns ();
|
||||
$edit->ss = new Sugar_Smarty ();
|
||||
$edit->module = 'EcmReturns';
|
||||
$edit->bean = $focus;
|
||||
$edit->tplFile = 'include/ECM/EcmViews/EditView/Tabs/EditView.tpl';
|
||||
$edit->preDisplay ();
|
||||
$edit->ss->assign ( "NEW_NUMBER", $new_number );
|
||||
$edit->ss->assign("DUPLICATE", $duplicate);
|
||||
echo $edit->display ();
|
||||
//loading view
|
||||
echo '<link rel="stylesheet" type="text/css" href="modules/EcmReturns/javascript/helper.css" media="screen" /><div class="loading_panel"></div>';
|
||||
106
modules/EcmReturns/Menu.php
Normal file
106
modules/EcmReturns/Menu.php
Normal file
@@ -0,0 +1,106 @@
|
||||
<?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.
|
||||
|
||||
********************************************************************************/
|
||||
|
||||
global $mod_strings, $current_user;
|
||||
|
||||
if(ACLController::checkAccess('EcmReturns', "edit", true)) $module_menu [] = Array("index.php?module=".'EcmReturns'."&action=EditView&return_module=".'EcmReturns'."&return_action=DetailView", translate('LNK_NEW_'.'ECMRETURNS', 'EcmReturns'),"CreateEcmReturns", 'EcmReturns');
|
||||
|
||||
if(ACLController::checkAccess('EcmReturns', "list", true)) $module_menu [] = Array("index.php?module=EcmReturns&action=index&return_module=EcmReturns&return_action=DetailView", translate('LNK_ECMRETURNS_LIST','EcmReturns'),"EcmReturns", 'EcmReturns');
|
||||
|
||||
?>
|
||||
|
||||
223
modules/EcmReturns/ModuleFieldsParser/ModuleFieldsParser.php
Normal file
223
modules/EcmReturns/ModuleFieldsParser/ModuleFieldsParser.php
Normal file
@@ -0,0 +1,223 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
class ModuleFieldsParser {
|
||||
|
||||
|
||||
|
||||
var $modules;
|
||||
|
||||
var $name;
|
||||
|
||||
|
||||
|
||||
function ModuleFieldsParser($name = 'mfp') {
|
||||
|
||||
$this->modules = Array();
|
||||
|
||||
if(file_exists('modules/EcmReturns/ModuleFieldsParser/config.php')) {
|
||||
|
||||
require_once('modules/EcmReturns/ModuleFieldsParser/config.php');
|
||||
|
||||
$this->modules = $mfp_modules;
|
||||
|
||||
}
|
||||
|
||||
$this->name = $name;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function getModulesSelectOptions($fieldRealNames = false) {
|
||||
|
||||
global $app_list_strings;
|
||||
|
||||
$arr = array();
|
||||
|
||||
if(count($this->modules)>0) {
|
||||
|
||||
foreach($this->modules as $key => $value) {
|
||||
|
||||
if(isset($value['name']) && $value['name'] != '')
|
||||
|
||||
if(isset($app_list_strings['moduleList'][$value['name']]) && $app_list_strings['moduleList'][$value['name']] != '')
|
||||
|
||||
$value['name'] = $app_list_strings['moduleList'][$value['name']];
|
||||
|
||||
$arr[$key]['name'] = $value['name'];
|
||||
|
||||
$arr[$key]['fields'] = $this->getModuleFieldsSelectOptions($key,$fieldRealNames);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $arr;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function getModuleFieldsSelectOptions($module,$fieldRealNames = false) {
|
||||
|
||||
global $beanList, $current_language, $GLOBALS;
|
||||
|
||||
$dict = null;
|
||||
|
||||
$file = 'cache/modules/'.$module.'/'.$beanList[$module].'vardefs.php';
|
||||
|
||||
if(file_exists($file)) {
|
||||
|
||||
include($file);
|
||||
|
||||
$dict = $GLOBALS['dictionary'][$beanList[$module]]['fields'];
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
$file = 'modules/'.$module.'/vardefs.php';
|
||||
|
||||
if(file_exists($file)) { include($file); $dict = $dictionary[$beanList[$module]]['fields']; }
|
||||
|
||||
}
|
||||
|
||||
if($dict) {
|
||||
|
||||
$mod = return_module_language($current_language, $module);
|
||||
|
||||
$arr = array();
|
||||
|
||||
foreach($dict as $key => $value) {
|
||||
|
||||
$tmp = '$'.$this->modules[$module]['prefix'].$value['name'];
|
||||
|
||||
if(!$fieldRealNames)
|
||||
|
||||
$arr[$tmp] = ((isset($mod[$value['vname']]) && $mod[$value['vname']] != '') ? $mod[$value['vname']] : $value['name']);
|
||||
|
||||
else
|
||||
|
||||
$arr[$tmp] = $value['name'];
|
||||
|
||||
}
|
||||
|
||||
return $arr;
|
||||
|
||||
}
|
||||
|
||||
return array();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function getJS() {
|
||||
|
||||
$json = getJSONobj();
|
||||
|
||||
$js = '<script language="javascript">';
|
||||
|
||||
$js .= 'var '.$this->name.'_data = '.$json->encode($this->getModulesSelectOptions()).';';
|
||||
|
||||
$js .= 'function '.$this->name.'_loadModules() { var ms = document.getElementById("'.$this->name.'_module"); for(x in '.$this->name.'_data) { ms.options[ms.options.length] = new Option('.$this->name.'_data[x]["name"],x,false); }; }';
|
||||
|
||||
$js .= 'function '.$this->name.'_loadFields() { var ms = document.getElementById("'.$this->name.'_module"); var fs = document.getElementById("'.$this->name.'_fields"); while(fs.options.length>0) fs.remove(0); var fields = '.$this->name.'_data[ms.value]["fields"]; for(x in fields) fs.options[fs.options.length] = new Option(fields[x],x,false); fs.onchange(); };';
|
||||
|
||||
$js .= 'function '.$this->name.'_loadField() { var fs = document.getElementById("'.$this->name.'_fields"); var fe = document.getElementById("'.$this->name.'_field"); fe.value = fs.value; };';
|
||||
|
||||
$js .= $this->name.'_loadModules(); '.$this->name.'_loadFields(); '.$this->name.'_loadField();';
|
||||
|
||||
$js .= '</script>';
|
||||
|
||||
return $js;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function getFormHTML($smarty = false, $name = '') {
|
||||
|
||||
if($name != '') $this->name = $name;
|
||||
|
||||
$html = '
|
||||
|
||||
<span>
|
||||
|
||||
<select id="'.$this->name.'_module" name="'.$this->name.'_module" onChange="'.$this->name.'_loadFields();"></select>
|
||||
|
||||
<select id="'.$this->name.'_fields" name="'.$this->name.'_fields" onChange="'.$this->name.'_loadField()"></select>
|
||||
|
||||
<input id="'.$this->name.'_field" name="'.$this->name.'_field" value="" size="40">'
|
||||
|
||||
.($smarty ? '{literal}' : '').$this->getJS().($smarty ? '{/literal}' : '').
|
||||
|
||||
'</span>';
|
||||
|
||||
return $html;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function fillFocusToModules() {
|
||||
|
||||
foreach($this->modules as $key => $value) {
|
||||
|
||||
if((!isset($value['focus']) || $value['focus'] == '') && (isset($value['id']) && $value['id'] != '')) {
|
||||
|
||||
global $beanFiles, $beanList;
|
||||
|
||||
$path = $beanFiles[$beanList[$key]];
|
||||
|
||||
if(file_exists($path)) {
|
||||
|
||||
require_once($path);
|
||||
|
||||
$this->modules[$key]['focus'] = new $beanList[$key]();
|
||||
|
||||
$this->modules[$key]['focus']->format_all_fields();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function parseText($text) {
|
||||
|
||||
$this->fillFocusToModules();
|
||||
|
||||
$temp = $this->getModulesSelectOptions(true);
|
||||
|
||||
foreach($this->modules as $module => $arr) {
|
||||
|
||||
if(isset($arr['focus']) && $arr['focus']!='') {
|
||||
|
||||
foreach($temp[$module]['fields'] as $field => $value) {
|
||||
|
||||
//$text = str_replace($field,((isset($this->modules[$module]['focus']->$value) && $this->modules[$module]['focus']->$value != '')?$this->modules[$module]['focus']->$value:''),$text);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $text;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
?>
|
||||
75
modules/EcmReturns/ModuleFieldsParser/config.php
Normal file
75
modules/EcmReturns/ModuleFieldsParser/config.php
Normal file
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
global $app_list_strings;
|
||||
|
||||
|
||||
|
||||
$mfp_modules = Array(
|
||||
|
||||
'EcmReturns' => array(
|
||||
|
||||
'name' => $app_list_strings['moduleList']['EcmReturns'],
|
||||
|
||||
'prefix' => 'off_',
|
||||
|
||||
'id' => '',
|
||||
|
||||
'focus' => ''
|
||||
|
||||
),
|
||||
|
||||
'EcmDocumentTemplates' => array(
|
||||
|
||||
'name' => $app_list_strings['moduleList']['EcmDocumentTemplates'],
|
||||
|
||||
'prefix' => 'dt_',
|
||||
|
||||
'id' => '',
|
||||
|
||||
'focus' => ''
|
||||
|
||||
),
|
||||
|
||||
'Accounts' => array(
|
||||
|
||||
'name' => $app_list_strings['moduleList']['Accounts'],
|
||||
|
||||
'prefix' => 'acc_',
|
||||
|
||||
'id' => '',
|
||||
|
||||
'focus' => ''
|
||||
|
||||
),
|
||||
|
||||
'Contacts' => array(
|
||||
|
||||
'name' => $app_list_strings['moduleList']['Contacts'],
|
||||
|
||||
'prefix' => 'con_',
|
||||
|
||||
'id' => '',
|
||||
|
||||
'focus' => ''
|
||||
|
||||
),
|
||||
|
||||
'Users' => array(
|
||||
|
||||
'name' => $app_list_strings['moduleList']['Users'],
|
||||
|
||||
'prefix' => 'us_',
|
||||
|
||||
'id' => '',
|
||||
|
||||
'focus' => ''
|
||||
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
|
||||
|
||||
?>
|
||||
331
modules/EcmReturns/PDFTemplate/content.php
Normal file
331
modules/EcmReturns/PDFTemplate/content.php
Normal file
@@ -0,0 +1,331 @@
|
||||
<?php
|
||||
$w = "70"; // first column width
|
||||
$w2 = "15"; // second column width
|
||||
$content = '
|
||||
<table style="width: 100%; font-size: 8pt;">
|
||||
<tr>
|
||||
<td style="width: ' . $w . '%">
|
||||
'.$labels['LBL_PDF_CONTENT_QUOTE_FOR'].'
|
||||
</td>
|
||||
<td style="width: ' . $w2 . '%">
|
||||
'.$labels['LBL_PDF_CONTENT_NUMBER'].'
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
<b>' . $focus->document_no . '</b>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: ' . $w . '%">
|
||||
<b>' . $focus->parent_name . '</b>
|
||||
</td>
|
||||
<td style="width: ' . $w2 . '%">
|
||||
'.$labels['LBL_PDF_CONTENT_REGISTER_DATE'].'
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
<b>' . $focus->register_date . '</b>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: ' . $w . '%">
|
||||
<b>' . $focus->parent_address_street . ', ' . $focus->parent_address_postalcode . ' ' . $focus->parent_address_city . '</b>
|
||||
</td>
|
||||
<td style="width: ' . $w2 . '%">
|
||||
'.$labels['LBL_PDF_CONTENT_ISSUED_BY'].'
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
<b>' . $user->full_name . '</b>
|
||||
</td>
|
||||
</tr>
|
||||
</table><br>
|
||||
';
|
||||
if ($focus->name && $focus->name != '') {
|
||||
$content .= '
|
||||
<table style="width: 100%; text-align: center">
|
||||
<tr><td>
|
||||
<b>' . $focus->name . '</b>
|
||||
</td></tr>
|
||||
</table>
|
||||
';
|
||||
}
|
||||
|
||||
$content .= '<br>';
|
||||
|
||||
// start items table
|
||||
$columns = array ();
|
||||
|
||||
$columns ['position'] = array (
|
||||
'field' => array (
|
||||
'position'
|
||||
),
|
||||
'label' => $labels['LBL_PDF_CONTENT_LIST_POSITION'],
|
||||
'align' => 'center'
|
||||
);
|
||||
|
||||
if ($_REQUEST['show_img']=='1') {
|
||||
$columns ['image'] = array (
|
||||
'field' => array (
|
||||
'image'
|
||||
),
|
||||
'label' => $labels['LBL_PDF_CONTENT_LIST_IMAGE'],
|
||||
'align' => 'center'
|
||||
);
|
||||
}
|
||||
|
||||
$columns ['name'] = array (
|
||||
'field' => array (
|
||||
'name',
|
||||
'product_code'
|
||||
),
|
||||
'label' => $labels['LBL_PDF_CONTENT_LIST_NAME'].'<br>'.$labels['LBL_PDF_CONTENT_LIST_CODE'],
|
||||
'align' => 'left'
|
||||
);
|
||||
|
||||
if ($_REQUEST ['show_ean'] == '1' || $_REQUEST ['show_ean2'] == '1' || $_REQUEST ['show_recipient_code'] == '1' || $_REQUEST ['show_remarks'] == '1') {
|
||||
$columns ['codes'] = array (
|
||||
'align' => 'center'
|
||||
);
|
||||
$columns ['codes'] ['label'] = '';
|
||||
if ($_REQUEST ['show_ean']) {
|
||||
$columns ['codes'] ['label'] .= $labels['LBL_PDF_CONTENT_LIST_EAN'].'<br>';
|
||||
$columns ['codes'] ['field'] [] = 'ean';
|
||||
}
|
||||
if ($_REQUEST ['show_ean2']) {
|
||||
$columns ['codes'] ['label'] .= $labels['LBL_PDF_CONTENT_LIST_EAN2'].'<br>';
|
||||
$columns ['codes'] ['field'] [] = 'ean2';
|
||||
}
|
||||
if ($_REQUEST ['show_recipient_code']) {
|
||||
$columns ['codes'] ['label'] .= $labels['LBL_PDF_CONTENT_LIST_RECIPIENT_CODE'];
|
||||
$columns ['codes'] ['field'] [] = 'recipient_code';
|
||||
}
|
||||
|
||||
if ($_REQUEST ['show_remarks']) {
|
||||
$columns ['codes'] ['label'] .= $labels['LBL_PDF_CONTENT_LIST_REMARKS'];
|
||||
$columns ['codes'] ['field'] [] = 'remarks';
|
||||
}
|
||||
|
||||
$codes = true;
|
||||
}
|
||||
$columns ['qty'] = array (
|
||||
'field' => array (
|
||||
'quantity',
|
||||
'unit_name'
|
||||
),
|
||||
'label' => $labels['LBL_PDF_CONTENT_LIST_QTY'].'<br>'.$labels['LBL_PDF_CONTENT_LIST_UNIT'],
|
||||
'align' => 'right'
|
||||
);
|
||||
|
||||
if (showDiscount ( $record ) == true) {
|
||||
$columns ['price_start'] = array (
|
||||
'field' => array (
|
||||
'price_start'
|
||||
),
|
||||
'label' => $labels['LBL_PDF_CONTENT_LIST_PRICE_START'],
|
||||
'align' => 'right'
|
||||
);
|
||||
|
||||
$columns ['discount'] = array (
|
||||
'field' => array (
|
||||
'discount'
|
||||
),
|
||||
'label' => $labels['LBL_PDF_CONTENT_LIST_DISCOUNT'],
|
||||
'align' => 'right'
|
||||
);
|
||||
|
||||
$columns ['price_netto'] = array (
|
||||
'field' => array (
|
||||
'price_netto'
|
||||
),
|
||||
'label' => $labels['LBL_PDF_CONTENT_LIST_PRICE_NETTO'],
|
||||
'align' => 'right'
|
||||
);
|
||||
|
||||
$discounts = true;
|
||||
} else
|
||||
$columns ['price_netto'] = array (
|
||||
'field' => array (
|
||||
'price_netto'
|
||||
),
|
||||
'label' => $labels['LBL_PDF_CONTENT_LIST_PRICE_NETTO'],
|
||||
'align' => 'right'
|
||||
);
|
||||
|
||||
$columns ['total_netto'] = array (
|
||||
'field' => array (
|
||||
'total_netto'
|
||||
),
|
||||
'label' => $labels['LBL_PDF_CONTENT_LIST_TOTAL_NETTO'],
|
||||
'align' => 'right'
|
||||
);
|
||||
|
||||
//set widths
|
||||
$totals = array();
|
||||
//1: no picture, no codes, no discounts
|
||||
if ($_REQUEST['show_img']=='0' && $codes==false && $discounts==false) {
|
||||
$columns['position']['width'] = '5';
|
||||
$columns['name']['width'] = '45';
|
||||
$columns['qty']['width'] = '10';
|
||||
$columns['price_netto']['width'] = '20';
|
||||
$columns['total_netto']['width'] = '20';
|
||||
}
|
||||
//2: no picture, codes, no discounts
|
||||
else if ($_REQUEST['show_img']=='0' && $codes==true && $discounts==false) {
|
||||
$columns['position']['width'] = '5';
|
||||
$columns['name']['width'] = '40';
|
||||
$columns['codes']['width'] = '15';
|
||||
$columns['qty']['width'] = '10';
|
||||
$columns['price_netto']['width'] = '15';
|
||||
$columns['total_netto']['width'] = '15';
|
||||
}
|
||||
//3: no picture, no codes, discounts
|
||||
else if ($_REQUEST['show_img']=='0' && $codes==false && $discounts==true) {
|
||||
$columns['position']['width'] = '5';
|
||||
$columns['name']['width'] = '40';
|
||||
$columns['qty']['width'] = '10';
|
||||
$columns['price_netto']['width'] = '12.5';
|
||||
$columns['price_start']['width'] = '12.5';
|
||||
$columns['discount']['width'] = '12.5';
|
||||
$columns['total_netto']['width'] = '12.5';
|
||||
}
|
||||
//4: no picture, codes, discounts
|
||||
else if ($_REQUEST['show_img']=='0' && $codes==true && $discounts==true) {
|
||||
$columns['position']['width'] = '5';
|
||||
$columns['name']['width'] = '30';
|
||||
$columns['codes']['width'] = '15';
|
||||
$columns['qty']['width'] = '7';
|
||||
$columns['price_netto']['width'] = '8';
|
||||
$columns['price_start']['width'] = '10';
|
||||
$columns['discount']['width'] = '10';
|
||||
$columns['total_netto']['width'] = '10';
|
||||
}
|
||||
//5: picture, no codes, no discounts
|
||||
else if ($_REQUEST['show_img']=='1' && $codes==false && $discounts==false) {
|
||||
$columns['position']['width'] = '5';
|
||||
$columns['name']['width'] = '45';
|
||||
$columns['image']['width'] = '20';
|
||||
$columns['qty']['width'] = '10';
|
||||
$columns['price_netto']['width'] = '10';
|
||||
$columns['total_netto']['width'] = '10';
|
||||
}
|
||||
//6: picture, codes, no discounts
|
||||
else if ($_REQUEST['show_img']=='1' && $codes==true && $discounts==false) {
|
||||
$columns['position']['width'] = '5';
|
||||
$columns['name']['width'] = '35';
|
||||
$columns['codes']['width'] = '15';
|
||||
$columns['image']['width'] = '15';
|
||||
$columns['qty']['width'] = '10';
|
||||
$columns['price_netto']['width'] = '10';
|
||||
$columns['total_netto']['width'] = '10';
|
||||
}
|
||||
//7: pictures, codes, discounts
|
||||
else if ($_REQUEST['show_img']=='1' && $codes==true && $discounts==true) {
|
||||
$columns['position']['width'] = '5';
|
||||
$columns['name']['width'] = '35';
|
||||
$columns['codes']['width'] = '15';
|
||||
$columns['image']['width'] = '15';
|
||||
$columns['qty']['width'] = '10';
|
||||
$columns['price_start']['width'] = '10';
|
||||
$columns['discount']['width'] = '10';
|
||||
$columns['price_netto']['width'] = '10';
|
||||
$columns['total_netto']['width'] = '10';
|
||||
}
|
||||
|
||||
// rysujemy :)
|
||||
$content .= '
|
||||
<table style="width: 100%; font-size: 7pt; border: 0.5 solid black; border-collapse: collapse"><thead>
|
||||
<tr>
|
||||
';
|
||||
|
||||
foreach ( $columns as $col ) {
|
||||
$content .= '
|
||||
<th style="border: 0.5 solid black; background: rgb(233,233,233); width: '.$col['width'].'%;">' . $col ['label'] . '</th>
|
||||
';
|
||||
}
|
||||
$content .= '
|
||||
</tr></thead><tbody>
|
||||
';
|
||||
|
||||
foreach ( $positions as $pos ) {
|
||||
$content .= '<tr>';
|
||||
foreach ( $columns as $col ) {
|
||||
$content .= '<td style="border: 0.5 solid black; text-align: ' . $col ['align'] . ';">';
|
||||
foreach ( $col ['field'] as $f ) {
|
||||
if ($f == 'image') {
|
||||
$content.='<img width="40px" src="modules/EcmProducts/upload/images/'.$pos['image'].'"/>';
|
||||
} else {
|
||||
if (!$pos[$f] || $pos[$f]=='') $pos[$f]='-';
|
||||
$content .= $pos [$f] . '<br>';
|
||||
}
|
||||
}
|
||||
$content .= '</td>';
|
||||
}
|
||||
$content .= '</tr>';
|
||||
}
|
||||
|
||||
$content .= '
|
||||
</tbody></table>
|
||||
';
|
||||
//summary table
|
||||
//get currency symbol
|
||||
$c = new Currency();
|
||||
$c->retrieve($focus->currency_id);
|
||||
$symbol = $c->symbol;
|
||||
unset($c);
|
||||
$content.='
|
||||
<br><br>
|
||||
<table style="font-size: 9pt; border: 0.5 solid black; border-collapse: collapse; width: 215px; margin-left: 70%">
|
||||
';
|
||||
|
||||
$content.='
|
||||
<tr>
|
||||
<td style="background: rgb(233,233,233); border: 0.5 solid black; width: 50%;">
|
||||
'.$labels['LBL_PDF_CONTENT_TOTAL_NETTO'].'
|
||||
</td>
|
||||
<td style="border: 0.5 solid black; text-align: right;">
|
||||
'.format_number($focus->total_netto).' '.$symbol.'
|
||||
</td>
|
||||
</tr>
|
||||
';
|
||||
|
||||
if ($focus->no_tax=='0') {
|
||||
$vats = explode(",", $focus->vats_summary);
|
||||
foreach ($vats as $v) {
|
||||
$vats2 = explode(":", $v);
|
||||
if ($vats2[0]=='') continue;
|
||||
$content.='
|
||||
<tr>
|
||||
<td style="background: rgb(233,233,233); border: 0.5 solid black; width: 50%;">
|
||||
'.$vats2[0].'
|
||||
</td>
|
||||
<td style="border: 0.5 solid black; text-align: right;">
|
||||
'.format_number($vats2[1]).' '.$symbol.'
|
||||
</td>
|
||||
</tr>
|
||||
';
|
||||
}
|
||||
$content.='
|
||||
<tr>
|
||||
<td style="background: rgb(233,233,233); border: 0.5 solid black; width: 50%;">
|
||||
'.$labels['LBL_PDF_CONTENT_TOTAL_BRUTTO'].'
|
||||
</td>
|
||||
<td style="border: 0.5 solid black; text-align: right;">
|
||||
'.format_number($focus->total_brutto).' '.$symbol.'
|
||||
</td>
|
||||
</tr>
|
||||
';
|
||||
}
|
||||
|
||||
$focus->pdf_text = str_replace(PHP_EOL, "<br>", $focus->pdf_text);
|
||||
$content.='
|
||||
</table>
|
||||
<br><br>
|
||||
<p style="font-size: 12;">'.$focus->pdf_text.'</p>
|
||||
';
|
||||
//echo $content; die();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
100
modules/EcmReturns/PDFTemplate/footer-en_us.php
Normal file
100
modules/EcmReturns/PDFTemplate/footer-en_us.php
Normal file
@@ -0,0 +1,100 @@
|
||||
<?php
|
||||
$w = "62"; //first column width
|
||||
$w2 = "12"; //second column width
|
||||
$footer = '
|
||||
<hr>
|
||||
<table style="width: 100%; font-size: 7pt;">
|
||||
<tr>
|
||||
<td style="width: '.$w.'%">
|
||||
e5 Polska Sp. z o.o
|
||||
</td>
|
||||
<td style="width: '.$w2.'%">
|
||||
<b>'.$labels['LBL_PDF_FOOTER_KRS'].'</b>
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
28207
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: '.$w.'%">
|
||||
ul. Wąwozowa 11
|
||||
</td>
|
||||
<td style="width: '.$w2.'%">
|
||||
<b>'.$labels['LBL_PDF_FOOTER_NIP'].'</b>
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
PL 525-21-73-990
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: '.$w.'%">
|
||||
02-796 Warszawa
|
||||
</td>
|
||||
<td style="width: '.$w2.'%">
|
||||
<b>'.$labels['LBL_PDF_FOOTER_REGON'].'</b>
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
016280234
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: '.$w.'%">
|
||||
Tel: +48 (22) 228 20 90
|
||||
</td>
|
||||
<td style="width: '.$w2.'%">
|
||||
<b>'.$labels['LBL_PDF_FOOTER_BANK'].'</b>
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
';
|
||||
if ($bank=='milenium')
|
||||
$footer.='BANK MILLENIUM';
|
||||
if ($bank=='mbank')
|
||||
$footer.='MBANK';
|
||||
$footer.='
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: '.$w.'%">
|
||||
Fax: +48 (56) 674 60 47
|
||||
</td>
|
||||
<td style="width: '.$w2.'%">
|
||||
<b>'.$labels['LBL_PDF_FOOTER_BANK_ACCOUNT'].'</b>
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
';
|
||||
if ($bank=='milenium')
|
||||
$footer.='PL36116022020000000064080587';
|
||||
if ($bank=='mbank')
|
||||
$footer.='PL96114010100000548212001002';
|
||||
$footer.='
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: '.$w.'%">
|
||||
'.$user->email1.'
|
||||
</td>
|
||||
<td style="width: '.$w2.'%">
|
||||
<b>'.$labels['LBL_PDF_FOOTER_SWIFT'].'</b>
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
';
|
||||
if ($bank=='milenium')
|
||||
$footer.='BIGBPLPW';
|
||||
if ($bank=='mbank')
|
||||
$footer.='BREXPLPW';
|
||||
$footer.='
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
<table style="width: 100%; font-size: 7pt;">
|
||||
<tr>
|
||||
<td style="width: 50%;">
|
||||
{PAGENO}/{nb}
|
||||
</td>
|
||||
<td style="width: 50%; text-align: right">
|
||||
<b>'.$focus->document_no.'</b>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
';
|
||||
95
modules/EcmReturns/PDFTemplate/footer-pl_pl.php
Normal file
95
modules/EcmReturns/PDFTemplate/footer-pl_pl.php
Normal file
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
$w = "62"; //first column width
|
||||
$w2 = "12"; //second column width
|
||||
$footer = '
|
||||
<hr>
|
||||
<table style="width: 100%; font-size: 7pt;">
|
||||
<tr>
|
||||
<td style="width: '.$w.'%">
|
||||
e5 Polska Sp. z o.o
|
||||
</td>
|
||||
<td style="width: '.$w2.'%">
|
||||
<b>'.$labels['LBL_PDF_FOOTER_KRS'].'</b>
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
28207
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: '.$w.'%">
|
||||
ul. Wąwozowa 11
|
||||
</td>
|
||||
<td style="width: '.$w2.'%">
|
||||
<b>'.$labels['LBL_PDF_FOOTER_NIP'].'</b>
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
PL 525-21-73-990
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: '.$w.'%">
|
||||
02-796 Warszawa
|
||||
</td>
|
||||
<td style="width: '.$w2.'%">
|
||||
<b>'.$labels['LBL_PDF_FOOTER_REGON'].'</b>
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
016280234
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: '.$w.'%">
|
||||
Tel: +48 (22) 228 20 90
|
||||
</td>
|
||||
<td style="width: '.$w2.'%">
|
||||
<b>'.$labels['LBL_PDF_FOOTER_BANK'].'</b>
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
';
|
||||
if ($bank=='milenium')
|
||||
$footer.='BANK MILLENIUM';
|
||||
if ($bank=='mbank')
|
||||
$footer.='MBANK';
|
||||
$footer.='
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: '.$w.'%">
|
||||
Fax: +48 (56) 674 60 47
|
||||
</td>
|
||||
<td style="width: '.$w2.'%">
|
||||
<b>'.$labels['LBL_PDF_FOOTER_BANK_ACCOUNT'].'</b>
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
';
|
||||
if ($bank=='milenium')
|
||||
$footer.='35 1160 2202 0000 0000 6408 0411';
|
||||
if ($bank=='mbank')
|
||||
$footer.='26 1140 1010 0000 5482 1200 1001';
|
||||
$footer.='
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: '.$w.'%">
|
||||
'.$user->email1.'
|
||||
</td>
|
||||
<td style="width: '.$w2.'%">
|
||||
<b>'.$labels['LBL_PDF_FOOTER_GIOS'].'</b>
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
E0006254W
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
<table style="width: 100%; font-size: 7pt;">
|
||||
<tr>
|
||||
<td style="width: 50%;">
|
||||
{PAGENO}/{nb}
|
||||
</td>
|
||||
<td style="width: 50%; text-align: right">
|
||||
<b>'.$focus->document_no.'</b>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
';
|
||||
12
modules/EcmReturns/PDFTemplate/header.php
Normal file
12
modules/EcmReturns/PDFTemplate/header.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
$header = '
|
||||
<table style="font-size: 7pt; width: 100%"><tr>
|
||||
<td>
|
||||
<img style="width: 150px;" src="modules/EcmReturns/PDFTemplate/logo.png"/>
|
||||
</td>
|
||||
<td style="text-align: right; vertical-align: bottom; font-size: 12;">
|
||||
www.e5.pl
|
||||
</td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
';
|
||||
55
modules/EcmReturns/PDFTemplate/helper.php
Normal file
55
modules/EcmReturns/PDFTemplate/helper.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
function showDiscount($record) {
|
||||
$db = $GLOBALS['db'];
|
||||
$res = $db->fetchByAssoc($db->query("SELECT count(distinct discount) AS c FROM ecmreturnitems WHERE
|
||||
ecmreturn_id='$record'
|
||||
AND discount!=0"));
|
||||
|
||||
if (isset($res['c']) && $res['c']>0)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
function formatPDFPositions($positions, $focus) {
|
||||
$result = array();
|
||||
foreach ($positions as $pos) {
|
||||
|
||||
$pos['position'] = intval($pos['position'])+1;
|
||||
$p = new EcmProduct();
|
||||
$p -> retrieve($pos['product_id']);
|
||||
|
||||
$pos['ean'] = $p->ean;
|
||||
$pos['ean2'] = $p->ean2;
|
||||
|
||||
$pos['image'] = $p->product_picture;
|
||||
|
||||
unset($p);
|
||||
|
||||
$c = new Currency();
|
||||
$c->retrieve($focus->currency_id);
|
||||
|
||||
$pos['price_start']=format_number($pos['price_start'],2,2).' '.$c->symbol;
|
||||
$pos['price_netto']=format_number($pos['price_netto'],2,2).' '.$c->symbol;
|
||||
$pos['total_netto']=format_number($pos['total_netto'],2,2).' '.$c->symbol;
|
||||
|
||||
unset($c);
|
||||
|
||||
if ($focus->ecmlanguage=='en_ussss') {
|
||||
//get names
|
||||
$db = $GLOBALS['db'];
|
||||
$r = $db->fetchByAssoc($db->query("SELECT short_description FROM ecmproduct_language WHERE ecmproduct_id='".$pos['product_id']."' AND language='en'"));
|
||||
$pos['name'] = $r['short_description'];
|
||||
|
||||
$lists = return_app_list_strings_language($focus->ecmlanguage);
|
||||
$pos['unit_name'] = $lists['ecmproducts_unit_dom'][$pos['unit_id']];
|
||||
unset($lists);
|
||||
}
|
||||
|
||||
$pos['discount'].='%';
|
||||
|
||||
$result[] = $pos;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
139
modules/EcmReturns/Save.php
Normal file
139
modules/EcmReturns/Save.php
Normal file
@@ -0,0 +1,139 @@
|
||||
<?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.
|
||||
|
||||
********************************************************************************/
|
||||
|
||||
$json = getJSONobj();
|
||||
require_once("modules/EcmReturns/EcmReturn.php");
|
||||
require_once('include/formbase.php');
|
||||
$focus = new EcmReturn();
|
||||
|
||||
|
||||
|
||||
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->position_list = $json->decode(htmlspecialchars_decode($_POST['position_list']));
|
||||
|
||||
$focus->save($check_notify);
|
||||
|
||||
$return_id = $focus->id;
|
||||
|
||||
echo $return_id;
|
||||
|
||||
handleRedirect($return_id,'EcmReturns');
|
||||
?>
|
||||
38
modules/EcmReturns/createCorrect.php
Normal file
38
modules/EcmReturns/createCorrect.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
if (! defined ( 'sugarEntry' ) || ! sugarEntry)
|
||||
die ( 'Not A Valid Entry Point' );
|
||||
|
||||
// require_once('modules/EcmGroupSales/HeaderMenu.php');
|
||||
|
||||
global $sugar_version, $sugar_config, $current_user, $app_strings, $mod_strings;
|
||||
|
||||
require_once ('modules/EcmNewServices/EcmNewService.php');
|
||||
require_once ('include/time.php');
|
||||
require_once ('include/json_config.php');
|
||||
|
||||
// add jquery
|
||||
echo '<link rel="stylesheet" type="text/css" href="include/jQuery/jquery-table/jquery.appendGrid-1.3.1.css"/>';
|
||||
echo '<link rel="stylesheet" type="text/css" href="include/jQuery/jquery-ui/themes/base/jquery-ui.css"/>';
|
||||
echo '<script type="text/javascript"
|
||||
src="include/jQuery/jquery-2.1.0.min.js"></script>';
|
||||
echo '<script type="text/javascript"
|
||||
src="include/jQuery/jquery-table/jquery.appendGrid-1.3.1.js"></script>';
|
||||
echo '<script type="text/javascript"
|
||||
src="include/jQuery/jquery-ui/ui/jquery-ui.js"></script>';
|
||||
|
||||
$json_config = new json_config ();
|
||||
$json = getJSONobj ();
|
||||
$focus = new EcmReturn ();
|
||||
|
||||
if (isset ( $_REQUEST ['ecmreturn_id'] )) {
|
||||
$focus->retrieve ( $_REQUEST ['ecmreturn_id'] );
|
||||
$focus->format_all_fields ();
|
||||
$items = $json->decode ( $_SESSION [$_REQUEST ['sess_id']] );
|
||||
if (sizeof ( $items ) == 0 || ! isset ( $focus->document_no ))
|
||||
die ( 'Error!' );
|
||||
$ret= $focus->saveCorrect($items);
|
||||
}
|
||||
|
||||
header('Location: index.php?module=EcmInvoiceOuts&action=DetailView&record='.$ret) ;
|
||||
|
||||
?>
|
||||
105
modules/EcmReturns/import.php
Normal file
105
modules/EcmReturns/import.php
Normal file
@@ -0,0 +1,105 @@
|
||||
<?php
|
||||
|
||||
// compare tables
|
||||
global $app_list_strings;
|
||||
$db = $GLOBALS['db'];
|
||||
$query=$db->query("describe ecmreturnitems");
|
||||
$fields=array();
|
||||
while($r = $db->fetchByAssoc($query)){
|
||||
$fields[]=$r;
|
||||
}
|
||||
//var_dump($fields);
|
||||
|
||||
$query2=$db->query("describe ecmreturnitems");
|
||||
$fields2=array();
|
||||
while($r = $db->fetchByAssoc($query2)){
|
||||
$fields2[]=$r;
|
||||
}
|
||||
|
||||
echo "<table><tr><td>Nazwa pola1</td><td>Nazwa pola2</td>";
|
||||
for($i=0;$i<count($fields2);$i++){
|
||||
echo "<tr><td>".$fields[$i]['Field']."</td><td>".$fields2[$i]['Field']."</td></tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
|
||||
// dodawanie itemkow
|
||||
|
||||
$query2=$db->query("select i.*,p.unit_id,p.product_category_id from ecmreturnitems as i
|
||||
join ecmproducts as p on p.id=i.ecmproduct_id order by i.date_entered desc");
|
||||
$fields2=array();
|
||||
global $app_list_strings;
|
||||
while($r = $db->fetchByAssoc($query2)){
|
||||
if($r['product_component']==1){$a=$db->query("select quantity as quantity_comp from
|
||||
ecmproductcomponents where ecmcomponent_id='".$r['ecmproduct_id']."' and ecmproduct_id='".$r['product_product_id']."'");
|
||||
$c = $db->fetchByAssoc($a);
|
||||
}
|
||||
$db->query("INSERT INTO ecmreturnitems set id='".$r['id']."',
|
||||
date_entered='".$r['date_entered']."',
|
||||
date_modified='".$r['date_modified']."',
|
||||
modified_user_id='".$r['modified_user_id']."',
|
||||
assigned_user_id='".$r['assigned_user_id']."',
|
||||
created_by='".$r['created_by']."',
|
||||
deleted='".$r['deleted']."',
|
||||
ecmreturn_id='".$r['ecmreturn_id']."',
|
||||
ecmproduct_id='".$r['ecmproduct_id']."',
|
||||
position='".$r['position']."',
|
||||
code='".$r['code']."',
|
||||
name='".$r['name']."',
|
||||
quantity='".$r['quantity']."',
|
||||
price_start='".$r['price']."',
|
||||
total_netto='".$r['total']."',
|
||||
dd_unit_id='".$r['dd_unit_id']."',
|
||||
dd_unit_name='".$app_list_strings['ecmproducts_unit_dom'][$r['dd_unit_id']]."',
|
||||
ecmproductcategory_id='".$r['ecmproductcategory_id']."'");
|
||||
}
|
||||
|
||||
|
||||
$db = $GLOBALS['db'];
|
||||
$query=$db->query("describe ecmreturns");
|
||||
$fields=array();
|
||||
while($r = $db->fetchByAssoc($query)){
|
||||
$fields[]=$r;
|
||||
}
|
||||
var_dump($fields);
|
||||
|
||||
$query2=$db->query("describe ecmreturns");
|
||||
$fields2=array();
|
||||
while($r = $db->fetchByAssoc($query2)){
|
||||
$fields2[]=$r;
|
||||
}
|
||||
|
||||
echo "<table><tr><td>Nazwa pola1</td><td>Nazwa pola2</td>";
|
||||
for($i=0;$i<count($fields2);$i++){
|
||||
echo "<tr><td>".$fields[$i]['Field']."</td><td>".$fields2[$i]['Field']."</td></tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
|
||||
$query2=$db->query("select * from ecmreturns");
|
||||
$fields2=array();
|
||||
while($r = $db->fetchByAssoc($query2)){
|
||||
if($r['end_date']=='')$r['end_date']=null;
|
||||
$db->query("INSERT INTO ecmreturns set id='".$r['id']."',
|
||||
date_entered='".$r['date_entered']."',
|
||||
date_modified='".$r['date_modified']."',
|
||||
modified_user_id='".$r['modified_user_id']."',
|
||||
assigned_user_id='".$r['assigned_user_id']."',
|
||||
created_by='".$r['created_by']."',
|
||||
deleted='".$r['deleted']."',
|
||||
name='".$r['name']."',
|
||||
description='".$r['description']."',
|
||||
document_no='".$r['document_no']."',
|
||||
number='".$r['number']."',
|
||||
parent_id='".$r['parent_id']."',
|
||||
parent_name='".$r['parent_name']."',
|
||||
type='".$r['type']."',
|
||||
status='".$r['status']."',
|
||||
register_date='".$r['register_date']."',
|
||||
validtill_date='".$r['validtill_date']."',
|
||||
parent_address_street='".$r['parent_address_street']."',
|
||||
parent_address_city='".$r['parent_address_city']."',
|
||||
parent_address_postalcode='".$r['parent_address_postalcode']."',
|
||||
parent_address_country='".$r['parent_address_country']."',
|
||||
total_netto='".$r['total']."',
|
||||
parent_nip='".$r['to_vatid']."'");
|
||||
}
|
||||
?>
|
||||
1
modules/EcmReturns/javahelper.php
Normal file
1
modules/EcmReturns/javahelper.php
Normal file
@@ -0,0 +1 @@
|
||||
<?php require_once('modules/EcmReturns/javascript/helper.php');
|
||||
104
modules/EcmReturns/javascript/EcmReturns.js
Normal file
104
modules/EcmReturns/javascript/EcmReturns.js
Normal file
@@ -0,0 +1,104 @@
|
||||
//START:
|
||||
$(document).ready(
|
||||
function() {
|
||||
// confirm exit
|
||||
window.onbeforeunload = confirmExit;
|
||||
// prevent submit by enter press
|
||||
lockEnter();
|
||||
// parent info
|
||||
$("#parent_name").change(
|
||||
function() {
|
||||
$(".loading_panel").css("display", "block");
|
||||
setTimeout(function() {
|
||||
getParentInfo($("#parent_id").val(), $(
|
||||
"#parent_type :selected").val());
|
||||
}, 1000);
|
||||
});
|
||||
// categories
|
||||
getCategoriesList();
|
||||
// type change
|
||||
$("#type").change(function() {
|
||||
// calculate totals
|
||||
var count = $('#' + itemsTable + '_T tr').length - 1; // -1 -
|
||||
// thead row
|
||||
for (var index = 0; index != count; index++)
|
||||
calculateRow(index);
|
||||
});
|
||||
// searchProductInput change
|
||||
$('#searchProductsInput').keyup(function() {
|
||||
searchProducts();
|
||||
});
|
||||
DrawHeaders();
|
||||
|
||||
$("#register_date").prop("disabled", true);
|
||||
$("#assigned_user_name").prop("disabled", true);
|
||||
$("#register_date_trigger").hide();
|
||||
$("#btn_assigned_user_name").hide();
|
||||
$("#btn_clr_assigned_user_name").hide();
|
||||
|
||||
if (($("#new_number").val() == true)
|
||||
&& ($("#duplicate").val() != true)) {
|
||||
generateNumber();
|
||||
} else if (($("#new_number").val() == true)
|
||||
&& ($("#duplicate").val() == true)) {
|
||||
generateNumber();
|
||||
getParentInfo($("#parent_id").val(),
|
||||
$("#parent_type :selected").val());
|
||||
getItems();
|
||||
} else {
|
||||
getParentInfo($("#parent_id").val(),
|
||||
$("#parent_type :selected").val());
|
||||
getItems();
|
||||
}
|
||||
// handle setItems
|
||||
setITEMS = function() {
|
||||
var formname = 'EditView';
|
||||
if (check_form_(formname) == true) {
|
||||
SetTab('ITEMS');
|
||||
}
|
||||
};
|
||||
|
||||
});
|
||||
// handle save
|
||||
var check_form_ = check_form;
|
||||
check_form = function(formname) {
|
||||
window.onbeforeunload = null;
|
||||
if (items.length == 0) {
|
||||
alert("Brak produktów");
|
||||
return false;
|
||||
}
|
||||
$(".loading_panel").css("display", "block");
|
||||
$("#register_date").prop("disabled", false);
|
||||
$("#assigned_user_name").prop("disabled", false);
|
||||
// calculate totals
|
||||
var count = $('#' + itemsTable + '_T tr').length - 1; // -1 - thead row
|
||||
for (var index = 0; index != count; index++)
|
||||
calculateRow(index);
|
||||
|
||||
$("#position_list").val(JSON.stringifyNoSecurity(items));
|
||||
|
||||
var check = checkProducts();
|
||||
|
||||
if (check_form_(formname) == false || check == false) {
|
||||
$("#register_date").prop("disabled", true);
|
||||
$("#assigned_user_name").prop("disabled", true);
|
||||
window.onbeforeunload = confirmExit;
|
||||
$(".loading_panel").css("display", "none");
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
function confirmExit() {
|
||||
return "";
|
||||
}
|
||||
|
||||
function lockEnter() {
|
||||
// prevent default
|
||||
$(window).keydown(function(event) {
|
||||
if (event.keyCode == 13 && $(":focus").prop('tagName')!='TEXTAREA') {
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
7
modules/EcmReturns/javascript/EcmReturnsDetail.js
Normal file
7
modules/EcmReturns/javascript/EcmReturnsDetail.js
Normal file
@@ -0,0 +1,7 @@
|
||||
//START:
|
||||
$(document).ready(
|
||||
function() {
|
||||
DrawHeaders();
|
||||
getItems(false);
|
||||
});
|
||||
|
||||
829
modules/EcmReturns/javascript/bimit_table.js
Normal file
829
modules/EcmReturns/javascript/bimit_table.js
Normal file
@@ -0,0 +1,829 @@
|
||||
var ajax_url = "index.php?module=EcmReturns&action=javahelper&to_pdf=1";
|
||||
var itemsTable = 'itemsTable';
|
||||
var items = new Array();
|
||||
var displayArray = new Array();
|
||||
var searchedProducts = new Array();
|
||||
|
||||
function FillTable(data, allReadOnly) {
|
||||
html = '';
|
||||
// loop throw data rows
|
||||
$
|
||||
.each(
|
||||
data,
|
||||
function(row_index, row) {
|
||||
html += '<tr>';
|
||||
// and insert columns
|
||||
$
|
||||
.each(
|
||||
columns,
|
||||
function(col_index, column) {
|
||||
// row must have code and name
|
||||
if (!row.product_code
|
||||
|| row.product_code == ''
|
||||
|| !row.name
|
||||
|| row.name == '')
|
||||
return; // return in each =
|
||||
// continue in php for
|
||||
// loop
|
||||
// special types
|
||||
if (column.name == 'number') {
|
||||
html += '<td><input class="inputs" style="text-align: center;" type="text" id="number_'
|
||||
+ row_index
|
||||
+ '" name="number_'
|
||||
+ row_index
|
||||
+ '" readonly value="'
|
||||
+ (row_index + 1)
|
||||
+ '"/></td>';
|
||||
} else if (column.name == 'name') {
|
||||
html += '<td><textarea style="width: 100%; height: 100%;" id="name_'
|
||||
+ row_index
|
||||
+ '" name="name_'
|
||||
+ row_index + '"';
|
||||
if (allReadOnly)
|
||||
html += ' readonly';
|
||||
html += '>' + row.name
|
||||
+ '</textarea></td>';
|
||||
} else if (column.name == 'options') {
|
||||
if (allReadOnly)
|
||||
html += '<td></tr>';
|
||||
else {
|
||||
html += '<td>';
|
||||
// move up
|
||||
html += '<a onClick="moveUpRow('
|
||||
+ row_index
|
||||
+ ')" target="_blank"><img style="cursor:pointer;" src="modules/EcmReturns/images/moverowup.gif"/></a>';
|
||||
html += ' ';
|
||||
// move down
|
||||
html += '<a onClick="moveDownRow('
|
||||
+ row_index
|
||||
+ ')" target="_blank"><img style="cursor:pointer;" src="modules/EcmReturns/images/moverowdown.gif"/></a>';
|
||||
html += '<br>';
|
||||
// delete row
|
||||
html += '<a onClick="deleteRow('
|
||||
+ row_index
|
||||
+ ')" target="_blank"><img style="cursor:pointer;" src="modules/EcmReturns/images/deleterow.gif"/></a>';
|
||||
html += '</td>';
|
||||
}
|
||||
}
|
||||
// other types
|
||||
else {
|
||||
html += '<td>';
|
||||
$
|
||||
.each(
|
||||
column.content,
|
||||
function(
|
||||
cell_index,
|
||||
cell) {
|
||||
var cellname = column.name
|
||||
+ cell.name;
|
||||
if (cellname == 'product_link') {
|
||||
html += '<a href="index.php?module=EcmProducts&action=DetailView&record='
|
||||
+ row.product_id
|
||||
+ '" target="_blank">'
|
||||
+ row.product_code
|
||||
+ '</a>';
|
||||
} else if (cellname == 'price_start_div'
|
||||
&& !allReadOnly) {
|
||||
html += '<br><img style="cursor: pointer;" src="modules/EcmReturns/images/search.gif" onClick="if ($(\'#price_start_div_'
|
||||
+ row_index
|
||||
+ '\').css(\'display\')==\'none\') getPricesInfo('
|
||||
+ row_index
|
||||
+ '); else $(\'#price_start_div_'
|
||||
+ row_index
|
||||
+ '\').hide(\'slow\')"/>';
|
||||
html += '<div id="'
|
||||
+ cellname
|
||||
+ '_'
|
||||
+ row_index
|
||||
+ '" style="display:none;float:right;text-align:right;border: 1px #cccccc solid;padding:3px;"></div>';
|
||||
} else {
|
||||
if (cell.label
|
||||
&& cell.label != '')
|
||||
html += '<p>'
|
||||
+ cell.label
|
||||
+ '</p>';
|
||||
html += '<input class="inputs" type="'
|
||||
+ cell.type
|
||||
+ '" name="'
|
||||
+ cellname
|
||||
+ '_'
|
||||
+ row_index
|
||||
+ '" id="'
|
||||
+ cellname
|
||||
+ '_'
|
||||
+ row_index
|
||||
+ '"';
|
||||
if (cell.readonly
|
||||
|| allReadOnly)
|
||||
html += ' readonly ';
|
||||
if (column.align)
|
||||
html += ' style="text-align: '
|
||||
+ column.align
|
||||
+ ';"';
|
||||
if (cell.onChange
|
||||
|| cell.isNumber)
|
||||
html += ' onChange="$(this).val(FormatNumber($(this).val()));'
|
||||
+ cell.onChange
|
||||
+ '" onClick="$(this).select();"';
|
||||
else if (cell.onChange
|
||||
|| !cell.isNumber)
|
||||
html += ' onChange="'
|
||||
+ cell.onChange
|
||||
+ '" ';
|
||||
if (row[cellname]
|
||||
&& cell.isNumber)
|
||||
html += ' value="'
|
||||
+ FormatNumber(row[cellname])
|
||||
+ '" ';
|
||||
else if (row[cellname])
|
||||
html += ' value="'
|
||||
+ row[cellname]
|
||||
+ '" ';
|
||||
else {
|
||||
if (cell.isNumber)
|
||||
html += ' value="0,00" ';
|
||||
else
|
||||
html += ' value="" ';
|
||||
}
|
||||
html += '>';
|
||||
}
|
||||
});
|
||||
html += '</td>';
|
||||
}
|
||||
|
||||
});
|
||||
html += '</tr>';
|
||||
|
||||
});
|
||||
|
||||
$('#' + itemsTable + '_T > tbody').html(html);
|
||||
|
||||
if (!allReadOnly) {
|
||||
// calculate totals
|
||||
var count = $('#' + itemsTable + '_T tr').length - 1; // -1 - thead row
|
||||
for (var index = 0; index != count; index++)
|
||||
calculateRow(index);
|
||||
} else {
|
||||
if ($("#type").val() == '0') {
|
||||
$("input[name^=price_start]").css("color", "red");
|
||||
$("input[name^=total_netto]").css("color", "red");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function calculateRow(index) {
|
||||
if (index == -1)
|
||||
return;
|
||||
|
||||
// liczone według najlepszych zasad księgowości
|
||||
var price_start = UnformatNumber($('#price_start_' + index).val());
|
||||
|
||||
var quantity = UnformatNumber($('#quantity_' + index).val());
|
||||
var price_netto = 0;
|
||||
|
||||
price_netto = price_start;
|
||||
|
||||
var total_netto = price_netto * quantity;
|
||||
|
||||
// put data
|
||||
$('#price_netto_' + index).val(FormatNumber(price_netto));
|
||||
$('#total_netto_' + index).val(FormatNumber(total_netto));
|
||||
|
||||
// put data to items array
|
||||
items[index].price_start = toFixed(price_start, 2);
|
||||
items[index].price_netto = toFixed(price_netto, 2);
|
||||
items[index].total_netto = toFixed(total_netto, 2);
|
||||
items[index].quantity = toFixed(quantity, 2);
|
||||
|
||||
// put other data
|
||||
items[index].recipient_code = $('#recipient_code_' + index).val();
|
||||
items[index].remarks = $('#remarks_' + index).val();
|
||||
// change name or language?
|
||||
items[index].name = $('#name_' + index).val();
|
||||
items[index].unit_name = $('#unit_name_' + index).val();
|
||||
|
||||
if ($("#type").val() == '0') {
|
||||
$("#price_start_" + index).prop("disabled", true);
|
||||
$("#price_start_" + index).css("color", "red");
|
||||
$("#total_netto_" + index).css("color", "red");
|
||||
} else {
|
||||
$("#price_start_" + index).prop("disabled", false);
|
||||
$("#price_start_" + index).css("color", "black");
|
||||
$("#total_netto_" + index).css("color", "black");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function deleteRow(index) {
|
||||
items.splice(index, 1);
|
||||
FillTable(items);
|
||||
}
|
||||
|
||||
function moveUpRow(index) {
|
||||
if (index == 0)
|
||||
return; // Can't go upper.. :(
|
||||
var new_index = index - 1;
|
||||
var old_index = index;
|
||||
if (new_index >= items.length) {
|
||||
var k = new_index - items.length;
|
||||
while ((k--) + 1) {
|
||||
items.push(undefined);
|
||||
}
|
||||
}
|
||||
items.splice(new_index, 0, items.splice(old_index, 1)[0]);
|
||||
FillTable(items);
|
||||
}
|
||||
|
||||
function moveDownRow(index) {
|
||||
if (index == items.length - 1)
|
||||
return; // Can't go lower.. :(
|
||||
var new_index = index + 1;
|
||||
var old_index = index;
|
||||
if (new_index >= items.length) {
|
||||
var k = new_index - items.length;
|
||||
while ((k--) + 1) {
|
||||
items.push(undefined);
|
||||
}
|
||||
}
|
||||
items.splice(new_index, 0, items.splice(old_index, 1)[0]);
|
||||
FillTable(items);
|
||||
}
|
||||
|
||||
function FormatNumber(number, precision) {
|
||||
var precision = precision || 2;
|
||||
// make string..
|
||||
number = number + '';
|
||||
number = number.replace(',', '.');
|
||||
// round
|
||||
number = toFixed(number, precision);
|
||||
// add 1000 sep
|
||||
var tmp = number.split(".");
|
||||
var c = '';
|
||||
for (var i = tmp[0].length; i != -1; i--) {
|
||||
c += tmp[0].charAt(i);
|
||||
if ((tmp[0].length - i) == 0 || i == 0)
|
||||
continue;
|
||||
if ((tmp[0].length - i) % 3 == 0)
|
||||
c += '.';
|
||||
}
|
||||
// reverse c
|
||||
c = c.split("").reverse().join("");
|
||||
|
||||
return c + ',' + tmp[1];
|
||||
}
|
||||
|
||||
function UnformatNumber(number) {
|
||||
// make string..
|
||||
number = number + '';
|
||||
// remove 1000 sep
|
||||
number = number.replace('.', '');
|
||||
// change ',' to '.'
|
||||
number = number.replace(',', '.');
|
||||
|
||||
return parseFloat(number);
|
||||
}
|
||||
|
||||
// round with precision
|
||||
function toFixed(value, precision) {
|
||||
var precision = precision || 0, neg = value < 0, power = Math.pow(10,
|
||||
precision), value = Math.round(value * power), integral = String((neg ? Math.ceil
|
||||
: Math.floor)(value / power)), fraction = String((neg ? -value
|
||||
: value)
|
||||
% power), padding = new Array(Math.max(precision - fraction.length,
|
||||
0) + 1).join('0');
|
||||
|
||||
return precision ? integral + '.' + padding + fraction : integral;
|
||||
}
|
||||
|
||||
// draw table
|
||||
function DrawHeaders() {
|
||||
var html = '<link rel="stylesheet" type="text/css" href="modules/EcmReturns/MyTable.css" />';
|
||||
html += '<div style="width:100%;border: 1px solid rgb(48,192,255);background-color:white;height: 250px;overflow:auto;" id="'
|
||||
+ itemsTable + 'DIV">';
|
||||
html += '<table class="positions" style="width:100%;" id="' + itemsTable
|
||||
+ '_T">';
|
||||
html += '<thead id="head">';
|
||||
html += '<tr id="tr">';
|
||||
// draw columns headers
|
||||
$.each(columns, function(index, column) {
|
||||
html += '<td width="' + column.width + '%">' + column.label + '</td>';
|
||||
});
|
||||
html += '</tr></thead><tbody></tbody></table>';
|
||||
html += '</div><br>';
|
||||
// totals table
|
||||
html += '<table width="100%"" cellpadding="0" cellspacing="0" border="0">';
|
||||
html += '<tr>';
|
||||
html += '<td width="55%" class="dataLabel" valign="top">';
|
||||
html += ' ';
|
||||
html += '</td> <!--color:#b3b9cf;-->';
|
||||
html += '<td width="40%" class="dataField" style="text-align: left;">';
|
||||
html += '<br>';
|
||||
html += '<table id="result_table" cellpadding="0" cellspacing="0" style="width:100%; height:100%; border: 1px solid rgb(48,192,255);">';
|
||||
html += '</table>';
|
||||
html += '</td>';
|
||||
html += '<td width="5%" class="dataField" style="text-align: left;"> </td>';
|
||||
html += '</tr>';
|
||||
html += '</table>';
|
||||
// sort? why not!
|
||||
/*
|
||||
* html += 'Sortowanie: '; html += '<select id="sort_field"
|
||||
* onChange="sortTable();"'; html += '<option value=""></option>'; html += '<option
|
||||
* value="name">Nazwa</option>'; html += '<option value="code">Kod</option>';
|
||||
* html += '<option value="category">Kategoria</option>'; html += '<option
|
||||
* value="category">Kategoria</option>'; html += '<option
|
||||
* value="price">Cena po<br>upuście</option>'; html += '<option
|
||||
* value="total">Wartość</option>'; html += '</select>';
|
||||
*/
|
||||
$('#' + itemsTable).html(html);
|
||||
}
|
||||
function searchProducts() {
|
||||
var searchKey = $('#searchProductsInput').val();
|
||||
if (searchKey.length < 2 && searchKey != '%') {
|
||||
return;
|
||||
}
|
||||
$("#searchResultDiv").html(
|
||||
'<img src="modules/EcmReturns/images/loading.gif"/>');
|
||||
setTimeout(function() {
|
||||
if (searchKey == $('#searchProductsInput').val()) {
|
||||
var params = {
|
||||
job : 'searchProducts',
|
||||
searchKey : searchKey,
|
||||
searchCategory : $("#productSearchCategory :selected").val(),
|
||||
searchStock : $("#productSearchStock :selected").val(),
|
||||
searchSort : $("#productSearchSort :selected").val(),
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : ajax_url,
|
||||
dataType : "json",
|
||||
success : function(data) {
|
||||
if (data != '-1')
|
||||
if (data.length == 0)
|
||||
$('#searchResultDiv').html(
|
||||
'MOD.LBL_SEARCH_NO_RESULT');
|
||||
else
|
||||
createSearchResult(data);
|
||||
},
|
||||
data : params
|
||||
});
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
function createSearchResult(data) {
|
||||
var html = '<table style="border: 0.5px dashed black; border-collapse: collapse; text-align: center;">';
|
||||
html += '<theader><tr>';
|
||||
html += '<th style="border: 0.5px dashed black; width: 15pt; margin: auto auto;"> </th>';
|
||||
html += '<th style="border: 0.5px dashed black; width: 100pt; text-align: center;">Kod</th>';
|
||||
html += '<th style="border: 0.5px dashed black; width: 300pt; text-align: center;">Nazwa</th>';
|
||||
if ($("#productSearchStock :selected").val() != '1')
|
||||
html += '<th style="border: 0.5px dashed black; width: 30pt; text-align: center;">Stan</th>';
|
||||
html += '<th style="border: 0.5px dashed black; width: 15pt; margin: auto auto;"> </th>';
|
||||
|
||||
html += '</tr></thead>';
|
||||
|
||||
$
|
||||
.each(
|
||||
data,
|
||||
function(index, value) {
|
||||
html += '<tr style="height: 15pt;">';
|
||||
html += '<td style="border: 0.5px dashed black;"><input id="prod_'
|
||||
+ value.id + '" type="checkbox"/></td>';
|
||||
html += '<td style="border: 0.5px dashed black;" onClick="$(\'#prod_'
|
||||
+ value.id
|
||||
+ '\').prop(\'checked\', true);">'
|
||||
+ value.code + '</td>';
|
||||
html += '<td style="border: 0.5px dashed black;" onClick="unsetAllCheckboxes(); $(\'#prod_'
|
||||
+ value.id
|
||||
+ '\').prop(\'checked\', true); return addProducts();">'
|
||||
+ value.name + '</td>';
|
||||
if ($("#productSearchStock :selected").val() != '1')
|
||||
html += '<td style="border: 0.5px dashed black;">'
|
||||
+ value.stock_state + '</td>';
|
||||
html += '<td style="border: 0.5px dashed black;">';
|
||||
html += '<img style="cursor: pointer;" src="modules/EcmReturns/images/search.gif" onClick="if ($(\'#search_info_div_'
|
||||
+ value.id
|
||||
+ '\').css(\'display\')==\'none\') getSearchInfo(\''
|
||||
+ value.id
|
||||
+ '\',\''
|
||||
+ value.code
|
||||
+ '\'); else $(\'#search_info_div_'
|
||||
+ value.id
|
||||
+ '\').hide(\'slow\')"/>';
|
||||
html += '<div id="'
|
||||
+ 'search_info_div_'
|
||||
+ value.id
|
||||
+ '" style="display:none;float:right;text-align:right;border: 1px #cccccc solid;padding:3px;"></div>';
|
||||
html += '</td>';
|
||||
html += '</tr>';
|
||||
searchedProducts.push(value.id);
|
||||
});
|
||||
// add button
|
||||
html += '</table><br>';
|
||||
html += 'Cena: <input type="text" id="searchInputPrice" value=""/> Ilość: <input type="text" id="searchInputQty" value=""/>';
|
||||
html += '<br><br><input type="button" value="Dodaj wiele" onClick="return addProducts();"/>';
|
||||
$('#searchResultDiv').html(html);
|
||||
}
|
||||
|
||||
function unsetAllCheckboxes() {
|
||||
$("#searchResultDiv input[type=checkbox]").each(function() {
|
||||
$(this).prop("checked", false);
|
||||
});
|
||||
}
|
||||
|
||||
function addProducts() {
|
||||
$(".loading_panel").css("display", "block");
|
||||
var products = new Array();
|
||||
$.each(searchedProducts, function(index, value) {
|
||||
if ($('#prod_' + value).is(':checked'))
|
||||
products[value] = true;
|
||||
});
|
||||
var pricebook = $("#pricebook_id :selected").val();
|
||||
for ( var key in products) {
|
||||
var params = {
|
||||
job : 'getProduct',
|
||||
id : key,
|
||||
pricebook : pricebook,
|
||||
account_id : $("#parent_id").val(),
|
||||
language : $("#ecmlanguage").val(),
|
||||
};
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : ajax_url,
|
||||
dataType : "json",
|
||||
async : false,
|
||||
success : function(data) {
|
||||
if (data != '-1') {
|
||||
var p = new Object();
|
||||
p.product_id = data.id;
|
||||
p.name = data.name;
|
||||
p.product_code = data.code;
|
||||
p.product_id = data.id;
|
||||
p.ecmvat_id = data.ecmvat_id;
|
||||
p.ecmvat_value = data.ecmvat_value;
|
||||
p.ecmvat_name = data.ecmvat_name;
|
||||
p.product_ean = data.ean;
|
||||
p.product_ean2 = data.ean2;
|
||||
p.unit_name = data.unit_name;
|
||||
p.unit_id = data.unit_id;
|
||||
//p.price_start = data.price_start;
|
||||
p.recipient_code = data.recipient_code;
|
||||
if ($("#searchInputPrice").val() != ''
|
||||
&& !isNaN(parseFloat(UnformatNumber($(
|
||||
"#searchInputPrice").val()))))
|
||||
p.price_start = $("#searchInputPrice").val();
|
||||
if ($("#searchInputQty").val() != ''
|
||||
&& !isNaN(parseFloat(UnformatNumber($(
|
||||
"#searchInputQty").val()))))
|
||||
p.quantity = $("#searchInputQty").val();
|
||||
items.push(p);
|
||||
}
|
||||
},
|
||||
data : params
|
||||
});
|
||||
}
|
||||
FillTable(items);
|
||||
// clear results
|
||||
$('#searchResultDiv').html('');
|
||||
searchedProducts = new Array();
|
||||
$('#searchProductsInput').val('');
|
||||
|
||||
$(".loading_panel").css("display", "none");
|
||||
}
|
||||
|
||||
function getItems(editview) {
|
||||
var record = '';
|
||||
if ($("#duplicate").val() == true)
|
||||
record = $("input[name='return_id']").val();
|
||||
else
|
||||
record = $("input[name='record']").val();
|
||||
if (isNaN(editview))
|
||||
editview = true;
|
||||
var params = {
|
||||
job : 'getItems',
|
||||
record : record,
|
||||
};
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : ajax_url,
|
||||
dataType : "json",
|
||||
success : function(data) {
|
||||
items = data;
|
||||
if (editview)
|
||||
FillTable(items, false);
|
||||
else
|
||||
FillTable(items, true);
|
||||
$(".loading_panel").css("display", "none");
|
||||
},
|
||||
data : params
|
||||
});
|
||||
}
|
||||
|
||||
function changeLanguage() {
|
||||
$(".loading_panel").css("display", "block");
|
||||
var count = $('#' + itemsTable + '_T tr').length - 1; // -1 - thead row
|
||||
for (var index = 0; index != count; index++) {
|
||||
var params = {
|
||||
job : 'getTranslation',
|
||||
product_id : $("#product_id_" + index).val(),
|
||||
language : $("#ecmlanguage").val(),
|
||||
unit_id : $("#unit_id_" + index).val(),
|
||||
};
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : ajax_url,
|
||||
async : false,
|
||||
dataType : "json",
|
||||
success : function(data) {
|
||||
$("#name_" + index).val(data.name);
|
||||
$("#unit_name_" + index).val(data.unit_name);
|
||||
calculateRow(index);
|
||||
},
|
||||
data : params
|
||||
});
|
||||
}
|
||||
$(".loading_panel").css("display", "none");
|
||||
}
|
||||
|
||||
function getPricesInfo(index) {
|
||||
$("#price_start_div_" + index).show('slow');
|
||||
$("#price_start_div_" + index).html(
|
||||
'<img src="modules/EcmReturns/images/loading.gif"/>');
|
||||
|
||||
var params = {
|
||||
job : 'getPricesInfo',
|
||||
product_id : $("#product_id_" + index).val(),
|
||||
pricebook_id : $("#pricebook_id :selected").val(),
|
||||
account_id : $("#parent_id").val(),
|
||||
};
|
||||
$
|
||||
.ajax({
|
||||
type : "POST",
|
||||
url : ajax_url,
|
||||
dataType : "json",
|
||||
async : false,
|
||||
success : function(data) {
|
||||
html = '<ul style="font-size: 7pt;">';
|
||||
$
|
||||
.each(
|
||||
data,
|
||||
function(key, value) {
|
||||
console.log(value.price);
|
||||
if (value.name == 'pricebook') {
|
||||
html += '<li style="cursor:pointer;" onClick="$(\'#price_start_'
|
||||
+ index
|
||||
+ '\').val(\''
|
||||
+ FormatNumber(value.price)
|
||||
+ '\'); $(this).closest(\'div\').hide(\'slow\');calculateRow('
|
||||
+ index
|
||||
+ ')"><u>'
|
||||
+ $(
|
||||
"#pricebook_id :selected")
|
||||
.html()
|
||||
+ ': '
|
||||
+ FormatNumber(value.price)
|
||||
+ '</u></li>';
|
||||
} else if (value.name == $(
|
||||
"#ecmprice_name").val()) {
|
||||
html += '<li style="cursor:pointer;" onClick="$(\'#price_start_'
|
||||
+ index
|
||||
+ '\').val(\''
|
||||
+ FormatNumber(value.price)
|
||||
+ '\'); $(this).closest(\'div\').hide(\'slow\');calculateRow('
|
||||
+ index
|
||||
+ ');"><b>'
|
||||
+ value.name
|
||||
+ ': '
|
||||
+ FormatNumber(value.price)
|
||||
+ '</b></li>';
|
||||
} else {
|
||||
html += '<li style="cursor:pointer;" onClick="$(\'#price_start_'
|
||||
+ index
|
||||
+ '\').val(\''
|
||||
+ FormatNumber(value.price)
|
||||
+ '\'); $(this).closest(\'div\').hide(\'slow\');calculateRow('
|
||||
+ index
|
||||
+ ');">'
|
||||
+ value.name
|
||||
+ ': '
|
||||
+ FormatNumber(value.price)
|
||||
+ '</li>';
|
||||
}
|
||||
});
|
||||
html += '</ul>';
|
||||
},
|
||||
data : params
|
||||
});
|
||||
$("#price_start_div_" + index).html(html);
|
||||
}
|
||||
|
||||
function getSearchInfo(product_id, product_code) {
|
||||
$("#search_info_div_" + product_id).show('slow');
|
||||
var html = '<a href="index.php?module=EcmProducts&action=DetailView&record='
|
||||
+ product_id + '" target="_blank">' + product_code + '</a><br><br>';
|
||||
html += '<table><tr><td><table><tr><td>';
|
||||
// get prices info
|
||||
var params = {
|
||||
job : 'getPricesInfo',
|
||||
product_id : product_id,
|
||||
pricebook_id : $("#pricebook_id :selected").val(),
|
||||
account_id : $("#parent_id").val(),
|
||||
};
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : ajax_url,
|
||||
dataType : "json",
|
||||
async : false,
|
||||
success : function(data) {
|
||||
html += 'Ceny<br>';
|
||||
$.each(data, function(key, value) {
|
||||
if (value.name == 'pricebook')
|
||||
html += $("#pricebook_id :selected").html() + ': '
|
||||
+ FormatNumber(value.price) + '<br>';
|
||||
if (value.name == $("#ecmprice_name").val())
|
||||
html += '<b>' + value.name + ': '
|
||||
+ FormatNumber(value.price) + '</b><br>';
|
||||
else
|
||||
html += value.name + ': ' + FormatNumber(value.price)
|
||||
+ '<br>';
|
||||
});
|
||||
},
|
||||
data : params
|
||||
});
|
||||
html += '</td></tr></table></td><td><table><tr><td>';
|
||||
var params = {
|
||||
job : 'getStockArray',
|
||||
product_id : product_id,
|
||||
};
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : ajax_url,
|
||||
dataType : "json",
|
||||
async : false,
|
||||
success : function(data) {
|
||||
html += 'Stany<br>';
|
||||
$.each(data, function(key, value) {
|
||||
html += key + ': ' + FormatNumber(value)
|
||||
+ '<br>';
|
||||
});
|
||||
},
|
||||
data : params
|
||||
});
|
||||
html += '</td></tr></table></td>';
|
||||
var show_purchase_prices = false;
|
||||
|
||||
if (show_purchase_prices) {
|
||||
html+='<td><table><tr><td>';
|
||||
var params = {
|
||||
job : 'getPurchaseArray',
|
||||
product_id : product_id,
|
||||
};
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : ajax_url,
|
||||
dataType : "json",
|
||||
async : false,
|
||||
success : function(data) {
|
||||
console.log(data);
|
||||
},
|
||||
data : params
|
||||
});
|
||||
html+='</td></tr></table></td>';
|
||||
}
|
||||
|
||||
html+='</tr></table>';
|
||||
|
||||
$("#search_info_div_" + product_id).html(html);
|
||||
}
|
||||
|
||||
//sortable rows in main table
|
||||
$("#"+itemsTable+" tbody").sortable();
|
||||
//get parent info use ajax
|
||||
function getParentInfo(parent_id, parent_type) {
|
||||
var params = {
|
||||
id : parent_id,
|
||||
type : 'Accounts',
|
||||
job : 'getParentInfo'
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: ajax_url,
|
||||
dataType : "json",
|
||||
success: function(data) {
|
||||
if (data == '-1') {
|
||||
alert('Błąd');
|
||||
$("#parent_name").val('');
|
||||
$("#parent_id").val('');
|
||||
} else {
|
||||
setParentInfo(data);
|
||||
}
|
||||
},
|
||||
data: params
|
||||
});
|
||||
}
|
||||
|
||||
//insert parent info in fields
|
||||
function setParentInfo(data) {
|
||||
//pricebooks
|
||||
createPricebookSelect(data.pricebooks);
|
||||
if (data.ecmprice_id && data.ecmprice_name) {
|
||||
$("#ecmprice_id").val(data.ecmprice_id);
|
||||
$("#ecmprice_name").val(data.ecmprice_name);
|
||||
}
|
||||
if ($("#new_number").val() == false) return; //if edit exists load only pricebooks
|
||||
if (data.name)
|
||||
$("#parent_name_copy").val(data.name);
|
||||
if (data.parent_nip)
|
||||
$("#parent_nip").val(data.parent_nip);
|
||||
if (data.parent_address_street)
|
||||
$("#parent_address_street").val(data.parent_address_street);
|
||||
if (data.parent_address_city)
|
||||
$("#parent_address_city").val(data.parent_address_city);
|
||||
if (data.parent_address_postalcode)
|
||||
$("#parent_address_postalcode").val(data.parent_address_postalcode);
|
||||
if (data.parent_address_country)
|
||||
$("#parent_address_country").val(data.parent_address_country);
|
||||
if (data.invoice_type && data.invoice_type!='K')
|
||||
$("#no_tax").attr('checked', true);
|
||||
if (data.ecmpaymentcondition_id && data.ecmpaymentcondition_name) {
|
||||
$("#ecmpaymentcondition_id").val(data.ecmpaymentcondition_id);
|
||||
$("#ecmpaymentcondition_name").val(data.ecmpaymentcondition_name);
|
||||
}
|
||||
if (data.ecmdeliverycondition_id && data.ecmdeliverycondition_name) {
|
||||
$("#ecmdeliverycondition_id").val(data.ecmdeliverycondition_id);
|
||||
$("#ecmdeliverycondition_name").val(data.ecmdeliverycondition_name);
|
||||
}
|
||||
if (data.currency_id)
|
||||
$("#currency_id option[value=\""+data.currency_id+"\"]").attr('selected', 'selected');
|
||||
//hide loading
|
||||
$(".loading_panel").css("display", "none");
|
||||
}
|
||||
|
||||
function createPricebookSelect(pricebooks) {
|
||||
var s = $("<select id=\"pricebook_id\"/>");
|
||||
var opt = '';
|
||||
$.each(pricebooks, function(index, value) {
|
||||
opt+='<option value="'+value.id+'">'+value.name+'</option>';
|
||||
});
|
||||
s.html(opt);
|
||||
$("#pricebooks").append(s);
|
||||
}
|
||||
|
||||
function generateNumber() {
|
||||
var params = {
|
||||
job : 'generateNumber'
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: ajax_url,
|
||||
dataType : "json",
|
||||
success: function(data) {
|
||||
if (data == '-1') {
|
||||
//try loading again
|
||||
generateNumber();
|
||||
} else {
|
||||
$("#document_no").val(data.document_no);
|
||||
$("#number").val(data.number);
|
||||
$(".loading_panel").css("display", "none");
|
||||
}
|
||||
},
|
||||
data: params
|
||||
});
|
||||
}
|
||||
|
||||
function getCategoriesList() {
|
||||
var params = {
|
||||
job : 'getCategoriesList'
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: ajax_url,
|
||||
dataType : "json",
|
||||
success: function(data) {
|
||||
var html = '<option value=""></option>';
|
||||
$.each(data, function(index, value){
|
||||
html+='<option value="'+value.id+'">'+value.name+'</option>';
|
||||
$("#productSearchCategory").html(html);
|
||||
});
|
||||
},
|
||||
data: params
|
||||
});
|
||||
}
|
||||
|
||||
function checkProducts() {
|
||||
var count = $('#' + itemsTable + '_T tr').length - 1; // -1 - thead row
|
||||
var error = false; // hope :)
|
||||
for (var index = 0; index != count; index++) {
|
||||
var qty = UnformatNumber($("#quantity_" + index).val());
|
||||
if (qty < 1) error = true;
|
||||
}
|
||||
if (error)
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
75
modules/EcmReturns/javascript/columndefs-detail.js
Normal file
75
modules/EcmReturns/javascript/columndefs-detail.js
Normal file
@@ -0,0 +1,75 @@
|
||||
columns = new Array();
|
||||
//define columns
|
||||
//begin: number
|
||||
columns[0] = {
|
||||
'name' : 'number',
|
||||
'label' : 'Lp.',
|
||||
'width' : 4,
|
||||
'content' : new Array(),
|
||||
};
|
||||
columns[0]['content'][0] = {'name' : '', 'type': 'text', 'readonly' : true};
|
||||
//end: number
|
||||
//begin: code
|
||||
columns[1] = {
|
||||
'name' : 'product_',
|
||||
'label' : 'Kod',
|
||||
'width' : 6,
|
||||
'content' : new Array(),
|
||||
};
|
||||
columns[1]['content'][0] = {'name' : 'code', 'type': 'hidden', 'readonly' : true};
|
||||
columns[1]['content'][1] = {'name' : 'id', 'type': 'hidden'};
|
||||
columns[1]['content'][2] = {'name' : 'link', 'type': 'text', 'readonly' : true};
|
||||
//end: code
|
||||
//begin: name
|
||||
columns[2] = {
|
||||
'name' : 'name',
|
||||
'label' : 'Nazwa',
|
||||
'width' : 20,
|
||||
'content' : new Array(),
|
||||
};
|
||||
columns[2]['content'][0] = {'name' : '', 'type': 'text'};
|
||||
//end: name
|
||||
//begin: quantity
|
||||
columns[3] = {
|
||||
'name' : 'quantity',
|
||||
'label' : 'Ilość',
|
||||
'width' : 5,
|
||||
'content' : new Array(),
|
||||
'align' : 'right',
|
||||
};
|
||||
columns[3]['content'][0] = {'name' : '', 'type': 'text', 'isNumber' : true, 'onChange' : 'calculateRow($(this).parent(\'td\').parent(\'tr\').index());'};
|
||||
//end: quantity
|
||||
//begin: unit
|
||||
columns[4] = {
|
||||
'name' : 'unit_',
|
||||
'label' : 'J.M.',
|
||||
'width' : 5,
|
||||
'content' : new Array(),
|
||||
'align' : 'center',
|
||||
};
|
||||
columns[4]['content'][0] = {'name' : 'name', 'type': 'text','readonly' : true};
|
||||
columns[4]['content'][1] = {'name' : 'id', 'type': 'hidden'};
|
||||
//end: unit
|
||||
//begin: price_start
|
||||
columns[5] = {
|
||||
'name' : 'price_start',
|
||||
'label' : 'Cena',
|
||||
'width' : 5,
|
||||
'content' : new Array(),
|
||||
'align' : 'right',
|
||||
};
|
||||
columns[5]['content'][0] = {'name' : '', 'type': 'text', 'isNumber' : true, 'onChange' : 'calculateRow($(this).parent(\'td\').parent(\'tr\').index());'};
|
||||
columns[5]['content'][1] = {'name' : '_div', 'type': 'text'};
|
||||
//end: price_start
|
||||
//begin: discount
|
||||
columns[6] = {
|
||||
'name' : 'total_',
|
||||
'label' : 'Wartość',
|
||||
'width' : 5,
|
||||
'content' : new Array(),
|
||||
'align' : 'right',
|
||||
};
|
||||
columns[6]['content'][0] = {'name' : 'netto', 'type': 'text', 'isNumber' : true, 'readonly' : true};
|
||||
//end: total
|
||||
|
||||
//end: remarks
|
||||
79
modules/EcmReturns/javascript/columndefs.js
Normal file
79
modules/EcmReturns/javascript/columndefs.js
Normal file
@@ -0,0 +1,79 @@
|
||||
columns = new Array();
|
||||
//define columns
|
||||
//begin: number
|
||||
columns[0] = {
|
||||
'name' : 'number',
|
||||
'label' : 'Lp.',
|
||||
'width' : 4,
|
||||
'content' : new Array(),
|
||||
};
|
||||
columns[0]['content'][0] = {'name' : '', 'type': 'text', 'readonly' : true};
|
||||
//end: number
|
||||
//begin: code
|
||||
columns[1] = {
|
||||
'name' : 'product_',
|
||||
'label' : 'Kod',
|
||||
'width' : 6,
|
||||
'content' : new Array(),
|
||||
};
|
||||
columns[1]['content'][0] = {'name' : 'code', 'type': 'hidden', 'readonly' : true};
|
||||
columns[1]['content'][1] = {'name' : 'id', 'type': 'hidden'};
|
||||
columns[1]['content'][2] = {'name' : 'link', 'type': 'text', 'readonly' : true};
|
||||
//end: code
|
||||
//begin: name
|
||||
columns[2] = {
|
||||
'name' : 'name',
|
||||
'label' : 'Nazwa',
|
||||
'width' : 20,
|
||||
'content' : new Array(),
|
||||
};
|
||||
columns[2]['content'][0] = {'name' : '', 'type': 'text'};
|
||||
//end: name
|
||||
//begin: quantity
|
||||
columns[3] = {
|
||||
'name' : 'quantity',
|
||||
'label' : 'Ilość',
|
||||
'width' : 5,
|
||||
'content' : new Array(),
|
||||
'align' : 'right',
|
||||
};
|
||||
columns[3]['content'][0] = {'name' : '', 'type': 'text', 'isNumber' : true, 'onChange' : 'calculateRow($(this).parent(\'td\').parent(\'tr\').index());'};
|
||||
//end: quantity
|
||||
//begin: unit
|
||||
columns[4] = {
|
||||
'name' : 'unit_',
|
||||
'label' : 'J.M.',
|
||||
'width' : 5,
|
||||
'content' : new Array(),
|
||||
'align' : 'center',
|
||||
};
|
||||
columns[4]['content'][0] = {'name' : 'name', 'type': 'text','readonly' : true};
|
||||
columns[4]['content'][1] = {'name' : 'id', 'type': 'hidden'};
|
||||
//end: unit
|
||||
//begin: price_start
|
||||
columns[5] = {
|
||||
'name' : 'price_start',
|
||||
'label' : 'Cena',
|
||||
'width' : 5,
|
||||
'content' : new Array(),
|
||||
'align' : 'right',
|
||||
};
|
||||
columns[5]['content'][0] = {'name' : '', 'type': 'text', 'isNumber' : true, 'onChange' : 'calculateRow($(this).parent(\'td\').parent(\'tr\').index());'};
|
||||
//end: price_start
|
||||
//begin: discou
|
||||
columns[6] = {
|
||||
'name' : 'total_',
|
||||
'label' : 'Wartość',
|
||||
'width' : 5,
|
||||
'content' : new Array(),
|
||||
'align' : 'right',
|
||||
};
|
||||
columns[6]['content'][0] = {'name' : 'netto', 'type': 'text', 'isNumber' : true, 'readonly' : true};
|
||||
//end: total
|
||||
//begin: recipient_code
|
||||
columns[7] = {
|
||||
'name' : 'options',
|
||||
'label' : 'Opcje',
|
||||
'width' : 3,
|
||||
'content' : new Array(),
|
||||
};
|
||||
270
modules/EcmReturns/javascript/helper.php
Normal file
270
modules/EcmReturns/javascript/helper.php
Normal file
@@ -0,0 +1,270 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('-1');
|
||||
if (!$_POST['job'] || $_POST['job']=='') die ('-1');
|
||||
switch ($_POST['job']) {
|
||||
case 'getParentInfo': getParentInfo($_POST['id'], $_POST['type']); break;
|
||||
case 'generateNumber': generateNumber(); break;
|
||||
case 'searchProducts': searchProducts($_POST['searchKey'], $_POST['searchCategory'], $_POST['searchStock'], $_POST['searchSort']); break;
|
||||
case 'getProduct': getProduct($_POST['id'], $_POST['pricebook'], $_POST['account_id'], $_POST['language']); break;
|
||||
case 'getItems': getItems($_POST['record']); break;
|
||||
case 'getCategoriesList': getCategoriesList(); break;
|
||||
case 'getTranslation': getTranslation($_POST['product_id'], $_POST['language'], $_REQUEST['unit_id']); break;
|
||||
case 'getPricesInfo': getPricesInfo($_POST['product_id'], $_POST['pricebook_id'], $_POST['account_id']); break;
|
||||
case 'getStockArray' : getStockArray($_POST['product_id']); break;
|
||||
case 'getPurchaseArray' : getPurchaseArray($_POST['product_id']); break;
|
||||
}
|
||||
|
||||
function getParentInfo($id, $type) {
|
||||
if (!$id || $id == '') die('-1');
|
||||
if (!$type || $type == '') die('-1');
|
||||
|
||||
if ($type == 'Accounts')
|
||||
$a = new Account();
|
||||
elseif ($type == 'Leads')
|
||||
$a = new Lead();
|
||||
else
|
||||
die(-1);
|
||||
|
||||
$a->retrieve($id);
|
||||
$data = array();
|
||||
$data['name'] = $a->name;
|
||||
$data['parent_nip'] = $a->to_vatid;
|
||||
$data['parent_address_street'] = $a->billing_address_street;
|
||||
$data['parent_address_postalcode'] = $a->billing_address_postalcode;
|
||||
$data['parent_address_city'] = $a->billing_address_city;
|
||||
$data['parent_address_country'] = $a->billing_address_country;
|
||||
$data['invoice_type'] = $a->invoice_type;
|
||||
$data['currency_id'] = $a->currency_id;
|
||||
if ($a->ecmpaymentcondition_id && $a->ecmpaymentcondition_id!='') {
|
||||
$pc = new EcmPaymentCondition();
|
||||
$pc->retrieve($a->ecmpaymentcondition_id);
|
||||
$data['ecmpaymentcondition_id'] = $pc->id;
|
||||
$data['ecmpaymentcondition_name'] = $pc->name;
|
||||
}
|
||||
if ($a->ecmdeliverycondition_id && $a->ecmdeliverycondition_id!='') {
|
||||
$pc = new EcmdeliveryCondition();
|
||||
$pc->retrieve($a->ecmdeliverycondition_id);
|
||||
$data['ecmdeliverycondition_id'] = $pc->id;
|
||||
$data['ecmdeliverycondition_name'] = $pc->name;
|
||||
}
|
||||
|
||||
if ($a->ecmprice_id && $a->ecmprice_id!='') {
|
||||
$pr = new EcmPrice();
|
||||
$pr->retrieve($a->ecmprice_id);
|
||||
$data['ecmprice_id'] = $pr->id;
|
||||
$data['ecmprice_name'] = $pr->name;
|
||||
}
|
||||
//get pricebooks, ownership pricebooks
|
||||
$pricebooks = array();
|
||||
$db=$GLOBALS['db'];
|
||||
$res = $db->query("SELECT id, name FROM ecmpricebooks WHERE account_id IN ('".$a->id."','".$a->parent_id."') AND active='1' AND deleted='0'");
|
||||
while ($row = $db->fetchByAssoc($res)) {
|
||||
$tmp = array();
|
||||
$tmp['id'] = $row['id'];
|
||||
$tmp['name'] = $row['name'];
|
||||
$pricebooks[] = $tmp;
|
||||
unset($tmp);
|
||||
}
|
||||
$data['pricebooks'] = $pricebooks;
|
||||
echo json_encode($data);
|
||||
unset($data);
|
||||
unset($a);
|
||||
unset($res);
|
||||
return;
|
||||
}
|
||||
function generateNumber() {
|
||||
$data = array();
|
||||
$data['number'] = EcmReturn::generateNumber();
|
||||
$data['document_no'] = EcmReturn::formatNumber($data['number']);
|
||||
echo json_encode($data);
|
||||
unset($data);
|
||||
return;
|
||||
}
|
||||
|
||||
function searchProducts($searchKey, $searchCategory, $searchStock, $searchSort) {
|
||||
|
||||
$db = $GLOBALS['db'];
|
||||
$q = "SELECT id, code, name FROM ecmproducts WHERE
|
||||
(UPPER(code) LIKE '%$searchKey%' OR
|
||||
UPPER(name) LIKE '%$searchKey%')
|
||||
AND deleted='0' ";
|
||||
if ($searchCategory && $searchCategory!="")
|
||||
$q.="AND product_category_id='$searchCategory' ";
|
||||
|
||||
if ($searchSort=='1')
|
||||
$q.="ORDER BY code";
|
||||
else if ($searchSort=='2')
|
||||
$q.="ORDER BY code DESC";
|
||||
else if ($searchSort=='3')
|
||||
$q.="ORDER BY name";
|
||||
else if ($searchSort=='4')
|
||||
$q.="ORDER BY name DESC";
|
||||
|
||||
$q.=" LIMIT 0,50";
|
||||
|
||||
$res = $db->query($q);
|
||||
$result = array();
|
||||
|
||||
if ($searchStock!='1') {
|
||||
//get main stock id
|
||||
$stock_res = $db->fetchByAssoc($db->query("SELECT id FROM ecmstocks WHERE main='1' LIMIT 0,1"));
|
||||
$stock_id = $stock_res['id'];
|
||||
}
|
||||
while ($row = $db->fetchByAssoc($res)) {
|
||||
$tmp = array();
|
||||
$tmp['id'] = $row['id'];
|
||||
$tmp['name'] = $row['name'];
|
||||
$tmp['code'] = $row['code'];
|
||||
|
||||
//get stock if necessary
|
||||
if ($searchStock!='1') {
|
||||
$tmp['stock_state'] = EcmStockOperation::getStock($row['id'], $stock_id);
|
||||
}
|
||||
|
||||
if ($searchStock=='3' && $tmp['stock_state']==0) continue; //don't show null stock
|
||||
|
||||
$result[] = $tmp;
|
||||
}
|
||||
echo json_encode($result);
|
||||
return;
|
||||
}
|
||||
|
||||
function getProduct($id, $pricebook_id, $account_id, $language) {
|
||||
$db = $GLOBALS['db'];
|
||||
$p = $db->fetchByAssoc($db->query("SELECT p.id, p.code, p.name, v.id as ecmvat_id, v.name as ecmvat_name, v.value as ecmvat_value, p.ean, p.ean2, p.unit_id FROM ecmproducts as p INNER JOIN ecmvats as v ON v.id=p.vat_id WHERE p.id='$id'"));
|
||||
global $app_list_strings;
|
||||
$p['unit_name'] = $app_list_strings['ecmproducts_unit_dom'][$p['unit_id']];
|
||||
//try get recipient_code and price from pricebook
|
||||
if ($pricebook_id && $pricebook_id!='') {
|
||||
$pr = $db->fetchByAssoc($db->query("SELECT price, recipient_code FROM ecmpricebooks_ecmproducts WHERE ecmpricebook_id='$pricebook_id' AND ecmproduct_id='$id' AND deleted='0'"));
|
||||
$p['price_start'] = $pr['price'];
|
||||
$p['recipient_code'] = $pr['recipient_code'];
|
||||
}
|
||||
if (!$p['price_start'] || floatval($p['price_start'])==0) {
|
||||
//try price from default prices
|
||||
$pr = $db->fetchByAssoc($db->query("SELECT pp.price FROM ecmprices_ecmproducts AS pp INNER JOIN ecmprices AS p ON pp.ecmprice_id=p.id INNER JOIN accounts AS a ON p.id=a.ecmprice_id WHERE a.id='$account_id' AND pp.ecmproduct_id='$id'"));
|
||||
$p['price_start'] = $pr['price'];
|
||||
}
|
||||
|
||||
if ($language=='en_us') {
|
||||
$r = $db->fetchByAssoc($db->query("SELECT short_description FROM ecmproduct_language WHERE ecmproduct_id='$id' AND language='en'"));
|
||||
$p['name'] = htmlspecialchars_decode($r['short_description']);
|
||||
|
||||
$lists = return_app_list_strings_language($language);
|
||||
$p['unit_name'] = $lists['ecmproducts_unit_dom'][$p['unit_id']];
|
||||
unset($lists);
|
||||
}
|
||||
echo json_encode($p);
|
||||
return;
|
||||
}
|
||||
|
||||
function getItems($record) {
|
||||
$of = new EcmReturn();
|
||||
$of->retrieve($record);
|
||||
$pl = $of->getPositionList(true);
|
||||
unset($of);
|
||||
echo json_encode($pl);
|
||||
return;
|
||||
}
|
||||
|
||||
function getCategoriesList() {
|
||||
$db = $GLOBALS['db'];
|
||||
$res = $db->query("SELECT id, name FROM ecmproductcategories WHERE deleted='0'");
|
||||
$result = array();
|
||||
while ($row = $db->fetchByAssoc($res)) {
|
||||
$tmp = array();
|
||||
$tmp['id'] = $row['id'];
|
||||
$tmp['name'] = $row['name'];
|
||||
$result[] = $tmp;
|
||||
}
|
||||
echo json_encode($result);
|
||||
return;
|
||||
}
|
||||
|
||||
function getTranslation($product_id, $language, $unit_id) {
|
||||
$db = $GLOBALS['db'];
|
||||
$result = array();
|
||||
if ($language=='en_us') {
|
||||
$r = $db->fetchByAssoc($db->query("SELECT short_description FROM ecmproduct_language WHERE ecmproduct_id='$product_id' AND language='en'"));
|
||||
$result['name'] = htmlspecialchars_decode($r['short_description']);
|
||||
} else if ($language=='pl_pl') {
|
||||
$p = new EcmProduct();
|
||||
$p->retrieve($product_id);
|
||||
$result['name'] = htmlspecialchars_decode($p->name);
|
||||
unset($p);
|
||||
}
|
||||
$lists = return_app_list_strings_language($language);
|
||||
$result['unit_name'] = $lists['ecmproducts_unit_dom'][$unit_id];
|
||||
unset($lists);
|
||||
|
||||
echo json_encode($result);
|
||||
return;
|
||||
}
|
||||
|
||||
function getPricesInfo($product_id, $pricebook_id, $account_id) {
|
||||
$db = $GLOBALS['db'];
|
||||
|
||||
$result = array();
|
||||
if ($pricebook_id && $pricebook_id!='') {
|
||||
//try get price from pricebook
|
||||
$res = $db->fetchByAssoc($db->query("SELECT price FROM ecmpricebooks_ecmproducts WHERE ecmpricebook_id='$pricebook_id' AND ecmproduct_id='$product_id' AND deleted='0'"));
|
||||
if ($res['price'] && $res['price']!='' && $res['price']!=0) {
|
||||
$tmp = array();
|
||||
$tmp['name'] = 'pricebook';
|
||||
$tmp['price'] = $res['price'];
|
||||
$result[] = $tmp;
|
||||
}
|
||||
}
|
||||
|
||||
//get from ecmprices
|
||||
$res = $db->query("SELECT p.name, pp.price FROM ecmprices_ecmproducts AS pp
|
||||
INNER JOIN ecmprices AS p
|
||||
ON p.id=pp.ecmprice_id
|
||||
WHERE
|
||||
pp.ecmproduct_id='$product_id'
|
||||
AND pp.price!=0");
|
||||
while ($row = $db->fetchByAssoc($res)) {
|
||||
$tmp = array();
|
||||
$tmp['name'] = $row['name'];
|
||||
$tmp['price'] = $row['price'];
|
||||
$result[] = $tmp;
|
||||
}
|
||||
|
||||
//get last invoice price
|
||||
if ($account_id && $account_id!='') {
|
||||
$res = $db->fetchByAssoc($db->query("SELECT ii.subprice, i.id, i.document_no FROM ecminvoiceoutitems AS ii
|
||||
INNER JOIN ecminvoiceouts AS i
|
||||
ON ii.ecminvoiceout_id=i.id
|
||||
WHERE ii.ecmproduct_id='$product_id'
|
||||
AND i.parent_id='$account_id'
|
||||
AND ii.deleted='0'
|
||||
AND i.deleted='0'
|
||||
AND i.canceled='0'
|
||||
ORDER BY i.register_date DESC
|
||||
LIMIT 0,1"));
|
||||
if ($res && $res['subprice']!='') {
|
||||
$tmp = array();
|
||||
$tmp['name'] = $res['document_no'];
|
||||
$tmp['price'] = $res['subprice'];
|
||||
$result[] = $tmp;
|
||||
}
|
||||
}
|
||||
|
||||
echo json_encode($result);
|
||||
return;
|
||||
}
|
||||
|
||||
function getStockArray($product_id) {
|
||||
$o = new EcmStockOperation();
|
||||
echo json_encode($o->getStockArray($product_id));
|
||||
unset($o);
|
||||
return;
|
||||
}
|
||||
|
||||
function getPurchaseArray($product_id) {
|
||||
$o = new EcmStockOperation();
|
||||
echo json_encode($o->getPurchaseArray($product_id));
|
||||
unset($o);
|
||||
return;
|
||||
}
|
||||
|
||||
447
modules/EcmReturns/language/en_us.lang.php
Normal file
447
modules/EcmReturns/language/en_us.lang.php
Normal file
@@ -0,0 +1,447 @@
|
||||
<?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.
|
||||
*
|
||||
* ******************************************************************************
|
||||
*/
|
||||
|
||||
$mod_strings = array (
|
||||
'LBL_ERRORS' => 'Products not found on invoices',
|
||||
'LBL_BTN_CREATE_ZS' => 'Create ZS',
|
||||
'LBL_ECMPRICE' => 'B2B Prices',
|
||||
'LBL_SEARCH' => 'Search',
|
||||
'LBL_CATEGORY' => 'Category',
|
||||
'LBL_PDF_TEXT' => 'Invoice text',
|
||||
'LBL_PARENT_NIP' => 'VAT ID',
|
||||
'LBL_NO_TAX' => 'No tax',
|
||||
'LBL_PDF_DOCUMENT_NAME' => 'Quote',
|
||||
'LBL_SITE' => 'Site',
|
||||
'LBL_SHOW_EAN' => 'Show EAN',
|
||||
'LBL_SHOW_EAN2' => 'Show EAN2',
|
||||
// added 05.02.2009
|
||||
'LBL_QUOTE_XLS' => 'Create XLS',
|
||||
'LBL_QUOTE_XLS_BUTTON_KEY' => 'Show XLS [Alt+X]',
|
||||
'LBL_QUOTE_XLS_BUTTON_TITLE' => 'Show Quote in XLS file.',
|
||||
// added 01.09.2009
|
||||
'LBL_PRICEBOOK' => 'Price Book',
|
||||
// added 05.08.2009
|
||||
'LBL_CURRENCY' => 'Currency',
|
||||
'LBL_DETAIL_BUTTON' => 'Details',
|
||||
// added 15.07.2009
|
||||
'LBL_EDITTABLE_UNIT' => 'Unit',
|
||||
// added 09.02.2009
|
||||
'LBL_SHOW_IMAGES_ON_OFFERS' => 'Show images on offers',
|
||||
'LBL_SHOW_RECIPIENT_CODE' => 'Show recipient code',
|
||||
|
||||
// FOR SYSTEM USE
|
||||
|
||||
'LBL_MODULE_NAME' => 'Quotes',
|
||||
|
||||
'LBL_MODULE_TITLE' => 'Quotes: Home',
|
||||
|
||||
'LBL_MODULE_ID' => 'EcmReturns',
|
||||
|
||||
'LBL_SEARCH_FORM_TITLE' => 'Quotes Search',
|
||||
|
||||
'LBL_LIST_FORM_TITLE' => 'Quotes List',
|
||||
|
||||
'LBL_NEW_FORM_TITLE' => 'New Quote',
|
||||
|
||||
'LBL_DETAILS' => 'Quote details:',
|
||||
|
||||
'LBL_ITEMS' => 'Items included:',
|
||||
|
||||
'LBL_TEXTS' => 'Texts to PDF:',
|
||||
|
||||
'LBL_PREVIEW' => 'Preview PDF:',
|
||||
|
||||
'LBL_EMAIL' => 'Create Email:',
|
||||
|
||||
'LBL_TO_INFORMATIONS' => 'To Informations:',
|
||||
|
||||
'LBL_DETAILS_TAB' => 'Details',
|
||||
|
||||
'LBL_ITEMS_TAB' => 'Items',
|
||||
|
||||
'LBL_TEXTS_TAB' => 'Texts',
|
||||
|
||||
'LBL_PREVIEW_TAB' => 'Preview',
|
||||
|
||||
'LBL_EMAIL_TAB' => 'Email',
|
||||
|
||||
'LBL_ID' => 'Id',
|
||||
|
||||
'LBL_NAME' => 'Name',
|
||||
|
||||
'LBL_DESCRIPTION' => 'Description',
|
||||
|
||||
'LBL_DATE_ENTERED' => 'Date Entered',
|
||||
|
||||
'LBL_DATE_MODIFIED' => 'Date Modified',
|
||||
|
||||
'LBL_MODIFIED' => 'Last Modified',
|
||||
|
||||
'LBL_ASSIGNED_TO_ID' => 'Assigned To',
|
||||
|
||||
'LBL_ASSIGNED_TO' => 'Assigned To',
|
||||
|
||||
'LBL_CREATED' => 'Created by',
|
||||
|
||||
'LBL_CREATED_BY_USER' => 'Created by',
|
||||
|
||||
'LBL_MODIFIED_BY_USER' => 'Modified by',
|
||||
|
||||
'LBL_ASSIGNED_TO_USER' => 'Assigned To',
|
||||
|
||||
'LBL_DELETED_BY' => 'Deleted by',
|
||||
|
||||
'LBL_NUMBER' => 'Number',
|
||||
|
||||
'LBL_DOCUMENT_NO' => 'Number',
|
||||
|
||||
'LBL_PARENT' => 'To',
|
||||
|
||||
'LBL_PARENT_NAME' => 'Account',
|
||||
|
||||
'LBL_PARENT_ID' => 'Account Id',
|
||||
|
||||
'LBL_TYPE' => 'Search user prices',
|
||||
|
||||
'LBL_ECMQUOTE_ID' => 'Quote Id',
|
||||
|
||||
'LBL_ECMQUOTE_NAME' => 'Quote Name',
|
||||
|
||||
'LBL_STATUS' => 'Status',
|
||||
|
||||
'LBL_REGISTER_DATE' => 'Document Date',
|
||||
|
||||
'LBL_SELL_DATE' => 'Sell Date',
|
||||
|
||||
'LBL_PAYMENT_DATE' => 'Payment Date',
|
||||
|
||||
'LBL_PARENT_ADDRESS_STREET' => 'Street',
|
||||
|
||||
'LBL_PARENT_ADDRESS_CITY' => 'Postalcode / City',
|
||||
|
||||
'LBL_PARENT_ADDRESS_POSTALCODE' => 'Postalcode',
|
||||
|
||||
'LBL_PARENT_ADDRESS_COUNTRY' => 'Country',
|
||||
|
||||
'LBL_TO_VATID' => 'VAT-ID',
|
||||
|
||||
'LBL_TO_IS_VAT_FREE' => 'Is VAT Free?',
|
||||
|
||||
'LBL_HEADER_TEXT' => 'Header Text',
|
||||
|
||||
'LBL_FOOTER_TEXT' => 'Footer Text',
|
||||
|
||||
'LBL_ADS_TEXT' => 'Ads Text',
|
||||
|
||||
'LBL_SUBTOTAL' => 'Subtotal',
|
||||
|
||||
'LBL_TOTAL' => 'Total',
|
||||
|
||||
'LBL_DISCOUNT' => 'Discount',
|
||||
|
||||
'LBL_VAT' => 'VAT',
|
||||
|
||||
'LBL_ACCEPTED' => 'Accepted',
|
||||
|
||||
'LBL_TEMPLATE_ID' => 'Template Id',
|
||||
|
||||
'LBL_TEMPLATE_NAME' => 'Template',
|
||||
|
||||
'LBL_PAYMENTCONDITION_NAME' => 'Payment Condition',
|
||||
'LBL_PAYMENTCONDITION_ID' => 'Payment Condition ID',
|
||||
|
||||
'LBL_DELIVERYCONDITION_NAME' => 'Delivery Condition',
|
||||
'LBL_DELIVERYCONDITION_ID' => 'Delivery Condition ID',
|
||||
|
||||
'LBL_FORMAT_NUMBER_ERROR' => 'Format Number Error!',
|
||||
|
||||
'LBL_SAVE_FORM_ERROR' => 'There are some errors on items list or in form!',
|
||||
|
||||
'LBL_DISCOUNT_ERROR' => 'Discount Format Number Error',
|
||||
|
||||
'LBL_EDITTABLE_NO' => 'Lp.',
|
||||
'LBL_EDITTABLE_CODE' => 'Code',
|
||||
'LBL_EDITTABLE_NAME' => 'Name',
|
||||
'LBL_EDITTABLE_QUANTITY' => 'Quant',
|
||||
'LBL_EDITTABLE_PRICE' => 'Price',
|
||||
'LBL_EDITTABLE_VAT' => 'VAT',
|
||||
'LBL_EDITTABLE_RECIPIENT_CODE' => 'Recipient Code',
|
||||
'LBL_EDITTABLE_DISCOUNT' => 'Discount',
|
||||
'LBL_EDITTABLE_TOTAL' => 'Total',
|
||||
'LBL_EDITTABLE_OPTIONS' => 'Opt',
|
||||
|
||||
'LBL_MOVE_ROW_UP' => 'Move Up',
|
||||
'LBL_MOVE_ROW_DOWN' => 'Move Down',
|
||||
'LBL_INSERT_NEW_ROW' => 'Insert new row',
|
||||
'LBL_DELETE_ROW' => 'Delete row',
|
||||
|
||||
'LBL_VALIDTILL_DATE' => 'Valid Till',
|
||||
|
||||
// FOR MENU LINKS
|
||||
|
||||
'LNK_NEW_ECMQUOTE' => 'Create Quote',
|
||||
|
||||
'LNK_ECMQUOTES_LIST' => 'Quotes List',
|
||||
|
||||
'LBL_IMG_SEARCH' => 'Search',
|
||||
|
||||
'LBL_IMG_NEW' => 'New, add to base',
|
||||
|
||||
'LBL_IMG_EDIT' => 'Edit',
|
||||
|
||||
'LBL_CONFIRM_QUESTION' => 'Would you like to confirm this Quote?',
|
||||
|
||||
'LBL_QUOTE_PDF' => 'Show PDF',
|
||||
'LBL_QUOTE_PDF_BUTTON_KEY' => 'Show PDF [Alt+P]',
|
||||
'LBL_QUOTE_PDF_BUTTON_TITLE' => 'Show Quote in PDF file.',
|
||||
|
||||
'LBL_QUOTE_TO_INVOICE' => 'Create Invoice',
|
||||
'LBL_QUOTE_TO_INVOICE_BUTTON_KEY' => 'Create Invoice [Alt+I]',
|
||||
'LBL_QUOTE_TO_INVOICE_BUTTON_TITLE' => 'Create Invoice.',
|
||||
|
||||
'LBL_QUOTE_TO_SALE' => 'Create Sales Order',
|
||||
'LBL_QUOTE_TO_SALE_BUTTON_KEY' => 'Create Sales Order [Alt+O]',
|
||||
'LBL_QUOTE_TO_SALE_BUTTON_TITLE' => 'Create Sales Order.',
|
||||
|
||||
'LBL_SEND_TO_CONFIRM' => 'Send To Confirm',
|
||||
'LBL_SEND_TO_CONFIRM_BUTTON_KEY' => 'Send To Confirm [Alt+C]',
|
||||
'LBL_SEND_TO_CONFIRM_BUTTON_TITLE' => 'Send This Quote To Confirm.',
|
||||
|
||||
'LBL_LIST_TO_INVOICE' => 'Create Invoice.',
|
||||
'LBL_LIST_TO_SALE' => 'Create Sales Order.',
|
||||
|
||||
// buttons
|
||||
|
||||
'LBL_SEND_BUTTON_TITLE' => 'Save & Send [Alt+D]',
|
||||
'LBL_SEND_BUTTON_KEY' => 'D',
|
||||
'LBL_SEND_BUTTON_LABEL' => 'Save & Send',
|
||||
|
||||
'LBL_REPAIR_BUTTON_TITLE' => 'Repair [Alt+R]',
|
||||
'LBL_REPAIR_BUTTON_KEY' => 'R',
|
||||
'LBL_REPAIR_BUTTON_LABEL' => 'Repair',
|
||||
|
||||
'LBL_ACCEPT_BUTTON_TITLE' => 'Accept [Alt+Z]',
|
||||
'LBL_ACCEPT_BUTTON_KEY' => 'Z',
|
||||
'LBL_ACCEPT_BUTTON_LABEL' => 'Accept',
|
||||
|
||||
'LBL_REJECT_BUTTON_TITLE' => 'Reject [Alt+R]',
|
||||
'LBL_REJECT_BUTTON_KEY' => 'R',
|
||||
'LBL_REJECT_BUTTON_LABEL' => 'Reject',
|
||||
|
||||
'LBL_GO_TO_LIST_BUTTON_TITLE' => 'Go to quotes list [Alt+G]',
|
||||
'LBL_GO_TO_LIST_BUTTON_KEY' => 'G',
|
||||
'LBL_GO_TO_LIST_BUTTON_LABEL' => 'Go to list',
|
||||
|
||||
'LBL_SENDEMAIL_BUTTON' => 'Send Email',
|
||||
|
||||
'LBL_NOT_SAVED' => 'Quote not saved. Please check all fields are correct!',
|
||||
|
||||
'LBL_SAVED' => 'Quote saved successfully.',
|
||||
|
||||
'LBL_DEFAULT_CONTACT_HEADER_TEXT' => 'Witaj $contact_full_name!',
|
||||
|
||||
'LBL_DEFAULT_CONTACT_FOOTER_TEXT' => 'Tekst pod tabelka dla Contact',
|
||||
|
||||
'LBL_DEFAULT_CONTACT_ADS_TEXT' => 'Tekst pogrubiony pod tabelka dla Contact',
|
||||
|
||||
'LBL_DEFAULT_ACCOUNT_HEADER_TEXT' => 'Oferta dla:',
|
||||
|
||||
'LBL_DEFAULT_ACCOUNT_FOOTER_TEXT' => 'Tekst pod tabelka dla Account',
|
||||
|
||||
'LBL_DEFAULT_ACCOUNT_ADS_TEXT' => 'Tekst pogrubiony pod tabelka dla Account',
|
||||
|
||||
'LBL_NOTES_SUBPANEL_TITLE' => 'Notes',
|
||||
|
||||
'LBL_EMAILS_SUBPANEL_TITLE' => 'Emails',
|
||||
|
||||
'LBL_DASHLET_MY_ECMQUOTES' => 'Quotes',
|
||||
|
||||
'LNK_ECMQUOTES_PDFLANGUAGES' => 'PDF Settings',
|
||||
'LBL_ECMLANGUAGE' => 'Language',
|
||||
'LBL_ECMQUOTES_PDFLANGUAGES_TITLE' => 'PDF Languages Settings',
|
||||
|
||||
'LBL_ACCESS_UNAVAIBLE_DELETE_EMAIL' => "You don't have a permission to send Email, because this Quote is not accepted by Manager!",
|
||||
'LBL_SEND_TO_CONFIRM_ERROR' => "Sending Quote to confirm error! Refresh site and try again.",
|
||||
|
||||
'LBL_STATUS_s10_SET_MESSAGE' => "Quote status is set.",
|
||||
'LBL_STATUS_s20_SET_MESSAGE' => "Now Quote is waiting for confimations.",
|
||||
'LBL_STATUS_s30_SET_MESSAGE' => "Quote is confirmed.",
|
||||
'LBL_STATUS_s40_SET_MESSAGE' => "Quote status is set.",
|
||||
'LBL_STATUS_s70_SET_MESSAGE' => "Quote status is set to Lost :(",
|
||||
|
||||
'LBL_STATUS_s20_FAIL_MESSAGE' => "Sending Quote to confirm error! Refresh site and try again.",
|
||||
|
||||
'LBL_LIST_SEND_TO_CONFIRM' => 'Send To Confirm',
|
||||
'LBL_LIST_DUPLICATE' => 'Duplicate',
|
||||
'LBL_LIST_PREVIEW_PDF' => 'Preview Quote',
|
||||
'LBL_LIST_REJECT' => 'Reject',
|
||||
'LBL_LIST_ACCEPT' => 'Accept',
|
||||
|
||||
'LBL_MODIFIED_USER' => 'Modified By',
|
||||
|
||||
'LBL_DEMO_VERSION_INFORMATION' => "This is only demo version.\nPlease contact us at ca@more7.com.",
|
||||
|
||||
'LBL_ORDER_ORIGIN' => 'Order Origin',
|
||||
|
||||
'LBL_PREVIEW_HEADER_NAME' => 'Preview',
|
||||
'LBL_PREVIEW_HEADER_CLOSE' => 'Close',
|
||||
|
||||
'LBL_CONTACT_NAME' => 'Contact',
|
||||
'LBL_CONTACT_ID' => 'Contact Id',
|
||||
'LBL_PARENT_NAME_COPY' => 'Company Name',
|
||||
'LBL_PARENT_CONTACT_NAME' => 'Contact Person',
|
||||
'LBL_PARENT_CONTACT_TITLE' => 'Contact Title',
|
||||
|
||||
'LBL_ALERT_ECMLANGUAGE_CHANGE' => 'Would you like to load default texts correspondencing to this language?',
|
||||
'LBL_LIST_DOWNLOAD_PDF' => 'Download PDF',
|
||||
'LBL_CREATE_ECMINVOICEOUT_BUTTON_LABEL' => 'Create Invoice',
|
||||
|
||||
'LBL_ECMTEAM_NAME' => 'Team',
|
||||
'LBL_ECMTEAM_ID' => 'Team ID',
|
||||
|
||||
'LBL_IMAGE_SIZE' => 'Images size (%)',
|
||||
|
||||
//mz new labels
|
||||
'LBL_SEARCH' => 'Search',
|
||||
'LBL_CATEGORY' => 'Category',
|
||||
'LBL_SEARCH_STOCK' => 'Show stock states',
|
||||
'LBL_SEARCH_STOCK_OPT_NO' => 'Don\'t show stock states',
|
||||
'LBL_SEARCH_STOCK_OPT_YES' => 'Show stock states',
|
||||
'LBL_SEARCH_STOCK_OPT_NOT_NULL' => 'Only products on stock',
|
||||
'LBL_SEARCH_SORT' => 'Sort results by',
|
||||
'LBL_SEARCH_SORT_CODE' => 'Code ASC',
|
||||
'LBL_SEARCH_SORT_CODE_DESC' => 'Code DESC',
|
||||
'LBL_SEARCH_SORT_NAME' => 'Name ASC',
|
||||
'LBL_SEARCH_SORT_NAME_DESC' => 'Name DESC',
|
||||
//PDF labels
|
||||
'LBL_PDF_FOOTER_KRS' => 'KRS:',
|
||||
'LBL_PDF_FOOTER_NIP' => 'VATID:',
|
||||
'LBL_PDF_FOOTER_REGON' => 'REGON:',
|
||||
'LBL_PDF_FOOTER_BANK' => 'Bank name:',
|
||||
'LBL_PDF_FOOTER_BANK_ACCOUNT' => 'Bank account:',
|
||||
'LBL_PDF_FOOTER_GIOS' => 'GIOS number:',
|
||||
'LBL_PDF_FOOTER_SWIFT' => 'Bank SWIFT:',
|
||||
'LBL_PDF_CONTENT_QUOTE_FOR' => 'Offer for:',
|
||||
'LBL_PDF_CONTENT_REGISTER_DATE' => 'Register date:',
|
||||
'LBL_PDF_CONTENT_ISSUED_BY' => 'Issued by:',
|
||||
'LBL_PDF_CONTENT_NUMBER' => 'Number:',
|
||||
'LBL_PDF_CONTENT_LIST_POSITION' => 'No.',
|
||||
'LBL_PDF_CONTENT_LIST_IMAGE' => 'Picture',
|
||||
'LBL_PDF_CONTENT_LIST_NAME' => 'Name',
|
||||
'LBL_PDF_CONTENT_LIST_CODE' => 'Index',
|
||||
'LBL_PDF_CONTENT_LIST_QTY' => 'Quantity',
|
||||
'LBL_PDF_CONTENT_LIST_UNIT' => 'Unit',
|
||||
'LBL_PDF_CONTENT_LIST_EAN' => 'Ean',
|
||||
'LBL_PDF_CONTENT_LIST_EAN2' => 'Ean 2',
|
||||
'LBL_PDF_CONTENT_LIST_RECIPIENT_CODE' => 'Recipient Code',
|
||||
'LBL_PDF_CONTENT_LIST_REMARKS' => 'Remarks',
|
||||
'LBL_PDF_CONTENT_LIST_PRICE_START' => 'Start price',
|
||||
'LBL_PDF_CONTENT_LIST_PRICE_NETTO' => 'Price netto',
|
||||
'LBL_PDF_CONTENT_LIST_DISCOUNT' => 'Discount',
|
||||
'LBL_PDF_CONTENT_LIST_TOTAL_NETTO' => 'Total netto',
|
||||
'LBL_PDF_CONTENT_TOTAL_NETTO' => 'Total netto',
|
||||
'LBL_PDF_CONTENT_TOTAL_BRUTTO' => 'Total brutto',
|
||||
|
||||
|
||||
|
||||
)
|
||||
;
|
||||
|
||||
?>
|
||||
424
modules/EcmReturns/language/ge_ge.lang.php
Normal file
424
modules/EcmReturns/language/ge_ge.lang.php
Normal file
@@ -0,0 +1,424 @@
|
||||
<?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.
|
||||
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$mod_strings = array (
|
||||
|
||||
|
||||
|
||||
// FOR SYSTEM USE
|
||||
|
||||
'LBL_MODULE_NAME' => 'Quotes',
|
||||
|
||||
'LBL_MODULE_TITLE' => 'Quotes: Home',
|
||||
|
||||
'LBL_MODULE_ID' => 'EcmReturns',
|
||||
|
||||
'LBL_SEARCH_FORM_TITLE' => 'Quotes Search',
|
||||
|
||||
'LBL_LIST_FORM_TITLE' => 'Quotes List',
|
||||
|
||||
'LBL_NEW_FORM_TITLE' => 'New Quote',
|
||||
|
||||
|
||||
|
||||
'LBL_DETAILS' => 'Quote details:',
|
||||
|
||||
'LBL_ITEMS' => 'Items included:',
|
||||
|
||||
'LBL_TEXTS' => 'Texts to PDF:',
|
||||
|
||||
'LBL_PREVIEW' => 'Preview PDF:',
|
||||
|
||||
'LBL_EMAIL' => 'Create Email:',
|
||||
|
||||
'LBL_TO_INFORMATIONS' => 'To Informations:',
|
||||
|
||||
|
||||
|
||||
'LBL_DETAILS_TAB' => 'Details',
|
||||
|
||||
'LBL_ITEMS_TAB' => 'Items',
|
||||
|
||||
'LBL_TEXTS_TAB' => 'Texts',
|
||||
|
||||
'LBL_PREVIEW_TAB' => 'Preview',
|
||||
|
||||
'LBL_EMAIL_TAB' => 'Email',
|
||||
|
||||
|
||||
|
||||
'LBL_ID' => 'Id',
|
||||
|
||||
'LBL_NAME' => 'Name',
|
||||
|
||||
'LBL_DESCRIPTION' => 'Description',
|
||||
|
||||
'LBL_DATE_ENTERED' => 'Date Entered',
|
||||
|
||||
'LBL_DATE_MODIFIED' => 'Date Modified',
|
||||
|
||||
'LBL_MODIFIED' => 'Last Modified',
|
||||
|
||||
'LBL_ASSIGNED_TO_ID' => 'Assigned To',
|
||||
|
||||
'LBL_ASSIGNED_TO' => 'Assigned To',
|
||||
|
||||
'LBL_CREATED' => 'Created by',
|
||||
|
||||
'LBL_CREATED_BY_USER' => 'Created by',
|
||||
|
||||
'LBL_MODIFIED_BY_USER' => 'Modified by',
|
||||
|
||||
'LBL_ASSIGNED_TO_USER' => 'Assigned To',
|
||||
|
||||
'LBL_DELETED_BY' => 'Deleted by',
|
||||
|
||||
'LBL_NUMBER' => 'Number',
|
||||
|
||||
'LBL_DOCUMENT_NO' => 'Number',
|
||||
|
||||
'LBL_PARENT' => 'To',
|
||||
|
||||
'LBL_PARENT_NAME' => 'Account',
|
||||
|
||||
'LBL_PARENT_ID' => 'Account Id',
|
||||
|
||||
'LBL_TYPE' => 'Type',
|
||||
|
||||
'LBL_ECMQUOTE_ID' => 'Quote Id',
|
||||
|
||||
'LBL_ECMQUOTE_NAME' => 'Quote Name',
|
||||
|
||||
'LBL_STATUS' => 'Status',
|
||||
|
||||
'LBL_REGISTER_DATE' => 'Document Date',
|
||||
|
||||
'LBL_SELL_DATE' => 'Sell Date',
|
||||
|
||||
'LBL_PAYMENT_DATE' => 'Payment Date',
|
||||
|
||||
'LBL_PARENT_ADDRESS_STREET' => 'Street',
|
||||
|
||||
'LBL_PARENT_ADDRESS_CITY' => 'Postalcode / City',
|
||||
|
||||
'LBL_PARENT_ADDRESS_POSTALCODE' => 'Postalcode',
|
||||
|
||||
'LBL_PARENT_ADDRESS_COUNTRY' => 'Country',
|
||||
|
||||
'LBL_TO_VATID' => 'VAT-ID',
|
||||
|
||||
'LBL_TO_IS_VAT_FREE' => 'Is VAT Free?',
|
||||
|
||||
'LBL_HEADER_TEXT' => 'Header Text',
|
||||
|
||||
'LBL_FOOTER_TEXT' => 'Footer Text',
|
||||
|
||||
'LBL_ADS_TEXT' => 'Ads Text',
|
||||
|
||||
|
||||
|
||||
'LBL_SUBTOTAL' => 'Subtotal',
|
||||
|
||||
'LBL_TOTAL' => 'Total',
|
||||
|
||||
'LBL_DISCOUNT' => 'Discount',
|
||||
|
||||
'LBL_VAT' => 'VAT',
|
||||
|
||||
'LBL_ACCEPTED' => 'Accepted',
|
||||
|
||||
'LBL_TEMPLATE_ID' => 'Template Id',
|
||||
|
||||
'LBL_TEMPLATE_NAME' => 'Template',
|
||||
|
||||
'LBL_PAYMENTCONDITION_NAME' => 'Payment Condition',
|
||||
'LBL_PAYMENTCONDITION_ID' => 'Payment Condition ID',
|
||||
|
||||
'LBL_DELIVERYCONDITION_NAME' => 'Delivery Condition',
|
||||
'LBL_DELIVERYCONDITION_ID' => 'Delivery Condition ID',
|
||||
|
||||
'LBL_FORMAT_NUMBER_ERROR' => 'Format Number Error!',
|
||||
|
||||
'LBL_SAVE_FORM_ERROR' => 'There are some errors on items list or in form!',
|
||||
|
||||
'LBL_DISCOUNT_ERROR' => 'Discount Format Number Error',
|
||||
|
||||
'LBL_EDITTABLE_NO' => 'Lp.',
|
||||
'LBL_EDITTABLE_CODE' => 'Code',
|
||||
'LBL_EDITTABLE_NAME' => 'Name',
|
||||
'LBL_EDITTABLE_QUANTITY' => 'Quant',
|
||||
'LBL_EDITTABLE_PRICE' => 'Price',
|
||||
'LBL_EDITTABLE_VAT' => 'VAT',
|
||||
'LBL_EDITTABLE_DISCOUNT' => 'Discount',
|
||||
'LBL_EDITTABLE_TOTAL' => 'Total',
|
||||
'LBL_EDITTABLE_OPTIONS' => 'Opt',
|
||||
|
||||
|
||||
'LBL_MOVE_ROW_UP' => 'Move Up',
|
||||
'LBL_MOVE_ROW_DOWN' => 'Move Down',
|
||||
'LBL_INSERT_NEW_ROW' => 'Insert new row',
|
||||
'LBL_DELETE_ROW' => 'Delete row',
|
||||
|
||||
'LBL_VALIDTILL_DATE' => 'Valid Till',
|
||||
|
||||
// FOR MENU LINKS
|
||||
|
||||
'LNK_NEW_ECMQUOTE' => 'Create Quote',
|
||||
|
||||
'LNK_ECMQUOTES_LIST' => 'Quotes List',
|
||||
|
||||
|
||||
|
||||
'LBL_IMG_SEARCH' => 'Search',
|
||||
|
||||
'LBL_IMG_NEW' => 'New, add to base',
|
||||
|
||||
'LBL_IMG_EDIT' => 'Edit',
|
||||
|
||||
'LBL_CONFIRM_QUESTION' => 'Would you like to confirm this Quote?',
|
||||
|
||||
'LBL_QUOTE_PDF' => 'Show PDF',
|
||||
'LBL_QUOTE_PDF_BUTTON_KEY' => 'Show PDF [Alt+P]',
|
||||
'LBL_QUOTE_PDF_BUTTON_TITLE' => 'Show Quote in PDF file.',
|
||||
|
||||
'LBL_QUOTE_TO_INVOICE' => 'Create Invoice',
|
||||
'LBL_QUOTE_TO_INVOICE_BUTTON_KEY' => 'Create Invoice [Alt+I]',
|
||||
'LBL_QUOTE_TO_INVOICE_BUTTON_TITLE' => 'Create Invoice.',
|
||||
|
||||
'LBL_QUOTE_TO_SALE' => 'Create Sales Order',
|
||||
'LBL_QUOTE_TO_SALE_BUTTON_KEY' => 'Create Sales Order [Alt+O]',
|
||||
'LBL_QUOTE_TO_SALE_BUTTON_TITLE' => 'Create Sales Order.',
|
||||
|
||||
'LBL_SEND_TO_CONFIRM' => 'Send To Confirm',
|
||||
'LBL_SEND_TO_CONFIRM_BUTTON_KEY' => 'Send To Confirm [Alt+C]',
|
||||
'LBL_SEND_TO_CONFIRM_BUTTON_TITLE' => 'Send This Quote To Confirm.',
|
||||
|
||||
'LBL_LIST_TO_INVOICE' => 'Create Invoice.',
|
||||
'LBL_LIST_TO_SALE' => 'Create Sales Order.',
|
||||
|
||||
|
||||
|
||||
//buttons
|
||||
|
||||
'LBL_SEND_BUTTON_TITLE' => 'Save & Send [Alt+D]',
|
||||
'LBL_SEND_BUTTON_KEY' => 'D',
|
||||
'LBL_SEND_BUTTON_LABEL' => 'Save & Send',
|
||||
|
||||
'LBL_REPAIR_BUTTON_TITLE' => 'Repair [Alt+R]',
|
||||
'LBL_REPAIR_BUTTON_KEY' => 'R',
|
||||
'LBL_REPAIR_BUTTON_LABEL' => 'Repair',
|
||||
|
||||
'LBL_ACCEPT_BUTTON_TITLE' => 'Accept [Alt+Z]',
|
||||
'LBL_ACCEPT_BUTTON_KEY' => 'Z',
|
||||
'LBL_ACCEPT_BUTTON_LABEL' => 'Accept',
|
||||
|
||||
'LBL_REJECT_BUTTON_TITLE' => 'Reject [Alt+R]',
|
||||
'LBL_REJECT_BUTTON_KEY' => 'R',
|
||||
'LBL_REJECT_BUTTON_LABEL' => 'Reject',
|
||||
|
||||
'LBL_GO_TO_LIST_BUTTON_TITLE' => 'Go to quotes list [Alt+G]',
|
||||
'LBL_GO_TO_LIST_BUTTON_KEY' => 'G',
|
||||
'LBL_GO_TO_LIST_BUTTON_LABEL' => 'Go to list',
|
||||
|
||||
'LBL_SENDEMAIL_BUTTON' => 'Send Email',
|
||||
|
||||
'LBL_NOT_SAVED' => 'Quote not saved. Please check all fields are correct!',
|
||||
|
||||
'LBL_SAVED' => 'Quote saved successfully.',
|
||||
|
||||
|
||||
|
||||
'LBL_DEFAULT_CONTACT_HEADER_TEXT' => 'Witaj $contact_full_name!',
|
||||
|
||||
'LBL_DEFAULT_CONTACT_FOOTER_TEXT' => 'Tekst pod tabelka dla Contact',
|
||||
|
||||
'LBL_DEFAULT_CONTACT_ADS_TEXT' => 'Tekst pogrubiony pod tabelka dla Contact',
|
||||
|
||||
|
||||
|
||||
'LBL_DEFAULT_ACCOUNT_HEADER_TEXT' => 'Oferta dla $account_name.',
|
||||
|
||||
'LBL_DEFAULT_ACCOUNT_FOOTER_TEXT' => 'Tekst pod tabelka dla Account',
|
||||
|
||||
'LBL_DEFAULT_ACCOUNT_ADS_TEXT' => 'Tekst pogrubiony pod tabelka dla Account',
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
'LBL_NOTES_SUBPANEL_TITLE' => 'Notes',
|
||||
|
||||
'LBL_EMAILS_SUBPANEL_TITLE' => 'Emails',
|
||||
|
||||
|
||||
|
||||
'LBL_DASHLET_MY_ECMQUOTES' => 'Quotes',
|
||||
|
||||
|
||||
|
||||
|
||||
'LBL_PDF_LIST_POSITION' => 'Poz.',
|
||||
'LBL_PDF_LIST_QUANTITY' => 'Ilosc',
|
||||
'LBL_PDF_LIST_UNIT' => '',
|
||||
'LBL_PDF_LIST_DESCRIPTION' => 'Opis',
|
||||
'LBL_PDF_LIST_PRICE' => 'Cena',
|
||||
'LBL_PDF_LIST_DISCOUNT' => 'Rabat',
|
||||
'LBL_PDF_LIST_VAT' => 'VAT',
|
||||
'LBL_PDF_LIST_TOTAL' => 'Suma',
|
||||
'LBL_PDF_TOTAL' => 'Suma',
|
||||
'LBL_PDF_DISCOUNT' => 'RABAT',
|
||||
'LBL_PDF_END_TOTAL' => 'Suma koncowa',
|
||||
'LBL_PDF_VAT' => 'VAT',
|
||||
'LBL_PDF_VATID' => 'VAT-ID',
|
||||
'LBL_PDF_NUMBER' => 'Numer',
|
||||
'LBL_PDF_DATE_REGISTER' => 'Data wystawienia',
|
||||
'LBL_PDF_VALIDTILL_DATE' => 'Waznosc oferty',
|
||||
'LBL_PDF_OWNER' => 'Wystawil',
|
||||
'LBL_PDF_DOCUMENT_NAME' => 'Oferta',
|
||||
'LBL_PDF_FILENAME' => 'Quote_',
|
||||
'LBL_PDF_CODE' => '',
|
||||
|
||||
'LNK_ECMQUOTES_PDFLANGUAGES' => 'PDF Settings',
|
||||
'LBL_ECMLANGUAGE' => 'Language',
|
||||
'LBL_ECMQUOTES_PDFLANGUAGES_TITLE' => 'PDF Languages Settings',
|
||||
|
||||
'LBL_ACCESS_UNAVAIBLE_DELETE_EMAIL' => "You don't have a permission to send Email, because this Quote is not accepted by Manager!",
|
||||
'LBL_SEND_TO_CONFIRM_ERROR' => "Sending Quote to confirm error! Refresh site and try again.",
|
||||
|
||||
'LBL_STATUS_s10_SET_MESSAGE' => "Quote status is set.",
|
||||
'LBL_STATUS_s20_SET_MESSAGE' => "Now Quote is waiting for confimations.",
|
||||
'LBL_STATUS_s30_SET_MESSAGE' => "Quote is confirmed.",
|
||||
'LBL_STATUS_s40_SET_MESSAGE' => "Quote status is set.",
|
||||
|
||||
'LBL_STATUS_s20_FAIL_MESSAGE' => "Sending Quote to confirm error! Refresh site and try again.",
|
||||
|
||||
'LBL_LIST_SEND_TO_CONFIRM' => 'Send To Confirm',
|
||||
'LBL_LIST_DUPLICATE' => 'Duplicate',
|
||||
'LBL_LIST_PREVIEW_PDF' => 'Preview Quote',
|
||||
'LBL_LIST_REJECT' => 'Reject',
|
||||
'LBL_LIST_ACCEPT' => 'Accept',
|
||||
|
||||
|
||||
'LBL_MODIFIED_USER' => 'Modified By',
|
||||
|
||||
'LBL_DEMO_VERSION_INFORMATION' => "This is only demo version.\nPlease contact us at ca@more7.com.",
|
||||
|
||||
'LBL_ORDER_ORIGIN' => 'Order Origin',
|
||||
|
||||
'LBL_PREVIEW_HEADER_NAME' => 'Preview',
|
||||
'LBL_PREVIEW_HEADER_CLOSE' => 'Close',
|
||||
|
||||
'LBL_CONTACT_NAME' => 'Contact',
|
||||
'LBL_CONTACT_ID' => 'Contact Id',
|
||||
'LBL_PARENT_NAME_COPY' => 'Company Name',
|
||||
'LBL_PARENT_CONTACT_NAME' => 'Contact Person',
|
||||
'LBL_PARENT_CONTACT_TITLE' => 'Contact Title',
|
||||
|
||||
'LBL_ALERT_ECMLANGUAGE_CHANGE' => 'Would you like to load default texts correspondencing to this language?',
|
||||
'LBL_LIST_DOWNLOAD_PDF' => 'Download PDF',
|
||||
|
||||
'LBL_IMAGE_SIZE' => 'Images size (%)',
|
||||
);
|
||||
|
||||
|
||||
|
||||
?>
|
||||
447
modules/EcmReturns/language/pl_pl.lang.php
Normal file
447
modules/EcmReturns/language/pl_pl.lang.php
Normal file
@@ -0,0 +1,447 @@
|
||||
<?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.
|
||||
*
|
||||
* ******************************************************************************
|
||||
*/
|
||||
|
||||
$mod_strings = array (
|
||||
'LBL_ERRORS' => 'Produkty nie znalezione na fakturach',
|
||||
'LBL_BTN_CREATE_ZS' => 'Utwórz ZS',
|
||||
'LBL_ECMPRICE' => 'Ceny B2B',
|
||||
'LBL_SEARCH' => 'Wyszukaj',
|
||||
'LBL_CATEGORY' => 'Kategoria',
|
||||
'LBL_PDF_TEXT' => 'Tekst na fakturze',
|
||||
'LBL_PARENT_NIP' => 'NIP',
|
||||
'LBL_NO_TAX' => 'Bez Vatu',
|
||||
'LBL_SITE' => 'Strona',
|
||||
'LBL_SHOW_EAN' => 'Pokaż EAN1',
|
||||
'LBL_SHOW_EAN2' => 'Pokaż EAN2',
|
||||
'LNK_NEW_'.'ECMRETURNS'=>'Utwórz zwrot',
|
||||
'LNK_ECMRETURNS_LIST'=>'Lista zwrotów',
|
||||
// added 01.09.2009
|
||||
'LBL_ECMLANGUAGE' => 'Język',
|
||||
'LBL_PRICEBOOK' => 'Cennik',
|
||||
'LBL_EDITTABLE_RECIPIENT_CODE' => 'Kod Odbiorcy',
|
||||
// added 05.08.2009
|
||||
'LBL_CURRENCY' => 'Waluta',
|
||||
'LBL_DETAIL_BUTTON' => 'Szczegóły',
|
||||
// added 15.07.2009
|
||||
'LBL_EDITTABLE_UNIT' => 'J.m.',
|
||||
// added 09.02.2009
|
||||
'LBL_SHOW_IMAGES_ON_OFFERS' => 'Pokaż obrazki w PDFie',
|
||||
'LBL_SHOW_RECIPIENT_CODE' => 'Pokaż kod odbiorcy',
|
||||
'LBL_INVOICE' => 'Faktura',
|
||||
'LBL_CORRECT' => 'Ost. Korekta',
|
||||
'LBL_EDITTABLE_RECIPIENT_CODE' => 'Kod Odbiorcy',
|
||||
'LBL_EDITTABLE_UNIT'=>'J.m.',
|
||||
'LBL_EDITTABLE_NO' => 'Lp.',
|
||||
'LBL_EDITTABLE_CODE' => 'Kod',
|
||||
'LBL_EDITTABLE_NAME' => 'Nazwa',
|
||||
'LBL_EDITTABLE_QUANTITY' => 'Ilosc',
|
||||
'LBL_EDITTABLE_PRICE' => 'Cena',
|
||||
'LBL_EDITTABLE_VAT' => 'VAT',
|
||||
'LBL_EDITTABLE_DISCOUNT' => 'Upust',
|
||||
'LBL_EDITTABLE_TOTAL' => 'Suma',
|
||||
'LBL_EDITTABLE_OPTIONS' => 'Opcje',
|
||||
'LBL_CREATE_COR'=>'Utwórz korektę',
|
||||
// FOR SYSTEM USE
|
||||
|
||||
'LBL_MODULE_NAME' => 'Zwroty',
|
||||
|
||||
'LBL_MODULE_TITLE' => 'Zwroty: Strona Główna',
|
||||
|
||||
'LBL_MODULE_ID' => 'EcmReturns',
|
||||
|
||||
'LBL_SEARCH_FORM_TITLE' => 'Wyszukiwanie',
|
||||
|
||||
'LBL_LIST_FORM_TITLE' => 'Lista Zwrotów',
|
||||
|
||||
'LBL_NEW_FORM_TITLE' => 'Nowy Zwrot',
|
||||
|
||||
'LBL_DETAILS' => 'Szczególy Zwrotu',
|
||||
|
||||
'LBL_ITEMS' => 'Zalaczone Produkty:',
|
||||
|
||||
'LBL_TEXTS' => 'Teksty do PDFa:',
|
||||
|
||||
'LBL_PREVIEW' => 'Podglad PDFa:',
|
||||
|
||||
'LBL_EMAIL' => 'Stwórz Email:',
|
||||
|
||||
'LBL_TO_INFORMATIONS' => 'Informacje o firmie:',
|
||||
|
||||
'LBL_DETAILS_TAB' => 'Szczególy',
|
||||
|
||||
'LBL_ITEMS_TAB' => 'Produkty',
|
||||
|
||||
'LBL_TEXTS_TAB' => 'Teksty',
|
||||
|
||||
'LBL_PREVIEW_TAB' => 'Podglad',
|
||||
|
||||
'LBL_EMAIL_TAB' => 'Email',
|
||||
|
||||
'LBL_ID' => 'Id',
|
||||
|
||||
'LBL_NAME' => 'Nr zwrotu:',
|
||||
|
||||
'LBL_DESCRIPTION' => 'Opis',
|
||||
|
||||
'LBL_DATE_ENTERED' => 'Data dodania',
|
||||
|
||||
'LBL_DATE_MODIFIED' => 'Date modyfikacji',
|
||||
|
||||
'LBL_MODIFIED' => 'Ostatnio modyfikowane',
|
||||
|
||||
'LBL_ASSIGNED_TO_ID' => 'Przypisane Do',
|
||||
|
||||
'LBL_ASSIGNED_TO' => 'Przypisane Do',
|
||||
|
||||
'LBL_CREATED' => 'Utworzone Przez',
|
||||
|
||||
'LBL_CREATED_BY_USER' => 'Utworzone Przez',
|
||||
'LBL_CORRECT_BUTTON_LABEL'=>'Stwórz Korektę',
|
||||
'LBL_MODIFIED_BY_USER' => 'Zmodyfikowane Przez',
|
||||
|
||||
'LBL_ASSIGNED_TO_USER' => 'Przypisane Do',
|
||||
|
||||
'LBL_DELETED_BY' => 'Usuniete Przez',
|
||||
|
||||
'LBL_NUMBER' => 'Numer',
|
||||
|
||||
'LBL_DOCUMENT_NO' => 'Numer',
|
||||
|
||||
'LBL_PARENT' => 'Do',
|
||||
|
||||
'LBL_PARENT_NAME' => 'Firma',
|
||||
|
||||
'LBL_PARENT_ID' => 'Firma Id',
|
||||
|
||||
'LBL_TYPE' => 'Wyszukuj podanych cen',
|
||||
|
||||
'LBL_ECMQUOTE_ID' => 'Id Oferty',
|
||||
|
||||
'LBL_ECMQUOTE_NAME' => 'Nazwa Oferty',
|
||||
|
||||
'LBL_STATUS' => 'Status',
|
||||
|
||||
'LBL_REGISTER_DATE' => 'Data Dokumentu',
|
||||
|
||||
'LBL_SELL_DATE' => 'Data Sprzedazy',
|
||||
|
||||
'LBL_PAYMENT_DATE' => 'Data Platnosci',
|
||||
|
||||
'LBL_PARENT_ADDRESS_STREET' => 'Ulica',
|
||||
|
||||
'LBL_PARENT_ADDRESS_CITY' => 'Kod pocztowy / Miasto',
|
||||
|
||||
'LBL_PARENT_ADDRESS_POSTALCODE' => 'Kod pocztowy',
|
||||
|
||||
'LBL_PARENT_ADDRESS_COUNTRY' => 'Panstwo',
|
||||
|
||||
'LBL_TO_VATID' => 'VAT-ID',
|
||||
|
||||
'LBL_TO_IS_VAT_FREE' => 'Czy jest wolne od vatu?',
|
||||
|
||||
'LBL_HEADER_TEXT' => 'Tekst naglówka',
|
||||
|
||||
'LBL_FOOTER_TEXT' => 'Tekst stopki',
|
||||
|
||||
'LBL_ADS_TEXT' => 'Dodatkowy tekst',
|
||||
|
||||
'LBL_SUBTOTAL' => 'Suma',
|
||||
|
||||
'LBL_TOTAL' => 'Suma',
|
||||
|
||||
'LBL_DISCOUNT' => 'Upust',
|
||||
|
||||
'LBL_VAT' => 'VAT',
|
||||
|
||||
'LBL_ACCEPTED' => 'Zaakceptowane',
|
||||
|
||||
'LBL_TEMPLATE_ID' => 'Id Szablonu',
|
||||
|
||||
'LBL_TEMPLATE_NAME' => 'Szablon',
|
||||
|
||||
'LBL_PAYMENTCONDITION_NAME' => 'Warunki Platnosci',
|
||||
'LBL_PAYMENTCONDITION_ID' => 'Warunki Platnosci ID',
|
||||
|
||||
'LBL_DELIVERYCONDITION_NAME' => 'Warunki Dostawy',
|
||||
'LBL_DELIVERYCONDITION_ID' => 'Warunki Dostawy ID',
|
||||
|
||||
'LBL_FORMAT_NUMBER_ERROR' => 'Blad formatu numeru!',
|
||||
|
||||
'LBL_SAVE_FORM_ERROR' => 'Wystepuja bledy na liscie produktów albo w formularzu!',
|
||||
|
||||
'LBL_DISCOUNT_ERROR' => 'Blad formatu upustu',
|
||||
|
||||
'LBL_EDITTABLE_NO' => 'Lp.',
|
||||
'LBL_EDITTABLE_CODE' => 'Kod',
|
||||
'LBL_EDITTABLE_NAME' => 'Nazwa',
|
||||
'LBL_EDITTABLE_QUANTITY' => 'Ilosc',
|
||||
'LBL_EDITTABLE_PRICE' => 'Cena',
|
||||
'LBL_EDITTABLE_VAT' => 'VAT',
|
||||
'LBL_EDITTABLE_DISCOUNT' => 'Upust',
|
||||
'LBL_EDITTABLE_TOTAL' => 'Suma',
|
||||
'LBL_EDITTABLE_OPTIONS' => 'Opcje',
|
||||
|
||||
'LBL_MOVE_ROW_UP' => 'W góre',
|
||||
'LBL_MOVE_ROW_DOWN' => 'W dól',
|
||||
'LBL_INSERT_NEW_ROW' => 'Wstaw nowy wiersz',
|
||||
'LBL_DELETE_ROW' => 'Usun wiersz',
|
||||
|
||||
'LBL_VALIDTILL_DATE' => 'Wazne do',
|
||||
|
||||
// FOR MENU LINKS
|
||||
|
||||
'LNK_NEW_ECMQUOTE' => 'Utwórz Ofertę',
|
||||
|
||||
'LNK_ECMQUOTES_LIST' => 'Lista Ofert',
|
||||
|
||||
'LBL_IMG_SEARCH' => 'Wyszukiwanie',
|
||||
|
||||
'LBL_IMG_NEW' => 'Nowy, dodaj do bazy',
|
||||
|
||||
'LBL_IMG_EDIT' => 'Edycja',
|
||||
|
||||
'LBL_CONFIRM_QUESTION' => 'Chcesz potwierdzic tą Ofertę?',
|
||||
|
||||
'LBL_QUOTE_PDF' => 'Pokaz PDF',
|
||||
'LBL_QUOTE_PDF_BUTTON_KEY' => 'Pokaz PDF [Alt+P]',
|
||||
'LBL_QUOTE_PDF_BUTTON_TITLE' => 'Pokaz Ofertę w pliku PDF.',
|
||||
|
||||
'LBL_QUOTE_TO_INVOICE' => 'Stwórz Fakture',
|
||||
'LBL_QUOTE_TO_INVOICE_BUTTON_KEY' => 'Stwórz Fakture [Alt+I]',
|
||||
'LBL_QUOTE_TO_INVOICE_BUTTON_TITLE' => 'Stwórz Fakture.',
|
||||
|
||||
'LBL_QUOTE_TO_SALE' => 'Stwórz Zamówienie Sprzedazy',
|
||||
'LBL_QUOTE_TO_SALE_BUTTON_KEY' => 'Stwórz Zamówienie Sprzedazy [Alt+O]',
|
||||
'LBL_QUOTE_TO_SALE_BUTTON_TITLE' => 'Stwórz Zamówienie Sprzedazy.',
|
||||
|
||||
'LBL_SEND_TO_CONFIRM' => 'Wyslij Do Potwierdzenia',
|
||||
'LBL_SEND_TO_CONFIRM_BUTTON_KEY' => 'Wyslij Do Potwierdzenia [Alt+C]',
|
||||
'LBL_SEND_TO_CONFIRM_BUTTON_TITLE' => 'Wyslij Do Potwierdzenia.',
|
||||
|
||||
'LBL_LIST_TO_INVOICE' => 'Stwórz Fakture.',
|
||||
'LBL_LIST_TO_SALE' => 'Stwórz Zamówienie Sprzedazy.',
|
||||
|
||||
// buttons
|
||||
|
||||
'LBL_SEND_BUTTON_TITLE' => 'Zapisz i Wyslij [Alt+D]',
|
||||
'LBL_SEND_BUTTON_KEY' => 'D',
|
||||
'LBL_SEND_BUTTON_LABEL' => 'Zapisz i Wyslij',
|
||||
|
||||
'LBL_REPAIR_BUTTON_TITLE' => 'Napraw [Alt+R]',
|
||||
'LBL_REPAIR_BUTTON_KEY' => 'R',
|
||||
'LBL_REPAIR_BUTTON_LABEL' => 'Napraw',
|
||||
|
||||
'LBL_ACCEPT_BUTTON_TITLE' => 'Zaakceptuj [Alt+Z]',
|
||||
'LBL_ACCEPT_BUTTON_KEY' => 'Z',
|
||||
'LBL_ACCEPT_BUTTON_LABEL' => 'Zaakceptuj',
|
||||
|
||||
'LBL_REJECT_BUTTON_TITLE' => 'Nie akceptuj [Alt+R]',
|
||||
'LBL_REJECT_BUTTON_KEY' => 'R',
|
||||
'LBL_REJECT_BUTTON_LABEL' => 'Nie akceptuj',
|
||||
|
||||
'LBL_GO_TO_LIST_BUTTON_TITLE' => 'Idz do listy Ofert [Alt+G]',
|
||||
'LBL_GO_TO_LIST_BUTTON_KEY' => 'G',
|
||||
'LBL_GO_TO_LIST_BUTTON_LABEL' => 'Idz do listy',
|
||||
|
||||
'LBL_SENDEMAIL_BUTTON' => 'Wyslij Email',
|
||||
|
||||
'LBL_NOT_SAVED' => 'Oferta nie została zapisana. Sprawdz czy wszytskie pola sa poprawne!',
|
||||
|
||||
'LBL_SAVED' => 'Oferta została zapisana pomyslnie.',
|
||||
|
||||
'LBL_DEFAULT_CONTACT_HEADER_TEXT' => 'Witaj $contact_full_name!',
|
||||
|
||||
'LBL_DEFAULT_CONTACT_FOOTER_TEXT' => 'Tekst pod tabelka dla Contact',
|
||||
|
||||
'LBL_DEFAULT_CONTACT_ADS_TEXT' => 'Tekst pogrubiony pod tabelka dla Contact',
|
||||
|
||||
'LBL_DEFAULT_ACCOUNT_HEADER_TEXT' => 'Oferta dla $account_name.',
|
||||
|
||||
'LBL_DEFAULT_ACCOUNT_FOOTER_TEXT' => 'Tekst pod tabelka dla Account',
|
||||
|
||||
'LBL_DEFAULT_ACCOUNT_ADS_TEXT' => 'Tekst pogrubiony pod tabelka dla Account',
|
||||
|
||||
'LBL_NOTES_SUBPANEL_TITLE' => 'Notatki',
|
||||
|
||||
'LBL_EMAILS_SUBPANEL_TITLE' => 'Emaile',
|
||||
|
||||
'LBL_DASHLET_MY_ECMQUOTES' => 'Oferty',
|
||||
|
||||
'LNK_ECMQUOTES_PDFLANGUAGES' => 'Ustawienia PDF',
|
||||
'LBL_ECMQUOTES_PDFLANGUAGES_TITLE' => 'Ustawienia jezyków PDFa',
|
||||
|
||||
'LBL_ACCESS_UNAVAIBLE_DELETE_EMAIL' => "You don't have a permission to send Email, because this Correct Document is not accepted by Manager!",
|
||||
'LBL_SEND_TO_CONFIRM_ERROR' => "Sending Correct Document to confirm error! Refresh site and try again.",
|
||||
|
||||
'LBL_STATUS_s10_SET_MESSAGE' => "Status Oferty ustawiony.",
|
||||
'LBL_STATUS_s20_SET_MESSAGE' => "Oferta czeka na potwierdzenie.",
|
||||
'LBL_STATUS_s30_SET_MESSAGE' => "Oferta jest potwierdzony.",
|
||||
'LBL_STATUS_s40_SET_MESSAGE' => "Status Oferty ustawiony.",
|
||||
|
||||
'LBL_STATUS_s20_FAIL_MESSAGE' => "Blad wysylki do potwierdzenia! Odswiez strone i sprobuj ponownie.",
|
||||
|
||||
'LBL_LIST_SEND_TO_CONFIRM' => 'Wyslij do Potwierdzenia',
|
||||
'LBL_LIST_DUPLICATE' => 'Duplikuj',
|
||||
'LBL_LIST_PREVIEW_PDF' => 'Podglad Oferty',
|
||||
'LBL_LIST_REJECT' => 'Nie akceptuj',
|
||||
'LBL_LIST_ACCEPT' => 'Akceptuj',
|
||||
|
||||
'LBL_MODIFIED_USER' => 'Zmodyfikowane Przez',
|
||||
|
||||
'LBL_DEMO_VERSION_INFORMATION' => "This is only demo version.\nPlease contact us at ca@more7.com.",
|
||||
|
||||
'LBL_ORDER_ORIGIN' => 'Zródlo zamówienia',
|
||||
|
||||
'LBL_PREVIEW_HEADER_NAME' => 'Podglad',
|
||||
'LBL_PREVIEW_HEADER_CLOSE' => 'Zamknij',
|
||||
|
||||
'LBL_CONTACT_NAME' => 'Kontakt',
|
||||
'LBL_CONTACT_ID' => 'Id Kontaktu',
|
||||
'LBL_PARENT_NAME_COPY' => 'Nazwa Firmy',
|
||||
'LBL_PARENT_CONTACT_NAME' => 'Osoba Kontaktowa',
|
||||
'LBL_PARENT_CONTACT_TITLE' => 'Tytul Kontaktu',
|
||||
|
||||
'LBL_ALERT_ECMLANGUAGE_CHANGE' => 'Czy zaladowac domyslne teksty dla tego jezyka?',
|
||||
'LBL_LIST_DOWNLOAD_PDF' => 'Pobierz PDF',
|
||||
|
||||
'LBL_IMAGE_SIZE' => 'Rozmiar obrazków (%)',
|
||||
|
||||
// mz new fields
|
||||
'LBL_SEARCH' => 'Wyszukaj',
|
||||
'LBL_CATEGORY' => 'Kategoria',
|
||||
'LBL_SEARCH_STOCK' => 'Stan magazynowy',
|
||||
'LBL_SEARCH_STOCK_OPT_NO' => 'Nie pokazuj',
|
||||
'LBL_SEARCH_STOCK_OPT_YES' => 'Pokaż',
|
||||
'LBL_SEARCH_STOCK_OPT_NOT_NULL' => 'Tylko produkty dostępne',
|
||||
'LBL_SEARCH_SORT' => 'Sortuj wyniki wg.',
|
||||
'LBL_SEARCH_SORT_CODE' => 'Kod rosnąco',
|
||||
'LBL_SEARCH_SORT_CODE_DESC' => 'Kod malejąco',
|
||||
'LBL_SEARCH_SORT_NAME' => 'Nazwa rosnąco',
|
||||
'LBL_SEARCH_SORT_NAME_DESC' => 'Nazwa malejąco',
|
||||
// PDF labels
|
||||
'LBL_PDF_FOOTER_KRS' => 'KRS:',
|
||||
'LBL_PDF_FOOTER_NIP' => 'NIP:',
|
||||
'LBL_PDF_FOOTER_REGON' => 'REGON:',
|
||||
'LBL_PDF_FOOTER_BANK' => 'Bank:',
|
||||
'LBL_PDF_FOOTER_BANK_ACCOUNT' => 'Number konta:',
|
||||
'LBL_PDF_FOOTER_GIOS' => 'Numer GIOS:',
|
||||
'LBL_PDF_CONTENT_QUOTE_FOR' => 'Oferta dla:',
|
||||
'LBL_PDF_CONTENT_REGISTER_DATE' => 'Data wystawienia:',
|
||||
'LBL_PDF_CONTENT_ISSUED_BY' => 'Wystawił:',
|
||||
'LBL_PDF_CONTENT_NUMBER' => 'Numer:',
|
||||
'LBL_PDF_CONTENT_LIST_POSITION' => 'Lp.',
|
||||
'LBL_PDF_CONTENT_LIST_IMAGE' => 'Zdjęcie',
|
||||
'LBL_PDF_CONTENT_LIST_NAME' => 'Nazwa',
|
||||
'LBL_PDF_CONTENT_LIST_CODE' => 'Indeks',
|
||||
'LBL_PDF_CONTENT_LIST_QTY' => 'Ilość',
|
||||
'LBL_PDF_CONTENT_LIST_UNIT' => 'j.m.',
|
||||
'LBL_PDF_CONTENT_LIST_EAN' => 'Ean',
|
||||
'LBL_PDF_CONTENT_LIST_EAN2' => 'Ean 2',
|
||||
'LBL_PDF_CONTENT_LIST_RECIPIENT_CODE' => 'Kod odbiorcy',
|
||||
'LBL_PDF_CONTENT_LIST_REMARKS' => 'Uwagi',
|
||||
'LBL_PDF_CONTENT_LIST_PRICE_START' => 'Cena początkowa',
|
||||
'LBL_PDF_CONTENT_LIST_PRICE_NETTO' => 'Cena netto',
|
||||
'LBL_PDF_CONTENT_LIST_DISCOUNT' => 'Rabat',
|
||||
'LBL_PDF_CONTENT_LIST_TOTAL_NETTO' => 'Wartość netto',
|
||||
'LBL_PDF_CONTENT_TOTAL_NETTO' => 'Suma netto',
|
||||
'LBL_PDF_CONTENT_TOTAL_BRUTTO' => 'Suma brutto'
|
||||
);
|
||||
|
||||
?>
|
||||
125
modules/EcmReturns/metadata/SearchFields.php
Normal file
125
modules/EcmReturns/metadata/SearchFields.php
Normal file
@@ -0,0 +1,125 @@
|
||||
<?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.
|
||||
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$searchFields['EcmReturns'] = array (
|
||||
|
||||
'name' => array ( 'query_type' => 'default' ),
|
||||
|
||||
'description' => 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' ),
|
||||
|
||||
'status' => array ( 'query_type' => 'default' ),
|
||||
|
||||
'register_date' => array ( 'query_type' => 'default' ),
|
||||
|
||||
'parent_name' => array( 'query' => 'default' ),
|
||||
|
||||
|
||||
);
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
245
modules/EcmReturns/metadata/detailviewdefs.php
Normal file
245
modules/EcmReturns/metadata/detailviewdefs.php
Normal file
@@ -0,0 +1,245 @@
|
||||
<?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".
|
||||
|
||||
* *******************************************************************************/
|
||||
global $app_list_strings;
|
||||
|
||||
$viewdefs ['EcmReturns'] ['DetailView'] = array (
|
||||
|
||||
'templateMeta' => array (
|
||||
|
||||
'form' => array (
|
||||
|
||||
'buttons' => array (
|
||||
|
||||
array (
|
||||
'customCode' => '{if $CAN_EDIT == true} <input title="{$APP.LBL_EDIT_BUTTON_TITLE}" accessKey="{$APP.LBL_EDIT_BUTTON_KEY}" class="button" onclick="this.form.return_module.value=\'EcmReturns\'; 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' => '<input title="{$APP.LBL_DUPLICATE_BUTTON_TITLE}" accessKey="{$APP.LBL_DUPLICATE_BUTTON_KEY}" class="button" onclick="this.form.return_module.value=\'EcmReturns\'; this.form.return_action.value=\'DetailView\'; this.form.isDuplicate.value=true; this.form.action.value=\'EditView\'; this.form.return_id.value=\'{$id}\';" type="submit" name="Duplicate" value="{$APP.LBL_DUPLICATE_BUTTON_LABEL}" id="duplicate_button">'
|
||||
),
|
||||
array (
|
||||
'customCode' => '{if $CREATE_CR == true} <input class="button" onclick="this.form.return_module.value=\'EcmReturns\'; this.form.action.value=\'searchProductsToCorrect\'; this.form.return_id.value=\'{$id}\';" type="submit" name="correct" value="{$MOD.LBL_CORRECT_BUTTON_LABEL}" id="create_correct">{/if}'
|
||||
)
|
||||
)
|
||||
,
|
||||
|
||||
'hidden' => array (
|
||||
'<input type="hidden" id="type" value=\'{$fields.type.value}\'>'
|
||||
)
|
||||
),
|
||||
|
||||
'maxColumns' => '2',
|
||||
|
||||
'widths' => array (
|
||||
|
||||
array (
|
||||
'label' => '10',
|
||||
'field' => '30'
|
||||
),
|
||||
|
||||
array (
|
||||
'label' => '10',
|
||||
'field' => '30'
|
||||
)
|
||||
),
|
||||
|
||||
'includes' => array (
|
||||
array (
|
||||
'file' => 'include/JSON.js'
|
||||
),
|
||||
array (
|
||||
'file' => 'modules/EcmReturns/javascript/EcmReturnsDetail.js'
|
||||
),
|
||||
array (
|
||||
'file' => 'modules/EcmReturns/javascript/bimit_table.js'
|
||||
),
|
||||
array (
|
||||
'file' => 'modules/EcmReturns/javascript/columndefs-detail.js'
|
||||
)
|
||||
)
|
||||
),
|
||||
|
||||
'panels' => array (
|
||||
|
||||
'LBL_DETAILS_TAB' => array (
|
||||
|
||||
array (
|
||||
|
||||
'document_no',
|
||||
|
||||
'assigned_user_name'
|
||||
),
|
||||
array (
|
||||
array (
|
||||
'name' => 'parent_name',
|
||||
'customCode' => '<a href="index.php?module={$fields.parent_type.value}&action=DetailView&record={$fields.parent_id.value}">{$fields.parent_name.value}</a>'
|
||||
),
|
||||
array (
|
||||
'name' => 'ecmpaymentcondition_name',
|
||||
'customCode' => '{$fields.ecmpaymentcondition_name.value}'
|
||||
)
|
||||
),
|
||||
array (
|
||||
'name',
|
||||
'type',
|
||||
),
|
||||
|
||||
array (
|
||||
array (
|
||||
'name' => 'status',
|
||||
'type' => 'enum',
|
||||
'customCode' => '<span id="statusEcmReturn">{$fields.status.options[$fields.status.value]}</span>'
|
||||
)
|
||||
),
|
||||
|
||||
array (
|
||||
'register_date'
|
||||
|
||||
),
|
||||
array (
|
||||
|
||||
array (
|
||||
|
||||
'name' => 'to_informations',
|
||||
'allCols' => true,
|
||||
|
||||
'hideLabel' => true,
|
||||
|
||||
'customCode' => '<br><b>{$MOD.LBL_TO_INFORMATIONS}</b>'
|
||||
)
|
||||
),
|
||||
|
||||
array (
|
||||
array (
|
||||
'name' => 'parent_name_copy',
|
||||
'customCode' => '{$fields.parent_name.value}'
|
||||
),
|
||||
),
|
||||
array (
|
||||
'parent_nip'
|
||||
),
|
||||
array (
|
||||
'parent_address_street'
|
||||
),
|
||||
array (
|
||||
array (
|
||||
'name' => 'parent_address_city',
|
||||
'tabIndex' => 't',
|
||||
'customCode' => '{$fields.parent_address_postalcode.value} {$fields.parent_address_city.value}'
|
||||
)
|
||||
),
|
||||
array (
|
||||
'parent_address_country'
|
||||
),
|
||||
array (
|
||||
'pdf_text'
|
||||
),
|
||||
array (
|
||||
array (
|
||||
|
||||
'name' => 'to_informations',
|
||||
'allCols' => true,
|
||||
|
||||
'hideLabel' => true,
|
||||
|
||||
'customCode' => '<br>'
|
||||
)
|
||||
),
|
||||
array (
|
||||
array (
|
||||
'name' => 'date_modified',
|
||||
'label' => 'LBL_DATE_MODIFIED',
|
||||
'customCode' => '{$fields.date_modified.value} {$APP.LBL_BY} {$MODIFIED_BY_NAME}'
|
||||
),
|
||||
array (
|
||||
'name' => 'date_entered',
|
||||
'customCode' => '{$fields.date_entered.value} {$APP.LBL_BY} {$CREATED_BY_NAME}'
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
'LBL_ITEMS_TAB' => array (
|
||||
|
||||
array (
|
||||
|
||||
array (
|
||||
'name' => 'items_list_panel',
|
||||
'allCols' => true,
|
||||
|
||||
'hideLabel' => true,
|
||||
|
||||
'customCode' => '<div id="itemsTable"></div>'
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
222
modules/EcmReturns/metadata/editviewdefs.php
Normal file
222
modules/EcmReturns/metadata/editviewdefs.php
Normal file
@@ -0,0 +1,222 @@
|
||||
<?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".
|
||||
* *******************************************************************************/
|
||||
global $sugar_config;
|
||||
$viewdefs ['EcmReturns'] ['EditView'] = array (
|
||||
'templateMeta' => array (
|
||||
'form' => array (
|
||||
'enctype' => 'multipart/form-data',
|
||||
'buttons' => array (
|
||||
'SAVE',
|
||||
'CANCEL'
|
||||
),
|
||||
'hidden' => array (
|
||||
'<input type="hidden" name="position_list" id="position_list" value=\'{$POSITION_LIST}\'>',
|
||||
'<input type="hidden" name="new_number" id="new_number" value=\'{$NEW_NUMBER}\'>',
|
||||
'<input type="hidden" id="duplicate" name="duplicate" value=\'{$DUPLICATE}\'>',
|
||||
)
|
||||
),
|
||||
'maxColumns' => '2',
|
||||
'widths' => array (
|
||||
array (
|
||||
'label' => '10',
|
||||
'field' => '30'
|
||||
),
|
||||
array (
|
||||
'label' => '10',
|
||||
'field' => '30'
|
||||
)
|
||||
),
|
||||
'includes' => array (
|
||||
array (
|
||||
'file' => 'include/JSON.js'
|
||||
),
|
||||
array (
|
||||
'file' => 'modules/EcmReturns/javascript/EcmReturns.js'
|
||||
),
|
||||
array (
|
||||
'file' => 'modules/EcmReturns/javascript/bimit_table.js'
|
||||
),
|
||||
array (
|
||||
'file' => 'modules/EcmReturns/javascript/columndefs.js'
|
||||
)
|
||||
)
|
||||
),
|
||||
'panels' => array (
|
||||
'LBL_DETAILS_TAB' => array (
|
||||
array (
|
||||
array (
|
||||
'type' => 'tab',
|
||||
'active' => true
|
||||
)
|
||||
),
|
||||
array (
|
||||
array (
|
||||
'name' => 'document_no',
|
||||
'tabIndex' => '1',
|
||||
'customCode' => '<div id="tst" style="display:none;"></div><input readonly="readonly" type="text" name="document_no" id="document_no" value=\'{$fields.document_no.value}\'>
|
||||
<input type="hidden" name="number" id="number" value=\'{$fields.number.value}\'>'
|
||||
),
|
||||
array (
|
||||
'name' => 'assigned_user_name',
|
||||
'tabIndex' => '1'
|
||||
)
|
||||
),
|
||||
array (
|
||||
array (
|
||||
'name' => 'parent_name',
|
||||
'tabIndex' => '1'
|
||||
),
|
||||
array (
|
||||
'name' => 'ecmpaymentcondition_name',
|
||||
'tabIndex' => '1'
|
||||
)
|
||||
),
|
||||
array (
|
||||
array (
|
||||
'name' => 'name',
|
||||
'tabIndex' => '1'
|
||||
)
|
||||
),
|
||||
array (
|
||||
|
||||
),
|
||||
array (
|
||||
array (
|
||||
'name' => 'register_date',
|
||||
'tabIndex' => '1',
|
||||
'type' => 'datetime',
|
||||
'displayParams' => array (
|
||||
'showFormats' => true
|
||||
)
|
||||
) ,
|
||||
array (
|
||||
'name' => 'type',
|
||||
'tabIndex' => '1'
|
||||
)
|
||||
),
|
||||
array (
|
||||
array (
|
||||
'allCols' => true,
|
||||
'hideLabel' => true,
|
||||
'customCode' => '<div class="tabForm" style="border-top:none;width:100%;height:1px;padding:0px;align:center;"></div><h4>{$MOD.LBL_TO_INFORMATIONS}</h4>'
|
||||
)
|
||||
),
|
||||
array (
|
||||
array (
|
||||
'name' => 'parent_name_copy',
|
||||
'tabIndex' => '1',
|
||||
'customCode' => '<input type="text" name="parent_name_copy" id="parent_name_copy" value="{$fields.parent_name.value}" readOnly="readonly" size="30" />'
|
||||
),
|
||||
),
|
||||
array (
|
||||
array (
|
||||
'name' => 'parent_nip',
|
||||
'tabIndex' => '1'
|
||||
),
|
||||
),
|
||||
array (
|
||||
array (
|
||||
'name' => 'parent_address_street',
|
||||
'tabIndex' => '1',
|
||||
'customCode' => '<textarea tabindex="1" id="parent_address_street" name="parent_address_street" rows="2" cols="30" maxlength="150" >{$fields.parent_address_street.value}</textarea>'
|
||||
)
|
||||
),
|
||||
array (
|
||||
array (
|
||||
'name' => 'parent_address_city',
|
||||
'tabIndex' => '1',
|
||||
'customCode' => '<input maxlength="8" type="text" name="parent_address_postalcode" id="parent_address_postalcode" value="{$fields.parent_address_postalcode.value}" style="vertical-align:top;width:80px;" /> <input type="text" name="parent_address_city" id="parent_address_city" value="{$fields.parent_address_city.value}" style="vertical-align:top;width:150px;" />'
|
||||
)
|
||||
),
|
||||
array (
|
||||
array (
|
||||
'name' => 'parent_address_country',
|
||||
'tabIndex' => '1'
|
||||
)
|
||||
),
|
||||
array (
|
||||
array (
|
||||
'allCols' => true,
|
||||
'hideLabel' => true,
|
||||
'customCode' => '<div class="tabForm" style="border-top:none;width:100%;height:1px;padding:0px;align:center;"></div><h4>{$MOD.LBL_PDF_TEXT}</h4>'
|
||||
)
|
||||
),
|
||||
array (
|
||||
array (
|
||||
'allCols' => true,
|
||||
'hideLabel' => true,
|
||||
'name' => 'pdf_text'
|
||||
)
|
||||
)
|
||||
),
|
||||
'LBL_ITEMS_TAB' => array (
|
||||
array (
|
||||
array (
|
||||
'type' => 'tab'
|
||||
)
|
||||
),
|
||||
array (
|
||||
array (
|
||||
'allCols' => true,
|
||||
'hideLabel' => true,
|
||||
'customCode' => '
|
||||
<div id="searchProducts" class="edit view search basic">
|
||||
<br>
|
||||
{$MOD.LBL_SEARCH}:
|
||||
<input type="text" value="" id="searchProductsInput"/>
|
||||
{$MOD.LBL_CATEGORY}:
|
||||
<select id="productSearchCategory"></select>
|
||||
{$MOD.LBL_SEARCH_STOCK}:
|
||||
<select id="productSearchStock">
|
||||
<option value="1">{$MOD.LBL_SEARCH_STOCK_OPT_NO}</option>
|
||||
<option value="2">{$MOD.LBL_SEARCH_STOCK_OPT_YES}</option>
|
||||
<option value="3">{$MOD.LBL_SEARCH_STOCK_OPT_NOT_NULL}</option>
|
||||
</select>
|
||||
{$MOD.LBL_SEARCH_SORT}:
|
||||
<select id="productSearchSort">
|
||||
<option value="1">{$MOD.LBL_SEARCH_SORT_CODE}</option>
|
||||
<option value="2">{$MOD.LBL_SEARCH_SORT_CODE_DESC}</option>
|
||||
<option value="3">{$MOD.LBL_SEARCH_SORT_NAME}</option>
|
||||
<option value="4">{$MOD.LBL_SEARCH_SORT_NAME_DESC}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div id="searchResultDiv"/></div>
|
||||
<br><br><div id="itemsTable"></div>'
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
114
modules/EcmReturns/metadata/listviewdefs.php
Normal file
114
modules/EcmReturns/metadata/listviewdefs.php
Normal file
@@ -0,0 +1,114 @@
|
||||
<?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.
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
$listViewDefs["EcmReturns"] = array(
|
||||
|
||||
'STATUS' => array(
|
||||
'width' => '5',
|
||||
'label' => 'LBL_STATUS',
|
||||
'default' => true,
|
||||
'sortable' => true,
|
||||
),
|
||||
|
||||
'DOCUMENT_NO' => array(
|
||||
'width' => '12',
|
||||
'label' => 'LBL_DOCUMENT_NO',
|
||||
'sortable' => true,
|
||||
'link' => true,
|
||||
'default' => true,
|
||||
),
|
||||
|
||||
'NAME' => array(
|
||||
'width' => '12',
|
||||
'label' => 'LBL_NAME',
|
||||
'default' => true,
|
||||
'sortable' => true),
|
||||
|
||||
'PARENT_NAME' => array(
|
||||
'width' => '15',
|
||||
'label' => 'LBL_PARENT_NAME',
|
||||
'default' => true,
|
||||
),
|
||||
|
||||
'TOTAL' => array(
|
||||
'width' => '10',
|
||||
'label' => 'LBL_TOTAL',
|
||||
'default' => true,
|
||||
),
|
||||
|
||||
'MODIFIED_BY_NAME' => array(
|
||||
'width' => '10',
|
||||
'label' => 'LBL_MODIFIED_USER',
|
||||
'module' => 'Users',
|
||||
'id' => 'USERS_ID',
|
||||
'default' => false,
|
||||
'sortable' => false,
|
||||
'related_fields' => array('modified_user_id'),
|
||||
),
|
||||
|
||||
'REGISTER_DATE' => array(
|
||||
'width' => '15',
|
||||
'label' => 'LBL_REGISTER_DATE',
|
||||
'default' => true,
|
||||
'sortable' => true,
|
||||
),
|
||||
|
||||
'OPTIONS' => array (
|
||||
'width' => '2',
|
||||
'label' => 'PDF',
|
||||
'default' => true,
|
||||
'sortable' => false,
|
||||
'align' => 'center',
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
?>
|
||||
121
modules/EcmReturns/metadata/searchdefs.php
Normal file
121
modules/EcmReturns/metadata/searchdefs.php
Normal file
@@ -0,0 +1,121 @@
|
||||
<?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".
|
||||
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
|
||||
$searchdefs['EcmReturns'] = array (
|
||||
|
||||
'templateMeta' => array (
|
||||
|
||||
'maxColumns' => '2',
|
||||
|
||||
'widths' => array (
|
||||
|
||||
'label' => '10',
|
||||
|
||||
'field' => '30'
|
||||
|
||||
),
|
||||
|
||||
),
|
||||
|
||||
'layout' => array (
|
||||
|
||||
'basic_search' => array (
|
||||
'document_no',
|
||||
'name',
|
||||
|
||||
|
||||
'status',
|
||||
|
||||
array('name'=>'current_user_only', 'label'=>'LBL_CURRENT_USER_FILTER', 'type'=>'bool'),
|
||||
|
||||
),
|
||||
|
||||
'advanced_search' => array (
|
||||
'document_no',
|
||||
'name',
|
||||
|
||||
'status',
|
||||
|
||||
'parent_name',
|
||||
|
||||
'register_date',
|
||||
|
||||
),
|
||||
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
76
modules/EcmReturns/metadata/studio.php
Normal file
76
modules/EcmReturns/metadata/studio.php
Normal file
@@ -0,0 +1,76 @@
|
||||
<?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.
|
||||
********************************************************************************/
|
||||
|
||||
$GLOBALS['studioDefs']['EcmReturns'] = array(
|
||||
'LBL_DETAILVIEW'=>array(
|
||||
'template' => 'xtpl',
|
||||
'template_file' => 'modules/EcmReturns/DetailView.html',
|
||||
'php_file' => 'modules/EcmReturns/DetailView.php',
|
||||
'type' => 'DetailView',
|
||||
),
|
||||
'LBL_EDITVIEW'=>array(
|
||||
'template' => 'xtpl',
|
||||
'template_file' => 'modules/EcmReturns/EditView.html',
|
||||
'php_file' => 'modules/EcmReturns/EditView.php',
|
||||
'type' => 'EditView',
|
||||
),
|
||||
'LBL_LISTVIEW'=>array(
|
||||
'template' => 'listview',
|
||||
'meta_file' => 'modules/EcmReturns/listviewdefs.php',
|
||||
'type' => 'ListView',
|
||||
),
|
||||
'LBL_SEARCHFORM'=>array(
|
||||
'template' => 'xtpl',
|
||||
'template_file' => 'modules/EcmReturns/SearchForm.html',
|
||||
'php_file' => 'modules/EcmReturns/ListView.php',
|
||||
'type' => 'SearchForm',
|
||||
),
|
||||
|
||||
);
|
||||
121
modules/EcmReturns/metadata/subpaneldefs.php
Normal file
121
modules/EcmReturns/metadata/subpaneldefs.php
Normal file
@@ -0,0 +1,121 @@
|
||||
<?php
|
||||
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
|
||||
/**
|
||||
|
||||
* Layout definition for Accounts
|
||||
|
||||
*
|
||||
|
||||
* 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['EcmReturns']['subpanel_setup'] = array (
|
||||
|
||||
'notes' => array(
|
||||
'order' => 10,
|
||||
'module' => 'Notes',
|
||||
'sort_order' => 'asc',
|
||||
'sort_by' => 'date_entered',
|
||||
'subpanel_name' => 'default',
|
||||
'get_subpanel_data' => 'notes',
|
||||
'add_subpanel_data' => 'note_id',
|
||||
'title_key' => 'LBL_NOTES_SUBPANEL_TITLE',
|
||||
'top_buttons' => array(
|
||||
array('widget_class' => 'SubPanelTopCreateButton'),
|
||||
),
|
||||
),
|
||||
/*
|
||||
'emails' => array (
|
||||
|
||||
'order' => 15,
|
||||
|
||||
'module' => 'Emails',
|
||||
|
||||
'sort_order' => 'asc',
|
||||
|
||||
'sort_by' => 'date_modified',
|
||||
|
||||
'get_subpanel_data' => 'emails',
|
||||
|
||||
'add_subpanel_data' => 'emails_id',
|
||||
|
||||
'subpanel_name' => 'ForEcmReturns',
|
||||
|
||||
'title_key' => 'LBL_EMAILS_SUBPANEL_TITLE',
|
||||
|
||||
'top_buttons' => array(),
|
||||
|
||||
),
|
||||
*/
|
||||
);
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
124
modules/EcmReturns/metadata/subpanels/default.php
Normal file
124
modules/EcmReturns/metadata/subpanels/default.php
Normal file
@@ -0,0 +1,124 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/**
|
||||
* Subpanel Layout definition for Contacts
|
||||
*
|
||||
* 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' => 'EcmReturns'),
|
||||
),
|
||||
|
||||
'where' => '',
|
||||
|
||||
|
||||
|
||||
'list_fields' => array (
|
||||
|
||||
'status' => array (
|
||||
'name' => 'status',
|
||||
'vname' => 'LBL_STATUS',
|
||||
'module' => 'EcmReturns',
|
||||
'width' => '5%',
|
||||
),
|
||||
/*
|
||||
'number' => array (
|
||||
'name' => 'number',
|
||||
'vname' => 'LBL_NUMBER',
|
||||
'module' => 'EcmReturns',
|
||||
'usage' => 'query_only',
|
||||
),
|
||||
*/
|
||||
'document_no' => array (
|
||||
'name' => 'document_no',
|
||||
'vname' => 'LBL_DOCUMENT_NO',
|
||||
'module' => 'EcmReturns',
|
||||
'widget_class' => 'SubPanelDetailViewLink',
|
||||
'width' => '15%',
|
||||
),
|
||||
|
||||
'name' => array (
|
||||
'name' => 'name',
|
||||
'vname' => 'LBL_NAME',
|
||||
'module' => 'EcmReturns',
|
||||
'width' => '40%'
|
||||
),
|
||||
|
||||
'total' => array (
|
||||
'name' => 'total',
|
||||
'vname' => 'LBL_TOTAL',
|
||||
'module' => 'EcmReturns',
|
||||
'width' => '15%',
|
||||
),
|
||||
|
||||
'register_date' => array (
|
||||
'name' => 'register_date',
|
||||
'vname' => 'LBL_REGISTER_DATE',
|
||||
'module' => 'EcmReturns',
|
||||
'width' => '10%',
|
||||
),
|
||||
'price' => array (
|
||||
'name' => 'price',
|
||||
'vname' => 'Cena',
|
||||
'module' => 'EcmStockDocIns',
|
||||
'width' => '5%',
|
||||
),
|
||||
'options' => array (
|
||||
'name' => 'options',
|
||||
'label' => ' ',
|
||||
'default' => true,
|
||||
'width' => '2%',
|
||||
'sortable' => false,
|
||||
),
|
||||
/*
|
||||
'PDF_URL' => array(
|
||||
'width' => '2%',
|
||||
'label' => ' ',
|
||||
'link' => true,
|
||||
'default' => true,
|
||||
'sortable' => false,
|
||||
),
|
||||
|
||||
'edit_button'=>array(
|
||||
'widget_class' => 'SubPanelEditButton',
|
||||
'width' => '2%',
|
||||
),
|
||||
*/
|
||||
|
||||
),
|
||||
);
|
||||
?>
|
||||
51
modules/EcmReturns/searchProductsToCorrect.php
Normal file
51
modules/EcmReturns/searchProductsToCorrect.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
if (! defined ( 'sugarEntry' ) || ! sugarEntry)
|
||||
die ( 'Not A Valid Entry Point' );
|
||||
|
||||
global $sugar_version, $sugar_config, $current_user, $app_strings, $mod_strings;
|
||||
|
||||
require_once ('modules/EcmReturns/EcmReturn.php');
|
||||
require_once ('include/time.php');
|
||||
require_once ('include/json_config.php');
|
||||
|
||||
// add jquery
|
||||
echo '<link rel="stylesheet" type="text/css" href="include/jQuery/jquery-table/jquery.appendGrid-1.3.1.css"/>';
|
||||
echo '<link rel="stylesheet" type="text/css" href="include/jQuery/jquery-ui/themes/base/jquery-ui.css"/>';
|
||||
echo '<script type="text/javascript"
|
||||
src="include/jQuery/jquery-2.1.0.min.js"></script>';
|
||||
echo '<script type="text/javascript"
|
||||
src="include/jQuery/jquery-table/jquery.appendGrid-1.3.1.js"></script>';
|
||||
echo '<script type="text/javascript"
|
||||
src="include/jQuery/jquery-ui/ui/jquery-ui.js"></script>';
|
||||
|
||||
$json_config = new json_config ();
|
||||
|
||||
$focus = new EcmReturn ();
|
||||
|
||||
if (isset ( $_REQUEST ['record'] )) {
|
||||
$focus->retrieve ( $_REQUEST ['record'] );
|
||||
$focus->format_all_fields ();
|
||||
$positions = $focus->getPositionList(true);
|
||||
$pos = $focus->searchProductsToCorrectList($positions);
|
||||
$position_list=$pos['items'];
|
||||
$errors = $pos['errors'];
|
||||
$sess_id = create_guid();
|
||||
$json = getJSONobj();
|
||||
|
||||
session_start();
|
||||
|
||||
$_SESSION[$sess_id] = $json->encode($position_list);
|
||||
} else die('error');
|
||||
|
||||
$edit->ss = new Sugar_Smarty ();
|
||||
$edit->module = 'EcmReturns';
|
||||
|
||||
$edit->ss->assign ( "CREATED_BY_NAME", $focus->created_by_name );
|
||||
$edit->ss->assign ( "MODIFIED_BY_NAME", $focus->modified_by_name );
|
||||
$edit->ss->assign ( 'FOCUS', $focus);
|
||||
$edit->ss->assign ('SESS_ID',$sess_id);
|
||||
$edit->ss->assign ( 'POSITION_LIST', $position_list);
|
||||
$edit->ss->assign ( 'ERRORS', $errors);
|
||||
$edit->ss->assign ( 'MOD', $mod_strings);
|
||||
$edit->ss-> display('modules/EcmReturns/tpls/searchProductsToCorrect.tpl'); //4
|
||||
?>
|
||||
33
modules/EcmReturns/tpls/searchProductsToCorrect.tpl
Normal file
33
modules/EcmReturns/tpls/searchProductsToCorrect.tpl
Normal file
@@ -0,0 +1,33 @@
|
||||
|
||||
<h1>{$FOCUS->parent_name}</h1>
|
||||
{if $ERRORS|@count != 0}
|
||||
<b>{$MOD.LBL_ERRORS}</b><br>
|
||||
{/if}
|
||||
{foreach from=$ERRORS key="key" item="item" name="components"}
|
||||
{$item}<br>
|
||||
{/foreach}
|
||||
<table class="ListView" width="100%">
|
||||
<tr>
|
||||
<td class="listViewThS1"><b>{$MOD.LBL_EDITTABLE_CODE}</b></td>
|
||||
<td class="listViewThS1"><b>{$MOD.LBL_EDITTABLE_NAME}</b></td>
|
||||
<td class="listViewThS1"><b>{$MOD.LBL_EDITTABLE_QUANTITY}</b></td>
|
||||
<td class="listViewThS1"><b>{$MOD.LBL_EDITTABLE_PRICE}</b></td>
|
||||
<td class="listViewThS1"><b>{$MOD.LBL_INVOICE}</b></td>
|
||||
<td class="listViewThS1"><b>{$MOD.LBL_CORRECT}</b></td>
|
||||
</tr>
|
||||
{foreach from=$POSITION_LIST key="key" item="item" name="components"}
|
||||
<tr style="background-color:{cycle values="#e6e6e6;,#ffffff;"}">
|
||||
<td class="oddListRowS1">{$item.code}</td>
|
||||
<td class="oddListRowS1">{$item.name}</td>
|
||||
<td class="oddListRowS1">{$item.quantity} / {$item.old_qty}</td>
|
||||
<td class="oddListRowS1">{$item.price_netto}</td>
|
||||
<td class="oddListRowS1">{if $item.inv_id!=''}<a href="index.php?module=EcmInvoiceOuts&action=DetailView&record={$item.inv_id}">{$item.inv_document_no}</a>{else}-{/if}</td>
|
||||
<td class="oddListRowS1">{if $item.cor_id!=''}<a href="index.php?module=EcmInvoiceOuts&action=DetailView&record={$item.cor_id}">{$item.cor_document_no}</a>{else}-{/if}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</table><br><br>
|
||||
{if $ERRORS|@count == 0}
|
||||
<a href="index.php?module=EcmInvoiceOuts&action=EditView&sess_id={$SESS_ID}&parent_doc_id={$FOCUS->id}&parent_doc_type=EcmReturn"><input type="button" value="{$MOD.LBL_CREATE_COR}"></a>
|
||||
{else}
|
||||
<a href="index.php?module=EcmReturns&action=DetailView&record={$FOCUS->id}"><input type="button" value="{$FOCUS->document_no}"></a>
|
||||
{/if}
|
||||
566
modules/EcmReturns/vardefs.php
Normal file
566
modules/EcmReturns/vardefs.php
Normal file
@@ -0,0 +1,566 @@
|
||||
<?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.
|
||||
* ******************************************************************************
|
||||
*/
|
||||
$dictionary ['EcmReturn'] = array (
|
||||
'table' => "ecmreturns",
|
||||
'comment' => 'EcmReturns',
|
||||
'duplicate_merge' => true,
|
||||
'unified_search' => true,
|
||||
// FIELDS SECTION
|
||||
'fields' => array (
|
||||
// STANDARD FIELDS SECTION
|
||||
'id' => array (
|
||||
'name' => 'id',
|
||||
'vname' => 'LBL_ID',
|
||||
'type' => 'id',
|
||||
'required' => true,
|
||||
'reportable' => false,
|
||||
'comment' => 'Unique identifier'
|
||||
),
|
||||
'name' => array (
|
||||
'name' => 'name',
|
||||
'vname' => 'LBL_NAME',
|
||||
'type' => 'name',
|
||||
'required' => false,
|
||||
'dbType' => 'varchar',
|
||||
'len' => 255,
|
||||
'unified_search' => true,
|
||||
'comment' => 'The short description of the record contents',
|
||||
'massupdate' => true,
|
||||
'merge_filter' => 'selected'
|
||||
),
|
||||
'description' => array (
|
||||
'type' => 'text',
|
||||
'name' => 'description',
|
||||
'vname' => 'LBL_DESCRIPTION',
|
||||
'comment' => 'Description',
|
||||
'unified_search' => true
|
||||
// 'required' => true,
|
||||
),
|
||||
'date_entered' => array (
|
||||
'name' => 'date_entered',
|
||||
'vname' => 'LBL_DATE_ENTERED',
|
||||
'type' => 'datetime',
|
||||
'required' => true,
|
||||
'comment' => 'Date record created'
|
||||
),
|
||||
'date_modified' => array (
|
||||
'name' => 'date_modified',
|
||||
'vname' => 'LBL_DATE_MODIFIED',
|
||||
'type' => 'datetime',
|
||||
'required' => true,
|
||||
'comment' => 'Date record last modified'
|
||||
),
|
||||
'modified_user_id' => array (
|
||||
'name' => 'modified_user_id',
|
||||
'rname' => 'user_name',
|
||||
'id_name' => 'modified_user_id',
|
||||
'vname' => 'LBL_MODIFIED',
|
||||
'type' => 'assigned_user_name',
|
||||
'table' => 'modified_user_id_users',
|
||||
'isnull' => 'false',
|
||||
'dbType' => 'varchar',
|
||||
'len' => 36,
|
||||
'required' => true,
|
||||
'reportable' => true,
|
||||
'comment' => 'User who last modified record'
|
||||
),
|
||||
'assigned_user_id' => array (
|
||||
'name' => 'assigned_user_id',
|
||||
'rname' => 'user_name',
|
||||
'id_name' => 'assigned_user_id',
|
||||
'vname' => 'LBL_ASSIGNED_TO_ID',
|
||||
'group' => 'assigned_user_name',
|
||||
'type' => 'relate',
|
||||
'table' => 'users',
|
||||
'reportable' => true,
|
||||
'Importable' => false,
|
||||
'isnull' => 'false',
|
||||
'dbType' => 'id',
|
||||
'audited' => true,
|
||||
'comment' => 'User ID assigned to record',
|
||||
'duplicate_merge' => 'disabled',
|
||||
'massupdate' => false
|
||||
),
|
||||
'assigned_user_name' => array (
|
||||
'name' => 'assigned_user_name',
|
||||
'vname' => 'LBL_ASSIGNED_TO',
|
||||
'type' => 'relate',
|
||||
'reportable' => false,
|
||||
'source' => 'non-db',
|
||||
'table' => 'users',
|
||||
'id_name' => 'assigned_user_id',
|
||||
'module' => 'Users',
|
||||
'duplicate_merge' => 'disabled',
|
||||
'massupdate' => false
|
||||
),
|
||||
'created_by' => array (
|
||||
'name' => 'created_by',
|
||||
'rname' => 'user_name',
|
||||
'id_name' => 'created_by',
|
||||
'vname' => 'LBL_CREATED',
|
||||
'type' => 'assigned_user_name',
|
||||
'table' => 'created_by_users',
|
||||
'isnull' => 'false',
|
||||
'dbType' => 'varchar',
|
||||
'len' => 36,
|
||||
'comment' => 'User that created the record'
|
||||
),
|
||||
'created_by_link' => array (
|
||||
'name' => 'created_by_link',
|
||||
'type' => 'link',
|
||||
'relationship' => 'ecmreturns' . '_created_by',
|
||||
'vname' => 'LBL_CREATED_BY_USER',
|
||||
'link_type' => 'one',
|
||||
'module' => 'Users',
|
||||
'bean_name' => 'User',
|
||||
'source' => 'non-db'
|
||||
),
|
||||
'modified_user_link' => array (
|
||||
'name' => 'modified_user_link',
|
||||
'type' => 'link',
|
||||
'relationship' => 'ecmreturns' . '_modified_user',
|
||||
'vname' => 'LBL_MODIFIED_BY_USER',
|
||||
'link_type' => 'one',
|
||||
'module' => 'Users',
|
||||
'bean_name' => 'User',
|
||||
'source' => 'non-db'
|
||||
),
|
||||
'assigned_user_link' => array (
|
||||
'name' => 'assigned_user_link',
|
||||
'type' => 'link',
|
||||
'relationship' => 'ecmreturns' . '_assigned_user',
|
||||
'vname' => 'LBL_ASSIGNED_TO_USER',
|
||||
'link_type' => 'one',
|
||||
'module' => 'Users',
|
||||
'bean_name' => 'User',
|
||||
'source' => 'non-db',
|
||||
'duplicate_merge' => 'enabled',
|
||||
'rname' => 'user_name',
|
||||
'id_name' => 'assigned_user_id',
|
||||
'table' => 'users'
|
||||
),
|
||||
'deleted' => array (
|
||||
'name' => 'deleted',
|
||||
'vname' => 'LBL_DELETED_BY',
|
||||
'type' => 'bool',
|
||||
'required' => true,
|
||||
'reportable' => false,
|
||||
'comment' => 'Record deletion indicator'
|
||||
),
|
||||
// NEW FIELDS SECTION
|
||||
'number' => array (
|
||||
'name' => 'number',
|
||||
'vname' => 'LBL_NUMBER',
|
||||
'type' => 'varchar',
|
||||
'required_option' => true,
|
||||
'unified_search' => true,
|
||||
'required' => true,
|
||||
'len' => '20'
|
||||
),
|
||||
'document_no' => array (
|
||||
'name' => 'document_no',
|
||||
'vname' => 'LBL_DOCUMENT_NO',
|
||||
'type' => 'varchar',
|
||||
'required_option' => true,
|
||||
'unified_search' => true,
|
||||
'required' => true,
|
||||
'len' => '30'
|
||||
),
|
||||
|
||||
'parent_id' => array (
|
||||
'name' => 'parent_id',
|
||||
'rname' => 'name',
|
||||
'id_name' => 'parent_id',
|
||||
'vname' => 'LBL_PARENT_ID',
|
||||
'group' => 'parent_name',
|
||||
'type' => 'relate',
|
||||
'table' => 'accounts',
|
||||
'reportable' => true,
|
||||
'Importable' => false,
|
||||
'isnull' => 'false',
|
||||
'dbType' => 'id',
|
||||
'audited' => true,
|
||||
'duplicate_merge' => 'disabled',
|
||||
'massupdate' => false
|
||||
),
|
||||
'parent_name' => array (
|
||||
'name' => 'parent_name',
|
||||
'vname' => 'LBL_PARENT_NAME',
|
||||
'type' => 'relate',
|
||||
'reportable' => false,
|
||||
'required' => true,
|
||||
'source' => 'non-db',
|
||||
'table' => 'accounts',
|
||||
'id_name' => 'parent_id',
|
||||
'module' => 'Accounts',
|
||||
'duplicate_merge' => 'disabled',
|
||||
'massupdate' => false
|
||||
),
|
||||
'type' => array (
|
||||
'name' => 'type',
|
||||
'vname' => 'LBL_TYPE',
|
||||
'required' => false,
|
||||
'type' => 'enum',
|
||||
'options' => 'ecmreturn_type_dom',
|
||||
'massupdate' => false
|
||||
),
|
||||
|
||||
'register_date' => array (
|
||||
'name' => 'register_date',
|
||||
'vname' => 'LBL_REGISTER_DATE',
|
||||
'type' => 'date',
|
||||
'reportable' => false,
|
||||
'showFormats' => true,
|
||||
'massupdate' => false,
|
||||
'required' => true
|
||||
),
|
||||
'parent_name_copy' => array (
|
||||
'name' => 'parent_name_copy',
|
||||
'vname' => 'LBL_PARENT_NAME_COPY',
|
||||
'type' => 'varchar',
|
||||
'source' => 'non-db'
|
||||
),
|
||||
'parent_address_street' => array (
|
||||
'name' => 'parent_address_street',
|
||||
'vname' => 'LBL_PARENT_ADDRESS_STREET',
|
||||
'type' => 'varchar',
|
||||
'len' => '150',
|
||||
'comment' => 'The street address used for parent address',
|
||||
'group' => 'parent_address',
|
||||
'merge_filter' => 'enabled'
|
||||
),
|
||||
'parent_address_city' => array (
|
||||
'name' => 'parent_address_city',
|
||||
'vname' => 'LBL_PARENT_ADDRESS_CITY',
|
||||
'type' => 'varchar',
|
||||
'len' => '100',
|
||||
'comment' => 'The city used for parent address',
|
||||
'group' => 'parent_address',
|
||||
'merge_filter' => 'enabled'
|
||||
),
|
||||
'parent_address_postalcode' => array (
|
||||
'name' => 'parent_address_postalcode',
|
||||
'vname' => 'LBL_PARENT_ADDRESS_POSTALCODE',
|
||||
'type' => 'varchar',
|
||||
'len' => '20',
|
||||
'group' => 'parent_address',
|
||||
'comment' => 'The postal code used for parent address',
|
||||
'merge_filter' => 'enabled'
|
||||
),
|
||||
'parent_address_country' => array (
|
||||
'name' => 'parent_address_country',
|
||||
'vname' => 'LBL_PARENT_ADDRESS_COUNTRY',
|
||||
'type' => 'varchar',
|
||||
'group' => 'parent_address',
|
||||
'comment' => 'The country used for the parent address',
|
||||
'merge_filter' => 'enabled'
|
||||
),
|
||||
'parent_nip' => array (
|
||||
'name' => 'parent_nip',
|
||||
'vname' => 'LBL_PARENT_NIP',
|
||||
'type' => 'varchar',
|
||||
'len' => 15
|
||||
),
|
||||
'parent_nip_unformated' => array (
|
||||
'name' => 'parent_nip_unformated',
|
||||
'vname' => 'LBL_PARENT_NIP',
|
||||
'type' => 'varchar',
|
||||
'len' => 15
|
||||
),
|
||||
|
||||
'pdf_text' => array (
|
||||
'name' => 'pdf_text',
|
||||
'vname' => 'LBL_PDF_TEXT',
|
||||
'type' => 'text'
|
||||
),
|
||||
// correct_id = id from ecinvoceouts
|
||||
'correct_id' => array (
|
||||
'name' => 'correct_id',
|
||||
'type' => 'varchar',
|
||||
'len' => '36',
|
||||
'vname' => '',
|
||||
'source' => 'non_db'
|
||||
),
|
||||
'correct_name' => array (
|
||||
'name' => 'correct_name',
|
||||
'type' => 'relate',
|
||||
'id_name' => 'correct_id',
|
||||
'module' => 'EcmInvoiceOuts',
|
||||
'len' => '30',
|
||||
'vname' => 'LBL_CORRECT_NAME',
|
||||
'source' => 'non-db',
|
||||
'rname' => 'name'
|
||||
),
|
||||
// end correct
|
||||
'currency_id' => array (
|
||||
'name' => 'currency_id',
|
||||
'type' => 'enum',
|
||||
'options' => 'currency_dom',
|
||||
'label' => 'LBL_CURRENCY'
|
||||
),
|
||||
'ecmpaymentcondition_id' => array (
|
||||
'name' => 'ecmpaymentcondition_id',
|
||||
'rname' => 'name',
|
||||
'id_name' => 'ecmpaymentcondition_id',
|
||||
'vname' => 'LBL_PAYMENTCONDITION_ID',
|
||||
'group' => 'ecmpaymentcondition_name',
|
||||
'type' => 'relate',
|
||||
'table' => 'ecmpaymentconditions',
|
||||
'reportable' => true,
|
||||
'Importable' => false,
|
||||
'isnull' => 'false',
|
||||
'dbType' => 'id',
|
||||
'audited' => true,
|
||||
'duplicate_merge' => 'disabled',
|
||||
'massupdate' => false
|
||||
),
|
||||
'ecmpaymentcondition_name' => array (
|
||||
'name' => 'ecmpaymentcondition_name',
|
||||
'vname' => 'LBL_PAYMENTCONDITION_NAME',
|
||||
'type' => 'relate',
|
||||
'reportable' => false,
|
||||
'source' => 'non-db',
|
||||
'table' => 'ecmpaymentcondition',
|
||||
'id_name' => 'ecmpaymentcondition_id',
|
||||
'module' => 'EcmPaymentConditions',
|
||||
'duplicate_merge' => 'disabled',
|
||||
'massupdate' => false,
|
||||
'required' => false
|
||||
),
|
||||
'ecmpaymentcondition_text' => array (
|
||||
'name' => 'ecmpaymentcondition_text',
|
||||
'vname' => 'LBL_PAYMENTCONDITION_TEXT',
|
||||
'type' => 'text',
|
||||
'reportable' => false,
|
||||
'module' => 'EcmPaymentConditions',
|
||||
'duplicate_merge' => 'disabled',
|
||||
'massupdate' => false
|
||||
),
|
||||
'to_informations' => array (
|
||||
'name' => 'to_informations',
|
||||
'vname' => 'LBL_TO_INFORMATIONS',
|
||||
'type' => 'text',
|
||||
'source' => 'non-db'
|
||||
),
|
||||
'items_list_panel' => array (
|
||||
'name' => 'items_list_panel',
|
||||
'vname' => 'LBL_ITEMS',
|
||||
'type' => 'text',
|
||||
'source' => 'non-db'
|
||||
),
|
||||
'preview_panel' => array (
|
||||
'name' => 'preview_panel',
|
||||
'vname' => 'LBL_PREVIEW',
|
||||
'type' => 'text',
|
||||
'source' => 'non-db'
|
||||
),
|
||||
// FOR SUBPANELS
|
||||
'account' => array (
|
||||
'name' => 'account',
|
||||
'type' => 'link',
|
||||
'relationship' => 'ecmreturns_account',
|
||||
'source' => 'non-db',
|
||||
'vname' => 'LBL_ACCOUNTS'
|
||||
),
|
||||
'contact' => array (
|
||||
'name' => 'contact',
|
||||
'type' => 'link',
|
||||
'relationship' => 'ecmreturns_contact',
|
||||
'source' => 'non-db',
|
||||
'vname' => 'LBL_CONTACTS'
|
||||
),
|
||||
'bugs' => array (
|
||||
'name' => 'bugs',
|
||||
'type' => 'link',
|
||||
'relationship' => 'ecmreturns_bug',
|
||||
'source' => 'non-db',
|
||||
'vname' => 'LBL_BUGS'
|
||||
),
|
||||
'notes' => array (
|
||||
'name' => 'notes',
|
||||
'type' => 'link',
|
||||
'relationship' => 'ecmreturns_notes',
|
||||
'source' => 'non-db',
|
||||
'vname' => 'LBL_NOTES'
|
||||
),
|
||||
'emails' => array (
|
||||
'name' => 'emails',
|
||||
'type' => 'link',
|
||||
'relationship' => 'ecmreturns_emails',
|
||||
'source' => 'non-db',
|
||||
'vname' => 'LBL_EMAILS'
|
||||
),
|
||||
'tasks' => array (
|
||||
'name' => 'tasks',
|
||||
'type' => 'link',
|
||||
'relationship' => 'ecmreturns_task',
|
||||
'source' => 'non-db',
|
||||
'vname' => 'LBL_TASKS'
|
||||
)
|
||||
),
|
||||
// INDICES SECTION
|
||||
'indices' => array (
|
||||
array (
|
||||
'name' => 'ecmreturns' . 'pk',
|
||||
'type' => 'primary',
|
||||
'fields' => array (
|
||||
'id'
|
||||
)
|
||||
),
|
||||
array (
|
||||
'name' => 'idx_' . 'ecmreturns' . '_document_no',
|
||||
'type' => 'index',
|
||||
'fields' => array (
|
||||
'document_no'
|
||||
)
|
||||
)
|
||||
),
|
||||
// RELATIONSHIPS SECTION
|
||||
'relationships' => array (
|
||||
'ecmreturns' . '_assigned_user' => array (
|
||||
'lhs_module' => 'Users',
|
||||
'lhs_table' => 'users',
|
||||
'lhs_key' => 'id',
|
||||
'rhs_module' => 'EcmReturns',
|
||||
'rhs_table' => 'ecmreturns',
|
||||
'rhs_key' => 'assigned_user_id',
|
||||
'relationship_type' => 'one-to-many'
|
||||
),
|
||||
'ecmreturns' . '_modified_user' => array (
|
||||
'lhs_module' => 'Users',
|
||||
'lhs_table' => 'users',
|
||||
'lhs_key' => 'id',
|
||||
'rhs_module' => 'EcmReturns',
|
||||
'rhs_table' => 'ecmreturns',
|
||||
'rhs_key' => 'modified_user_id',
|
||||
'relationship_type' => 'one-to-many'
|
||||
),
|
||||
'ecmreturns' . '_created_by' => array (
|
||||
'lhs_module' => 'Users',
|
||||
'lhs_table' => 'users',
|
||||
'lhs_key' => 'id',
|
||||
'rhs_module' => 'EcmReturns',
|
||||
'rhs_table' => 'ecmreturns',
|
||||
'rhs_key' => 'created_by',
|
||||
'relationship_type' => 'one-to-many'
|
||||
),
|
||||
'ecmreturns' . '_account' => array (
|
||||
'lhs_module' => 'Accounts',
|
||||
'lhs_table' => 'accounts',
|
||||
'lhs_key' => 'id',
|
||||
'rhs_module' => 'EcmReturns',
|
||||
'rhs_table' => 'ecmreturns',
|
||||
'rhs_key' => 'parent_id',
|
||||
'relationship_type' => 'one-to-many'
|
||||
),
|
||||
'ecmreturns' . '_contact' => array (
|
||||
'lhs_module' => 'Contacts',
|
||||
'lhs_table' => 'contacts',
|
||||
'lhs_key' => 'id',
|
||||
'rhs_module' => 'EcmReturns',
|
||||
'rhs_table' => 'ecmreturns',
|
||||
'rhs_key' => 'contact_id',
|
||||
'relationship_type' => 'one-to-many'
|
||||
),
|
||||
'ecmreturns' . '_project' => array (
|
||||
'lhs_module' => 'Project',
|
||||
'lhs_table' => 'project',
|
||||
'lhs_key' => 'id',
|
||||
'rhs_module' => 'EcmReturns',
|
||||
'rhs_table' => 'ecmreturns',
|
||||
'rhs_key' => 'parent_id',
|
||||
'relationship_type' => 'one-to-many'
|
||||
),
|
||||
'ecmreturns' . '_bug' => array (
|
||||
'lhs_module' => 'Bugs',
|
||||
'lhs_table' => 'bugs',
|
||||
'lhs_key' => 'id',
|
||||
'rhs_module' => 'EcmReturns',
|
||||
'rhs_table' => 'ecmreturns',
|
||||
'rhs_key' => 'parent_id',
|
||||
'relationship_type' => 'one-to-many'
|
||||
),
|
||||
'ecmreturns_notes' => array (
|
||||
'lhs_module' => 'EcmReturns',
|
||||
'lhs_table' => 'ecmreturns',
|
||||
'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' => 'EcmReturns'
|
||||
),
|
||||
'ecmreturns' . '_case' => array (
|
||||
'lhs_module' => 'Cases',
|
||||
'lhs_table' => 'cases',
|
||||
'lhs_key' => 'id',
|
||||
'rhs_module' => 'EcmReturns',
|
||||
'rhs_table' => 'ecmreturns',
|
||||
'rhs_key' => 'parent_id',
|
||||
'relationship_type' => 'one-to-many'
|
||||
),
|
||||
'ecmreturns' . '_task' => array (
|
||||
'lhs_module' => 'Tasks',
|
||||
'lhs_table' => 'tasks',
|
||||
'lhs_key' => 'id',
|
||||
'rhs_module' => 'EcmReturns',
|
||||
'rhs_table' => 'ecmreturns',
|
||||
'rhs_key' => 'parent_id',
|
||||
'relationship_type' => 'one-to-many'
|
||||
)
|
||||
),
|
||||
// THIS FLAG ENABLES OPTIMISTIC LOCKING FOR SAVES FROM EDITVIEW
|
||||
'optimistic_locking' => true
|
||||
);
|
||||
355
modules/EcmReturns/views/DetailView/DetailView.tpl
Normal file
355
modules/EcmReturns/views/DetailView/DetailView.tpl
Normal file
@@ -0,0 +1,355 @@
|
||||
{*
|
||||
|
||||
/*********************************************************************************
|
||||
|
||||
* 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".
|
||||
|
||||
********************************************************************************/
|
||||
|
||||
*}
|
||||
|
||||
{{include file="modules/EcmOfferes/views/DetailView/header.tpl"}}
|
||||
|
||||
{sugar_include include=$includes}
|
||||
|
||||
|
||||
|
||||
{{* Render tag for VCR control if SHOW_VCR_CONTROL is true *}}
|
||||
|
||||
{{if $SHOW_VCR_CONTROL}}
|
||||
|
||||
<table width='100%' border='0' style="border-bottom:0px;" cellspacing='{$gridline}' cellpadding='0' class='tabDetailView'>
|
||||
|
||||
{$PAGINATION}
|
||||
|
||||
</table>
|
||||
|
||||
{{/if}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{literal}
|
||||
|
||||
<script language="javascript">
|
||||
|
||||
var SelectedTab = "";
|
||||
|
||||
function SetTab(tab_name) {
|
||||
|
||||
var TabMenu = document.getElementById('groupTabsPanels');
|
||||
|
||||
var tabs = TabMenu.getElementsByTagName('li');
|
||||
|
||||
for(i=0;i<tabs.length;i++) {
|
||||
|
||||
if((tab_name+'_menu') === tabs[i].id) {
|
||||
|
||||
tabs[i].className = 'active';
|
||||
|
||||
tabs[i].getElementsByTagName('a')[0].className = 'current';
|
||||
|
||||
} else {
|
||||
|
||||
tabs[i].className = '';
|
||||
|
||||
tabs[i].getElementsByTagName('a')[0].className = '';
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var prev = document.getElementById(SelectedTab);
|
||||
|
||||
var curr = document.getElementById(tab_name);
|
||||
|
||||
prev.style.display = 'none';
|
||||
|
||||
curr.style.display = '';
|
||||
|
||||
SelectedTab = tab_name;
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
{/literal}
|
||||
|
||||
|
||||
|
||||
<ul class="subpanelTablist" style="margin-top:10px;" id="groupTabsPanels">
|
||||
|
||||
{{foreach name=section from=$sectionPanels key=label item=panel}}
|
||||
{{if $panel[0][0].field.type == 'tab'}}
|
||||
{{if $label=='EMAIL'}}
|
||||
{{else}}
|
||||
<li class="{{if $panel[0][0].field.active}}active{{/if}}" id="panel_{{$label}}_menu">
|
||||
|
||||
<script language="javascript">
|
||||
var set{{$label}} = function() {literal} { {/literal} SetTab('panel_{{$label}}'); {literal} }; {/literal}
|
||||
{{if $panel[0][0].field.active}}SelectedTab="panel_{{$label}}";{{/if}}
|
||||
</script>
|
||||
|
||||
<a class="{{if $panel[0][0].field.active}}current{{else}}other{{/if}}" href="javascript:set{{$label}}();">{sugar_translate label='LBL_{{$label}}_TAB' module='{{$module}}'}</a>
|
||||
|
||||
</li>
|
||||
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{/foreach}}
|
||||
<li class="" id="panel_EMAIL_menu">
|
||||
<a class="" href="javascript:{$EMAIL_LINK}">{sugar_translate label='LBL_EMAIL_TAB' module='EcmOfferes'}</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
{{* Loop through all top level panels first *}}
|
||||
|
||||
{{counter name="panelCount" print=false start=0 assign="panelCount"}}
|
||||
|
||||
{{foreach name=section from=$sectionPanels key=label item=panel}}
|
||||
|
||||
{{assign var='panel_id' value=$panelCount}}
|
||||
|
||||
<div {{if $panel[0][0].field.active == false}}style="display:none"{{/if}} id='panel_{{$label}}'>
|
||||
|
||||
{counter name="panelFieldCount" start=0 print=false assign="panelFieldCount"}
|
||||
|
||||
{{* Print out the panel title if one exists*}}
|
||||
|
||||
|
||||
|
||||
{{* Check to see if the panel variable is an array, if not, we'll attempt an include with type param php *}}
|
||||
|
||||
{{* See function.sugar_include.php *}}
|
||||
|
||||
{{if !is_array($panel)}}
|
||||
|
||||
{sugar_include type='php' file='{{$panel}}'}
|
||||
|
||||
{{else}}
|
||||
|
||||
|
||||
|
||||
<!--
|
||||
|
||||
{{if !empty($label) && !is_int($label) && $label != 'DEFAULT'}}
|
||||
|
||||
<h4 class="dataLabel">{sugar_translate label='{{$label}}' module='{{$module}}'}</h4><br>
|
||||
|
||||
{{/if}}
|
||||
|
||||
-->
|
||||
|
||||
|
||||
|
||||
{{* Print out the table data *}}
|
||||
|
||||
<table width='100%' border='0' style="border-top:0px" cellspacing='{$gridline}' cellpadding='0' class='tabDetailView'>
|
||||
|
||||
{{if $panelCount == 0}}
|
||||
|
||||
{{counter name="panelCount" print=false}}
|
||||
|
||||
{{/if}}
|
||||
|
||||
{{foreach name=rowIteration from=$panel key=row item=rowData}}
|
||||
|
||||
<tr>
|
||||
|
||||
{{assign var='columnsInRow' value=$rowData|@count}}
|
||||
|
||||
{{assign var='columnsUsed' value=0}}
|
||||
|
||||
{{foreach name=colIteration from=$rowData key=col item=colData}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{{if $colData.field.allCols == false}}
|
||||
|
||||
<td width='{{$def.templateMeta.widths[$smarty.foreach.colIteration.index].label}}%' class='tabDetailViewDL' NOWRAP>
|
||||
|
||||
{{if isset($colData.field.customLabel)}}
|
||||
|
||||
{{$colData.field.customLabel}}
|
||||
|
||||
{{elseif isset($colData.field.label) && strpos($colData.field.label, '$')}}
|
||||
|
||||
{capture name="label" assign="label"}
|
||||
|
||||
{{$colData.field.label}}
|
||||
|
||||
{/capture}
|
||||
|
||||
{$label|strip_semicolon}:
|
||||
|
||||
{{elseif isset($colData.field.label)}}
|
||||
|
||||
{capture name="label" assign="label"}
|
||||
|
||||
{sugar_translate label='{{$colData.field.label}}' module='{{$module}}'}
|
||||
|
||||
{/capture}
|
||||
|
||||
{$label|strip_semicolon}:
|
||||
|
||||
{{elseif isset($fields[$colData.field.name])}}
|
||||
|
||||
{capture name="label" assign="label"}
|
||||
|
||||
{sugar_translate label='{{$fields[$colData.field.name].vname}}' module='{{$module}}'}
|
||||
|
||||
{/capture}
|
||||
|
||||
{$label|strip_semicolon}:
|
||||
|
||||
{{else}}
|
||||
|
||||
|
||||
|
||||
{{/if}}
|
||||
|
||||
</td>
|
||||
|
||||
{{/if}}
|
||||
|
||||
<td width='{{if $colData.field.allCols == true}}100{{else}}{{$def.templateMeta.widths[$smarty.foreach.colIteration.index].field}}{{/if}}%' class='tabDetailViewDF' {{if $colData.field.allCols == true}}colspan='4'{{else}}{{if $colData.colspan}}colspan='{{$colData.colspan}}'{{/if}}{{/if}}>
|
||||
|
||||
{{if $colData.field.customCode || $colData.field.assign}}
|
||||
|
||||
{counter name="panelFieldCount"}
|
||||
|
||||
{{sugar_evalcolumn var=$colData.field colData=$colData}}
|
||||
|
||||
{{elseif $fields[$colData.field.name] && !empty($colData.field.fields) }}
|
||||
|
||||
{{foreach from=$colData.field.fields item=subField}}
|
||||
|
||||
{{if $fields[$subField]}}
|
||||
|
||||
{counter name="panelFieldCount"}
|
||||
|
||||
{{sugar_field parentFieldArray='fields' tabindex=$tabIndex vardef=$fields[$subField] displayType='detailView'}}
|
||||
|
||||
{{else}}
|
||||
|
||||
{counter name="panelFieldCount"}
|
||||
|
||||
{{$subField}}
|
||||
|
||||
{{/if}}
|
||||
|
||||
{{/foreach}}
|
||||
|
||||
{{elseif $fields[$colData.field.name]}}
|
||||
|
||||
{counter name="panelFieldCount"}
|
||||
|
||||
{{sugar_field parentFieldArray='fields' vardef=$fields[$colData.field.name] displayType='detailView' displayParams=$colData.field.displayParams typeOverride=$colData.field.type}}
|
||||
|
||||
{{/if}}
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
{{/foreach}}
|
||||
|
||||
</tr>
|
||||
|
||||
{{/foreach}}
|
||||
|
||||
|
||||
|
||||
</table>
|
||||
|
||||
{{/if}}
|
||||
|
||||
</div>
|
||||
|
||||
{if $panelFieldCount == 0}
|
||||
|
||||
|
||||
|
||||
<script>document.getElementById("panel_{{$panel_id}}").style.display='none';</script>
|
||||
|
||||
{/if}
|
||||
|
||||
{{/foreach}}
|
||||
|
||||
{{include file="modules/EcmOfferes/views/DetailView/footer.tpl"}}
|
||||
|
||||
37
modules/EcmReturns/views/DetailView/footer.tpl
Normal file
37
modules/EcmReturns/views/DetailView/footer.tpl
Normal file
@@ -0,0 +1,37 @@
|
||||
{*
|
||||
/*********************************************************************************
|
||||
* 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".
|
||||
********************************************************************************/
|
||||
*}
|
||||
</form>
|
||||
105
modules/EcmReturns/views/DetailView/header.tpl
Normal file
105
modules/EcmReturns/views/DetailView/header.tpl
Normal file
@@ -0,0 +1,105 @@
|
||||
{*
|
||||
/*********************************************************************************
|
||||
* 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".
|
||||
********************************************************************************/
|
||||
*}
|
||||
{{* Add the preForm code if it is defined (used for vcards) *}}
|
||||
{{if $preForm}}
|
||||
{{$preForm}}
|
||||
{{/if}}
|
||||
<table cellpadding="1" cellspacing="0" border="0" width="100%">
|
||||
<tr>
|
||||
<td style="padding-bottom: 2px;" align="left" NOWRAP>
|
||||
<form action="index.php" method="post" name="DetailView" id="form">
|
||||
<input type="hidden" name="module" value="{$module}">
|
||||
<input type="hidden" name="record" value="{$fields.id.value}">
|
||||
<input type="hidden" name="return_action">
|
||||
<input type="hidden" name="return_module">
|
||||
<input type="hidden" name="return_id">
|
||||
<input type="hidden" name="isDuplicate" value="false">
|
||||
<input type="hidden" name="offset" value="{$offset}">
|
||||
<input type="hidden" name="action" value="EditView">
|
||||
{{if isset($form.hidden)}}
|
||||
{{foreach from=$form.hidden item=field}}
|
||||
{{$field}}
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
|
||||
{{if !isset($form.buttons)}}
|
||||
<input title="{$APP.LBL_EDIT_BUTTON_TITLE}" accessKey="{$APP.LBL_EDIT_BUTTON_KEY}" class="button" onclick="this.form.return_module.value='{$module}'; 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} ">
|
||||
<input title="{$APP.LBL_DUPLICATE_BUTTON_TITLE}" accessKey="{$APP.LBL_DUPLICATE_BUTTON_KEY}" class="button" onclick="this.form.return_module.value='{$module}'; this.form.return_action.value='index'; this.form.isDuplicate.value=true; this.form.action.value='EditView'" type="submit" name="Duplicate" value=" {$APP.LBL_DUPLICATE_BUTTON_LABEL} " id='duplicate_button'>
|
||||
<input title="{$APP.LBL_DELETE_BUTTON_TITLE}" accessKey="{$APP.LBL_DELETE_BUTTON_KEY}" class="button" onclick="this.form.return_module.value='{$module}'; this.form.return_action.value='ListView'; this.form.action.value='Delete'; return confirm('{$APP.NTC_DELETE_CONFIRMATION}')" type="submit" name="Delete" value=" {$APP.LBL_DELETE_BUTTON_LABEL} " >
|
||||
{{else}}
|
||||
{{counter assign="num_buttons" start=0 print=false}}
|
||||
{{foreach from=$form.buttons key=val item=button}}
|
||||
{{if !is_array($button) && in_array($button, $built_in_buttons)}}
|
||||
{{counter print=false}}
|
||||
{{sugar_button module="$module" id="$button" view="EditView"}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
{{if isset($closeFormBeforeCustomButtons)}}
|
||||
</form>
|
||||
</td>
|
||||
{{/if}}
|
||||
{{if count($form.buttons) > $num_buttons}}
|
||||
{{foreach from=$form.buttons key=val item=button}}
|
||||
{{if is_array($button) && $button.customCode}}
|
||||
<td style="padding-bottom: 2px;" align="left" NOWRAP>
|
||||
{{sugar_button module="$module" id="$button" view="EditView"}}
|
||||
</td>
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{if !isset($closeFormBeforeCustomButtons)}}
|
||||
</form>
|
||||
</td>
|
||||
{{/if}}
|
||||
{{if empty($form.hideAudit) || !$form.hideAudit}}
|
||||
<td style="padding-bottom: 2px;" align="left" NOWRAP>
|
||||
{{sugar_button module="$module" id="Audit" view="EditView"}}
|
||||
</td>
|
||||
{{/if}}
|
||||
<td align="right" width="100%">{$ADMIN_EDIT}</td>
|
||||
{{* Add $form.links if they are defined *}}
|
||||
{{if !empty($form) && isset($form.links)}}
|
||||
<td align="right" width="10%"> </td>
|
||||
<td align="right" width="100%" NOWRAP>
|
||||
{{foreach from=$form.links item=link}}
|
||||
{{$link}}
|
||||
{{/foreach}}
|
||||
</td>
|
||||
{{/if}}
|
||||
</tr>
|
||||
</table>
|
||||
95
modules/EcmReturns/views/DetailView/view.detail.my.php
Normal file
95
modules/EcmReturns/views/DetailView/view.detail.my.php
Normal 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();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
424
modules/EcmReturns/views/EditView/EditView.tpl
Normal file
424
modules/EcmReturns/views/EditView/EditView.tpl
Normal file
@@ -0,0 +1,424 @@
|
||||
{*
|
||||
|
||||
/*********************************************************************************
|
||||
|
||||
* 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".
|
||||
|
||||
********************************************************************************/
|
||||
|
||||
*}
|
||||
|
||||
|
||||
|
||||
{literal}
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
.dataLabel { padding: 2px; }
|
||||
|
||||
.dataField { padding: 2px; }
|
||||
|
||||
.tabEditViewDF { padding: 2px; }
|
||||
|
||||
td .dataLabel { padding: 2px; }
|
||||
|
||||
td .dataField { padding: 2px; }
|
||||
|
||||
td .tabEditViewDF { padding: 2px; }
|
||||
|
||||
.tabForm { border-top:none; }
|
||||
|
||||
</style>
|
||||
|
||||
{/literal}
|
||||
|
||||
|
||||
|
||||
{{include file='modules/EcmOfferes/views/EditView/header.tpl'}}
|
||||
|
||||
{sugar_include include=$includes}
|
||||
|
||||
|
||||
|
||||
<table width="100%" cellspacing="0" cellpadding="0" class='tabDetailView' id='tabFormPagination'>
|
||||
|
||||
{{if $panelCount == 0}}
|
||||
|
||||
{{* Render tag for VCR control if SHOW_VCR_CONTROL is true *}}
|
||||
|
||||
{{if $SHOW_VCR_CONTROL}}
|
||||
|
||||
{$PAGINATION}
|
||||
|
||||
{{/if}}
|
||||
|
||||
{{/if}}
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
{literal}
|
||||
|
||||
<script language="javascript">
|
||||
|
||||
var SelectedTab = "";
|
||||
var TabsMainBlock = false;
|
||||
|
||||
function SetTab(tab_name) {
|
||||
|
||||
if(TabsMainBlock) return;
|
||||
|
||||
var TabMenu = document.getElementById('groupTabs');
|
||||
|
||||
var tabs = TabMenu.getElementsByTagName('li');
|
||||
|
||||
for(i=0;i<tabs.length;i++) {
|
||||
|
||||
if((tab_name+'_menu') === tabs[i].id) {
|
||||
|
||||
tabs[i].className = 'active';
|
||||
|
||||
tabs[i].getElementsByTagName('a')[0].className = 'current';
|
||||
|
||||
} else {
|
||||
|
||||
tabs[i].className = '';
|
||||
|
||||
tabs[i].getElementsByTagName('a')[0].className = '';
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var prev = document.getElementById(SelectedTab);
|
||||
|
||||
var curr = document.getElementById(tab_name);
|
||||
|
||||
prev.style.display = 'none';
|
||||
|
||||
curr.style.display = '';
|
||||
|
||||
SelectedTab = tab_name;
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
{/literal}
|
||||
|
||||
|
||||
|
||||
<ul class="tabList" style="margin-top:10px;" id="groupTabs">
|
||||
|
||||
{{foreach name=section from=$sectionPanels key=label item=panel}}
|
||||
|
||||
{{if $panel[0][0].field.type == 'tab'}}
|
||||
|
||||
<li class="{{if $panel[0][0].field.active}}active{{/if}}" id="{{$label}}_menu">
|
||||
|
||||
<script language="javascript">
|
||||
|
||||
var set{{$label}} = function() {literal} { {/literal} SetTab('{{$label}}'); {literal} }; {/literal}
|
||||
|
||||
{{if $panel[0][0].field.active}}SelectedTab="{{$label}}";{{/if}}
|
||||
|
||||
</script>
|
||||
|
||||
<a class="{{if $panel[0][0].field.active}}current{{/if}}" href="javascript:set{{$label}}();">{sugar_translate label='LBL_{{$label}}_TAB' module='{{$module}}'}</a>
|
||||
|
||||
</li>
|
||||
|
||||
{{/if}}
|
||||
|
||||
{{/foreach}}
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
{{* Loop through all top level panels first *}}
|
||||
|
||||
{{counter name="panelCount" start=-1 print=false assign="panelCount"}}
|
||||
|
||||
|
||||
|
||||
{{foreach name=section from=$sectionPanels key=label item=panel}}
|
||||
|
||||
{{counter name="panelCount" print=false}}
|
||||
|
||||
|
||||
|
||||
{{* Print out the table data *}}
|
||||
|
||||
<div id="{{$label}}" style="display:{{if !$panel[0][0].field.active}}none{{/if}};">
|
||||
|
||||
{counter name="panelFieldCount" start=0 print=false assign="panelFieldCount"}
|
||||
|
||||
{{* Check to see if the panel variable is an array, if not, we'll attempt an include with type param php *}}
|
||||
|
||||
{{* See function.sugar_include.php *}}
|
||||
|
||||
{{if !is_array($panel)}}
|
||||
|
||||
{sugar_include type='php' file='{{$panel}}'}
|
||||
|
||||
{{else}}
|
||||
|
||||
|
||||
|
||||
<table width="100%" border="0" cellspacing="1" cellpadding="0" class="{$def.templateMeta.panelClass|default:tabForm}">
|
||||
|
||||
{{* Only show header if it is not default or an int value *}}
|
||||
|
||||
{{if !empty($label) && !is_int($label) && $label != 'DEFAULT'}}
|
||||
|
||||
<th class="dataLabel" align="left" colspan="8">
|
||||
|
||||
<h4>{sugar_translate label='LBL_{{$label}}' module='{{$module}}'}</h4>
|
||||
|
||||
</th>
|
||||
|
||||
{{/if}}
|
||||
|
||||
|
||||
|
||||
{{assign var='rowCount' value=0}}
|
||||
|
||||
{{foreach name=rowIteration from=$panel key=row item=rowData}}
|
||||
|
||||
<tr>
|
||||
|
||||
|
||||
|
||||
{{assign var='columnsInRow' value=$rowData|@count}}
|
||||
|
||||
{{assign var='columnsUsed' value=0}}
|
||||
|
||||
|
||||
|
||||
{{* Loop through each column and display *}}
|
||||
|
||||
{{counter name="colCount" start=0 print=false assign="colCount"}}
|
||||
|
||||
|
||||
|
||||
{{foreach name=colIteration from=$rowData key=col item=colData}}
|
||||
|
||||
{{counter name="colCount" print=false}}
|
||||
|
||||
{{math assign="tabIndex" equation="$panelCount * $maxColumns + $colCount"}}
|
||||
|
||||
{{if count($rowData) == $colCount}}
|
||||
|
||||
{{assign var="colCount" value=0}}
|
||||
|
||||
{{/if}}
|
||||
|
||||
|
||||
|
||||
{{if empty($def.templateMeta.labelsOnTop) && empty($colData.field.hideLabel)}}
|
||||
|
||||
<td valign="top" width='{{$def.templateMeta.widths[$smarty.foreach.colIteration.index].label}}%' class="dataLabel" NOWRAP>
|
||||
|
||||
{{if isset($colData.field.customLabel)}}
|
||||
|
||||
{{$colData.field.customLabel}}
|
||||
|
||||
{{elseif isset($colData.field.label)}}
|
||||
|
||||
{capture name="label" assign="label}
|
||||
|
||||
{sugar_translate label='{{$colData.field.label}}' module='{{$module}}'}
|
||||
|
||||
{/capture}
|
||||
|
||||
{$label|strip_semicolon}:
|
||||
|
||||
{{elseif isset($fields[$colData.field.name])}}
|
||||
|
||||
{capture name="label" assign="label}
|
||||
|
||||
{sugar_translate label='{{$fields[$colData.field.name].vname}}' module='{{$module}}'}
|
||||
|
||||
{/capture}
|
||||
|
||||
{$label|strip_semicolon}:
|
||||
|
||||
{{/if}}
|
||||
|
||||
{{* Show the required symbol if field is required, but override not set. Or show if override is set *}}
|
||||
|
||||
{{if ($fields[$colData.field.name].required && (!isset($colData.field.displayParams.required) || $colData.field.displayParams.required)) ||
|
||||
|
||||
(isset($colData.field.displayParams.required) && $colData.field.displayParams.required)}}
|
||||
|
||||
<span class="required">{{$APP.LBL_REQUIRED_SYMBOL}}</span>
|
||||
|
||||
{{/if}}
|
||||
|
||||
</td>
|
||||
|
||||
{{/if}}
|
||||
|
||||
|
||||
|
||||
<td valign="top" width='{{if $colData.field.allCols}}100%{{else}}{{$def.templateMeta.widths[$smarty.foreach.colIteration.index].field}}{{/if}}%' class='tabEditViewDF' {{if $colData.field.allCols}}colspan='8'{{else}}{{if $colData.colspan}}colspan='{{$colData.colspan}}'{{/if}}{{/if}} NOWRAP>
|
||||
|
||||
{{if !empty($def.templateMeta.labelsOnTop)}}
|
||||
|
||||
{{if isset($colData.field.label)}}
|
||||
|
||||
{{if !empty($colData.field.label)}}
|
||||
|
||||
{sugar_translate label='{{$colData.field.label}}' module='{{$module}}'}:
|
||||
|
||||
{{/if}}
|
||||
|
||||
{{elseif isset($fields[$colData.field.name])}}
|
||||
|
||||
{sugar_translate label='{{$fields[$colData.field.name].vname}}' module='{{$module}}'}:
|
||||
|
||||
{{/if}}
|
||||
|
||||
|
||||
|
||||
{{* Show the required symbol if field is required, but override not set. Or show if override is set *}}
|
||||
|
||||
{{if ($fields[$colData.field.name].required && (!isset($colData.field.displayParams.required) || $colData.field.displayParams.required)) ||
|
||||
|
||||
(isset($colData.field.displayParams.required) && $colData.field.displayParams.required)}}
|
||||
|
||||
<span class="required">{{$APP.LBL_REQUIRED_SYMBOL}}</span>
|
||||
|
||||
{{/if}}
|
||||
|
||||
{{if !isset($colData.field.label) || !empty($colData.field.label)}}
|
||||
|
||||
<br>
|
||||
|
||||
{{/if}}
|
||||
|
||||
{{/if}}
|
||||
|
||||
|
||||
|
||||
{{if $fields[$colData.field.name] && !empty($colData.field.fields) }}
|
||||
|
||||
{{foreach from=$colData.field.fields item=subField}}
|
||||
|
||||
{{if $fields[$subField.name]}}
|
||||
|
||||
{counter name="panelFieldCount"}
|
||||
|
||||
{{sugar_field parentFieldArray='fields' tabindex=$colData.field.tabindex vardef=$fields[$subField.name] displayType='editView' displayParams=$subField.displayParams formName=$form_name}}
|
||||
|
||||
{{/if}}
|
||||
|
||||
{{/foreach}}
|
||||
|
||||
{{elseif !empty($colData.field.customCode)}}
|
||||
|
||||
{counter name="panelFieldCount"}
|
||||
|
||||
{{sugar_evalcolumn var=$colData.field.customCode colData=$colData tabindex=$colData.field.tabindex}}
|
||||
|
||||
{{elseif $fields[$colData.field.name]}}
|
||||
|
||||
{counter name="panelFieldCount"}
|
||||
|
||||
{{$colData.displayParams}}
|
||||
|
||||
{{sugar_field parentFieldArray='fields' tabindex=$colData.field.tabindex vardef=$fields[$colData.field.name] displayType='editView' displayParams=$colData.field.displayParams typeOverride=$colData.field.type formName=$form_name}}
|
||||
|
||||
{{/if}}
|
||||
|
||||
|
||||
|
||||
{{/foreach}}
|
||||
|
||||
</tr>
|
||||
|
||||
{{/foreach}}
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
{{/if}}
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
{if $panelFieldCount == 0}
|
||||
|
||||
<script>document.getElementById("{{$label}}").style.display='none';</script>
|
||||
|
||||
{/if}
|
||||
|
||||
{{/foreach}}
|
||||
|
||||
{{include file='modules/EcmOfferes/views/EditView/footer.tpl'}}
|
||||
61
modules/EcmReturns/views/EditView/footer.tpl
Normal file
61
modules/EcmReturns/views/EditView/footer.tpl
Normal file
@@ -0,0 +1,61 @@
|
||||
{*
|
||||
/*********************************************************************************
|
||||
* 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".
|
||||
********************************************************************************/
|
||||
*}
|
||||
{{if empty($form.button_location) || $form.button_location == 'bottom'}}
|
||||
<div style="padding-top: 2px">
|
||||
{{if !empty($form) && !empty($form.buttons)}}
|
||||
{{foreach from=$form.buttons key=val item=button}}
|
||||
{{sugar_button module="$module" id="$button" view="$view"}}
|
||||
{{/foreach}}
|
||||
{{else}}
|
||||
{{sugar_button module="$module" id="SAVE" view="$view"}}
|
||||
{{sugar_button module="$module" id="CANCEL" view="$view"}}
|
||||
{{/if}}
|
||||
{{sugar_button module="$module" id="Audit" view="$view"}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</form>
|
||||
{{if $externalJSFile}}
|
||||
require_once("'".$externalJSFile."'");
|
||||
{{/if}}
|
||||
|
||||
{$set_focus_block}
|
||||
|
||||
{{if isset($scriptBlocks)}}
|
||||
<!-- Begin Meta-Data Javascript -->
|
||||
{{$scriptBlocks}}
|
||||
<!-- End Meta-Data Javascript -->
|
||||
{{/if}}
|
||||
79
modules/EcmReturns/views/EditView/header.tpl
Normal file
79
modules/EcmReturns/views/EditView/header.tpl
Normal file
@@ -0,0 +1,79 @@
|
||||
{*
|
||||
/*********************************************************************************
|
||||
* 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".
|
||||
********************************************************************************/
|
||||
*}
|
||||
<form action="index.php" method="POST" name="{$form_name}" id="{$form_id}" {$enctype}>
|
||||
<table width="100%" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td style="padding-bottom: 2px;">
|
||||
<input type="hidden" name="module" value="{$module}">
|
||||
{if isset($smarty.request.isDuplicate) && $smarty.request.isDuplicate eq "true"}
|
||||
<input type="hidden" name="record" value="">
|
||||
{else}
|
||||
<input type="hidden" name="record" value="{$fields.id.value}">
|
||||
{/if}
|
||||
<input type="hidden" name="isDuplicate" value="false">
|
||||
<input type="hidden" name="action">
|
||||
<input type="hidden" name="return_module" value="{$smarty.request.return_module}">
|
||||
<input type="hidden" name="return_action" value="{$smarty.request.return_action}">
|
||||
<input type="hidden" name="return_id" value="{$smarty.request.return_id}">
|
||||
<input type="hidden" name="contact_role">
|
||||
{if !empty($smarty.request.return_module)}
|
||||
<input type="hidden" name="relate_to" value="{$smarty.request.return_module}">
|
||||
<input type="hidden" name="relate_id" value="{$smarty.request.return_id}">
|
||||
{/if}
|
||||
<input type="hidden" name="offset" value="{$offset}">
|
||||
{{if isset($form.hidden)}}
|
||||
{{foreach from=$form.hidden item=field}}
|
||||
{{$field}}
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
{{if empty($form.button_location) || $form.button_location == 'top'}}
|
||||
{{if !empty($form) && !empty($form.buttons)}}
|
||||
{{foreach from=$form.buttons key=val item=button}}
|
||||
{{sugar_button module="$module" id="$button" view="$view"}}
|
||||
{{/foreach}}
|
||||
{{else}}
|
||||
{{sugar_button module="$module" id="SAVE" view="$view"}}
|
||||
{{sugar_button module="$module" id="CANCEL" view="$view"}}
|
||||
{{/if}}
|
||||
{{if empty($form.hideAudit) || !$form.hideAudit}}
|
||||
{{sugar_button module="$module" id="Audit" view="$view"}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</td>
|
||||
<td align='right'>{{$ADMIN_EDIT}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
186
modules/EcmReturns/views/EditView/view.edit.ecmreturns.php
Normal file
186
modules/EcmReturns/views/EditView/view.edit.ecmreturns.php
Normal file
@@ -0,0 +1,186 @@
|
||||
<?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 ViewEditEcmReturns 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 ViewEditEcmReturns(){
|
||||
|
||||
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;
|
||||
|
||||
}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]['editviewdefs'])){
|
||||
|
||||
$metadataFile = $metafiles[$this->module]['editviewdefs'];
|
||||
|
||||
$foundViewDefs = true;
|
||||
|
||||
}
|
||||
|
||||
}elseif(file_exists('modules/'.$this->module.'/metadata/metafiles.php')){
|
||||
|
||||
require_once('modules/'.$this->module.'/metadata/metafiles.php');
|
||||
|
||||
if(!empty($metafiles[$this->module]['editviewdefs'])){
|
||||
|
||||
$metadataFile = $metafiles[$this->module]['editviewdefs'];
|
||||
|
||||
$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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
251
modules/EcmReturns/views/view.list.php
Normal file
251
modules/EcmReturns/views/view.list.php
Normal file
@@ -0,0 +1,251 @@
|
||||
<?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: This file is used to override the default Meta-data EditView behavior
|
||||
* to provide customization specific to the Calls module.
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________..
|
||||
********************************************************************************/
|
||||
|
||||
require_once('include/MVC/View/views/view.list.php');
|
||||
|
||||
class EcmReturnsViewList extends ViewList{
|
||||
|
||||
function EcmReturnsViewList(){
|
||||
parent::ViewList();
|
||||
}
|
||||
|
||||
function display(){
|
||||
if(!$this->bean->ACLAccess('list')){
|
||||
ACLController::displayNoAccess();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$this->module=$module = "EcmReturns";
|
||||
$metadataFile = null;
|
||||
$foundViewDefs = false;
|
||||
if(file_exists('custom/modules/' . $module. '/metadata/listviewdefs.php')){
|
||||
$metadataFile = 'custom/modules/' . $module . '/metadata/listviewdefs.php';
|
||||
$foundViewDefs = true;
|
||||
}else{
|
||||
if(file_exists('custom/modules/'.$module.'/metadata/metafiles.php')){
|
||||
require_once('custom/modules/'.$module.'/metadata/metafiles.php');
|
||||
if(!empty($metafiles[$module]['listviewdefs'])){
|
||||
$metadataFile = $metafiles[$module]['listviewdefs'];
|
||||
$foundViewDefs = true;
|
||||
}
|
||||
}elseif(file_exists('modules/'.$module.'/metadata/metafiles.php')){
|
||||
require_once('modules/'.$module.'/metadata/metafiles.php');
|
||||
if(!empty($metafiles[$module]['listviewdefs'])){
|
||||
$metadataFile = $metafiles[$module]['listviewdefs'];
|
||||
$foundViewDefs = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!$foundViewDefs && file_exists('modules/'.$module.'/metadata/listviewdefs.php')){
|
||||
$metadataFile = 'modules/'.$module.'/metadata/listviewdefs.php';
|
||||
}
|
||||
require_once($metadataFile);
|
||||
|
||||
if(!empty($_REQUEST['saved_search_select']) && $_REQUEST['saved_search_select']!='_none') {
|
||||
if(empty($_REQUEST['button']) && (empty($_REQUEST['clear_query']) || $_REQUEST['clear_query']!='true')) {
|
||||
$this->saved_search = loadBean('SavedSearch');
|
||||
$this->saved_search->retrieveSavedSearch($_REQUEST['saved_search_select']);
|
||||
$this->saved_search->populateRequest();
|
||||
}
|
||||
elseif(!empty($_REQUEST['button'])) { // click the search button, after retrieving from saved_search
|
||||
$_SESSION['LastSavedView'][$_REQUEST['module']] = '';
|
||||
unset($_REQUEST['saved_search_select']);
|
||||
unset($_REQUEST['saved_search_select_name']);
|
||||
}
|
||||
}
|
||||
|
||||
$storeQuery = new StoreQuery();
|
||||
if(!isset($_REQUEST['query'])){
|
||||
$storeQuery->loadQuery($this->module);
|
||||
$storeQuery->populateRequest();
|
||||
}else{
|
||||
$storeQuery->saveFromRequest($this->module);
|
||||
}
|
||||
|
||||
$seed = $this->bean;
|
||||
$lv = new ListViewSmarty();
|
||||
$displayColumns = array();
|
||||
if(!empty($_REQUEST['displayColumns'])) {
|
||||
foreach(explode('|', $_REQUEST['displayColumns']) as $num => $col) {
|
||||
if(!empty($listViewDefs[$module][$col]))
|
||||
$displayColumns[$col] = $listViewDefs[$module][$col];
|
||||
}
|
||||
}
|
||||
else {
|
||||
foreach($listViewDefs[$module] as $col => $params) {
|
||||
if(!empty($params['default']) && $params['default'])
|
||||
$displayColumns[$col] = $params;
|
||||
}
|
||||
}
|
||||
$params = array('massupdate' => true, 'export'=>false);
|
||||
|
||||
$lv->quickViewLinks = false;
|
||||
$lv->export = false;
|
||||
$lv->mergeduplicates = false;
|
||||
|
||||
if(!empty($_REQUEST['orderBy'])) {
|
||||
$params['orderBy'] = $_REQUEST['orderBy'];
|
||||
$params['overrideOrder'] = true;
|
||||
if(!empty($_REQUEST['sortOrder'])) $params['sortOrder'] = $_REQUEST['sortOrder'];
|
||||
}
|
||||
|
||||
$lv->displayColumns = $displayColumns;
|
||||
|
||||
$this->seed = $seed;
|
||||
$this->module = $module;
|
||||
|
||||
$searchForm = null;
|
||||
|
||||
//search
|
||||
$view = 'basic_search';
|
||||
if(!empty($_REQUEST['search_form_view']))
|
||||
$view = $_REQUEST['search_form_view'];
|
||||
$headers = true;
|
||||
if(!empty($_REQUEST['search_form_only']) && $_REQUEST['search_form_only'])
|
||||
$headers = false;
|
||||
elseif(!isset($_REQUEST['search_form']) || $_REQUEST['search_form'] != 'false') {
|
||||
if(isset($_REQUEST['searchFormTab']) && $_REQUEST['searchFormTab'] == 'advanced_search') {
|
||||
$view = 'advanced_search';
|
||||
}else {
|
||||
$view = 'basic_search';
|
||||
}
|
||||
}
|
||||
|
||||
$use_old_search = true;
|
||||
if(file_exists('modules/'.$this->module.'/SearchForm.html')){
|
||||
require_once('include/SearchForm/SearchForm.php');
|
||||
$searchForm = new SearchForm($this->module, $this->seed);
|
||||
}else{
|
||||
$use_old_search = false;
|
||||
require_once('include/SearchForm/SearchForm2.php');
|
||||
|
||||
if(!empty($metafiles[$this->module]['searchdefs']))
|
||||
require_once($metafiles[$this->module]['searchdefs']);
|
||||
elseif(file_exists('modules/'.$this->module.'/metadata/searchdefs.php'))
|
||||
require_once('modules/'.$this->module.'/metadata/searchdefs.php');
|
||||
|
||||
if (file_exists('custom/modules/'.$this->module.'/metadata/searchdefs.php'))
|
||||
{
|
||||
require_once('custom/modules/'.$this->module.'/metadata/searchdefs.php');
|
||||
}
|
||||
elseif (!empty($metafiles[$this->module]['searchdefs']))
|
||||
{
|
||||
require_once($metafiles[$this->module]['searchdefs']);
|
||||
}
|
||||
elseif (file_exists('modules/'.$this->module.'/metadata/searchdefs.php'))
|
||||
{
|
||||
require_once('modules/'.$this->module.'/metadata/searchdefs.php');
|
||||
}
|
||||
|
||||
if(!empty($metafiles[$this->module]['searchfields']))
|
||||
require_once($metafiles[$this->module]['searchfields']);
|
||||
elseif(file_exists('modules/'.$this->module.'/metadata/SearchFields.php'))
|
||||
require_once('modules/'.$this->module.'/metadata/SearchFields.php');
|
||||
|
||||
$searchForm = new SearchForm($this->seed, $this->module, $this->action);
|
||||
$searchForm->setup($searchdefs, $searchFields, 'include/SearchForm/tpls/SearchFormGeneric.tpl', $view, $listViewDefs);
|
||||
|
||||
$searchForm->lv = $lv;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(isset($this->options['show_title']) && $this->options['show_title'] && (!isset($_REQUEST['search_form_only']) || $_REQUEST['search_form_only'] != "true")) {
|
||||
$moduleName = isset($this->seed->module_dir) ? $this->seed->module_dir : $GLOBALS['mod_strings']['LBL_MODULE_NAME'];
|
||||
|
||||
echo "\n<p>\n";
|
||||
echo get_module_title($moduleName, $GLOBALS['mod_strings']['LBL_MODULE_TITLE'], true);
|
||||
echo "\n</p>\n";
|
||||
|
||||
}
|
||||
|
||||
$where = '';
|
||||
if(isset($_REQUEST['query']))
|
||||
{
|
||||
// we have a query
|
||||
if(!empty($_SERVER['HTTP_REFERER']) && preg_match('/action=EditView/', $_SERVER['HTTP_REFERER'])) { // from EditView cancel
|
||||
$searchForm->populateFromArray($storeQuery->query);
|
||||
}
|
||||
else {
|
||||
$searchForm->populateFromRequest();
|
||||
}
|
||||
$where_clauses = $searchForm->generateSearchWhere(true, $this->seed->module_dir);
|
||||
if (count($where_clauses) > 0 )$where = '('. implode(' ) AND ( ', $where_clauses) . ')';
|
||||
$GLOBALS['log']->info("List View Where Clause: $where");
|
||||
}
|
||||
if($use_old_search){
|
||||
switch($view) {
|
||||
case 'basic_search':
|
||||
$searchForm->setup();
|
||||
$searchForm->displayBasic($headers);
|
||||
break;
|
||||
case 'advanced_search':
|
||||
$searchForm->setup();
|
||||
$searchForm->displayAdvanced($headers);
|
||||
break;
|
||||
case 'saved_views':
|
||||
echo $searchForm->displaySavedViews($listViewDefs, $lv, $headers);
|
||||
break;
|
||||
}
|
||||
|
||||
}else{
|
||||
echo $searchForm->display($headers);
|
||||
}
|
||||
if(!$headers)
|
||||
return;
|
||||
|
||||
if(empty($_REQUEST['search_form_only']) || $_REQUEST['search_form_only'] == false){
|
||||
// $this->processQuickSearch();
|
||||
$lv->setup($seed, 'include/ListView/ListViewGeneric.tpl', $where, $params);
|
||||
$savedSearchName = empty($_REQUEST['saved_search_select_name']) ? '' : (' - ' . $_REQUEST['saved_search_select_name']);
|
||||
echo get_form_header($GLOBALS['mod_strings']['LBL_LIST_FORM_TITLE'] . $savedSearchName, '', false);
|
||||
echo $lv->display();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user