first commit

This commit is contained in:
2025-03-12 17:06:23 +01:00
commit 2241f7131f
13185 changed files with 1692479 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
<?php
/**
* SOTESHOP/stInvoicePlugin
*
* Ten plik należy do aplikacji stInvoicePlugin opartej na licencji (Professional License SOTE).
* Nie zmieniaj tego pliku, jeśli chcesz korzystać z automatycznych aktualizacji oprogramowania.
* Jeśli chcesz wprowadzać swoje modyfikacje do programu, zapoznaj się z dokumentacją, jak zmieniać
* oprogramowanie bez zmiany kodu bazowego http://www.sote.pl/modifications
*
* @package stInvoicePlugin
* @subpackage actions
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/sote (Professional License SOTE)
* @version $Id: actions.class.php 665 2009-04-16 07:43:27Z michal $
* @author Bartosz Alejski <bartosz.alejski@sote.pl>
*/
/**
* Klasa stInvoiceFrontendActions.
*
* @package stInvoicePlugin
* @subpackage actions
*/
class stOrderPrintPdfActions extends stActions
{
public function executeShow() {
sfLoader::loadHelpers('Helper');
sfLoader::loadHelpers('Partial');
sfLoader::loadHelpers('stPartial');
$order_id = $this->getRequestParameter('id',null);
$download = $this->getRequestParameter('download',false);
$culture = $this->getRequestParameter('culture', $this->getUser()->getCulture());
if (!$order_id)
{
return sfView::NONE;
}
$order = OrderPeer::retrieveByPK($order_id);
if (!$order)
{
return sfView::NONE;
}
$pdf = new stOrderPrintPdf($order);
$pdf->setCulture($culture);
$pdf->forceDownload($download);
$response = $this->getResponse();
$response->clearHttpHeaders();
$response->setHttpHeader('Content-Type', 'application/pdf');
$response->setHttpHeader('Content-Disposition', 'attachment;filename="'.$order->getNumber().'.pdf');
return $this->renderText($pdf->renderOrder());
}
}

View File

@@ -0,0 +1,26 @@
<?php
/**
* SOTESHOP/stNewsletterPlugin
*
* Ten plik należy do aplikacji stNewsletterPlugin opartej na licencji (Professional License SOTE).
* Nie zmieniaj tego pliku, jeśli chcesz korzystać z automatycznych aktualizacji oprogramowania.
* Jeśli chcesz wprowadzać swoje modyfikacje do programu, zapoznaj się z dokumentacją, jak zmieniać
* oprogramowanie bez zmiany kodu bazowego http://www.sote.pl/modifications
*
* @package stNewsletterPlugin
* @subpackage configs
* @copyright SOTE (www.sote.pl)
* @license http://www.sote.pl/license/sote (Professional License SOTE)
* @version $Id: config.php 665 2009-04-16 07:43:27Z michal $
* @author Karol Blejwas <karol.blejwas@sote.pl>
*/
/**
* Włączanie modułów
*/
stPluginHelper::addEnableModule('stOrderPrintPdf', 'backend');
/**
* Routingi
*/
stPluginHelper::addRouting('stOrderPrintPdfPlugin', '/orderPdf/:action/*', 'stOrderPrintPdf', 'show', 'backend');

View File

@@ -0,0 +1,29 @@
<br/>
<table cellpadding="0" cellspacing="0" border="0" width="440">
<tr>
<td width="10px"></td>
<td>
<table cellpadding="0" cellspacing="0" border="1" width="270px">
<tr>
<td height="14" style="text-align:center;" bgcolor="#ccc"><b><?php echo __('Dane dostawy:') ?></b></td>
</tr>
<tr>
<td style="text-align:left;">
<?php echo $orderUserDataDelivery->getCompany(); ?> <?php echo $orderUserDataDelivery->getName(); ?> <?php echo $orderUserDataDelivery->getSurname(); ?><br />
<?php echo $orderUserDataDelivery->getStreet(); ?> <?php echo $orderUserDataDelivery->getHouse(); ?> <?php echo $orderUserDataDelivery->getFlat() ? "/" : null ?> <?php echo $orderUserDataDelivery->getFlat() ?><br />
<?php echo $orderUserDataDelivery->getCode(); ?> <?php echo $orderUserDataDelivery->getTown(); ?> <?php echo $orderUserDataDelivery->getCountry(); ?><br />
</td>
</tr>
</table>
</td>
</tr>
</table>

