fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [15187] rental: invoice simulation


From: sigurdne
Subject: [Fmsystem-commits] [15187] rental: invoice simulation
Date: Mon, 23 May 2016 10:12:05 +0000 (UTC)

Revision: 15187
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15187
Author:   sigurdne
Date:     2016-05-23 10:12:05 +0000 (Mon, 23 May 2016)
Log Message:
-----------
rental: invoice simulation

Modified Paths:
--------------
    trunk/rental/inc/class.sobilling.inc.php
    trunk/rental/inc/class.uibilling.inc.php
    trunk/rental/setup/phpgw_no.lang
    trunk/rental/templates/base/billing.xsl

Modified: trunk/rental/inc/class.sobilling.inc.php
===================================================================
--- trunk/rental/inc/class.sobilling.inc.php    2016-05-23 10:11:41 UTC (rev 
15186)
+++ trunk/rental/inc/class.sobilling.inc.php    2016-05-23 10:12:05 UTC (rev 
15187)
@@ -261,7 +261,7 @@
                        return $missing_billing_info;
                }
 
-               public function create_billing( int $decimals, int 
$contract_type, int $billing_term, int $year, int $month, $title, int 
$created_by, array $contracts_to_bill, array 
$contracts_overriding_billing_start, string $export_format, int 
$existing_billing, array $contracts_bill_only_one_time )
+               public function create_billing( int $decimals, int 
$contract_type, int $billing_term, int $year, int $month, $title, int 
$created_by, array $contracts_to_bill, array 
$contracts_overriding_billing_start, string $export_format, int 
$existing_billing, array $contracts_bill_only_one_time, bool $dry_run )
                {
                        if ($contracts_overriding_billing_start == null)
                        {
@@ -281,7 +281,10 @@
                                $billing->set_timestamp_start(time()); // Start 
of run
                                $billing->set_export_format($export_format);
                                $billing->set_title($title);
-                               $this->store($billing); // Store job as it is
+                               if(!$dry_run)
+                               {
+                                       $this->store($billing); // Store job as 
it is
+                               }
                                $billing_end_timestamp = strtotime('-1 day', 
strtotime(($month == 12 ? ($year + 1) : $year) . '-' . ($month == 12 ? '01' : 
($month + 1)) . '-01')); // Last day of billing period is the last day of the 
month we're billing
                                $counter = 0;
                                $total_sum = 0;
@@ -294,7 +297,10 @@
                        }
 
                        $billing_info = new rental_billing_info(null, 
$billing->get_id(), $contract_type, $billing_term, $year, $month);
-                       $res = 
rental_sobilling_info::get_instance()->store($billing_info);
+                       if(!$dry_run)
+                       {
+                               $res = 
rental_sobilling_info::get_instance()->store($billing_info);
+                       }
 
                        // Get the number of months in selected term for 
contract
                        $months = 
rental_socontract::get_instance()->get_months_in_term($billing_term);
@@ -303,21 +309,30 @@
                        $first_day_of_selected_month = strtotime($year . '-' . 
$month . '-01');
                        $bill_from_timestamp = strtotime('-' . ($months - 1) . 
' month', $first_day_of_selected_month);
 
+                       $invoices = array();
                        foreach ($contracts_to_bill as $contract_id) // Runs 
through all the contracts that should be billed in this run
                        {
-                               $invoice = 
rental_invoice::create_invoice($decimals, $billing->get_id(), $contract_id, 
in_array($contract_id, $contracts_overriding_billing_start) ? true : false, 
$bill_from_timestamp, $billing_end_timestamp, in_array($contract_id, 
$contracts_bill_only_one_time) ? true : false, false, $billing_term); // 
Creates an invoice of the contract
+                               $invoice = 
rental_invoice::create_invoice($decimals, $billing->get_id(), $contract_id, 
in_array($contract_id, $contracts_overriding_billing_start) ? true : false, 
$bill_from_timestamp, $billing_end_timestamp, in_array($contract_id, 
$contracts_bill_only_one_time) ? true : false, $dry_run, $billing_term); // 
Creates an invoice of the contract
                                if ($invoice != null)
                                {
                                        $total_sum += $invoice->get_total_sum();
+                                       $invoices[] = $invoice;
                                }
                        }
                        $billing->set_total_sum(round($total_sum, $decimals));
                        $billing->set_timestamp_stop(time()); //  End of run
                        $billing->set_success(true); // Billing job is a success
-                       $this->store($billing); // Store job now that we're done
+                       if(!$dry_run)
+                       {
+                               $this->store($billing); // Store job now that 
we're done
+                       }
                        // End of transaction!
                        if ($this->db->transaction_commit())
                        {
+                               if($dry_run)
+                               {
+                                       return $invoices;
+                               }
                                return $billing;
                        }
                        throw new UnexpectedValueException('Transaction 
failed.');

Modified: trunk/rental/inc/class.uibilling.inc.php
===================================================================
--- trunk/rental/inc/class.uibilling.inc.php    2016-05-23 10:11:41 UTC (rev 
15186)
+++ trunk/rental/inc/class.uibilling.inc.php    2016-05-23 10:12:05 UTC (rev 
15187)
@@ -81,8 +81,274 @@
                        $tabs['details'] = array('label' => lang('Details'), 
'link' => '#details');
                        $active_tab = 'details';
 
+                       // Step 'simulation' of the billing job
+                       if (phpgw::get_var('step') == 2  && 
phpgw::get_var('next') != null) // User clicked next on step 2
+                       {
+                               $names = 
$this->locations->get_name($contract_type);
+                               if ($names['appname'] == 
$GLOBALS['phpgw_info']['flags']['currentapp'])
+                               {
+                                       if 
(!$this->hasPermissionOn($names['location'], PHPGW_ACL_ADD))
+                                       {
+                                               phpgw::no_access();
+                                       }
+                               }
+
+                               $use_existing = phpgw::get_var('use_existing');
+                               $existing_billing = 
phpgw::get_var('existing_billing');
+                               if ($use_existing < 1)
+                               {
+                                       $existing_billing = 0;
+                               }
+                               $contract_ids = phpgw::get_var('contract'); // 
Ids of the contracts to bill
+
+                               $contract_ids_override = 
phpgw::get_var('override_start_date'); //Ids of the contracts that should 
override billing start date with first day in period
+                               $contract_bill_only_one_time = 
phpgw::get_var('bill_only_one_time');
+                               if (($contract_ids != null && 
is_array($contract_ids) && count($contract_ids) > 0) || 
(isset($contract_bill_only_one_time) && is_array($contract_bill_only_one_time) 
&& count($contract_bill_only_one_time) > 0)) // User submitted contracts to bill
+                               {
+                                       $missing_billing_info = 
rental_sobilling::get_instance()->get_missing_billing_info(phpgw::get_var('billing_term'),
 phpgw::get_var('year'), phpgw::get_var('month'), $contract_ids, 
$contract_ids_override, phpgw::get_var('export_format'));
+
+                                       if ($missing_billing_info == null || 
count($missing_billing_info) == 0)
+                                       {
+                                               $_decimal_place = 
isset($GLOBALS['phpgw_info']['user']['preferences']['rental']['currency_decimal_places'])
 ? 
isset($GLOBALS['phpgw_info']['user']['preferences']['rental']['currency_decimal_places'])
 : 2;
+                                               $invoices = 
rental_sobilling::get_instance()->create_billing(
+                                                       $_decimal_place,
+                                                       
phpgw::get_var('contract_type'),
+                                                       
phpgw::get_var('billing_term'),
+                                                       phpgw::get_var('year'),
+                                                       phpgw::get_var('month'),
+                                                       phpgw::get_var('title'),
+                                                       
$GLOBALS['phpgw_info']['user']['account_id'],
+                                                       $contract_ids,
+                                                       $contract_ids_override,
+                                                       
phpgw::get_var('export_format'),
+                                                       $existing_billing,
+                                                       
$contract_bill_only_one_time,
+                                                       $_dry_run = true
+                                               );
+                                               $simulation_data = array();
+                                               $_total_sum = 0;
+
+                                               
phpgw::import_class('rental.soparty');
+
+                                               foreach ($invoices as $invoice)
+                                               {
+                                                       $party = 
rental_soparty::get_instance()->get_single($invoice->get_party_id());
+                                                       $contract_url = '<a 
target="_blank" href="' . 
self::link(array('menuaction'=>'rental.uicontract.edit', 'id' => 
$invoice->get_contract_id())) . '">' .$invoice->get_old_contract_id() . '</a>';
+                                                       $simulation_data[] = 
array(
+                                                               
'old_contract_id' => $contract_url,
+                                                               
'composite_name' => $invoice->get_header(),
+                                                               'party_name' => 
$party->get_name(),
+                                                               'total_sum' => 
$invoice->get_total_sum(),
+                                                               'serial_number' 
=> $invoice->get_id(),
+                                                       );
+                                                       $_total_sum += 
$invoice->get_total_sum();
+                                               }
+
+                                               $datatable_def[] = array
+                                               (
+                                                       'container' => 
'datatable-container_0',
+                                                       'requestUrl' => "''",
+                                                       'data' => 
json_encode(array()),
+                                                       'ColumnDefs' => array(
+                                                               array('key' => 
'old_contract_id', 'label' => lang('contract_id'), 'className' => '',
+                                                                       
'sortable' => true, 'hidden' => false),
+                                                               array('key' => 
'composite_name', 'label' => lang('invoice_header'), 'className' => '',
+                                                                       
'sortable' => true, 'hidden' => false),
+                                                               array('key' => 
'party_name', 'label' => lang('party_name'), 'className' => '',
+                                                                       
'sortable' => true, 'hidden' => false),
+                                                               array('key' => 
'total_sum', 'label' => lang('Total sum'), 'className' => 'right',
+                                                                       
'sortable' => true, 'hidden' => false, 'formatter' => 'formatterPrice'),
+                                                               array('key' => 
'serial_number', 'label' => lang('serial_number'), 'className' => 'center',
+                                                                       
'sortable' => true, 'hidden' => false)
+                                                       ),
+                                                       'data' => 
json_encode($simulation_data),
+                                                       'config' => array(
+                                                               
array('disableFilter' => true)
+                                                       )
+                                               );
+                                               $template = 'simulation';
+
+                                               //Get year
+                                               $year = phpgw::get_var('year');
+
+                                               //Get term and month
+                                               $billing_term_tmp = 
phpgw::get_var('billing_term_selection');
+                                               $billing_term_selection = 
$billing_term_tmp;
+                                               $billing_term = 
substr($billing_term_tmp, 0, 1);
+                                               $billing_month = 
substr($billing_term_tmp, 2);
+
+                                               if ($billing_term == '1')
+                                               { // monthly
+                                                       $month = $billing_month;
+                                               }
+                                               else if ($billing_term == '4')
+                                               { // quarterly
+                                                       if ($billing_month == 
'1')
+                                                       { //1. quarter
+                                                               $month = 3;
+                                                               
$billing_term_label = lang('first_quarter');
+                                                       }
+                                                       else if ($billing_month 
== '2')
+                                                       { //2. quarter
+                                                               $month = 6;
+                                                               
$billing_term_label = lang('second_quarter');
+                                                       }
+                                                       else if ($billing_month 
== '3')
+                                                       { //3. quarter
+                                                               $month = 9;
+                                                               
$billing_term_label = lang('third_quarter');
+                                                       }
+                                                       else
+                                                       { //4. quarter
+                                                               $month = 12;
+                                                               
$billing_term_label = lang('fourth_quarter');
+                                                       }
+                                               }
+                                               else if ($billing_term == '3')
+                                               { // half year
+                                                       if ($billing_month == 
'1')
+                                                       {
+                                                               $month = 6;
+                                                               
$billing_term_label = lang('first_half');
+                                                       }
+                                                       else
+                                                       {
+                                                               $month = 12;
+                                                               
$billing_term_label = lang('second_half');
+                                                       }
+                                               }
+                                               else // yearly
+                                               {
+                                                       $month = 12;
+                                                       $billing_term_label = 
lang('annually');
+                                               }
+
+                                               //Use existing billing?
+                                               $use_existing = false;
+                                               $existing_billing = 
phpgw::get_var('existing_billing');
+                                               if ($existing_billing != 
'new_billing')
+                                               {
+                                                       $use_existing = true;
+                                               }
+
+                                               //Determine title
+                                               $title = 
phpgw::get_var('title');
+                                               if (!isset($title) || $title == 
'')
+                                               {
+                                                       $fields = 
rental_socontract::get_instance()->get_fields_of_responsibility();
+                                                       foreach ($fields as $id 
=> $label)
+                                                       {
+                                                               if ($id == 
$contract_type)
+                                                               {
+                                                                       
$description = lang($label) . ' ';
+                                                               }
+                                                       }
+                                                       $description .= 
lang('month ' . $month) . ' ';
+                                                       $description .= $year;
+                                                       $title = $description;
+                                               }
+
+                                               if ($use_existing)
+                                               {
+                                                       $billing_tmp = 
rental_sobilling::get_instance()->get_single($existing_billing);
+                                                       $title = 
$billing_tmp->get_title();
+                                               }
+
+
+                                               $fields = 
rental_socontract::get_instance()->get_fields_of_responsibility();
+                                               foreach ($fields as $id => 
$label)
+                                               {
+                                                       if ($id == 
$contract_type)
+                                                       {
+                                                               
$fields_of_responsibility_label = lang($label);
+                                                       }
+                                               }
+
+                                       // Get the number of months in selected 
term for contract
+                                               $months = 
rental_socontract::get_instance()->get_months_in_term($billing_term);
+
+                                               // The billing should start 
from the first date of the periode (term) we're billing for
+                                               $first_day_of_selected_month = 
strtotime($year . '-' . $month . '-01');
+                                               $bill_from_timestamp = 
strtotime('-' . ($months - 1) . ' month', $first_day_of_selected_month);
+                                               $billing_start = 
date($this->dateFormat, $bill_from_timestamp);
+
+                                               if ($billing_term == 1)
+                                               {
+                                                       foreach 
(rental_sobilling::get_instance()->get_billing_terms() as $term_id => 
$term_title)
+                                                       {
+                                                               if ($term_id == 
$billing_term)
+                                                               {
+                                                                       
$billing_term_label = lang($term_title);
+                                                               }
+                                                       }
+                                               }
+
+                                               $data = array
+                                                       (
+                                                       'datatable_def' => 
$datatable_def,
+                                                       'form_action' => 
$GLOBALS['phpgw']->link('/index.php', $link_add),
+                                                       'cancel_url' => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'rental.uibilling.index')),
+                                                       'contract_type' => 
$contract_type,
+                                                       'billing_start' => 
$billing_start,
+                                                       'billing_term' => 
$billing_term,
+                                                       'billing_term_label' => 
$billing_term_label,
+                                                       
'billing_term_selection' => $billing_term_selection,
+                                                       
'fields_of_responsibility_label' => $fields_of_responsibility_label,
+                                                       'year' => $year,
+                                                       'month' => $month,
+                                                       'month_label' => 
lang('month ' . $month . ' capitalized'),
+                                                       'title' => $title,
+                                                       'sum' => 
number_format($_total_sum, $this->decimalPlaces, $this->decimalSeparator, 
$this->thousandsSeparator) . ' ' . $this->currency_suffix,
+                                                       'use_existing' => 
$use_existing,
+                                                       'existing_billing' => 
$existing_billing,
+                                                       'export_format' => 
phpgw::get_var('export_format'),
+                                                       'contract_ids' => 
$contract_ids, //phpgw::get_var('contract'); // Ids of the contracts to bill
+                                                       'contract_ids_override' 
=> $contract_ids_override, //phpgw::get_var('override_start_date'); //Ids of 
the contracts that should override billing start date with first day in period
+                                                       
'contract_bill_only_one_time' => $contract_bill_only_one_time,// 
phpgw::get_var('bill_only_one_time');
+                                                       'errorMsgs' => 
$errorMsgs,
+                                                       'warningMsgs' => 
$warningMsgs,
+                                                       'infoMsgs' => $infoMsgs,
+                                                       'tabs' => 
phpgwapi_jquery::tabview_generate($tabs, $active_tab)
+                                               );
+                                               $code = <<<JS
+                                               var thousandsSeparator = 
'{$this->thousandsSeparator}';
+                                               var decimalSeparator = 
'{$this->decimalSeparator}';
+                                               var decimalPlaces = 
'{$this->decimalPlaces}';
+                                               var currency_suffix = 
'{$this->currency_suffix}';
+                                               var area_suffix = 
'{$this->area_suffix}';
+JS;
+                                               
$GLOBALS['phpgw']->js->add_code('', $code);
+                                               self::add_javascript('rental', 
'rental', 'billing.add.js');
+                                               
phpgwapi_jquery::load_widget('numberformat');
+                                               
self::render_template_xsl(array('billing', 'datatable_inline'), array($template 
=> $data));
+                                               return;
+
+
+                                       }
+                                       else // Incomplete biling info
+                                       {
+                                               foreach ($missing_billing_info 
as $contract_id => $info_array)
+                                               {
+                                                       if ($info_array != null 
&& count($info_array) > 0)
+                                                       {
+                                                               $errorMsgs[] = 
lang('Missing billing information.', $contract_id);
+                                                               foreach 
($info_array as $info)
+                                                               {
+                                                                       
$errorMsgs[] = ' - ' . lang($info);
+                                                               }
+                                                       }
+                                               }
+                                               $step = 2; // Go back to step 2
+                                       }
+                               }
+                               else
+                               {
+                                       $errorMsgs[] = lang('No contracts were 
selected.');
+                                       $step = 2; // Go back to step 2
+                               }
+                       }
                        // Step 3 - the billing job
-                       if (phpgw::get_var('step') == '2' && 
phpgw::get_var('next') != null) // User clicked next on step 2
+                       if (phpgw::get_var('step') == 'simulation' && 
phpgw::get_var('next') != null) // User clicked next on step 2
                        {
                                if ($GLOBALS['phpgw']->session->is_repost())
                                {
@@ -137,7 +403,7 @@
                                }
                        }
                        // Step 2 - list of contracts that should be billed
-                       if ($step == 2 || (phpgw::get_var('step') == '1' && 
phpgw::get_var('next') != null) || phpgw::get_var('step') == '3' && 
phpgw::get_var('previous') != null) // User clicked next on step 1 or previous 
on step 3
+                       if ($step == 2 || (phpgw::get_var('step') == '1' && 
phpgw::get_var('next') != null) || phpgw::get_var('step') == 'simulation' && 
phpgw::get_var('previous') != null) // User clicked next on step 1 or previous 
on step simulation
                        {
                                //Responsibility area
                                //$contract_type = 
phpgw::get_var('contract_type');
@@ -155,7 +421,7 @@
                                $year = phpgw::get_var('year');
 
                                //Get term and month
-                               if ($step == 2)
+                               if ($step == 2 || phpgw::get_var('step') == 
'simulation')
                                {
                                        $billing_term_tmp = 
phpgw::get_var('billing_term_selection');
                                }
@@ -710,6 +976,7 @@
                                                'type' => 'all_billings',
                                                'phpgw_return_as' => 'json'
                                        )),
