Add php files

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

View File

@@ -0,0 +1,92 @@
<?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['MyEcmPrepaymentInvoicesDashlet']['searchFields'] = array('priority' => array('default' => ''),
'status' => array('default' => array('Assigned', 'New', 'Pending')),
'found_in_release' => array('default' => ''),
'fixed_in_release' => array('default' => ''),
'type' => array('default' => ''),
'' => array('default' => ''),
'date_entered' => array('default' => ''),
'date_modified' => array('default' => ''),
'assigned_user_id' => array('type' => 'assigned_user_name',
'default' => $current_user->name));
$dashletData['MyEcmPrepaymentInvoicesDashlet']['columns'] = array('ecmprepaymentinvoice_number' => array('width' => '5',
'label' => 'LBL_NUMBER',
'default' => true),
'name' => array('width' => '40',
'label' => 'LBL_LIST_SUBJECT',
'link' => true,
'default' => true),
'priority' => array('width' => '10',
'label' => 'LBL_PRIORITY',
'default' => true),
'status' => array('width' => '10',
'label' => 'LBL_STATUS',
'default' => true),
'resolution' => array('width' => '15',
'label' => 'LBL_RESOLUTION'),
'release_name' => array('width' => '15',
'label' => 'LBL_FOUND_IN_RELEASE',
'related_fields' => array('found_in_release')),
'type' => array('width' => '15',
'label' => 'LBL_TYPE'),
'fixed_in_release_name' => array('width' => '15',
'label' => 'LBL_FIXED_IN_RELEASE'),
'source' => array('width' => '15',
'label' => 'LBL_SOURCE'),
'date_entered' => array('width' => '15',
'label' => 'LBL_DATE_ENTERED'),
'date_modified' => array('width' => '15',
'label' => 'LBL_DATE_MODIFIED'),
'created_by' => array('width' => '8',
'label' => 'LBL_CREATED'),
'assigned_user_name' => array('width' => '8',
'label' => 'LBL_LIST_ASSIGNED_USER'),
);
?>

View File

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

View File

@@ -0,0 +1,75 @@
<?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/EcmPrepaymentInvoices/EcmPrepaymentInvoice.php');
class MyEcmPrepaymentInvoicesDashlet extends DashletGeneric {
function MyEcmPrepaymentInvoicesDashlet($id, $def = null) {
global $current_user, $app_strings;
require('modules/EcmPrepaymentInvoices/Dashlets/MyEcmPrepaymentInvoicesDashlet/MyEcmPrepaymentInvoicesDashlet.data.php');
parent::DashletGeneric($id, $def);
$this->searchFields = $dashletData['MyEcmPrepaymentInvoicesDashlet']['searchFields'];
$this->columns = $dashletData['MyEcmPrepaymentInvoicesDashlet']['columns'];
if(empty($def['title'])) $this->title = translate('LBL_LIST_MY_ECMPREPAYMENTINVOICES', 'EcmPrepaymentInvoices');
$this->seedBean = new EcmPrepaymentInvoice();
}
function displayOptions() {
require_once('modules/Releases/Release.php');
$this->processDisplayOptions();
$seedRelease = new Release();
$this->currentSearchFields['fixed_in_release']['input'] = '<select multiple="true" size="3" name="fixed_in_release[]">'
. get_select_options_with_id($seedRelease->get_releases(false, "Active"), (empty($this->filters['fixed_in_release']) ? '' : $this->filters['fixed_in_release']))
. '</select>';
$this->currentSearchFields['found_in_release']['input'] = '<select multiple="true" size="3" name="found_in_release[]">'
. get_select_options_with_id($seedRelease->get_releases(false, "Active"), (empty($this->filters['found_in_release']) ? '' : $this->filters['found_in_release']))
. '</select>';
$this->configureSS->assign('searchFields', $this->currentSearchFields);
return $this->configureSS->fetch($this->configureTpl);
}
}
?>

View File

@@ -0,0 +1,89 @@
<?
error_reporting(LC_ALL);
ini_set('display_errors', '1');
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
global $sugar_version, $sugar_config, $current_user, $app_strings, $mod_strings, $current_user, $app_list_strings;
require_once('modules/EcmPrepaymentInvoices/EcmPrepaymentInvoice.php');
//require_once('modules/EcmPrepaymentInvoices/Forms.php');
require_once ('include/time.php');
require_once('include/json_config.php');
$json_config = new json_config();
$focus = new EcmPrepaymentInvoice();
if(isset($_REQUEST['record']))$focus->retrieve($_REQUEST['record']);
$file = 'modules/EcmGroupSales/EcmGroupSale.php';
if(file_exists($file)) {
$cc = array();
require_once($file);
$cc = EcmGroupSale::loadSettings();
}
$OPT = array();
$OPT['row_item_height'] = $cc['row_item_height'];
$OPT['row_item_height_selected'] = $cc['row_item_height_selected'];
$OPT['rows_on_item_list'] = $cc['rows_on_item_list'];
$OPT['position_table_height'] = $OPT['row_item_height']*$OPT['rows_on_item_list']+40+$OPT['rows_on_item_list']*4;
$OPT['quick_product_item_adding'] = $cc['quick_product_item_adding'];
global $app_list_strings;
$focus->position_list = str_replace('&quot;','\"',$focus->getPositionListDetailView());
require_once('include/MVC/View/SugarView.php');
require_once('modules/EcmPrepaymentInvoices/views/DetailView/view.detail.php');
$detail = new EcmPrepaymentInvoicesViewDetail();
$detail->ss = new Sugar_Smarty();
$detail->module = 'EcmPrepaymentInvoices';
$detail->bean = $focus;
$detail->tplFile = 'include/DetailView/DetailView.tpl';
$detail->ss->assign("POSITION_LIST", $focus->position_list);
//get other prepaymentinvoices info
$res = $GLOBALS['db']->query("SELECT id, document_no, inv_value FROM ecmprepaymentinvoices WHERE ecmsale_id='".$focus->ecmsale_id."'");
$total = 0;
$other_inv = '';
while ($row = $GLOBALS['db']->fetchByAssoc($res)) {
if ($row['id']==$focus->id) continue;
$other_inv.='<a href="index.php?module=EcmPrepaymentInvoices&action=DetailView&record='.$row['id'].'">'.$row['document_no'].'</a> ';
$total+=$row['inv_value'];
}
$detail->ss->assign('other_ecmprepaymentinvoices',$other_inv);
$detail->ss->assign('other_ecmprepayment_invoices_sum',$total);
$desc.='<input title="Generuj PDF" class="button" onclick="if(document.getElementById(\'div_desc\').style.display==\'none\')document.getElementById(\'div_desc\').style.display=\'block\';else document.getElementById(\'div_desc\').style.display=\'none\';" type="button" name="productcard" id="productcard" value="Generuj PDF">';
$desc .= '<div id="div_desc" style="border: 1px solid #cccccc;background:#e6e6e6;padding:5px;position:absolute;display:none;">';
$desc .= 'Typ: <select name="preview_type" id="preview_type"><option value>Faktura zaliczkowa</option><br /><br />';
$desc.='<input name="quote_pdf" id="quote_pdf" title="Show PDF" accessKey="" class="button" onclick="window.location = \'index.php?module=EcmPrepaymentInvoices&action=previewPDF&to_pdf=1&record='.$_REQUEST['record'].'\';" type="button" value="Pokaż PDF">';
$detail->ss->assign("CATALOGUE",$desc);
$scriptOpt = '<script language="javascript">
var OPT = '.str_replace('&quot;','\"',$json->encode($OPT)).';
var MOD = '.str_replace('&quot;','\"',$json->encode($mod_strings)).';
var N;
</script>';
echo $scriptOpt;
$detail->preDisplay();
echo $detail->display();
?>