View File

@@ -0,0 +1,63 @@
<?php
/**
* @var Order $order
*/
?>
<font>
<table cellspacing="0" width="502">
<tr>
<td align="left" width="200">
<font size="14"><b><?php echo __('Zamówienie nr') ?>: <?php echo $order->getNumber(); ?></b></font><br/>
<font size="10"><?php echo $order->getCreatedAt(); ?><br/><br/>
<?php if($order->getIsConfirmed()): ?>
<font color="Green"><?php echo __('potwierdzone') ?></font>
<?php else: ?>
<font color="Red"><?php echo __('niepotwierdzone') ?></font>
<?php endif; ?><br/>
<?php echo __('Status') ?>: <b><?php echo $order->getOrderStatus()->getName(); ?></b></font><br/>
<font size="10"><?php echo __('Faktura VAT') ?>: <b><?php if($invoice=="request"): ?><?php echo __('Tak') ?><?php else: ?><?php echo __('Nie') ?><?php endif; ?></b></font><br/></td>
<td align="right" width="302" style="font-size: 8px">
<?php echo $config->get('company'); ?><br/>
<?php echo $config->get('nip')!="" ? __('NIP:') : "" ?> <?php echo $config->get('nip'); ?><br/>
<?php echo $config->get('street'); ?> <?php echo $config->get('house'); ?> <?php echo $config->get('flat'); ?><br/>
<?php echo $config->get('code'); ?> <?php echo $config->get('town'); ?><br/>
<?php echo $config->get('phone')!="" ? __('Telefon:') : "" ?> <?php echo $config->get('phone'); ?><br/>
<?php echo $config->get('fax')!="" ? __('Fax:') : "" ?> <?php echo $config->get('fax'); ?><br/>
<?php echo $config->get('bank')!="" ? __('Konto:') : "" ?> <?php echo $config->get('bank'); ?><br/>
<?php echo $config->get('email'); ?><br/>
</td>
</tr>
</table>
<table cellspacing="0" width="700">
<?php if ($order->isAllegroOrder()): ?>
<tr>
<td>
<?php echo __('Użytkownik Allegro:') ?> <b><?php echo $order->getOptAllegroNick(); ?></b>
</td>
</tr>
<tr>
<td>
<?php echo __('Zamówienie Allegro:') ?> <b><?php echo $order->getOptAllegroCheckoutFormId() ?></b>
</td>
</tr>
<?php endif; ?>
<tr>
<td>
<?php echo __('Email klienta:') ?> <b><?php echo $order->getOptClientEmail(); ?></b>
</td>
</tr>
<?php if($order->getSfGuardUser() && $order->getSfGuardUser()->getWholesale()): ?>
<tr>
<td>
<?php echo __('Grupa hurtowa:') ?> <b><?php echo strtoupper($order->getSfGuardUser()->getWholesale()); ?></b>
</td>
</tr>
<?php endif; ?>
<?php if (stConfig::getInstance('stOrder')->get('show_not_professional_purchase') && !empty($order->getOrderUserDataBilling()->getCompany())): ?>
<tr>
<td><?php echo __("Zakup o charakterze zawodowym", null, 'stUserData') ?>: <b><?php echo $order->getOrderUserDataBilling()->getNotProfessionalPurchaseLabel() ?></b></td>
</tr>
<?php endif ?>
</table>
</font>

View File

