first commit
This commit is contained in:
@@ -0,0 +1 @@
|
||||
<?php echo $product->getGroupPriceId() ? st_admin_get_icon('check-circle') : '' ?>
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
use_helper('stCurrency');
|
||||
echo st_currency_select_tag('add_group_price[currency_id]', $add_group_price->getCurrencyId(), array('exclude_system_currency' => true));
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
use_helper('stPrice');
|
||||
?>
|
||||
<table class="st_record_list" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo __('Netto') ?></th>
|
||||
<th><?php echo __('Brutto') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><?php echo input_tag ('add_group_price[currency_old_price][netto]', st_price_format($add_group_price->getOldPriceNetto()), array('size' => 7)) ?></td>
|
||||
<td><?php echo input_tag ('add_group_price[currency_old_price][brutto]', st_price_format($add_group_price->getOldPriceBrutto()), array('size' => 7)) ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
use_helper('stPrice');
|
||||
?>
|
||||
<table class="st_record_list" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo __('Netto') ?></th>
|
||||
<th><?php echo __('Brutto') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><?php echo input_tag ('add_group_price[currency_price][netto]', st_price_format($add_group_price->getPriceNetto()), array('size' => 7)) ?></td>
|
||||
<td><?php echo input_tag ('add_group_price[currency_price][brutto]', st_price_format($add_group_price->getPriceBrutto()), array('size' => 7)) ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
if ($sf_request->hasParameter('update'))
|
||||
{
|
||||
st_admin_section_start();
|
||||
echo st_get_component('stGroupPriceBackend', 'productPriceUpdate', array('group' => $add_group_price));
|
||||
st_admin_section_end();
|
||||
}
|
||||
else
|
||||
{
|
||||
include st_admin_get_template_path(__FILE__);
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<?php echo select_tag('add_group_price[currency_price_type]', options_for_select(GroupPricePeer::getPriceTypes($sf_context->getI18N()), $add_group_price->getPriceType())) ?>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
sfLoader::loadHelpers(array('stProduct'), 'stProduct');
|
||||
|
||||
$cache = new stFunctionCache('stTax');
|
||||
|
||||
$tax_info = $cache->cacheCall('_object_product_tax_helper');
|
||||
|
||||
st_price_tax_managment_init(array(
|
||||
'taxField' => 'add_group_price_currency_tax_id',
|
||||
'taxValues' => $tax_info['values'],
|
||||
'priceFields' => array(
|
||||
array('price' => 'add_group_price_currency_price_netto', 'priceWithTax' => 'add_group_price_currency_price_brutto'),
|
||||
array('price' => 'add_group_price_currency_old_price_netto', 'priceWithTax' => 'add_group_price_currency_old_price_brutto'),
|
||||
|
||||
)));
|
||||
|
||||
echo select_tag('add_group_price[currency_tax_id]', options_for_select($tax_info['names'], $add_group_price->getTaxId() ? $add_group_price->getTaxId() : $tax_info['default']));
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php use_helper('stPrice') ?>
|
||||
|
||||
<?php $groups = array('a', 'b', 'c') ?>
|
||||
<table class="st_record_list" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<?php foreach ($groups as $group): ?>
|
||||
<th colspan="2"><?php echo __('Grupa %name%', array('%name%' => strtoupper($group))) ?></th>
|
||||
<?php endforeach ?>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php foreach ($groups as $group): ?>
|
||||
<th><?php echo __('Netto') ?></th>
|
||||
<th><?php echo __('Brutto') ?></th>
|
||||
<?php endforeach ?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<?php foreach ($groups as $group): $getter_netto = 'getWholesale'.ucfirst($group).'Netto'; $getter_brutto = 'getWholesale'.ucfirst($group).'Brutto'; $getter_currency = 'getCurrencyWholesale'.ucfirst($group) ?>
|
||||
<td><?php echo input_tag ('add_group_price[currency_wholesale]['.$group.'_netto]', st_price_format($add_group_price->$getter_netto()), array('size' => 7)) ?></td>
|
||||
<td><?php echo input_tag ('add_group_price[currency_wholesale]['.$group.'_brutto]', st_price_format($add_group_price->$getter_brutto()), array('size' => 7)) ?></td>
|
||||
<?php endforeach ?>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php foreach ($groups as $group): ?>
|
||||
<?php st_price_tax_manager_add_price_field(array('price' => 'add_group_price_currency_wholesale_'.$group.'_netto', 'priceWithTax' => 'add_group_price_currency_wholesale_'.$group.'_brutto')); ?>
|
||||
<?php endforeach ?>
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
if ($sf_request->hasParameter('update'))
|
||||
{
|
||||
st_admin_section_start();
|
||||
echo st_get_component('stGroupPriceBackend', 'productPriceUpdate', array('group' => $group_price));
|
||||
st_admin_section_end();
|
||||
}
|
||||
else
|
||||
{
|
||||
include st_admin_get_template_path(__FILE__);
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
echo select_tag('filters[assigned_product]', options_for_select(array(
|
||||
'' => '---',
|
||||
1 => __('tak'),
|
||||
0 => __('nie'),
|
||||
), isset($filters['assigned_product']) ? $filters['assigned_product'] : null));
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php echo select_tag('group_type', options_for_select(GroupPricePeer::getTypes($sf_context->getI18N()), null !== $value->getPriceType())); ?>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function ($)
|
||||
{
|
||||
$(document).ready(function()
|
||||
{
|
||||
$('select[name=group_type]').change(function() {
|
||||
var selected = Number($(this).val());
|
||||
|
||||
if (selected) {
|
||||
$('#sf_fieldset_ustaw_szablon_cen').addClass('hidden');
|
||||
$('#sf_fieldset_zmien_jedna_cene')
|
||||
.removeClass('hidden')
|
||||
.find('select')
|
||||
.trigger('chosen:update');
|
||||
} else {
|
||||
$('#sf_fieldset_zmien_jedna_cene').addClass('hidden');
|
||||
$('#sf_fieldset_ustaw_szablon_cen')
|
||||
.removeClass('hidden')
|
||||
.find('select')
|
||||
.trigger('chosen:update');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
use_helper('stPrice');
|
||||
echo stPrice::round($group_price->getPrice());
|
||||
?>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?php
|
||||
echo null !== $value->getPriceType() ? __('Stawka VAT produktu') : $value->getTax();
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
use_helper('stCurrency');
|
||||
/**
|
||||
* @var GroupPrice $entity
|
||||
*/
|
||||
|
||||
$title = '<div class="text-left">';
|
||||
|
||||
if ($entity->getPriceType())
|
||||
{
|
||||
$currency = $entity->getCurrency();
|
||||
|
||||
$modifier = $entity->getPriceModifier();
|
||||
$percent = substr($modifier, -1);
|
||||
|
||||
$prefix = $modifier[0] == '-' || $modifier[0] == '+' ? $modifier[0] : '';
|
||||
|
||||
$modifierFormat = $percent ? $modifier : $prefix . st_currency_format(trim($modifier, '+-'), array('currency' => $currency));
|
||||
|
||||
$types = GroupPricePeer::getPriceTypes($sf_context->getI18N());
|
||||
$title .= content_tag('b', __('Zmień') . ': ') . $types[$entity->getPriceType()];
|
||||
$title .= '<br>';
|
||||
$title .= content_tag('b', __('Modyfikator ceny') . ': ') . $modifierFormat;
|
||||
}
|
||||
else
|
||||
{
|
||||
$brutto = lcfirst(__('Brutto'));
|
||||
|
||||
$currency = $entity->getCurrency();
|
||||
|
||||
$title .= content_tag('b', __('Vat') . ': ') . $entity->getTax();
|
||||
$title .= '<br>';
|
||||
$title .= content_tag('b', __('Cena'). ': ') . st_currency_format($entity->getPriceNetto(), array('currency' => $currency)) . ' (' . st_currency_format($entity->getPriceBrutto(), array('currency' => $currency)) . ' ' . $brutto . ')';
|
||||
$title .= '<br>';
|
||||
$title .= content_tag('b', __('Stara cena') . ': ') . st_currency_format($entity->getOldPriceNetto(), array('currency' => $currency)) . ' (' . st_currency_format($entity->getOldPriceBrutto(), array('currency' => $currency)) . ' ' . $brutto . ')';
|
||||
$title .= '<br>';
|
||||
$title .= content_tag('b', __('Cena hurtowa') . ' (' . __('Grupa A') . '): ') . st_currency_format($entity->getWholesaleANetto(), array('currency' => $currency)) . ' (' . st_currency_format($entity->getWholesaleABrutto(), array('currency' => $currency)) . ' ' . $brutto . ')';
|
||||
$title .= '<br>';
|
||||
$title .= content_tag('b', __('Cena hurtowa') . ' (' . __('Grupa B') . '): ') . st_currency_format($entity->getWholesaleBNetto(), array('currency' => $currency)) . ' (' . st_currency_format($entity->getWholesaleBBrutto(), array('currency' => $currency)) . ' ' . $brutto . ')';
|
||||
$title .= '<br>';
|
||||
$title .= content_tag('b', __('Cena hurtowa') . ' (' . __('Grupa C') . '): ') . st_currency_format($entity->getWholesaleCNetto(), array('currency' => $currency)) . ' (' . st_currency_format($entity->getWholesaleCBrutto(), array('currency' => $currency)) . ' ' . $brutto . ')';
|
||||
}
|
||||
|
||||
$title .= '</div>';
|
||||
|
||||
echo content_tag('span', content_tag('span', $entity->getTypeLabel(), array('class' => 'align-middle')). ' ' . st_admin_get_icon('info'), array('title' => htmlspecialchars($title), 'class' => 'tooltip', 'data-tootlip-align' => 'left'));
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
use_helper('stPrice');
|
||||
?>
|
||||
<table class="st_record_list" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo __('Netto') ?></th>
|
||||
<th><?php echo __('Brutto') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><?php echo input_tag ('group_price[old_price][netto]', st_price_format($group_price->getOldPriceNetto()), array('size' => 7)) ?></td>
|
||||
<td><?php echo input_tag ('group_price[old_price][brutto]', st_price_format($group_price->getOldPriceBrutto()), array('size' => 7)) ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
use_helper('stPrice');
|
||||
?>
|
||||
<table class="st_record_list" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo __('Netto') ?></th>
|
||||
<th><?php echo __('Brutto') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><?php echo input_tag ('group_price[price][netto]', st_price_format($group_price->getPriceNetto()), array('size' => 7)) ?></td>
|
||||
<td><?php echo input_tag ('group_price[price][brutto]', st_price_format($group_price->getPriceBrutto()), array('size' => 7)) ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -0,0 +1 @@
|
||||
<?php echo select_tag('group_price[price_type]', options_for_select(GroupPricePeer::getPriceTypes($sf_context->getI18N()), $group_price->getPriceType())) ?>
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
use_helper('stProgressBar');
|
||||
echo progress_bar('stChangePrice', 'stChangePriceProgressBar', 'send', $count);
|
||||
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* @var GroupPrice $group_price
|
||||
*/
|
||||
|
||||
echo st_admin_get_icon('stProduct') . content_tag('span', $group_price->countProducts(), array('class' => 'align-middle ml-1'));
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
sfLoader::loadHelpers(array('stProduct'), 'stProduct');
|
||||
|
||||
$cache = new stFunctionCache('stTax');
|
||||
|
||||
$tax_info = $cache->cacheCall('_object_product_tax_helper');
|
||||
|
||||
st_price_tax_managment_init(array(
|
||||
'taxField' => 'group_price_tax_id',
|
||||
'taxValues' => $tax_info['values'],
|
||||
'priceFields' => array(
|
||||
array('price' => 'group_price_price_netto', 'priceWithTax' => 'group_price_price_brutto'),
|
||||
array('price' => 'group_price_old_price_netto', 'priceWithTax' => 'group_price_old_price_brutto'),
|
||||
|
||||
)));
|
||||
|
||||
echo select_tag('group_price[tax_id]', options_for_select($tax_info['names'], $group_price->getTaxId() ? $group_price->getTaxId() : $tax_info['default']));
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php use_helper('stPrice') ?>
|
||||
|
||||
<?php $groups = array('a', 'b', 'c') ?>
|
||||
<table class="st_record_list" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<?php foreach ($groups as $group): ?>
|
||||
<th colspan="2"><?php echo __('Grupa %name%', array('%name%' => strtoupper($group))) ?></th>
|
||||
<?php endforeach ?>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php foreach ($groups as $group): ?>
|
||||
<th><?php echo __('Netto') ?></th>
|
||||
<th><?php echo __('Brutto') ?></th>
|
||||
<?php endforeach ?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<?php foreach ($groups as $group): $getter_netto = 'getWholesale'.ucfirst($group).'Netto'; $getter_brutto = 'getWholesale'.ucfirst($group).'Brutto'; $getter_currency = 'getCurrencyWholesale'.ucfirst($group) ?>
|
||||
<td><?php echo input_tag ('group_price[wholesale]['.$group.'_netto]', st_price_format($group_price->$getter_netto()), array('size' => 7)) ?></td>
|
||||
<td><?php echo input_tag ('group_price[wholesale]['.$group.'_brutto]', st_price_format($group_price->$getter_brutto()), array('size' => 7)) ?></td>
|
||||
<?php endforeach ?>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php foreach ($groups as $group): ?>
|
||||
<?php st_price_tax_manager_add_price_field(array('price' => 'group_price_wholesale_'.$group.'_netto', 'priceWithTax' => 'group_price_wholesale_'.$group.'_brutto')); ?>
|
||||
<?php endforeach ?>
|
||||
|
||||
Reference in New Issue
Block a user