View File

@@ -0,0 +1,386 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: TODO: To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
require_once('data/SugarBean.php');
require_once('include/utils.php');
class EcmPrepaymentInvoice extends SugarBean {
var $field_name_map = array();
var $id;
var $date_entered;
var $date_modified;
var $modified_user_id;
var $assigned_user_id;
var $name;
var $inv_value;
var $position_list;
var $products_on_pdf;
var $module_dir = 'EcmPrepaymentInvoices';
var $table_name = "ecmprepaymentinvoices";
var $object_name = "EcmPrepaymentInvoice";
var $new_schema = true;
var $additional_column_fields = array('assigned_user_name', 'assigned_user_id');
function EcmPrepaymentInvoice() {
parent::SugarBean();
$this->setupCustomFields('EcmPrepaymentInvoices');
foreach($this->field_defs as $field){
$this->field_name_map[$field['name']] = $field;
}
}
function get_summary_text(){
return $this->name;
}
function create_list_query($order_by, $where, $show_deleted = 0){
$custom_join = $this->custom_fields->getJOIN();
$query ="SELECT ";
$query.="ecmprepaymentinvoices.*,users.user_name as assigned_user_name";
if($custom_join)$query.=$custom_join['select'];
$query.=" FROM ecmprepaymentinvoices ";
$query.="LEFT JOIN users ON ecmprepaymentinvoices.assigned_user_id=users.id";
$query.=" ";
if($custom_join)$query.=$custom_join['join'];
$where_auto='1=1';
if($show_deleted==0)$where_auto=" $this->table_name.deleted=0 ";
elseif($show_deleted==1)$where_auto=" $this->table_name.deleted=1 ";
if($where!="")$query.="where $where AND ".$where_auto;
else $query.="where ".$where_auto;
if(substr_count($order_by,'.')>0)$query .= " ORDER BY $order_by";
elseif($order_by != "")$query .= " ORDER BY $order_by";
else $query .= " ORDER BY ecmprepaymentinvoices.name";
return $query;
}
function create_export_query($order_by,$where){
$custom_join = $this->custom_fields->getJOIN();
$query ="SELECT ";
$query.="ecmprepaymentinvoices.*,users.user_name as assigned_user_name";
if($custom_join)$query.=$custom_join['select'];
$query.=" FROM ecmprepaymentinvoices ";
$query.="LEFT JOIN users ON ecmprepaymentinvoices.assigned_user_id=users.id";
$query.=" ";
if($custom_join)$query.=$custom_join['join'];
$where_auto='1=1';
if($show_deleted==0)$where_auto=" $this->table_name.deleted=0 ";
elseif($show_deleted==1)$where_auto=" $this->table_name.deleted=1 ";
if($where!="")$query.="where $where AND ".$where_auto;
else $query.="where ".$where_auto;
if(substr_count($order_by,'.')>0)$query .= " ORDER BY $order_by";
elseif($order_by != "")$query .= " ORDER BY $order_by";
else $query .= " ORDER BY ecmprepaymentinvoices.name";
return $query;
}
function fill_in_additional_list_fields(){
}
function fill_in_additional_detail_fields(){
$this->to_nip = 'tt';
parent::fill_in_additional_detail_fields();
}
function get_list_view_data(){
global $current_language;
$the_array=parent::get_list_view_data();
$app_list_strings=return_app_list_strings_language($current_language);
$mod_strings=return_module_language($current_language,'EcmPrepaymentInvoices');
$the_array['NAME']=(($this->name == "") ? "<em>blank</em>" : $this->name);
$the_array['ENCODED_NAME']=$this->name;
$the_array['PDF']='<img border="0" src="modules/EcmSales/images/pdf.gif" title="Podglad Zam<61>wienia" onclick="EcmPreviewPDF(\'index.php?module=EcmPrepaymentInvoices&amp;action=previewPDF&amp;method=I&amp;record='.$this->id.'&amp;to_pdf=1\',{zoom:75,toolbar:1});" style="cursor:pointer">';
return $the_array;
}
function build_generic_where_clause($the_query_string){
$where_clauses=array();
$the_query_string=PearDatabase::quote(from_html($the_query_string));
array_push($where_clauses,"ecmprepaymentinvoices.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,$ecmprepaymentinvoice)
{
global $mod_strings,$app_list_strings;
$xtpl->assign("ECMPREPAYMENTINVOICE_SUBJECT",$ecmprepaymentinvoice->name);
return $xtpl;
}
function bean_implements($interface){
switch($interface){
case 'ACL':return true;
}
return false;
}
function save($check_notify=FALSE){
$return_id = parent::save($check_notify);
//$this->savePositions($return_id);
return $return_id;
}
function setTemplate() {
if(!isset($this->template_id) || $this->template_id == '') return null;
if(isset($this->template)) return $this->template;
require_once('modules/EcmDocumentTemplates/EcmDocumentTemplate.php');
$this->template = new EcmDocumentTemplate();
//$this->template->retrieve($this->template_id);
$this->template->retrieve($this->template_id, true, false);
if(isset($this->template->id) && $this->template->id != '') {
$this->template->format_all_fields();
}
else
$this->template = null;
return $this->template;
}
function generateNumber() {
$this->setTemplate();
$this->number = isset($this->template) ? $this->template->generateNumber($this->table_name) : '';
return $this->number;
}
function formatNumber() {
$this->setTemplate();
$this->document_no = isset($this->template) ? $this->template->formatNumber($this->number, $this->module_dir) : '';
return $this->document_no;
}
function formatDocumentNumber($documentNumber = '', $code = '') {
return isset($this->template) ? $this->template->formatDocumentNumber($documentNumber, $code) : '';
}
function getPDF($id = null,$method = 'I',$name = null) {
global $sugar_config;
if($id != null) {
$this->retrieve($id);
if($this->id == '') return;
}
global $mod_strings;
require_once('modules/EcmTexts/EcmText.php');
if(isset($this->ecmlanguage) && $this->ecmlanguage != '') {
$data = EcmText::LoadText(null,null,"EcmPrepaymentInvoices",$this->ecmlanguage);
if(isset($data[0]) && isset($data[0]['data']) && isset($data[0]['data']['labels'])) {
$data = $data[0]['data']['labels'];
foreach($data as $key => $value) {
$mod_strings[$value['label']] = $value['translation'];
}
}
}
$this->format_all_fields();
$this->setTemplate();
if(isset($this->template->id) && $this->template->id != '') {
$this->template->setPDF($this->template_id);
$this->template->pdf->SetAutoPageBreak(true,40);
$this->DrawMainPDF($this->template->pdf);
$this->template->outputPDF((($name) ? $name : $this->createPdfFileName()),$method);
}
}
function DrawMainPDF($pdf) {
global $mod_strings;
$arr=$this->template->getTemplateFile($_REQUEST['module']);
include_once("modules/EcmDocumentTemplates/templates/".$arr[0]."/".$arr[1]."/subheader.php");
/*
$pdf->SetFont('arialpl','','7');
$this->DrawPositions($pdf);
*/
include_once("modules/EcmDocumentTemplates/templates/".$arr[0]."/".$arr[1]."/subfooter.php");
}
function setUser() {
if(is_object($this->user)) return $this->user;
require_once('modules/Users/User.php');
$us = new User();
global $current_user;
$us->retrieve(($this->assigned_user_id)?$this->assigned_user_id:$current_user->id);
if(isset($us->id) && $us->id != '') {
$this->user = $us;
}
else
$this->user = null;
return $this->user;
}
function createPdfFileName($format=true) {
$arr1 = Array('\\', '/', ':', '*', '?' , '"', '<', '>', '|', ' ');
$arr2 = Array('', '', '', '', '', '\'', '[', ']', '', '_');
$tmp = $this->document_no;
if($format) {
$tmp = str_replace($arr1, $arr2, 'Invoice_'.$tmp.'.pdf');
}
else
$tmp = 'InvoiceOut '.$tmp.'.pdf';
return $tmp;
}
//manage positions
function getPosition($position, $checked = false) {
if(!is_array($position)) return '';
global $timedate;
global $db;
$r=$db->fetchByAssoc($db->query("select q.document_no,q.id from ecmquotes as q inner join ecmquoteitems as i on i.ecmquote_id=q.id where i.id='".$position['item_id']."'"));
$rs=$db->fetchByAssoc($db->query("select sum(quantity) as q from ecmstockdocoutitems where item_id='".$position['id']."'"));
$pr=$db->fetchByAssoc($db->query("select unit_name from ecmproducts where id='".$position['ecmproduct_id']."'"));
$return_array = array();
$return_array['id'] = $position['ecmproduct_id'];
//$return_array['ecmquote_id']=$r['id'];
//$return_array['ecmquote_name']=$r['document_no'];
$return_array['iid'] = $position['id'];
//$return_array['item_id'] = $position['item_id'];
//$return_array['position'] = $position['position'];
$return_array['code'] = $position['code'];
$return_array['name'] = $position['name'];
$return_array['quantity'] = $position['quantity'];
if ($checked) $return_array['checked'] = true;
//$return_array['price'] = $position['price'];
//$return_array['discount'] = $position['discount'];
//$return_array['total'] = $position['total'];
//$return_array['unit_id'] = $position['dd_unit_id'];
//$return_array['unit_name'] = $pr['unit_name'];
//$return_array['vat_id'] = $position['ecmvat_id'];
//$return_array['vat_name'] = $position['ecmvat_name'];
//$return_array['vat_value'] = $position['ecmvat_value'];
//$return_array['category_id'] = $position['ecmproductcategory_id'];
//$return_array['currency_id'] = $position['currency_id'];
//$return_array['currency_name'] = $position['currency_name'];
//$return_array['recipient_code'] = $position['recipient_code'];
//$return_array['temp_item_id'] = $position['temp_item_id'];
//$return_array['temp_date'] = $position['temp_date'];
//$return_array['rq'] = $position['rq'];
//if($rs['q']<$position['quantity'])$return_array['check']=$position['id'];
//include_once("modules/EcmStockOperations/EcmStockOperation.php");
//$op=new EcmStockOperation();
//$return_array['stock']=$op->getStock($position['ecmproduct_id']);
return $return_array;
}
function getPositionListDetailView($sale_id, $array = false) {
//get invoice products
$inv_prod = explode("|", $this->products_on_pdf);
$query = "SELECT * FROM `ecmsaleitems` WHERE id IN ('".implode("','", $inv_prod)."') order by position asc";
$r = $this->db->query($query);
$return_array = array();
if($r) {
while($w = $this->db->fetchByAssoc($r)) {
if (in_array($w['id'], $inv_prod)) $checked = true; else $checked = false;
$return_array [] = $this->getPosition($w, $checked);
}
$json = getJSONobj();
return $array ? $return_array : $json->encode($return_array);
}
return $array ? false : '[]';
}
function getPositionList($sale_id, $array = false) {
//get invoice products
$inv_prod = explode("|", $this->products_on_pdf);
$query = "SELECT * FROM `ecmsaleitems` WHERE `ecmsale_id`='".$sale_id."' order by position asc";
$r = $this->db->query($query);
$return_array = array();
//return $query;
if($r) {
while($w = $this->db->fetchByAssoc($r)) {
if (in_array($w['id'], $inv_prod)) $checked = true; else $checked = false;
$return_array [] = $this->getPosition($w, $checked);
}
$json = getJSONobj();
return $array ? $return_array : $json->encode($return_array);
}
return $array ? false : '[]';
}
}
?>

View File

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

View File

@@ -0,0 +1,126 @@
<?php
error_reporting(LC_ALL);
ini_set('display_errors',1);
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
global $sugar_version, $sugar_config, $current_user, $app_strings, $mod_strings, $current_user, $app_list_strings, $db, $timedate;
require_once('modules/EcmPrepaymentInvoices/EcmPrepaymentInvoice.php');
//require_once('modules/EcmPrepaymentInvoices/Forms.php');
require_once('include/json_config.php');
$json_config = new json_config();
$json = getJSONobj();
$file = 'modules/EcmGroupSales/EcmGroupSale.php';
if(file_exists($file)) {
$cc = array();
require_once($file);
$cc = EcmGroupSale::loadSettings();
}
$OPT = array();
$OPT['row_item_height'] = $cc['row_item_height'];
$OPT['row_item_height_selected'] = $cc['row_item_height_selected'];
$OPT['rows_on_item_list'] = $cc['rows_on_item_list'];
$OPT['position_table_height'] = $OPT['row_item_height']*$OPT['rows_on_item_list']+40+$OPT['rows_on_item_list']*4;
$OPT['quick_product_item_adding'] = $cc['quick_product_item_adding'];
require_once('include/MVC/View/SugarView.php');
require_once('modules/EcmPrepaymentInvoices/views/EditView/view.edit.php');
$focus = new EcmPrepaymentInvoice();
if(isset($_REQUEST['record'])) {
$focus->retrieve($_REQUEST['record']);
echo $focus->ecmsale_id;
}
echo $focus->register_date;
$cur = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select value from currency_nbp_archive where date<'".$focus->register_date."' and currency_id='".$focus->currency_id."' order by date desc limit 0,1;"));
if ($cur['value'])
$focus->currency_value_nbp = $cur['value'];
var_dump($cur);
$edit = new EcmPrepaymentInvoicesViewEdit();
$edit->ss = new Sugar_Smarty();
$edit->module = 'EcmPrepaymentInvoices';
$edit->bean = $focus;
if($_REQUEST['ecmsale_id']){
$OPT['new_number'] = true;
$arr=array("parent_contact_name","to_nip","currency_id","template_id","parent_id","parent_name","parent_type","parent_address_street","parent_address_postalcode","parent_address_city","parent_address_country","total");
include_once("modules/EcmSales/EcmSale.php");
$sale=new EcmSale();
$sale->retrieve($_REQUEST['ecmsale_id']);
foreach($arr as $a)$edit->bean->$a=$sale->$a;
$edit->bean->descritpion="PRZEDPŁATA";
$edit->bean->register_date=$timedate->to_display_date(date("Y-m-d"));
$edit->bean->payment_date=$timedate->to_display_date(date("Y-m-d"));
$edit->bean->currency_value = $sale->currency_value;
$edit->bean->to_vatid=$sale->to_vatid;
$focus->position_list = str_replace('&quot;','\"',$focus->getPositionList($_REQUEST['ecmsale_id']));
$edit->ss->assign("POSITION_LIST",$focus->position_list);
}
$tt="";
$w=$GLOBALS[db]->query("select name,id,deleted,date_modified from ecmdocumenttemplates where deleted='0' or id='".$focus->template_id."'");
while($r=$GLOBALS[db]->fetchByAssoc($w)){
if($r['deleted']==1 && $_REQUEST['record'] && $focus->template_id){
$tt.='<option value="'.$r['id'].'"';
if($r['id']==$focus->template_id)$tt.=' selected';
$tt.='>'.$r['name'].' till '.$r['date_modified'].'</option>';
}
elseif($r['deleted']==0){
$tt.='<option value="'.$r['id'].'"';
if($r['id']==$focus->template_id)$tt.=' selected';
$tt.='>'.$r['name'].'</option>';
}
}
$edit->ss->assign("DOCUMENT_TEMPLATES_OPTIONS", $tt);
$tt="";
$w=$GLOBALS[db]->query("select name,id,value from ecmvats where deleted='0' order by name");
while($r=$GLOBALS[db]->fetchByAssoc($w)){
$tt.='<option value="'.$r['id'].'"';
if($r['value']==23)$tt.=' selected';
$tt.='>'.$r['name'].'</option>';
}
$edit->ss->assign("ECMVATS_OPTIONS", $tt);
$edit->ss->assign("ecmsale_id", $_REQUEST['ecmsale_id']);
$edit->ss->assign("ecmsale_name", $sale->document_no);
//$edit->tplFile = 'include/ECM/EcmViews/EditView/Tabs/EditView.tpl';
$edit->tplFile = 'include/EditView/EditView.tpl';
$scriptOpt = '<script language="javascript">
var OPT = '.str_replace('&quot;','\"',$json->encode($OPT)).';
var MOD = '.str_replace('&quot;','\"',$json->encode($mod_strings)).';
var N;
</script>';
echo $scriptOpt;
$edit->preDisplay();
echo $edit->display();
//echo '<div id="subpanels">';
//require_once('subpanels.php');
//echo '</div>';
?>

View File

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

View File

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

View File

@@ -0,0 +1,109 @@
<?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();
$pll = array(); $i=0; while(isset($_POST['p_'.$i])) { $pll[] = $json->decode(htmlspecialchars_decode($_POST['p_'.$i])); $_POST['p_'.$i] = ''; $i++;}
$_POST = $json->decode(htmlspecialchars_decode($_POST['otherFormData']));
$_POST['position_list'] = $pll;
$pop=array(); //products_on_pdf
foreach ($pll as $v) {
$pop[] = $v['iid'];
}
$_REQUEST = $_POST;
require_once("modules/EcmPrepaymentInvoices/EcmPrepaymentInvoice.php");
require_once('include/formbase.php');
$focus = new EcmPrepaymentInvoice();
if(isset($_POST['record']) && $_POST['record'] != '') {
$focus->retrieve($_POST['record']);
//$focus->id = $_POST['record'];
}
$focus->products_on_pdf = implode("|", $pop);
if(isset($focus->id) && $focus->id != ''){
$_POST['email_id'] = $focus->email_id;
} else {
$new_invoice = true;
}
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;
}
}
$r = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("SELECT value FROM ecmvats WHERE id='".$focus->ecmvat_id."'"));
$focus->ecmvat_value=floatval($r['value']);
$focus->save($check_notify);
$return_id = $focus->id;
echo $return_id; die();
?>