@@ -0,0 +1,34 @@
<?php use_helper('stCurrency', 'stOrder', 'stDelivery');?>
<font size="8">
<table border="1" cellpadding="0" cellspacing="0">
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="4" width="502">
<tr>
<td bgcolor="#ccc">
<b><?php echo __('Dane dostawy') ?></b>
</td>
</tr>
</table>
<table border="0" cellpadding="4" cellspacing="0" width="502">
<thead>
<tr>
<th width="260" bgcolor="#eee" align="left"><?php echo __('Rodzaj dostawy') ?></th>
<th width="130" bgcolor="#eee" align="left"><?php if($order->getOrderDelivery()->getNumber()!=""): ?><?php echo __('Numer przesyłki') ?><?php endif; ?></th>
<th width="112" bgcolor="#eee" align="right"><?php echo __('Koszt przesyłki') ?></th>
</tr>
</thead>
<tbody>
<tr>
<td width="260" align="left"><?php echo strip_tags($order->getOrderDelivery()->getNameTranslated($sf_user->getCulture(), true)); ?></td>
<td width="130" align="left"><?php if($order->getOrderDelivery()->getNumber()!=""): ?><?php echo $order->getOrderDelivery()->getNumber(); ?><?php endif; ?></td>
<td width="112" align="right"><?php echo st_order_delivery_cost($order, true) ?></td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
</font>

View File

@@ -0,0 +1,20 @@
<?php if ($order->getDescription() != "") : ?>
<table border="1" cellspacing="0" cellpadding="4" width="502" style="font-size: 8px;">
<tr>
<td bgcolor="#ccc"><b><?php echo __('Uwagi klienta') ?></b></td>
</tr>
<tr>
<td><?php echo $order->getDescription(); ?></td>
</tr>
</table>
<?php endif; ?>
<?php if ($order->getMerchantNotes() != "") : ?>
<table border="1" cellspacing="0" cellpadding="4" width="502" style="font-size: 8px;">
<tr>
<td bgcolor="#ccc"><b><?php echo __('Notatki sprzedawcy') ?></b></td>
</tr>
<tr>
<td><?php echo str_replace("\n", "<br />", $order->getMerchantNotes()); ?></td>
</tr>
</table>
<?php endif; ?>

View File

@@ -0,0 +1,29 @@
<?php
use_helper('Helper', 'stOrder', 'stCurrency');
/**
* @var Order $order
*/
?>
<table cellspacing="0" cellpadding="4" width="502">
<?php if ($order->getDiscountCouponCode()) : ?>
<tr>
<td align="right"><?php echo __('Kod rabatowy') ?>: <?php echo $order->getDiscountCouponCode()->getCode() ?> (<?php echo $order->getDiscountCouponCode()->getDiscount() ?>%)</td>
</tr>
<?php endif; ?>
<?php if ($order->getDiscount()) : ?>
<tr>
<td align="right"><?php echo __('Łączna wartość') ?>: <?php echo st_order_price_format($order->getTotalAmountWithDelivery(true, true, false), $order->getOrderCurrency()) ?></td>
</tr>
<tr>
<td align="right"><?php echo __('Udzielony rabat') ?> (<?php echo $order->getDiscount()->getName() ?>): -<?php echo st_order_price_format($order->getTotalProductDiscountAmount(true, true), $order->getOrderCurrency()) ?></td>
</tr>
<?php endif ?>
<?php if ($order->getPaidAmount() > 0): ?>
<tr>
<td align="right"><?php echo __('Zapłacono') ?>: <?php echo st_order_price_format($order->getPaidAmount(), $order->getOrderCurrency()) ?></td>
</tr>
<?php endif ?>
<tr>
<td align="right"><?php echo __('Razem do zapłaty') ?>: <font size="16"><b><?php echo st_order_price_format($order->getUnpaidAmount(), $order->getOrderCurrency()) ?><?php if ($total_points_value > 0): ?><br /><?php echo $total_points_value . " " . $config_points->get('points_shortcut', null, true); ?><?php endif ?></b></font></td>
</tr>
</table>

View File

