<?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>'

        ),

      ),

    ), */
	)   
);
?>