View File

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

View File

@@ -0,0 +1,18 @@
<?php
require_once('modules/EcmPrepaymentInvoices/EcmPrepaymentInvoice.php');
$focus = new EcmPrepaymentInvoice();
if(isset($_REQUEST['generate']) && $_REQUEST['generate'] == '1') {
try {
if(isset($_REQUEST['record']) && $_REQUEST['record'] != '') $focus->retrieve($_REQUEST['record']);
$focus->template_id = $_REQUEST['template_id'];
$focus->setTemplate();
$arr = array();
$arr['number'] = (isset($focus->id) && $focus->id != '') ? $focus->number : $focus->generateNumber("ecmreceipts","numer");
$arr['document_no'] = $focus->formatNumber();
}
catch (Exception $e) { echo ''; return; }
$json = getJSONobj();
echo '['.$json->encode($arr).']';
return;
}
?>

View File

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

View File

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

View File

@@ -0,0 +1,109 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: Defines the English language pack for the base application.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
$mod_strings = array (
//mh 21-03-13
'LBL_PDF_INDEX_DBF'=> 'Indeks kontrahenta',
//
'LBL_OTHER_ECMPRAPAYMENTINVOICES' => 'Wcześniejsze przedpłaty',
'LBL_OTHER_ECMPRAPAYMENTINVOICES_SUM' => 'Suma wcześniejszych przedpłat',
'LBL_TO_INFORMATIONS' => 'Informacje o firmie:',
'LBL_TEXTS' => 'Teksty do PDFa:',
'LBL_HEADER_TEXT' => 'Tekst naglówka',
'LBL_FOOTER_TEXT' => 'Tekst stopki',
'LBL_ADS_TEXT' => 'Dodatkowy tekst',
'LBL_EDITTABLE_CODE' => 'Indeks',
'LBL_EDITTABLE_NAME' => 'Nazwa',
'LBL_ITEMS' => 'Produkty na zamówieniu',
'LBL_ITEMS_TAB' => 'Produkty',
'LBL_TEXTS_TAB' => 'Teksty',
'LBL_NOT_SAVED' => 'Faktura nie zostala zapisana. Sprawdz czy wszytskie pola sa poprawne!',
'LBL_SAVED' => 'Faktura zostala zapisana pomyslnie.',
'LBL_ECMVAT_NAME' => 'VAT',
'LBL_TEMPLATE_NAME' => 'Szablon',
'LBL_PAYMENTCONDITION_NAME'=>'Warunki płatności',
'LBL_REGISTER_DATE'=>'Data dokumentu',
'LBL_PAYMENT_DATE'=>'Data płatności',
'LBL_PREVIEW_TAB' => 'Podglad',
'LBL_PREVIEW' => 'Podglad PDFa:',
'DEFAULT' => 'Informacje ogólne',
'LBL_DOCUMENT_NO' => 'Numer',
'LBL_PARENT_NAME' => 'Kontrahent',
'LBL_CURRENCY' => 'Waluta',
'LBL_CURRENCY_VALUE' => 'Kurs',
'LBL_TEMPLATE_ID' => 'Szablon',
'LBL_ECMLANGUAGE'=>'Język',
'LBL_TO_NIP'=>'Nip',
'LBL_PARENT_CONTACT_NAME'=>'Osoba kontaktowa',
'LBL_PARENT_ADDRESS_STREET'=>'Ulica',
'LBL_PARENT_ADDRESS_CITY'=>'Miasto',
'LBL_PARENT_ADDRESS_COUNTRY'=>'Państwo',
'LBL_ASSIGNED_TO_ID' => 'Przypisane Do',
'LBL_VALUE' => 'Wartość',
'LBL_MODULE_NAME' => 'Faktury Zaliczkowe',
'LBL_MODULE_TITLE' => 'Faktury Zaliczkowe: Strona Główna',
'LBL_MODULE_ID' => 'Faktury Zaliczkowe',
'LBL_SEARCH_FORM_TITLE' => 'Faktury Zaliczkowe Wyszukiwanie',
'LBL_LIST_FORM_TITLE' => 'Lista Faktur Zaliczkowych',
'LBL_NEW_FORM_TITLE' => 'Nowa Faktura Zaliczkowa',
'LBL_SUBJECT' => 'Tytuł:',
'LBL_ECMPREPAYMENTINVOICE' => 'Faktura Zaliczkowa:',
'LBL_ECMPREPAYMENTINVOICE_SUBJECT' => 'Nazwa Faktury Zaliczkowe:',
'LBL_LIST_SUBJECT' => 'Nazwa',
'LBL_LIST_LAST_MODIFIED' => 'Ostatnia Modyfikacja',
'LNK_NEW_ECMPREPAYMENTINVOICE' => 'Utwórz Stawkę VAT',
'LNK_ECMPREPAYMENTINVOICE_LIST' => 'Faktury Zaliczkowe',
'ERR_DELETE_RECORD' => 'Podaj numer rekordu aby usunąć stawkę vat.',
'LBL_LIST_MY_ECMPREPAYMENTINVOICES' => 'Moje Przypisane Faktury Zaliczkowe',
'LBL_CREATED_BY' => 'Utworzone Przez:',
'LBL_DATE_CREATED' => 'Data Utworzenia:',
'LBL_MODIFIED_BY' => 'Ostatnio Modyfikowane Przez:',
'LBL_DATE_LAST_MODIFIED' => 'Data Modyfikacji:',
'LBL_DEFAULT_SUBPANEL_TITLE' => 'Faktury Zaliczkowe',
'LBL_SYSTEM_ID' => 'System ID',
'LBL_LIST_ASSIGNED_TO_NAME' => 'Przypisany Użytkownik',
'LBL_LIST_VALUE' => 'Wartość',
'LBL_ASSIGNED_TO_NAME' => 'Przypisane Do',
);