@@ -0,0 +1,89 @@
<?php
/**
* @var Order $order
*/
use_helper('stCurrency', 'stOrder', 'stPrice', 'stJQueryTools', 'stProductImage', 'stDiscount');
sfLoader::loadHelpers('stProduct');
?>
<font size="8">
<table cellpadding="0" cellspacing="0" border="1" style="table-layout: auto;">
<tr>
<td>
<table cellspacing="0" cellpadding="4" width="502">
<tr>
<td bgcolor="#ccc">
<b><?php echo __('Produkty'); ?></b>
</td>
</tr>
</table>
<table border="0" cellpadding="4" cellspacing="0" width="502">
<tr>
<td width="21" bgcolor="#eee" align="left"></td>
<td width="65" bgcolor="#eee" align="left"><?php echo __('Kod') ?></td>
<td width="<?php if ($order_for_points == 1) : echo "91";
else : echo "141";
endif; ?>" bgcolor="#eee" align="left"><?php echo __('Nazwa') ?></td>
<td width="60" bgcolor="#eee" align="right"><?php echo __('Netto') ?></td>
<td width="30" bgcolor="#eee" align="right"><?php echo __('Vat') ?></td>
<td width="60" bgcolor="#eee" align="right"><?php echo __('Brutto') ?></td>
<?php if ($order_for_points == 1) : ?>
<td width="70" bgcolor="#eee" align="right"><?php echo $config_points->get('points_shortcut', null, true) ?></td>
<?php endif; ?>
<td width="45" bgcolor="#eee" align="right"><?php echo __('Ilość') ?></td>
<td width="80" bgcolor="#eee" align="right"><?php echo __('Suma') ?></td>
</tr>
<?php $totalPriceBrutto = 0; ?>
<?php $total_points_value = 0; ?>
<?php foreach ($order->getOrderProductsJoinProduct() as $key => $product) :
/**
* @var OrderProduct $product
*/
?>
<?php if ($product->getProductForPoints() == 1) : $total_points_value += $product->getPointsValue() * $product->getQuantity();
endif; ?>
<?php $brutto = ($product->getPrice(true)); ?>
<tr>
<td width="21" style="text-align:left;"><?php echo $key + 1 ?></td>
<td width="65" style="text-align:left;"><?php echo $product->getCode(); ?></td>
<td width="<?php if ($order_for_points == 1) : echo "91";
else : echo "141";
endif; ?>" style="text-align:left;">
<?php echo strip_tags($product->getName()); ?>
<?php if ($product->getOptions()) : ?>
<?php st_order_display_product_options($product) ?>
<?php endif; ?>
<?php if ($order->isAllegroOrder()) : ?>
<?php echo __('Oferta Allegro') ?>: <?php echo $product->getAllegroAuctionId() ?>
<?php endif ?>
</td>
<td width="60" style="text-align:right;"><?php if ($product->getProductForPoints() == 1) : echo "-";
else : echo st_order_product_price($product);
endif; ?></td>
<td width="30" style="text-align:right;"><?php if ($product->getProductForPoints() == 1) : echo "-";
else : echo $product->getVat() . "%";
endif; ?></td>
<td width="60" style="text-align:right;"><span><?php if ($product->getProductForPoints() == 1) : echo "-";
else : echo st_order_product_price($product, true);
endif; ?></span></td>
<?php if ($order_for_points == 1) : ?><td width="70" style="text-align:right;"><span><?php if ($product->getProductForPoints() == 1) : echo $product->getPointsValue();
else : echo "-";
endif; ?></span></td><?php endif; ?>
<td width="45" align="right"><?php echo $product->getQuantity(); ?> <?php echo st_product_uom($product->getProduct()) ?></td>
<td width="80" style="text-align:right;"><?php if ($product->getProductForPoints() == 1) : echo $product->getPointsValue() * $product->getQuantity();
echo " " . $config_points->get('points_shortcut', null, true);
else : echo st_order_product_total_amount($product, true);
endif; ?></td>
</tr>
<?php endforeach; ?>
<tr>
<td colspan="5" width="502" bgcolor="#eee" align="right" style="margin-right: 25px;"><?php echo __('Łączna wartość'); ?>:&nbsp;&nbsp;&nbsp;<b><?php echo st_order_product_total_amount($order, true, false) ?><?php if ($total_points_value > 0) : ?><br /> <?php echo $total_points_value . " " . $config_points->get('points_shortcut', null, true); ?> <?php endif; ?></b></td>
</tr>
</table>
</td>
</tr>
</table>
</font>