+                                       'sorted_by'     => array('key' => 4, 
'dir' => 'desc'),
                                        'allrows' => true,
                                        'editor_action' => '',
                                        'field' => array(

Modified: trunk/rental/setup/phpgw_no.lang
===================================================================
--- trunk/rental/setup/phpgw_no.lang    2016-05-23 10:11:41 UTC (rev 15186)
+++ trunk/rental/setup/phpgw_no.lang    2016-05-23 10:12:05 UTC (rev 15187)
@@ -616,4 +616,5 @@
 new    rental  no      Ny
 download excel export bk       rental  no      Last ned Excel-eksport BK
 serial_number  rental  no      Serienummer
-Name or company is required    rental  no      Navn på person ELLER navn på 
foretak er obligatorisk
\ No newline at end of file
+Name or company is required    rental  no      Navn på person ELLER navn på 
foretak er obligatorisk
+simulation     rental  no      Simulering
\ No newline at end of file

Modified: trunk/rental/templates/base/billing.xsl
===================================================================
--- trunk/rental/templates/base/billing.xsl     2016-05-23 10:11:41 UTC (rev 
15186)
+++ trunk/rental/templates/base/billing.xsl     2016-05-23 10:12:05 UTC (rev 
15187)
@@ -8,6 +8,9 @@
                <xsl:when test="step2">
                        <xsl:apply-templates select="step2"/>
                </xsl:when>
+               <xsl:when test="simulation">
+                       <xsl:apply-templates select="simulation"/>
+               </xsl:when>
                <xsl:when test="view">
                        <xsl:apply-templates select="view"/>
                </xsl:when>
@@ -87,12 +90,12 @@
                <xsl:variable name="form_action">
                        <xsl:value-of select="form_action"/>
                </xsl:variable>
-               
+
                <h3>
                        <xsl:value-of select="php:function('lang', 
'invoice_run')"/>:<xsl:text> </xsl:text>
                        <xsl:value-of select="title"/>
                </h3>
