<?php

/* * *******************************************************************************
 * 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 Affero 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 Affero General Public License for more
 * details.
 *
 * You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
 *
 * In accordance with Section 7(b) of the GNU Affero 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['EcmFkVatTables']['DetailView'] = array(
    'templateMeta' => array(
        'maxColumns' => '2',
        'form' => array(
            'hidden' => array(
                '<input type="hidden" name="decree_list" id="decree_list" value="{$DECREE_LIST}"/>',
                '<input type="hidden" name="type" id="type" value=""/>',
                '<input type="hidden" name="template_id" id="template_id" value=""/>',
            ),
        ),
        'widths' => array(
            array(
                'label' => '10',
                'field' => '30',
            ),
            array(
                'label' => '10',
                'field' => '30',
            ),
        ),
        'includes' => array(
            array(
                'file' => 'include/JSON.js',
            ),
            array(
                'file' => 'modules/EcmFkVatTables/MyTable.js',
            ),
            array(
                'file' => 'modules/EcmFkVatTables/EcmFkVatRegisters.js',
            ),
            array(
                'file' => 'modules/EcmFkVatTables/EcmFkVatRegistersDetailView.js',
            ),
            // array(
                // 'file' => 'include/ECM/EcmPreviewPDF/EcmPreviewPDF.js',
            // ),
        ),
    ),
    'panels' => array(
        'LBL_DETAILS' => array(
            // 'id',
            array(
                // 'created_by_name',
                array (
                    'label' => 'LBL_CREATED_BY_NAME',
                    'customCode' => '{if $fields.created_by_name.value}{$fields.created_by_name.value}{else}-{/if}',
                ),
                // 'modified_by_name',
                array (
                    'label' => 'LBL_MODIFIED_BY_NAME',
                    'customCode' => '{if $fields.modified_by_name.value}{$fields.modified_by_name.value}{else}-{/if}',
                ),
            ),
            array(
                // 'date_entered',
                array (
                    'label' => 'LBL_DATE_ENTERED',
                    'customCode' => '{if $fields.date_entered.value}{$fields.date_entered.value}{else}nigdy{/if}',
                ),
                // 'date_modified',
                array (
                    'label' => 'LBL_DATE_MODIFIED',
                    'customCode' => '{if $fields.date_modified.value}{$fields.date_modified.value}{else}nigdy{/if}',
                ),
            ),
            array(
                'position',
                'name',
            ),
            array(
                // 'acc_wn',
                // 'acc_wn_code',
                array (
                    'label' => 'LBL_ACC_WN_CODE',
                    // 'customCode' => '{if $fields.acc_wn_code.value}{$fields.acc_wn_code.value}{else}000{/if}',
                    'customCode' => '
                    {if $fields.account_acc_wn.value}
                        Konto WN kontrahenta
                    {else}
                        {if $fields.acc_wn_code.value}
                            {$fields.acc_wn_code.value}
                        {else}
                            000
                        {/if}
                    {/if}',
                ),
                // 'acc_ma',
                // 'acc_ma_code',
                array (
                    'label' => 'LBL_ACC_MA_CODE',
                    'customCode' => '
                    {if $fields.account_acc_ma.value}
                        Konto MA kontrahenta
                    {else}
                        {if $fields.acc_ma_code.value}
                            {$fields.acc_ma_code.value}
                        {else}
                            000
                        {/if}
                    {/if}',
                ),
            ),
            /*
            array(
                // 'account_acc_wn',
                array (
                    'label' => 'LBL_ACCOUNT_ACC_WN',
                    'customCode' => '{if $fields.account_acc_wn.value}Tak{else}Nie{/if}',
                ),
                // 'account_acc_ma',
                array (
                    'label' => 'LBL_ACCOUNT_ACC_MA',
                    'customCode' => '{if $fields.account_acc_ma.value}Tak{else}Nie{/if}',
                ),
            ),
            */
            array(
                'rez',
                'vat',
            ),
            array(
                'netto',
                'type',
            ),
            array(
                // 'deleted',
                array (
                    'label' => 'LBL_DELETED',
                    'customCode' => '{if $fields.deleted.value}Tak{else}Nie{/if}',
                ),
                '',
            ),
        ),



        'LBL_DECREE' => array(
            array(
                array(
                    'name' => 'decree_panel',
                    'allCols' => true,
                    'hideLabel' => true,
                    'customCode' =>
                    '
                    <link rel="stylesheet" type="text/css" href="modules/EcmFkVatTables/MyTable.css" />
                    <!--<link rel="stylesheet" type="text/css" href="modules/EcmFkVatTables/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="decreeTableDIV">
                        <table class="positions" style="width: 100%;" id="decreeTable">
                            <thead id="head">
                                <tr id="tr">
                                    <td width="20%">{$MOD.LBL_EDITABLE_POSITION}</td>
                                    <td width="25%">{$MOD.LBL_EDITABLE_NAME}</td>
                                    <td width="25%">{$MOD.LBL_EDITABLE_WN}</td>
                                    <td width="25%">{$MOD.LBL_EDITABLE_MA}</td>
                                    <!--<td width="5%">{$MOD.LBL_EDITABLE_OPTIONS}</td>-->
                                </tr>
                            </thead>
                            <tbody id="tbody">
                            </tbody>
                        </table>
                    </div>
                    ',
                ),
            ),
        ),
        'LBL_DEFINITIONS' => array(
            array(
                'zal',
                'licz',
            ),
            array(
                'zal_wn',
                'zal_ma',
            ),
        ),

    ),
);