first commit
This commit is contained in:
@@ -0,0 +1,320 @@
|
||||
<?php echo form_tag('stDeliveryBackend/saveConfig', array('name'=>'config')) ?>
|
||||
|
||||
<fieldset>
|
||||
|
||||
<?php $error_time_h_limit = form_error('dateTime{time_h_limit}'); ?>
|
||||
<?php $error_time_m_limit = form_error('dateTime{time_m_limit}'); ?>
|
||||
<?php $error_time_h_from = form_error('dateTime{time_h_from}'); ?>
|
||||
<?php $error_time_m_from = form_error('dateTime{time_m_from}'); ?>
|
||||
<?php $error_time_h_to = form_error('dateTime{time_h_to}'); ?>
|
||||
<?php $error_time_m_to = form_error('dateTime{time_m_to}'); ?>
|
||||
<?php $error_time_h_def = form_error('dateTime{time_h_def}'); ?>
|
||||
<?php $error_time_m_def = form_error('dateTime{time_m_def}'); ?>
|
||||
|
||||
<?php $error_array1_from = form_error('dateTime{array1_from}'); ?>
|
||||
<?php $error_array1_to = form_error('dateTime{array1_to}'); ?>
|
||||
<?php $error_array2_from = form_error('dateTime{array2_from}'); ?>
|
||||
<?php $error_array2_to = form_error('dateTime{array2_to}'); ?>
|
||||
<?php $error_array3_from = form_error('dateTime{array3_from}'); ?>
|
||||
<?php $error_array3_to = form_error('dateTime{array3_to}'); ?>
|
||||
<?php $error_array4_from = form_error('dateTime{array4_from}'); ?>
|
||||
<?php $error_array4_to = form_error('dateTime{array4_to}'); ?>
|
||||
<?php $error_array5_from = form_error('dateTime{array5_from}'); ?>
|
||||
<?php $error_array5_to = form_error('dateTime{array5_to}'); ?>
|
||||
<?php $error_array6_from = form_error('dateTime{array6_from}'); ?>
|
||||
<?php $error_array6_to = form_error('dateTime{array6_to}'); ?>
|
||||
|
||||
<?php $error_min = form_error('dateTime{min}'); ?>
|
||||
<?php $error_max = form_error('dateTime{max}'); ?>
|
||||
|
||||
<div class="st_header"><div><h2><?php echo __('Konfiguracja daty dostawy') ?> </h2></div></div>
|
||||
<div class="st_fieldset-content">
|
||||
|
||||
<div class="form-row">
|
||||
<label><?php echo __('Włącz określenie daty dostawy') ?>:</label>
|
||||
<div class="content">
|
||||
<?php echo checkbox_tag('dateTime[date_on]',true,$config->get('date_on')) ?>
|
||||
<br class="st_clear_all">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<label><?php echo __('Dostawa najwcześniej po [ilość dni]') ?>:</label>
|
||||
<div class="content time">
|
||||
<span style="color:red;">
|
||||
<?php echo $error_min;?>
|
||||
</span>
|
||||
<?php echo input_tag('dateTime[min]', $config->get('min'), $config->get('min'), _parse_attributes(array('maxlength'=>'255' ,'class'=>form_has_error('dateTime{min}') ? 'st_form-error' : ''))) ?>
|
||||
<br class="st_clear_all">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<label><?php echo __('Zamówienia przyjmowane do godziny') ?>:</label>
|
||||
<div class="content time">
|
||||
<span style="color:red;">
|
||||
<?php echo $error_time_h_limit;?>
|
||||
<?php echo $error_time_m_limit; ?>
|
||||
</span>
|
||||
<?php echo input_tag('dateTime[time_h_limit]', $config->get('time_h_limit'), $config->get('time_h_limit'), array('maxlength'=>'255')) ?>:
|
||||
<?php echo input_tag('dateTime[time_m_limit]', $config->get('time_m_limit'), $config->get('time_m_limit'), array('maxlength'=>'255')) ?>
|
||||
<br class="st_clear_all">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<label><?php echo __('Dostawa najpóźniej do [ilość dni]') ?>:</label>
|
||||
<div class="content time">
|
||||
<span style="color:red;">
|
||||
<?php echo $error_max;?>
|
||||
</span>
|
||||
<?php echo input_tag('dateTime[max]', $config->get('max'), $config->get('max'), array('maxlength'=>'255')) ?>
|
||||
<br class="st_clear_all">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<div class="st_header"><div><h2><?php echo __('Wyłączone daty z dostawy') ?> </h2></div></div>
|
||||
<div class="st_fieldset-content">
|
||||
|
||||
<div class="form-row">
|
||||
<label><?php echo __('Wyłącz weekendy') ?>:</label>
|
||||
<div class="content">
|
||||
<?php echo checkbox_tag('dateTime[weekends_on]',true,$config->get('weekends_on')) ?>
|
||||
<br class="st_clear_all">
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
||||
function clearInput(id)
|
||||
{
|
||||
document.getElementById(id).value='';
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="form-row">
|
||||
<label><?php echo __('Wyłącz przedział') ?>:</label>
|
||||
<div class="content">
|
||||
<span style="color:red;">
|
||||
<?php echo $error_array1_from; ?>
|
||||
<?php echo $error_array1_to; ?>
|
||||
</span>
|
||||
<?php echo __('od') .": ". input_date_tag('dateTime[array1_from]', $config->get('array1_from'), _parse_attributes(array (
|
||||
'rich' => true,
|
||||
'withtime' => false,
|
||||
'culture' => 'pl',
|
||||
'calendar_button_img' => '/sf/sf_admin/images/date.png',
|
||||
'readonly' => 'readonly',
|
||||
'size' => 8,
|
||||
))); ?><img style="vertical-align:middle;cursor:pointer;" onclick="clearInput('dateTime_array1_from');" src="/images/backend/icons/delete.gif" title="<?php echo __('wyczyść') ?>" alt="<?php echo __('wyczyść') ?>"> <?php echo __('do').": ". input_date_tag('dateTime[array1_to]', $config->get('array1_to'), _parse_attributes(array (
|
||||
'rich' => true,
|
||||
'withtime' => false,
|
||||
'culture' => 'pl',
|
||||
'calendar_button_img' => '/sf/sf_admin/images/date.png',
|
||||
'readonly' => 'readonly',
|
||||
'size' => 8,
|
||||
))) ?><img style="vertical-align:middle;cursor:pointer;" onclick="clearInput('dateTime_array1_to');" src="/images/backend/icons/delete.gif" title="<?php echo __('wyczyść') ?>" alt="<?php echo __('wyczyść') ?>">
|
||||
<br class="st_clear_all">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<label><?php echo __('Wyłącz przedział') ?>:</label>
|
||||
<div class="content">
|
||||
<span style="color:red;">
|
||||
<?php echo $error_array2_from; ?>
|
||||
<?php echo $error_array2_to; ?>
|
||||
</span>
|
||||
<?php echo __('od') .": ". input_date_tag('dateTime[array2_from]', $config->get('array2_from'), _parse_attributes(array (
|
||||
'rich' => true,
|
||||
'withtime' => false,
|
||||
'culture' => 'pl',
|
||||
'calendar_button_img' => '/sf/sf_admin/images/date.png',
|
||||
'readonly' => 'readonly',
|
||||
'size' => 8,
|
||||
))); ?><img style="vertical-align:middle;cursor:pointer;" onclick="clearInput('dateTime_array2_from');" src="/images/backend/icons/delete.gif" title="<?php echo __('wyczyść') ?>" alt="<?php echo __('wyczyść') ?>"> <?php echo __('do').": ". input_date_tag('dateTime[array2_to]', $config->get('array2_to'), _parse_attributes(array (
|
||||
'rich' => true,
|
||||
'withtime' => false,
|
||||
'culture' => 'pl',
|
||||
'calendar_button_img' => '/sf/sf_admin/images/date.png',
|
||||
'readonly' => 'readonly',
|
||||
'size' => 8,
|
||||
))) ?><img style="vertical-align:middle;cursor:pointer;" onclick="clearInput('dateTime_array2_to');" src="/images/backend/icons/delete.gif" title="<?php echo __('wyczyść') ?>" alt="<?php echo __('wyczyść') ?>">
|
||||
<br class="st_clear_all">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<label><?php echo __('Wyłącz przedział') ?>:</label>
|
||||
<div class="content">
|
||||
<span style="color:red;">
|
||||
<?php echo $error_array3_from; ?>
|
||||
<?php echo $error_array3_to; ?>
|
||||
</span>
|
||||
<?php echo __('od') .": ". input_date_tag('dateTime[array3_from]', $config->get('array3_from'), _parse_attributes(array (
|
||||
'rich' => true,
|
||||
'withtime' => false,
|
||||
'culture' => 'pl',
|
||||
'calendar_button_img' => '/sf/sf_admin/images/date.png',
|
||||
'readonly' => 'readonly',
|
||||
'size' => 8,
|
||||
))); ?><img style="vertical-align:middle;cursor:pointer;" onclick="clearInput('dateTime_array3_from');" src="/images/backend/icons/delete.gif" title="<?php echo __('wyczyść') ?>" alt="<?php echo __('wyczyść') ?>"> <?php echo __('do').": ". input_date_tag('dateTime[array3_to]', $config->get('array3_to'), _parse_attributes(array (
|
||||
'rich' => true,
|
||||
'withtime' => false,
|
||||
'culture' => 'pl',
|
||||
'calendar_button_img' => '/sf/sf_admin/images/date.png',
|
||||
'readonly' => 'readonly',
|
||||
'size' => 8,
|
||||
))) ?><img style="vertical-align:middle;cursor:pointer;" onclick="clearInput('dateTime_array3_to');" src="/images/backend/icons/delete.gif" title="<?php echo __('wyczyść') ?>" alt="<?php echo __('wyczyść') ?>">
|
||||
<br class="st_clear_all">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<label><?php echo __('Wyłącz przedział') ?>:</label>
|
||||
<div class="content">
|
||||
<span style="color:red;">
|
||||
<?php echo $error_array4_from; ?>
|
||||
<?php echo $error_array4_to; ?>
|
||||
</span>
|
||||
<?php echo __('od') .": ". input_date_tag('dateTime[array4_from]', $config->get('array4_from'), _parse_attributes(array (
|
||||
'rich' => true,
|
||||
'withtime' => false,
|
||||
'culture' => 'pl',
|
||||
'calendar_button_img' => '/sf/sf_admin/images/date.png',
|
||||
'readonly' => 'readonly',
|
||||
'size' => 8,
|
||||
))); ?><img style="vertical-align:middle;cursor:pointer;" onclick="clearInput('dateTime_array4_from');" src="/images/backend/icons/delete.gif" title="<?php echo __('wyczyść') ?>" alt="<?php echo __('wyczyść') ?>"> <?php echo __('do').": ". input_date_tag('dateTime[array4_to]', $config->get('array4_to'), _parse_attributes(array (
|
||||
'rich' => true,
|
||||
'withtime' => false,
|
||||
'culture' => 'pl',
|
||||
'calendar_button_img' => '/sf/sf_admin/images/date.png',
|
||||
'readonly' => 'readonly',
|
||||
'size' => 8,
|
||||
))) ?><img style="vertical-align:middle;cursor:pointer;" onclick="clearInput('dateTime_array4_to');" src="/images/backend/icons/delete.gif" title="<?php echo __('wyczyść') ?>" alt="<?php echo __('wyczyść') ?>">
|
||||
<br class="st_clear_all">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<label><?php echo __('Wyłącz przedział') ?>:</label>
|
||||
<div class="content">
|
||||
<span style="color:red;">
|
||||
<?php echo $error_array5_from; ?>
|
||||
<?php echo $error_array5_to; ?>
|
||||
</span>
|
||||
<?php echo __('od') .": ". input_date_tag('dateTime[array5_from]', $config->get('array5_from'), _parse_attributes(array (
|
||||
'rich' => true,
|
||||
'withtime' => false,
|
||||
'culture' => 'pl',
|
||||
'calendar_button_img' => '/sf/sf_admin/images/date.png',
|
||||
'readonly' => 'readonly',
|
||||
'size' => 8,
|
||||
))); ?><img style="vertical-align:middle;cursor:pointer;" onclick="clearInput('dateTime_array5_from');" src="/images/backend/icons/delete.gif" title="<?php echo __('wyczyść') ?>" alt="<?php echo __('wyczyść') ?>"> <?php echo __('do').": ". input_date_tag('dateTime[array5_to]', $config->get('array5_to'), _parse_attributes(array (
|
||||
'rich' => true,
|
||||
'withtime' => false,
|
||||
'culture' => 'pl',
|
||||
'calendar_button_img' => '/sf/sf_admin/images/date.png',
|
||||
'readonly' => 'readonly',
|
||||
'size' => 8,
|
||||
))) ?><img style="vertical-align:middle;cursor:pointer;" onclick="clearInput('dateTime_array5_to');" src="/images/backend/icons/delete.gif" title="<?php echo __('wyczyść') ?>" alt="<?php echo __('wyczyść') ?>">
|
||||
<br class="st_clear_all">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<label><?php echo __('Wyłącz przedział') ?>:</label>
|
||||
<div class="content">
|
||||
<span style="color:red;">
|
||||
<?php echo $error_array6_from; ?>
|
||||
<?php echo $error_array6_to; ?>
|
||||
</span>
|
||||
<?php echo __('od') .": ". input_date_tag('dateTime[array6_from]', $config->get('array6_from'), _parse_attributes(array (
|
||||
'rich' => true,
|
||||
'withtime' => false,
|
||||
'culture' => 'pl',
|
||||
'calendar_button_img' => '/sf/sf_admin/images/date.png',
|
||||
'readonly' => 'readonly',
|
||||
'size' => 8,
|
||||
))); ?><img style="vertical-align:middle;cursor:pointer;" onclick="clearInput('dateTime_array6_from');" src="/images/backend/icons/delete.gif" title="<?php echo __('wyczyść') ?>" alt="<?php echo __('wyczyść') ?>"> <?php echo __('do').": ". input_date_tag('dateTime[array6_to]', $config->get('array6_to'), _parse_attributes(array (
|
||||
'rich' => true,
|
||||
'withtime' => false,
|
||||
'culture' => 'pl',
|
||||
'calendar_button_img' => '/sf/sf_admin/images/date.png',
|
||||
'readonly' => 'readonly',
|
||||
'size' => 8,
|
||||
))) ?><img style="vertical-align:middle;cursor:pointer;" onclick="clearInput('dateTime_array6_to');" src="/images/backend/icons/delete.gif" title="<?php echo __('wyczyść') ?>" alt="<?php echo __('wyczyść') ?>">
|
||||
<br class="st_clear_all">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
|
||||
|
||||
<fieldset>
|
||||
<div class="st_header"><div><h2><?php echo __('Konfiguracja czasu dostawy') ?> </h2></div></div>
|
||||
<div class="st_fieldset-content">
|
||||
|
||||
<div class="form-row">
|
||||
<label><?php echo __('Włącz określanie czasu dostawy') ?>:</label>
|
||||
<div class="content">
|
||||
<?php echo checkbox_tag('dateTime[time_on]',true,$config->get('time_on')) ?>
|
||||
<br class="st_clear_all">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<label><?php echo __('Minimalna godzina dostawy') ?>:</label>
|
||||
<div class="content time">
|
||||
<span style="color:red;">
|
||||
<?php echo $error_time_h_from;?>
|
||||
<?php echo $error_time_m_from;?>
|
||||
</span>
|
||||
<?php echo input_tag('dateTime[time_h_from]', $config->get('time_h_from'), $config->get('time_h_from'), array('maxlength'=>'255')) ?>:
|
||||
<?php echo input_tag('dateTime[time_m_from]', $config->get('time_m_from'), $config->get('time_m_from'), array('maxlength'=>'255')) ?>
|
||||
<br class="st_clear_all">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<label><?php echo __('Maksymalna godzina dostawy') ?>:</label>
|
||||
<div class="content time">
|
||||
<span style="color:red;">
|
||||
<?php echo $error_time_h_to;?>
|
||||
<?php echo $error_time_m_to;?>
|
||||
</span>
|
||||
<?php echo input_tag('dateTime[time_h_to]', $config->get('time_h_to'), $config->get('time_h_to'), array('maxlength'=>'255')) ?>:
|
||||
<?php echo input_tag('dateTime[time_m_to]', $config->get('time_m_to'), $config->get('time_m_to'), array('maxlength'=>'255')) ?>
|
||||
<br class="st_clear_all">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<label><?php echo __('Domyślna godzina dostawy') ?>:</label>
|
||||
<div class="content time">
|
||||
<span style="color:red;">
|
||||
<?php echo $error_time_h_def;?>
|
||||
<?php echo $error_time_m_def;?>
|
||||
</span>
|
||||
<?php echo input_tag('dateTime[time_h_def]', $config->get('time_h_def'), $config->get('time_h_def'), array('maxlength'=>'255')) ?>:
|
||||
<?php echo input_tag('dateTime[time_m_def]', $config->get('time_m_def'), $config->get('time_m_def'), array('maxlength'=>'255')) ?>
|
||||
<br class="st_clear_all">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
|
||||
|
||||
<?php echo st_get_admin_actions_head() ?>
|
||||
<?php echo st_get_admin_action('save', __('Zapisz', null, 'stAdminGeneratorPlugin')) ?>
|
||||
<?php echo st_get_admin_actions_foot() ?>
|
||||
|
||||
</form>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
if ($delivery->getCountriesArea() && $delivery->getCountriesArea()->getIsActive())
|
||||
{
|
||||
|
||||
if (strlen($delivery->getCountriesArea()->getName()) > 20) {
|
||||
|
||||
echo st_truncate_text($delivery->getCountriesArea()->getName(), '20', '...');
|
||||
|
||||
} else {
|
||||
|
||||
echo $delivery->getCountriesArea()->getName();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
use_javascript('/jQueryTools/jquery/effects.core.js?version=2');
|
||||
|
||||
use_javascript('/jQueryTools/stTableRecordManager/js/script.js?version=2');
|
||||
|
||||
use_stylesheet('/jQueryTools/stTableRecordManager/css/style.css?version=2');
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
|
||||
jQuery(function($) {
|
||||
$('#st_delivery-sections').stTableRecordManager({ namespace: 'delivery[sections]', confirmMsg: '<?php echo __('Jesteś pewien?', null, 'stAdminGeneratorPlugin') ?>'});
|
||||
$('#st_delivery-sections').bind('postAdd', function(event, row, fields) {
|
||||
stPrice.addFormatBehavior(fields.from);
|
||||
stPriceTaxManagment.instance.addPriceField({price: fields.cost_netto.id, priceWithTax: fields.cost_brutto.id});
|
||||
});
|
||||
$('#delivery_section_cost_type').change(function() {
|
||||
if (this.selectedIndex > 0)
|
||||
{
|
||||
$('#st_delivery-sections').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#st_delivery-sections').hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
//]]>
|
||||
</script>
|
||||
<?php echo select_tag('delivery[section_cost_type]', options_for_select($options, $selected)) ?>
|
||||
<?php echo form_error('delivery{sections}', array('style' => 'color: #FF3333')) ?>
|
||||
<table id="st_delivery-sections" class="st_record_list st_record_manager" cellspacing="0" style="margin-top: 10px; <?php echo $delivery->getSectionCostType() ? '' : 'display: none' ?>">
|
||||
<thead>
|
||||
<tr>
|
||||
<th rowspan="2"><?php echo __('Od') ?></th>
|
||||
<th colspan="2"><?php echo __('Koszt') ?></th>
|
||||
<th rowspan="2"> </th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo __('Netto') ?></th>
|
||||
<th><?php echo __('Brutto') ?></th>
|
||||
</tr>
|
||||
<tr class="template">
|
||||
<th><?php echo input_tag('from', null, array('size' => 8, 'value' => '0')) ?></th>
|
||||
<th><?php echo input_tag('cost_netto', null, array('size' => 8, 'value' => '0.00')) ?></th>
|
||||
<th><?php echo input_tag('cost_brutto', null, array('size' => 8, 'value' => '0.00')) ?></th>
|
||||
<th class="actions">
|
||||
<?php echo link_to(st_admin_get_icon('add-circle', array('size' => 'medium')), "#", array('class' => 'create')) ?>
|
||||
<?php echo link_to(st_admin_get_icon('delete-circle', array('size' => 'medium')), "#", array('class' => 'remove')) ?>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($delivery_sections as $id => $delivery_section): $namespace = 'delivery[sections]['.$id.']'; ?>
|
||||
<?php
|
||||
$error_from = form_has_error('delivery{sections}{'.$id.'}{from}');
|
||||
$error_cost = form_has_error('delivery{sections}{'.$id.'}{cost_netto}');
|
||||
$error_cost_brutto = form_has_error('delivery{sections}{'.$id.'}{cost_brutto}');
|
||||
st_price_tax_manager_add_price_field(array(
|
||||
'price' => 'delivery_sections_'.$id.'_cost_netto',
|
||||
'priceWithTax' => 'delivery_sections_'.$id.'_cost_brutto'));
|
||||
?>
|
||||
<?php if ($error_from): ?>
|
||||
<tr class="errors"><td colspan="4"><?php echo form_error('delivery{sections}{'.$id.'}{from}', array('style' => 'color: #FF3333')) ?></td></tr>
|
||||
<?php endif; ?>
|
||||
<?php if ($error_cost): ?>
|
||||
<tr class="errors"><td colspan="4"><?php echo form_error('delivery{sections}{'.$id.'}{cost_netto}', array('style' => 'color: #FF3333')) ?></td></tr>
|
||||
<?php endif; ?>
|
||||
<?php if ($error_cost_brutto): ?>
|
||||
<tr class="errors"><td colspan="4"><?php echo form_error('delivery{sections}{'.$id.'}{cost_brutto}', array('style' => 'color: #FF3333')) ?></td></tr>
|
||||
<?php endif; ?>
|
||||
<tr>
|
||||
<td>
|
||||
<?php echo input_tag($namespace.'[from]', $delivery_section->getFrom(), array('size' => 8, 'style' => $error_from ? 'color: #FF3333' : '')) ?>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<?php echo input_tag($namespace.'[cost_netto]', $delivery_section->getCostNetto(), array('size' => 8, 'style' => $error_cost ? 'color: #FF3333' : '')) ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
echo input_tag($namespace.'[cost_brutto]', $delivery_section->getCostBrutto(), array('size' => 8, 'style' => $error_cost_brutto ? 'color: #FF3333' : ''))
|
||||
?>
|
||||
</td>
|
||||
<td class="actions">
|
||||
<?php echo link_to(st_admin_get_icon('delete-circle', array('size' => 'medium')), "#", array('class' => 'remove')) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -0,0 +1,168 @@
|
||||
<script type="text/javascript">
|
||||
jQuery(function($) {
|
||||
$('#st_delivery-payment-body').on("click", "[data-action]", function() {
|
||||
var action = $(this);
|
||||
|
||||
var tr = action.closest('tr');
|
||||
|
||||
console.log(tr);
|
||||
|
||||
if (action.data('action') == "up") {
|
||||
|
||||
var prev = tr.prevAll('.st_delivery-payment-row-enabled').first();
|
||||
|
||||
if (prev.length) {
|
||||
prev.before(tr);
|
||||
}
|
||||
} else if (action.data('action') == "down") {
|
||||
var next = tr.nextAll('.st_delivery-payment-row-enabled').first();
|
||||
|
||||
if (next.length) {
|
||||
next.after(tr);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#st_delivery-payment-body').on("change", ".cost-type", function() {
|
||||
var select = $(this);
|
||||
|
||||
var tr = select.closest("tr");
|
||||
|
||||
tr.find('.cost-netto').prop("disabled", select.val() == '%');
|
||||
// tr.find('.cost-brutto').trigger('change');
|
||||
var el = tr.find('.cost-brutto').change().get(0);
|
||||
|
||||
var event = document.createEvent("HTMLEvents");
|
||||
event.initEvent("change",true,false);
|
||||
el.dispatchEvent(event);
|
||||
});
|
||||
|
||||
$('#st_delivery-payment-body').on("change", ".cost-brutto", function() {
|
||||
var input = $(this);
|
||||
|
||||
var tr = input.closest("tr");
|
||||
|
||||
if (tr.find('.cost-type').val() == '%') {
|
||||
tr.find('.cost-netto').val(input.val());
|
||||
}
|
||||
});
|
||||
|
||||
$('#st_delivery-payment-body').on("change", ".st_delivery-payment-form-active", function() {
|
||||
var checkbox = $(this);
|
||||
|
||||
var tr = checkbox.closest("tr");
|
||||
|
||||
var elements = tr.find(":input");
|
||||
elements.not(checkbox).prop("disabled", !checkbox.prop("checked"));
|
||||
elements.filter('.cost-type').change();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php echo form_error('delivery{payments}', array('style' => 'color: #FF3333')) ?>
|
||||
<?php if (empty($payments)): ?>
|
||||
<?php echo st_link_to(__('Brak aktywnego typu płatności, przejdź do konfiguracji typów płatności'), '@stPaymentType') ?>
|
||||
<?php else: ?>
|
||||
<table class="st_record_list" cellspacing="0" width="100%" style="max-width: 850px;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th rowspan="2"><?php echo __('Aktywna') ?></th>
|
||||
<th rowspan="2"><?php echo __('Domyślna') ?></th>
|
||||
<th rowspan="2" style="width: 100%"><?php echo __('Nazwa') ?></th>
|
||||
<th colspan="3"><?php echo __('Koszt') ?></th>
|
||||
<th><?php echo __('Darmowa od') ?></th>
|
||||
<th><?php echo __('Koszt kuriera') ?></th>
|
||||
<th rowspan="2"><?php echo __('Kolejność') ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo __('Netto') ?></th>
|
||||
<th><?php echo __('Brutto') ?></th>
|
||||
<th><?php echo __('Rodzaj') ?></th>
|
||||
<th><?php echo __('Brutto') ?></th>
|
||||
<th><?php echo __('Brutto') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="st_delivery-payment-body">
|
||||
|
||||
<?php foreach ($payments as $index => $payment): ?>
|
||||
<?php
|
||||
$dhp = $payment->getDeliveryHasPaymentType();
|
||||
$active = $dhp ? $dhp->getIsActive() : false;
|
||||
$pid = $payment->getId();
|
||||
|
||||
$error_cost = form_has_error('delivery{payments}{'.$pid.'}{cost_netto}');
|
||||
$error_cost_brutto = form_has_error('delivery{payments}{'.$pid.'}{cost_brutto}');
|
||||
$error_free_from = form_has_error('delivery{payments}{'.$pid.'}{free_from}');
|
||||
st_price_tax_manager_add_price_field(array(
|
||||
'price' => 'delivery_payments_'.$pid.'_cost_netto',
|
||||
'priceWithTax' => 'delivery_payments_'.$pid.'_cost_brutto'));
|
||||
?>
|
||||
<?php if ($error_cost): ?>
|
||||
<tr><td colspan="7"><?php echo form_error('delivery{payments}{'.$pid.'}{cost_netto}', array('style' => 'color: #FF3333')) ?></td></tr>
|
||||
<?php endif; ?>
|
||||
<?php if ($error_cost_brutto): ?>
|
||||
<tr><td colspan="7"><?php echo form_error('delivery{payments}{'.$pid.'}{cost_brutto}', array('style' => 'color: #FF3333')) ?></td></tr>
|
||||
<?php endif; ?>
|
||||
<?php if ($error_free_from): ?>
|
||||
<tr><td colspan="7"><?php echo form_error('delivery{payments}{'.$pid.'}{free_from}', array('style' => 'color: #FF3333')) ?></td></tr>
|
||||
<?php endif; ?>
|
||||
<tr id="st_delivery-payment-row-<?php echo $pid ?>" class="st_delivery-payment-row-<?php echo $active ? 'enabled' : 'disabled' ?>">
|
||||
<td><?php echo st_admin_checkbox_tag('delivery[payments]['.$pid.'][is_active]', $pid, $active, array('class' => 'st_delivery-payment-form-active')) ?></td>
|
||||
<td><?php echo st_admin_radio_tag('delivery[is_default_payment]', $pid, $dhp ? $dhp->getIsDefault() : false, array('id' => 'delivery_is_default_payment_' . $pid, 'disabled' => !$active)) ?></td>
|
||||
<td style="text-align: left">
|
||||
<?php echo st_link_to($payment->getName(), 'stPaymentType/edit?id=' . $pid) ?>
|
||||
<?php if (!$payment->checkPaymentConfiguration()): ?>
|
||||
<p><b><?php echo __('Skonfiguruj płatność') ?></b></p>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo input_hidden_tag('delivery[payments]['.$pid.'][cost_netto]', $dhp ? $dhp->getCost() : '0.00', array('id' => 'delivery_payments_'.$pid.'_cost_netto_hidden')) ?>
|
||||
<?php echo input_tag('delivery[payments]['.$pid.'][cost_netto]',
|
||||
$dhp ? $dhp->getCost() : '0.00',
|
||||
array('size' => 6, 'disabled' => !$active || ($dhp && $dhp->getCostType() == '%'), 'style' => $error_cost ? 'border-color: #FF3333' : '', 'class' => 'cost-netto cost')) ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo input_hidden_tag('delivery[payments]['.$pid.'][cost_brutto]', $dhp ? $dhp->getCostBrutto() : '0.00', array('id' => 'delivery_payments_'.$pid.'_cost_brutto_hidden')) ?>
|
||||
<?php echo input_tag('delivery[payments]['.$pid.'][cost_brutto]',
|
||||
$dhp ? $dhp->getCostBrutto() : '0.00',
|
||||
array('size' => 6, 'disabled' => !$active, 'style' => $error_cost ? 'border-color: #FF3333' : '', 'class' => 'cost-brutto cost')) ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo select_tag('delivery[payments]['.$pid.'][cost_type]', options_for_select(array('P' => stCurrency::getDefault()->getShortcut(), '%' => '%'), $dhp ? $dhp->getCostType() : null), array('class' => 'cost-type')) ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo input_hidden_tag('delivery[payments]['.$pid.'][free_from]', $dhp ? $dhp->getFreeFrom() : '0.00', array('id' => 'delivery_payments_'.$pid.'_free_from_hidden')) ?>
|
||||
<?php echo input_tag('delivery[payments]['.$pid.'][free_from]',
|
||||
$dhp ? $dhp->getFreeFrom() : '0.00',
|
||||
array('size' => 8, 'disabled' => !$active, 'style' => $error_free_from ? 'border-color: #FF3333' : '')) ?>
|
||||
<?php echo st_price_add_format_behavior('delivery_payments_'.$pid.'_free_from') ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo input_hidden_tag('delivery[payments]['.$pid.'][courier_cost]', $dhp ? $dhp->getCourierCost() : '0.00', array('id' => 'delivery_payments_'.$pid.'_courier_cost_hidden')) ?>
|
||||
<?php echo input_tag('delivery[payments]['.$pid.'][courier_cost]',
|
||||
$dhp ? $dhp->getCourierCost(): '0.00',
|
||||
array('size' => 8, 'disabled' => !$active, 'style' => $error_free_from ? 'border-color: #FF3333' : '')) ?>
|
||||
<?php echo st_price_add_format_behavior('delivery_payments_'.$pid.'_courier_cost') ?>
|
||||
</td>
|
||||
<td>
|
||||
<div id="st_delivery-payment-row-<?php echo $pid ?>-control" style="display: <?php echo $active ? 'block' : 'none' ?>">
|
||||
<?php if ($form_has_errors): ?>
|
||||
<?php echo st_admin_get_icon('collapse') ?>
|
||||
<?php echo st_admin_get_icon('expand') ?>
|
||||
<?php else: ?>
|
||||
<a href="#" data-action="up"><?php echo st_admin_get_icon('collapse') ?></a>
|
||||
<a href="#" data-action="down"><?php echo st_admin_get_icon('expand') ?></a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php st_price_tax_manager_add_price_field(array('price' => 'delivery_payments_'.$pid.'_cost_netto', 'priceWithTax' => 'delivery_payments_'.$pid.'_cost_brutto')) ?>
|
||||
<?php endforeach ?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr><th colspan="9"><?php echo st_link_to(__('Konfiguracja płatności'), '@stPaymentType') ?></th></tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<?php endif ?>
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php echo form_error('delivery{countries_area_id}', array('style' => 'color: #FF3333')) ?>
|
||||
<?php $c = new Criteria() ?>
|
||||
<?php $c->add(CountriesAreaPeer::IS_ACTIVE, true) ?>
|
||||
<?php if (CountriesAreaPeer::doCount($c)): ?>
|
||||
<?php echo object_select_tag($delivery, 'getCountriesAreaId', array (
|
||||
'related_class' => 'CountriesArea',
|
||||
'peer_method' => 'doSelectActive',
|
||||
'control_name' => 'delivery[countries_area_id]',
|
||||
'include_custom' => __('Wybierz strefę'),
|
||||
)); ?>
|
||||
<span style="margin-left: 10px"><?php echo st_link_to(__('Konfiguracja stref'), 'stCountriesBackend/countriesAreaList') ?></span>
|
||||
<?php else: ?>
|
||||
<?php echo st_link_to(__('Brak aktywnej strefy, przejdź do konfiguracji stref'), 'stCountriesBackend/countriesAreaList') ?>
|
||||
<?php endif ?>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
use_helper('stPrice');
|
||||
|
||||
|
||||
$error_netto = form_has_error('delivery{cost_netto}');
|
||||
|
||||
$error_brutto = form_has_error('delivery{cost_brutto}');
|
||||
?>
|
||||
<table class="st_record_list" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><b><?php echo __('Netto') ?></b></th>
|
||||
<th><b><?php echo __('Brutto') ?></b></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><?php echo input_tag ('delivery[cost_netto]', st_price_format($delivery->getCostNetto()), array('size' => 8, 'style' => $error_netto ? 'border-color: #FF3333' : '')) ?></td>
|
||||
<td><?php echo input_tag ('delivery[cost_brutto]', st_price_format($delivery->getCostBrutto()), array('size' => 8, 'style' => $error_brutto ? 'border-color: #FF3333' : '')) ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
<?php echo input_hidden_tag('delivery[is_default]', $delivery->getIsDefault()) ?>
|
||||
<?php echo st_admin_checkbox_tag('delivery[is_default]', 1, $delivery->getIsDefault(), array('disabled' => $delivery->getIsDefault())) ?>
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php echo select_tag('delivery[paczkomaty_size]', options_for_select(array('A' => 'A (8 x 38 x 64 cm)', 'B' => 'B (19 x 38 x 64 cm)', 'C' => 'C (41 x 38 x 64 cm)'), $delivery->getPaczkomatySize())); ?>
|
||||
|
||||
<input name="delivery[paczkomaty_dimension]" id="delivery_paczkomaty_dimension" type="hidden" value="[<?php echo $delivery->getHeight() ?>, <?php echo $delivery->getWidth() ?>, <?php echo $delivery->getDepth() ?>]" />
|
||||
<script type="text/javascript">
|
||||
jQuery(function($) {
|
||||
var deliveries = <?php echo json_encode(DeliveryTypePeer::doSelectArrayCached()) ?>;
|
||||
var dimensions = {
|
||||
'A': [8, 38, 64],
|
||||
'B': [19, 38, 64],
|
||||
'C': [41, 38, 64]
|
||||
};
|
||||
|
||||
var delivery_width = $('#delivery_width');
|
||||
var delivery_height = $('#delivery_height');
|
||||
var delivery_depth = $('#delivery_depth');
|
||||
var paczkomaty_dimension = $('#delivery_paczkomaty_dimension');
|
||||
var paczkomaty_size = $('#delivery_paczkomaty_size');
|
||||
|
||||
paczkomaty_size.change(function() {
|
||||
var dimension = dimensions[$(this).val()];
|
||||
delivery_width.val(dimension[1]);
|
||||
delivery_height.val(dimension[0]);
|
||||
delivery_depth.val(dimension[2]);
|
||||
paczkomaty_dimension.val('['+dimension.join(', ')+']');
|
||||
});
|
||||
|
||||
$('#delivery_type_id').change(function() {
|
||||
var select = $(this);
|
||||
|
||||
if (select.val() && deliveries[select.val()].type == 'inpostp') {
|
||||
paczkomaty_size.change();
|
||||
$('.row_edit_paczkomaty').show();
|
||||
delivery_width.prop("disabled", true);
|
||||
delivery_height.prop("disabled", true);
|
||||
delivery_depth.prop("disabled", true);
|
||||
} else {
|
||||
$('.row_edit_paczkomaty').hide();
|
||||
delivery_width.prop("disabled", false);
|
||||
delivery_height.prop("disabled", false);
|
||||
delivery_depth.prop("disabled", false);
|
||||
}
|
||||
}).change();
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php use_helper('stPrice') ?>
|
||||
|
||||
<?php
|
||||
$taxes = TaxPeer::doSelect(new Criteria());
|
||||
|
||||
$tax_values = array();
|
||||
|
||||
foreach ($taxes as $tax)
|
||||
{
|
||||
$tax_values[] = $tax->getVat();
|
||||
}
|
||||
|
||||
st_price_tax_managment_init(array(
|
||||
'taxField' => 'delivery_edit_tax',
|
||||
'taxValues' => $tax_values,
|
||||
'priceFields' => array(
|
||||
array('price' => 'delivery_cost_netto', 'priceWithTax' => 'delivery_cost_brutto'),
|
||||
array('price' => 'cost_netto', 'priceWithTax' => 'cost_brutto'),
|
||||
)));
|
||||
?>
|
||||
|
||||
<?php echo select_tag('delivery[edit_tax]', options_for_select(_get_options_from_objects($taxes, 'getVatName'), $delivery->getTax()->getId())) ?>
|
||||
|
||||
|
||||
<?php //echo object_select_tag($delivery->getTax(), 'getId', array('related_class' => 'Tax','text_method' => 'getVatName', 'control_name' => 'delivery[edit_tax]')) ?>
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php use_javascript('stPrice.js') ?>
|
||||
<table class="st_record_list" cellspacing="0" id="st_delivery-visibility" width="100%" style="max-width: 850px;">
|
||||
<thead>
|
||||
<tr width="100%" style="max-width: 850px;">
|
||||
<th colspan="2"><?php echo __('Waga') ?></th>
|
||||
<th colspan="2"><?php echo __('Ilość sztuk') ?></th>
|
||||
<th colspan="2"><?php echo __('Kwota zamówienia') ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo __('Od') ?></th>
|
||||
<th><?php echo __('Do') ?></th>
|
||||
<th><?php echo __('Od') ?></th>
|
||||
<th><?php echo __('Do') ?></th>
|
||||
<th><?php echo __('Od') ?></th>
|
||||
<th><?php echo __('Do') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><?php echo input_tag('delivery[min_order_weight]', $delivery->getMinOrderWeight(), array('size' => 13, 'class' => 'float')) ?></td>
|
||||
<td><?php echo input_tag('delivery[max_order_weight]', $delivery->getMaxOrderWeight(), array('size' => 12, 'class' => 'float')) ?></td>
|
||||
<td><?php echo input_tag('delivery[min_order_quantity]', $delivery->getMinOrderQuantity(), array('size' => 13, 'class' => 'integer')) ?></td>
|
||||
<td><?php echo input_tag('delivery[max_order_quantity]', $delivery->getMaxOrderQuantity(), array('size' => 12, 'class' => 'integer')) ?></td>
|
||||
<td><?php echo input_tag('delivery[min_order_amount]', $delivery->getMinOrderAmount(), array('size' => 13, 'class' => 'float')) ?></td>
|
||||
<td><?php echo input_tag('delivery[max_order_amount]', $delivery->getMaxOrderAmount(), array('size' => 12, 'class' => 'float')) ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<script type="text/javascript">
|
||||
$$('#st_delivery-visibility input').each(function(input){
|
||||
if (input.hasClassName('float'))
|
||||
{
|
||||
input.observe('change', function() {
|
||||
this.value = stPrice.fixNumberFormat(this.value);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
input.observe('change', function() {
|
||||
this.value = stPrice.fixNumberFormat(this.value, 0);
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
use_helper('stPrice');
|
||||
$error_netto = form_has_error('delivery{express_delivery_cost_netto}');
|
||||
$error_brutto = form_has_error('delivery{express_delivery_cost_brutto}');
|
||||
/**
|
||||
* @var Delivery $delivery
|
||||
*/
|
||||
?>
|
||||
|
||||
|
||||
<table id="express_delivery_container" class="st_record_list" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><b><?php echo __('Netto') ?></b></th>
|
||||
<th><b><?php echo __('Brutto') ?></b></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<?php echo input_tag ('delivery[express_delivery_cost_netto]', st_price_format($delivery->getExpressDeliveryCostNetto()), array(
|
||||
'size' => 8,
|
||||
'style' => $error_netto ? 'border-color: #FF3333' : '',
|
||||
'disabled' => !$delivery->getIsExpressDelivery()
|
||||
)) ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo input_tag ('delivery[express_delivery_cost_brutto]', st_price_format($delivery->getExpressDeliveryCostBrutto()), array(
|
||||
'size' => 8,
|
||||
'style' => $error_brutto ? 'border-color: #FF3333' : '',
|
||||
'disabled' => !$delivery->getIsExpressDelivery()
|
||||
)) ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php st_price_tax_manager_add_price_field(array('price' => 'delivery_express_delivery_cost_netto', 'priceWithTax' => 'delivery_express_delivery_cost_brutto')); ?>
|
||||
|
||||
<script>
|
||||
jQuery(function($) {
|
||||
var container = $('#express_delivery_container');
|
||||
$('#delivery_is_express_delivery').change(function() {
|
||||
var enabled = $(this).prop('checked');
|
||||
container.find('input').add('#delivery_always_charge_express_delivery_cost').prop('disabled', !enabled);
|
||||
}).change();
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* @var Delivery $delivery
|
||||
*/
|
||||
|
||||
$expressDeliveryTimeLimit = stConfig::getInstance('stDeliveryBackend')->get('express_delivery_order_time_limit');
|
||||
|
||||
echo st_admin_optional_input($name, $delivery->getExpressDeliveryOrderTimeLimit() ? $delivery->getExpressDeliveryOrderTimeLimit() : $expressDeliveryTimeLimit, [
|
||||
'disabled' => null === $delivery->getExpressDeliveryOrderTimeLimit()
|
||||
]);
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
use_helper('stText');
|
||||
|
||||
if (strlen($delivery->getName()) > 20) {
|
||||
|
||||
echo st_truncate_text($delivery->getName(), '20', '...');
|
||||
|
||||
} else {
|
||||
|
||||
echo $delivery->getName();
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* @var Delivery $delivery
|
||||
*/
|
||||
$availability = $delivery->$method();
|
||||
|
||||
echo st_admin_table_start([
|
||||
['label' => __('Dzień')],
|
||||
['label' => __('Godzina')],
|
||||
]);
|
||||
|
||||
echo st_admin_table_body([
|
||||
'columns' => [
|
||||
st_admin_select_day_of_week_tag($name . '[day]', isset($availability['day']) ? $availability['day'] : null, [
|
||||
'include_custom' => __('Brak')
|
||||
]),
|
||||
st_admin_input_time_tag($name . '[time]', isset($availability['time']) ? $availability['time'] : null)
|
||||
]
|
||||
]);
|
||||
|
||||
echo st_admin_table_end();
|
||||
?>
|
||||
|
||||
<script>
|
||||
jQuery(function($) {
|
||||
$('#<?php echo get_id_from_name($name . '[day]') ?>').change(function() {
|
||||
$('#<?php echo get_id_from_name($name . '[time]') ?>').prop('disabled', "" === $(this).val());
|
||||
}).change();
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
use_helper('stPrice');
|
||||
$error_netto = form_has_error('delivery{weekend_delivery_cost_netto}');
|
||||
$error_brutto = form_has_error('delivery{weekend_delivery_cost_brutto}');
|
||||
/**
|
||||
* @var Delivery $delivery
|
||||
*/
|
||||
st_admin_table_start([
|
||||
['label' => __('Netto')],
|
||||
['label' => __('Brutto')],
|
||||
], ['id' => 'weekend_delivery_container']);
|
||||
|
||||
st_admin_table_body([
|
||||
'columns' => [
|
||||
input_tag ('delivery[weekend_delivery_cost_netto]', st_price_format($delivery->getWeekendDeliveryCostNetto()), array(
|
||||
'size' => 8,
|
||||
'style' => $error_netto ? 'border-color: #FF3333' : '',
|
||||
'disabled' => !$delivery->getIsWeekendDelivery()
|
||||
)),
|
||||
input_tag ('delivery[weekend_delivery_cost_brutto]', st_price_format($delivery->getWeekendDeliveryCostBrutto()), array(
|
||||
'size' => 8,
|
||||
'style' => $error_brutto ? 'border-color: #FF3333' : '',
|
||||
'disabled' => !$delivery->getIsWeekendDelivery(),
|
||||
'class' => 'weekend_delivery_field',
|
||||
))
|
||||
]
|
||||
]);
|
||||
|
||||
st_admin_table_end();
|
||||
|
||||
st_price_tax_manager_add_price_field(array('price' => 'delivery_weekend_delivery_cost_netto', 'priceWithTax' => 'delivery_weekend_delivery_cost_brutto'));
|
||||
?>
|
||||
|
||||
<script>
|
||||
jQuery(function($) {
|
||||
var container = $('#weekend_delivery_container');
|
||||
$('#delivery_is_weekend_delivery').change(function() {
|
||||
var enabled = $(this).prop('checked');
|
||||
container.find('input').add('#delivery_always_charge_weekend_delivery_cost').prop('disabled', !enabled);
|
||||
}).change();
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user