View File

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

View File

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

View File

@@ -0,0 +1,205 @@
<?php
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$viewdefs['EcmPrepaymentInvoices']['DetailView'] = array(
'templateMeta'=>array(
'form'=>array(
'buttons'=>array(
'DUPLICATE',
array(
'customCode' => '{$CATALOGUE}'
),
),
'hidden' => array (
'<input type="hidden" name="position_list" id="position_list" value=\'{$POSITION_LIST}\'>',
),
),
'maxColumns'=>'2',
'widths'=>array(
array(
'label'=>'10',
'field' =>'30'
),
array(
'label'=>'10',
'field'=>'30'
)
),
'includes' => array(
array('file'=>'modules/EcmPrepaymentInvoices/EcmPrepaymentInvoicesDetailView.js'),
array('file'=>'include/ECM/EcmPreviewPDF/EcmPreviewPDF.js'),
array('file'=>'include/JSON.js'),
array('file'=>'include/javascript/quicksearch.js'),
array('file'=>'modules/EcmInvoiceOuts/MyTable.js'),
array('file'=>'modules/EcmInvoiceOuts/formloader.js'),
array('file'=>'modules/EcmProducts/mintajax.js'),
array('file'=>'modules/EcmProducts/helper.js'),
),
),
'panels'=>array(
'default'=>array(
array(
array(
'name' => 'document_no',
'tabIndex' => 'f',
'customCode' => '{$fields.document_no.value}'
),
'assigned_user_name'
),
array('parent_name','template_name'),
array(
array('name'=>'currency_id','label'=>'LBL_CURRENCY'),
array('name'=>'currency_value_nbp','label'=>'Kurs NBP'),
),
array(
array(
'name'=>'inv_value',
'label'=>'LBL_VALUE',
),
array(
'label'=>'Zamówienie',
'customCode'=>'<a href="index.php?module=EcmSales&action=DetailView&record={$ecmsale_id}">{$ecmsale_name}</a>',
),
),
array('register_date','payment_date'),
array(array('name'=>'ecmvat_name','label'=>'Stawka Vat'),'ecmpaymentcondition_name'),
array('description',''),
array(
array(
'label'=>'LBL_OTHER_ECMPRAPAYMENTINVOICES',
'customCode'=>'{$other_ecmprepaymentinvoices}'
),
array(
'label'=>'LBL_OTHER_ECMPRAPAYMENTINVOICES_SUM',
'customCode'=>'{$other_ecmprepayment_invoices_sum}',
),
),
array(
array(
'name' => 'to_informations',
'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_contact_name',
'tabIndex' => '1',
),
array(
'name' => 'ecmlanguage',
'tabIndex' => '1',
)
),
array (
array(
'name' => 'parent_address_street',
'tabIndex' => '1',
'customCode' => '{$fields.parent_address_street.value}',
),
array(
'name' => 'to_vatid',
'tabIndex' => '1',
),
),
array (
array(
'name' => 'parent_address_city',
'tabIndex' => '1',
'customCode' => '{$fields.parent_address_postalcode.value} {$fields.parent_address_city.value}'
),
),
array (
array(
'name' => 'parent_address_country',
'tabIndex' => '1',
),
),
),
'LBL_ITEMS_TAB'=> array(
array(
array(
'name' => 'items_list_panel',
'allCols' => true,
'hideLabel' => true,
'customCode' => '
'
// .'{literal}'.
// '<script language="javascript">var parent_options='.$json->encode($app_list_strings['ecmworkitems_parent_dom']).';</script>'
// .'{/literal}'.
.'
<link rel="stylesheet" type="text/css" href="modules/EcmInvoiceOuts/MyTable.css" />
<link rel="stylesheet" type="text/css" href="modules/EcmInvoiceOuts/AjaxSearch/AjaxSearch.css" />
<div style="width:100%;border: 1px solid rgb(48,192,255);background-color:white;height:{$OPT.position_table_height}px;max-height:{$OPT.position_table_height}px;overflow:auto;" id="itemsTableDIV">
<table class="positions" style="width:100%;" id="itemsTable">
<thead id="head">
<tr id="tr">
<td width="10%">{$MOD.LBL_EDITTABLE_CODE}</td>
<td width="37%">{$MOD.LBL_EDITTABLE_NAME}</td>
</tr>
</thead>
<tbody id="tbody">
</tbody>
</table>
</div>
',
)
),
),
/*
'LBL_PREVIEW_TAB'=> array(
array(
array(
'name' => 'preview_panel',
'allCols' => true,
'hideLabel' => true,
'customCode' => '<span id="previewPDF" width="100%" height="100%"></span>'
),
),
), */
)
);
?>