-               
+
                <form id="form" name="form" method="post" 
action="{$form_action}" class="pure-form pure-form-aligned">
                        <div id="tab-content">
                                <xsl:value-of disable-output-escaping="yes" 
select="tabs"/>
@@ -155,7 +158,7 @@
                                                                        
<xsl:value-of select="php:function('lang', 'previous')"/>
                                                                </xsl:variable>
                                                                <xsl:variable 
name="next">
-                                                                       
<xsl:value-of select="php:function('lang', 'bill2')"/>
+                                                                       
<xsl:value-of select="php:function('lang', 'simulation')"/>
                                                                </xsl:variable>
                                                                <div 
class="proplist-col">
                                                                        <input 
type="submit" class="pure-button pure-button-primary" name="previous" 
value="{$previous}"/>
@@ -301,13 +304,145 @@
                                                                
</xsl:call-template>
                                                        </xsl:if>
                                                </xsl:for-each>
-                                       </div>                                  
        
+                                       </div>
                                </div>
                        </div>
                </form>
        </div>
 </xsl:template>
 
+<xsl:template xmlns:php="http://php.net/xsl"; match="simulation">
+       <div>
+               <xsl:variable name="form_action">
+                       <xsl:value-of select="form_action"/>
+               </xsl:variable>
+
+               <h3>
+                       <xsl:value-of select="php:function('lang', 
'invoice_run')"/>:<xsl:text> </xsl:text>
+                       <xsl:value-of select="title"/>
+               </h3>
+
+               <form id="form" name="form" method="post" 
action="{$form_action}" class="pure-form pure-form-aligned">
+                       <div id="tab-content">
+                               <xsl:value-of disable-output-escaping="yes" 
select="tabs"/>
+                               <div id="details">
+                                       <input type="hidden" name="step" 
value="simulation"/>
+                                       <input type="hidden" 
name="contract_type" value="{contract_type}"/>
+                                       <input type="hidden" name="year" 
value="{year}"/>
+                                       <input type="hidden" name="month" 
value="{month}"/>
+                                       <input type="hidden" name="title" 
value="{title}"/>
+                                       <input type="hidden" 
name="use_existing" value="{use_existing}"/>
+                                       <input type="hidden" 
name="existing_billing" value="{existing_billing}"/>
+                                       <input type="hidden" 
name="billing_term" value="{billing_term}"/>
+                                       <input type="hidden" 
name="billing_term_selection" value="{billing_term_selection}"/>
+                                       <input type="hidden" 
name="export_format" value="{export_format}"/>
+                                       <xsl:for-each select="contract_ids">
+                                               <input type="hidden" 
name="contract[]">
+                                                       <xsl:attribute 
name="value">
+                                                               <xsl:value-of 
select="current()"/>
+                                                       </xsl:attribute>
+                                               </input>
+                                       </xsl:for-each>
+                                       <xsl:for-each 
select="contract_ids_override">
+                                               <input type="hidden" 
name="override_start_date[]">
+                                                       <xsl:attribute 
name="value">
+                                                               <xsl:value-of 
select="current()"/>
+                                                       </xsl:attribute>
+                                               </input>
+                                       </xsl:for-each>
+                                       <xsl:for-each 
select="contract_bill_only_one_time">
+                                               <input type="hidden" 
name="bill_only_one_time[]">
+                                                       <xsl:attribute 
name="value">
+                                                               <xsl:value-of 
select="current()"/>
+                                                       </xsl:attribute>
+                                               </input>
+                                       </xsl:for-each>
+
+                                       <div class="pure-g">
+                                               <div class="pure-u-1-3">
+                                                       
<h3>Fakturakjøringsdetaljer</h3>
+                                                       <div 
class="pure-control-group">
+                                                               <label>
+                                                                       
<xsl:value-of select="php:function('lang', 'contract_type')"/>
+                                                               </label>
+                                                               <xsl:value-of 
select="fields_of_responsibility_label"/>
+                                                       </div>
+                                                       <div 
class="pure-control-group">
+                                                               <label>
+                                                                       
<xsl:value-of select="php:function('lang', 'billing_start')"/>
+                                                               </label>
+                                                               <xsl:value-of 
select="billing_start"/>
+                                                       </div>
+                                                       <div 
class="pure-control-group">
+                                                               <label>
+                                                                       
<xsl:value-of select="php:function('lang', 'year')"/>
+                                                               </label>
+                                                               <xsl:value-of 
select="year"/>
+                                                       </div>
+                                                       <div 
class="pure-control-group">
+                                                               <label>
+                                                                       
<xsl:value-of select="php:function('lang', 'Export format')"/>
+                                                               </label>
+                                                               <xsl:value-of 
select="export_format"/>
+                                                       </div>
+                                                       <xsl:if 
test="billing_term = 1">
+                                                               <div 
class="pure-control-group">
+                                                                       <label>
+                                                                               
<xsl:value-of select="php:function('lang', 'month')"/>
+                                                                       </label>
+                                                                       
<xsl:value-of select="month_label"/>
+                                                               </div>
+                                                       </xsl:if>
+                                                       <div 
class="pure-control-group">
+                                                               <label>
+                                                                       
<xsl:value-of select="php:function('lang', 'billing_term')"/>
+                                                               </label>
+                                                               <xsl:value-of 
select="billing_term_label"/>
+                                                       </div>
+                                                       <div 
class="pure-control-group">
+                                                               <label>
+                                                                       
<xsl:value-of select="php:function('lang', 'sum')"/>
+                                                               </label>
+                                                               <xsl:value-of 
select="sum"/>
+                                                       </div>
+                                                       
<h3>Fakturakjøringsvalg</h3>
+                                                       <div 
class="pure-control-group">
+                                                               <xsl:variable 
name="previous">
+                                                                       
<xsl:value-of select="php:function('lang', 'previous')"/>
+                                                               </xsl:variable>
+                                                               <xsl:variable 
name="next">
+                                                                       
<xsl:value-of select="php:function('lang', 'bill2')"/>
+                                                               </xsl:variable>
+                                                               <div 
class="proplist-col">
+                                                                       <input 
type="submit" class="pure-button pure-button-primary" name="previous" 
value="{$previous}"/>
+                                                                       <input 
type="submit" class="pure-button pure-button-primary" name="next" 
value="{$next}"/>
+                                                               </div>
+                                                       </div>
+                                               </div>
+                                       </div>
+                                       <div>
+                                               <h2>
+                                                       <xsl:value-of 
select="php:function('lang', 'simulation')"/>
+                                               </h2>
+                                               <xsl:for-each 
select="datatable_def">
+                                                       <xsl:if test="container 
= 'datatable-container_0'">
+                                                               
<xsl:call-template name="table_setup">
+                                                                       
<xsl:with-param name="container" select ='container'/>
+                                                                       
<xsl:with-param name="requestUrl" select ='requestUrl' />
+                                                                       
<xsl:with-param name="ColumnDefs" select ='ColumnDefs' />
+                                                                       
<xsl:with-param name="tabletools" select ='tabletools' />
+                                                                       
<xsl:with-param name="data" select ='data' />
+                                                                       
<xsl:with-param name="config" select ='config' />
+                                                               
</xsl:call-template>
+                                                       </xsl:if>
+                                               </xsl:for-each>
+                                       </div>
+                               </div>
+                       </div>
+               </form>
+       </div>
+</xsl:template>
+
 <!-- view  -->
 <xsl:template xmlns:php="http://php.net/xsl"; match="view">
        <div>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]