View File

@@ -0,0 +1,52 @@
<?php
/**
* @var Order $order
* @var Payment $payment
*/
use_helper('stCurrency');
?>
<font size="8">
<table border="1" cellpadding="0" cellspacing="0">
<tr>
<td>
<table cellspacing="0" cellpadding="4" width="502">
<tr>
<td bgcolor="#ccc">
<b><?php echo __('Dane płatności') ?></b>
</td>
</tr>
</table>
<?php if($order->getOrderPayment()): ?>
<table border="0" cellspacing="0" cellpadding="4" width="502">
<thead>
<tr>
<th bgcolor="#eee" width="62"><?php echo __('Id') ?></th>
<th bgcolor="#eee" width="120"><?php echo __('Data dokonania płatności') ?></th>
<th bgcolor="#eee" width="180"><?php echo __('Typ płatności') ?></th>
<th bgcolor="#eee" width="60"><?php echo __('Status') ?></th>
<th bgcolor="#eee" width="80" align="right"><?php echo __('Kwota') ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($order->getOrderPayments() as $payment): $paymentType = $payment->getPaymentType(); $paymentType->setCulture($sf_user->getCulture()) ?>
<tr>
<td width="62"><?php echo $payment->getId() ?></td>
<td width="120"><?php echo $payment->getPayedAt() ?></td>
<td width="180"><?php echo $paymentType->getName() ?></td>
<td width="60">
<?php if ($payment->getStatus()): ?>
<?php echo __('Rozliczona') ?>
<?php else: ?>
<?php echo __('Nierozliczona') ?>
<?php endif; ?>
</td>
<td width="80" align="right"><?php echo st_order_price_format($payment->getAmount(), $order->getOrderCurrency());?></td>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php endif; ?>
</td>
</tr>
</table>
</font>

View File

@@ -0,0 +1,52 @@
<?php
$culture = sfContext::getInstance()->getUser()->getCulture();
$first = true;
if (!function_exists('addNewLine'))
{
function addNewLine(&$first)
{
if (!$first)
{
echo "<br />";
}
$first = false;
}
}
?>
<font>
<table cellpadding="8" cellspacing="0" border="1" width="100%">
<tr>
<td style="background-color: #ccc;"><?php echo $user_data instanceof OrderUserDataBilling ? __('Dane billingowe') : __('Dane dostawy') ?></td>
</tr>
<tr>
<td height="<?php echo $height ?>">
<?php if ($user_data->getCompany()): ?>
<?php addNewLine($first) ?><?php echo $user_data->getCompany(); ?>
<?php endif; ?>
<?php if ($user_data->getVatNumber()): ?>
<?php addNewLine($first) ?><?php echo __('NIP') ?>: <?php echo $user_data->getVatNumber(); ?>
<?php endif; ?>
<?php if ($user_data->getFullName()): ?>
<?php addNewLine($first) ?><?php echo $user_data->getFullName(); ?>
<?php endif; ?>
<?php addNewLine($first) ?><?php echo $user_data->getAddress(); ?>
<?php if ($user_data->getAddressMore()): ?>
<?php addNewLine($first) ?><?php echo $user_data->getAddressMore(); ?>
<?php endif; ?>
<?php if ($user_data->getRegion()): ?>
<?php addNewLine($first) ?><?php echo $user_data->getRegion(); ?>
<?php endif; ?>
<?php addNewLine($first) ?><?php echo $user_data->getCode(); ?> <?php echo $user_data->getTown(); ?> <?php echo sfI18n::getCountry($user_data->getCountry()->getIsoA2(), $culture); ?>
<?php if ($user_data instanceof OrderUserDataBilling && $user_data->getPesel()): ?>
<?php addNewLine($first) ?><?php echo __('PESEL') ?>: <?php echo $user_data->getPesel(); ?>
<?php endif; ?>
<?php if ($user_data->getPhone()): ?>
<?php addNewLine($first) ?><?php echo __('tel') ?>: <?php echo $user_data->getPhone(); ?>
<?php endif; ?>
</td>
</tr>
</table>
</font>