View 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".
********************************************************************************/
$viewdefs['EcmPrepaymentInvoices']['EditView'] = array(
'templateMeta'=>array(
'form' => array(
'buttons'=>array(
array('customCode' => '<input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="button" onclick="return SaveForm();" type="button" name="button" value="{$APP.LBL_SAVE_BUTTON_LABEL}">'),
'CANCEL'
),
'hidden' => array (
'<input type="hidden" name="position_list" id="position_list" value=\'{$POSITION_LIST}\'>',
),
),
'maxColumns'=>'2',
'widths'=>array(
array('label'=>'10','field'=>'30'),
array('label'=>'10','field'=>'30'),
),
'includes' => array(
array('file'=>'include/JSON.js'),
array('file'=>'include/javascript/quicksearch.js'),
array('file'=>'modules/EcmPrepaymentInvoices/EcmPrepaymentInvoices.js'),
array('file'=>'modules/EcmInvoiceOuts/MyTable.js'),
array('file'=>'modules/EcmInvoiceOuts/formloader.js'),
array('file'=>'modules/EcmProducts/mintajax.js'),
array('file'=>'modules/EcmProducts/helper.js'),
),
),
'panels'=>array(
'default'=>array(
array(
array(
'name' => 'document_no',
'tabIndex' => 'f',
'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}\'>'
),
'assigned_user_name'
),
array('parent_name',
array(
'name' => 'template_name',
'label'=>'LBL_TEMPLATE_NAME',
'customCode'=>'<select id="template_id" name="template_id" onChange="document.getElementById(\'template_name\').value=this.options[this.selectedIndex].text;">{$DOCUMENT_TEMPLATES_OPTIONS}</select><input type="hidden" id="template_name" name="template_name" value="{$fields.template_name.value}">'
),
),
array(
array('name'=>'currency_id','label'=>'LBL_CURRENCY'),
array('name'=>'currency_value_nbp','label'=>'Kurs NBP'),
),
array(
array(
'name'=>'inv_value',
'label'=>'LBL_VALUE',
),
array(
'label'=>'Zamówienie',
'customCode'=>'<input type="hidden" name="ecmsale_id" value="{$ecmsale_id}"><a href="index.php?module=EcmSales&action=DetailView&record={$ecmsale_id}">{$ecmsale_name}</a>',
),
),
array('register_date','payment_date'),
array(
array(
'name' => 'ecmvat_name',
'label'=>'LBL_ECMVAT_NAME',
'customCode'=>'<select id="ecmvat_id" name="ecmvat_id" onChange="document.getElementById(\'ecmvat_name\').value=this.options[this.selectedIndex].text;">{$ECMVATS_OPTIONS}</select><input id="ecmvat_name" name="ecmvat_name" type="hidden"/>'
),
'ecmpaymentcondition_name'),
array(
array(
'name' => 'description',
),
),
array(
array(
'name' => 'to_informations',
'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_contact_name',
'tabIndex' => '1',
),
array(
'name' => 'ecmlanguage',
'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(
'name' => 'to_vatid',
'tabIndex' => '1',
),
),
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;" />&nbsp;&nbsp;<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',
),
),
),
'LBL_ITEMS_TAB'=> array(
array(
array(
'name' => 'items_list_panel',
'allCols' => true,
'hideLabel' => true,
'customCode' => '
'
// .'{literal}'.
// '<script language="javascript">var parent_options='.$json->encode($app_list_strings['ecmworkitems_parent_dom']).';</script>'
// .'{/literal}'.
.'
<link rel="stylesheet" type="text/css" href="modules/EcmInvoiceOuts/MyTable.css" />
<link rel="stylesheet" type="text/css" href="modules/EcmInvoiceOuts/AjaxSearch/AjaxSearch.css" />
<div style="width:100%;border: 1px solid rgb(48,192,255);background-color:white;height:{$OPT.position_table_height}px;max-height:{$OPT.position_table_height}px;overflow:auto;" id="itemsTableDIV">
<table class="positions" style="width:100%;" id="itemsTable">
<thead id="head">
<tr id="tr">
<td width="4%">{$MOD.LBL_EDITTABLE_NO}</td>
<td width="10%">{$MOD.LBL_EDITTABLE_CODE}</td>
<td width="37%">{$MOD.LBL_EDITTABLE_NAME}</td>
</tr>
</thead>
<tbody id="tbody">
</tbody>
</table>
</div>
',
)
),
),
),
);
?>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,42 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/**
* Layout definition for EcmPrepaymentInvoices
*
* 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['EcmPrepaymentInvoices']['subpanel_setup'] = array(
);
?>

View File

@@ -0,0 +1,91 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/**
* Subpanel Layout definition for EcmPrepaymentInvoices
*
* 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' => 'EcmPrepaymentInvoices'),
),
'where' => '',
'list_fields' => array(
'ecmprepaymentinvoice_number'=>array(
'vname' => 'LBL_LIST_NUMBER',
'width' => '5%',
),
'name'=>array(
'vname' => 'LBL_LIST_SUBJECT',
'widget_class' => 'SubPanelDetailViewLink',
'width' => '50%',
),
'status'=>array(
'vname' => 'LBL_LIST_STATUS',
'width' => '15%',
),
'type'=>array(
'vname' => 'LBL_LIST_TYPE',
'width' => '15%',
),
'priority'=>array(
'vname' => 'LBL_LIST_PRIORITY',
'width' => '11%',
),
'assigned_user_name' => array (
'name' => 'assigned_user_name',
'vname' => 'LBL_LIST_ASSIGNED_TO_NAME',
),
'edit_button'=>array(
'widget_class' => 'SubPanelEditButton',
'module' => 'EcmPrepaymentInvoices',
'width' => '4%',
),
'remove_button'=>array(
'widget_class' => 'SubPanelRemoveButton',
'module' => 'EcmPrepaymentInvoices',
'width' => '5%',
),
),
);
?>

View File

@@ -0,0 +1,91 @@
<?php
error_reporting(E_PARSE | E_WARNING);
$json = getJSONobj();
$pll = array(); $i=0; while(isset($_POST['p_'.$i])) { $pll[] = $json->decode(htmlspecialchars_decode($_POST['p_'.$i])); $_POST['p_'.$i] = ''; $i++;}
$_POST = $json->decode(htmlspecialchars_decode($_POST['otherFormData']));
$_POST['position_list'] = $pll;
if(isset($_REQUEST['record']) && $_REQUEST['record'] != '' && $_REQUEST['cache'] != "fromJava") {
require_once("modules/EcmPrepaymentInvoices/EcmPrepaymentInvoice.php");
$focus = new EcmPrepaymentInvoice();
$method = (isset($_REQUEST['method']) && $_REQUEST['method'] != '') ? $_REQUEST['method'] : 'D';
$focus->getPDF($_REQUEST['record'],$method);
} else
if($_REQUEST['cache'] == "fromJava" && $_GET['from']!="EcmPrepaymentInvoices") {
$_SESSION['PDF_ECMINVOICEOUTS'] = $_POST;
} else
if($_GET['from']=="EcmPrepaymentInvoices") {
require_once("modules/EcmPrepaymentInvoices/EcmPrepaymentInvoice.php");
$focus = new EcmPrepaymentInvoice();
if(isset($_SESSION['PDF_ECMINVOICEOUTS']['record']) && $_SESSION['PDF_ECMINVOICEOUTS']['record'] != '') {
$focus->retrieve($_SESSION['PDF_ECMINVOICEOUTS']['record']);
}
if(!$focus->ACLAccess('Save')){
ACLController::displayNoAccess(true);
sugar_cleanup(true);
}
foreach($focus->column_fields as $field){
if(isset($_SESSION['PDF_ECMINVOICEOUTS'][$field])){
$value = $_SESSION['PDF_ECMINVOICEOUTS'][$field];
$focus->$field = $value;
}
}
foreach($focus->additional_column_fields as $field){
if(isset($_SESSION['PDF_ECMINVOICEOUTS'][$field])){
$value = $_SESSION['PDF_ECMINVOICEOUTS'][$field];
$focus->$field = $value;
}
}
if(isset($_SESSION['PDF_ECMINVOICEOUTS']['to_is_vat_free']) && $_SESSION['PDF_ECMINVOICEOUTS']['to_is_vat_free']) $focus->to_is_vat_free = 1; else $focus->to_is_vat_free = 0;
$json = getJSONobj();
$pl = $_SESSION['PDF_ECMINVOICEOUTS']['position_list'];
$focus->position_list = $pl;
$focus->document_no = $_SESSION['PDF_ECMINVOICEOUTS']['document_no'];
$focus->wz_id=$_SESSION['PDF_ECMINVOICEOUTS']['out_id'];
//$focus->ecmpaymentcondition_text = EcmPrepaymentInvoice::getTranslation('EcmPaymentConditions',$focus->ecmpaymentcondition_id,$focus->ecmlanguage);
//die();
$focus->getPDF();
}
?>

View File

@@ -0,0 +1,388 @@
<?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
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$dictionary['EcmPrepaymentInvoice']=array(
'table'=>'ecmprepaymentinvoices',
'audited'=>true,
'comment'=>'EcmPrepaymentInvoices',
'duplicate_merge'=>true ,
'unified_search'=>true,
'fields'=>array(
'document_no' => array(
'name' => 'document_no',
'vname' => 'LBL_DOCUMENT_NO',
'type' => 'varchar',
'required_option' => true,
'unified_search' => true,
'required' => true,
'len' => '30',
),
'template_id' =>
array (
'name' => 'template_id',
'vname' => 'LBL_TEMPLATE_ID',
'type' => 'id',
'required_option' => true,
'required' => true,
),
'template_name' =>
array (
'name' => 'template_name',
'vname' => 'LBL_TEMPLATE_NAME',
'type' => 'varchar',
'len' => '100',
'required_option' => true,
'unified_search' => true,
'required' => true,
),
'ecmvat_id' =>
array (
'name' => 'ecmvat_id',
'vname' => 'LBL_ECMVAT_ID',
'type' => 'id',
'required_option' => true,
'required' => true,
),
'ecmvat_name' =>
array (
'name' => 'ecmvat_name',
'vname' => 'LBL_ECMVAT_NAME',
'type' => 'varchar',
'len' => '100',
'required_option' => true,
'unified_search' => true,
'required' => true,
),
'ecmvat_value' =>
array (
'name' => 'ecmvat_value',
'vname' => 'LBL_ECMVAT_VALUE',
'type' => 'decimal',
'len' => '10,4',
'required_option' => false,
'unified_search' => true,
'required' => false,
),
'currency_id' =>
array (
'name' => 'currency_id',
'type' => 'enum',
'options' => 'currency_dom',
'label' => 'LBL_CURRENCY',
'required' => true,
),
'currency_value' =>
array (
'name' => 'currency_value',
'type' => 'decimal',
'len' => '10,4',
'label' => 'LBL_CURRENCY_VALUE',
),
'currency_value_nbp' =>
array (
'name' => 'currency_value_nbp',
'type' => 'decimal',
'len' => '10,4',
'label' => 'LBL_CURRENCY_VALUE_NBP',
),
'products_on_pdf' => array (
'name' => 'products_on_pdf',
'type' => 'text',
),
'other_ecmprepaymentinvoices' =>
array (
'name' => 'other_ecmprepaymentinvoices',
'vname' => 'LBL_OTHER_ECMPRAPAYMENTINVOICES',
'type' => 'varchar',
'source' => 'non-db',
),
'other_ecmprepaymentinvoices_sum' =>
array (
'name' => 'other_ecmprepaymentinvoices',
'vname' => 'LBL_OTHER_ECMPRAPAYMENTINVOICES_SUM',
'type' => 'decimal',
'len' => '10,2',
'source' => 'non-db',
),
'register_date' => array (
'name' => 'register_date',
'vname' => 'LBL_REGISTER_DATE',
'type' => 'date',
'reportable' => false,
'showFormats' => true,
'massupdate' => false,
'required' => true,
),
'payment_date' => array (
'name' => 'payment_date',
'vname' => 'LBL_PAYMENT_DATE',
'type' => 'date',
'reportable' => false,
'showFormats' => true,
'massupdate' => false,
'required' => true,
),
'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,
),
'ecmpaymentcondition_text' =>
array (
'name' => 'ecmpaymentcondition_text',
'vname' => 'LBL_PAYMENTCONDITION_TEXT',
'type' => 'text',
'reportable' => false,
'module' => 'EcmPaymentConditions',
'duplicate_merge' => 'disabled',
'massupdate' => false,
),
'parent_type' => array(
'name'=>'parent_type',
'vname'=>'LBL_PARENT',
'type'=>'varchar',
'required'=>true,
'reportable'=>false,
'len'=>'25',
'comment' => 'The Sugar object to which the call is related',
'massupdate' => false,
),
'parent_name' => array(
'name'=> 'parent_name',
'parent_type'=>'ecmreceipts_parent_dom' ,
'id_name'=>'parent_id',
'vname'=>'LBL_PARENT_NAME',
'type'=>'relate',
'group'=>'parent_name',
'dbtype' => 'varchar',
'len' => '255',
'module' => 'Accounts',
'massupdate' => false,
'required' => true,
),
'parent_id' => array (
'name' => 'parent_id',
'type' => 'id',
'module' => 'Accounts',
'vname' => 'LBL_PARENT_ID',
'group'=>'parent_name',
'massupdate' => false,
'reportable'=>false,
'required' => true,
),
'parent_name_copy' => array(
'name' => 'parent_name_copy',
'vname' => 'LBL_PARENT_NAME_COPY',
'type' => 'varchar',
'source' => 'non-db',
),
'parent_contact_name' => array (
'name' => 'parent_contact_name',
'vname' => 'LBL_PARENT_CONTACT_NAME',
'type' => 'varchar',
'len' => '255',
'merge_filter' => 'enabled',
),
'parent_contact_title' => array (
'name' => 'parent_contact_title',
'vname' => 'LBL_PARENT_CONTACT_TITLE',
'type' => 'varchar',
'len' => '255',
'merge_filter' => 'enabled',
),
'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',
'required' => true,
),
'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',
'required' => true,
),
'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',
'required' => true,
),
'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',
),
'to_vatid' =>
array (
'name' => 'to_vatid',
'vname' => 'LBL_TO_NIP',
'type' => 'varchar',
'len' => 15,
'required' => true,
),
'ecmlanguage' =>
array(
'name' => 'ecmlanguage',
'vname' => 'LBL_ECMLANGUAGE',
'type' => 'enum',
'options' => 'ecmlanguages_dom',
'required' => true,
'len' => 35,
'massupdate' => false,
),
'ecmsale_id' =>
array (
'name' => 'ecmsale_id',
'type' => 'id',
'vname' => 'LBL_ECMSALE_ID',
'group'=>'ecmsale_name',
'reportable'=>false,
),
'ecmsale_name' =>
array (
'name' => 'ecmsale_name',
'rname'=>'document_no',
'dbType'=> 'varchar',
'len' => '255',
'group'=>'ecmsale_name',
'vname' => 'LBL_ECMSALE_NAME',
'reportable'=>false,
'id_name' => 'ecmsale_id',
'join_name' => 'ecmsales',
'type' => 'relate',
'module' => 'EcmSales',
'link'=>'ecmsales',
),
'inv_value' =>
array(
'name' => 'inv_value',
'type' => 'decimal',
'len' => '10,2',
),
'number' => array(
'name' => 'number',
'vname' => 'LBL_NUMBER',
'type' => 'varchar',
'required_option' => true,
'unified_search' => true,
'required' => true,
'len' => '20',
),
),
'indices'=>array(
array('name'=>'idx_ecmprepaymentinvoice_id_del','type'=>'index','fields'=>array('id','deleted')),
array('name'=>'idx_ecmprepaymentinvoice_assigned_del','type'=>'index','fields'=>array( 'deleted', 'assigned_user_id')),
),
'relationships'=>array(
'ecmprepaymentinvoices_assigned_user'=>array(
'lhs_module'=>'Users',
'lhs_table'=>'users',
'lhs_key'=>'id',
'rhs_module'=>'EcmPrepaymentInvoices',
'rhs_table'=>'ecmprepaymentinvoices',
'rhs_key'=>'assigned_user_id',
'relationship_type'=>'one-to-many'
),
'ecmprepaymentinvoices_modified_user'=>array(
'lhs_module'=>'Users',
'lhs_table'=>'users',
'lhs_key'=>'id',
'rhs_module'=>'EcmPrepaymentInvoices',
'rhs_table'=>'ecmprepaymentinvoices',
'rhs_key'=>'modified_user_id',
'relationship_type'=>'one-to-many'
),
'ecmprepaymentinvoices_created_by'=>array(
'lhs_module'=>'Users',
'lhs_table'=>'users',
'lhs_key'=>'id',
'rhs_module'=>'EcmPrepaymentInvoices',
'rhs_table'=>'ecmprepaymentinvoices',
'rhs_key'=>'created_by',
'relationship_type'=>'one-to-many'
)
),
'optimistic_locking'=>true,
);
require_once('include/SugarObjects/VardefManager.php');
VardefManager::createVardef('EcmPrepaymentInvoices','EcmPrepaymentInvoice', array('default','assignable'));
?>

View File

@@ -0,0 +1,100 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 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/MVC/View/views/view.detail.php');
class EcmPrepaymentInvoicesViewDetail extends ViewDetail {
function EcmPrepaymentInvoicesViewDetail(){
parent::ViewDetail();
}
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, 'include/ECM/EcmViews/DetailView/Tabs/DetailView.tpl');
}
function display(){
global $db;
if(empty($this->bean->id)){
global $app_strings;
sugar_die($app_strings['ERROR_NO_RECORD']);
}
$arr=array("parent_contact_name","to_nip","currency_id","template_id","parent_id","parent_name","parent_type","parent_address_street","parent_address_postalcode","parent_address_city","parent_address_country","total");
include_once("modules/EcmSales/EcmSale.php");
$sale=new EcmSale();
$sale->retrieve($this->bean->ecmsale_id);
foreach($arr as $a)$this->bean->$a=$sale->$a;
$this->ss->assign("ecmsale_id", $this->bean->ecmsale_id);
$this->ss->assign("ecmsale_name", $sale->document_no);
$this->dv->process();
global $mod_strings;
echo $this->dv->display();
}
}
?>

View File

@@ -0,0 +1,89 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 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 EcmPrepaymentInvoices module.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
require_once('include/MVC/View/views/view.edit.php');
class EcmPrepaymentInvoicesViewEdit extends ViewEdit {
function EcmPrepaymentInvoicesViewEdit(){
parent::ViewEdit();
}
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, 'include/ECM/EcmViews/EditView/Tabs/EditView.tpl');
}
function display() {
parent::display();
}
}
?>