first commit
This commit is contained in:
1336
apps/backend/modules/stOrder/actions/actions.class.php
Normal file
1336
apps/backend/modules/stOrder/actions/actions.class.php
Normal file
File diff suppressed because it is too large
Load Diff
241
apps/backend/modules/stOrder/actions/components.class.php
Normal file
241
apps/backend/modules/stOrder/actions/components.class.php
Normal file
@@ -0,0 +1,241 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SOTESHOP/stOrder
|
||||
*
|
||||
* Ten plik należy do aplikacji stOrder 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 stOrder
|
||||
* @subpackage actions
|
||||
* @copyright SOTE (www.sote.pl)
|
||||
* @license http://www.sote.pl/license/sote (Professional License SOTE)
|
||||
* @version $Id: components.class.php 16489 2011-12-16 08:53:47Z bartek $
|
||||
*/
|
||||
|
||||
/**
|
||||
* SOTESHOP/stOrder
|
||||
* Ten plik należy do aplikacji stOrder 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 stOrder
|
||||
* @subpackage actions
|
||||
* @property stPropelPager $pager
|
||||
*/
|
||||
class stOrderComponents extends autostOrderComponents
|
||||
{
|
||||
public function executeOrderStatusType()
|
||||
{
|
||||
$this->select_options = array();
|
||||
|
||||
$i18n = $this->getContext()->getI18N();
|
||||
|
||||
foreach (OrderStatusPeer::getTypes() as $type => $label)
|
||||
{
|
||||
$this->select_options[$type] = $i18n->__($label, array(), 'stOrder');
|
||||
}
|
||||
}
|
||||
|
||||
public function executePayment()
|
||||
{
|
||||
$this->payments = $this->order->getOrderHasPaymentsJoinPayment();
|
||||
|
||||
$c = new Criteria();
|
||||
|
||||
$c->add(PaymentTypePeer::ACTIVE, 1);
|
||||
|
||||
$activePayments = PaymentTypePeer::doSelectWithI18n($c);
|
||||
|
||||
foreach ($activePayments as $activePayment)
|
||||
{
|
||||
if (!$activePayment->checkPaymentConfiguration()) continue;
|
||||
|
||||
$activePaymentType[$activePayment->getId()] = $activePayment->getName();
|
||||
}
|
||||
|
||||
$this->paymentsType = $activePaymentType;
|
||||
}
|
||||
|
||||
public function executeProforma()
|
||||
{
|
||||
$this->order_id = $this->order->getId();
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(InvoicePeer::ORDER_ID, $this->order->getId());
|
||||
$c->add(InvoicePeer::IS_PROFORMA, 1);
|
||||
$invoice = InvoicePeer::doSelectOne($c);
|
||||
$ifirmaConfig = stConfig::getInstance(sfContext::getInstance(), 'stInvoiceBackend');
|
||||
$this->ifirma_enabled = $ifirmaConfig->get('ifirma_enabled');
|
||||
|
||||
if ($invoice)
|
||||
{
|
||||
$this->invoice_id = $invoice->getId();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->type = "none";
|
||||
}
|
||||
}
|
||||
|
||||
public function executeInvoice()
|
||||
{
|
||||
$ifirmaConfig = stConfig::getInstance(sfContext::getInstance(), 'stInvoiceBackend');
|
||||
$this->ifirma_enabled = $ifirmaConfig->get('ifirma_enabled');
|
||||
|
||||
// if($invoice)
|
||||
// {
|
||||
// $this->invoice_id = $invoice->getId();
|
||||
|
||||
// if($invoice->getIsRequest()==1)
|
||||
// {
|
||||
// $this->type = "request";
|
||||
// }
|
||||
|
||||
// if($invoice->getIsConfirm()==1)
|
||||
// {
|
||||
// $this->type = "confirm";
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// $invoice = $this->order->getProforma();
|
||||
|
||||
// if ($invoice)
|
||||
// {
|
||||
// $this->invoice_id = $invoice->getId();
|
||||
// $this->type = "proforma";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// $this->type = 'none';
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
public function executePointsStatus()
|
||||
{
|
||||
$this->config_points = stConfig::getInstance(sfContext::getInstance(), 'stPointsBackend');
|
||||
$this->config_points->setCulture($this->getRequestParameter('culture', stLanguage::getOptLanguage()));
|
||||
|
||||
$this->points_status = 0;
|
||||
if (stPoints::isPointsAssigned($this->order) == true)
|
||||
{
|
||||
$this->points_status = 1;
|
||||
}
|
||||
|
||||
$this->points_earn = stPoints::getOrderTotalPointsEarn($this->order);
|
||||
|
||||
$this->order_id = $this->order->getId();
|
||||
}
|
||||
|
||||
public function executePointsSpend()
|
||||
{
|
||||
$this->config_points = stConfig::getInstance(sfContext::getInstance(), 'stPointsBackend');
|
||||
$this->config_points->setCulture($this->getRequestParameter('culture', stLanguage::getOptLanguage()));
|
||||
$this->points_value = stPoints::getOrderTotalPointsValue($this->order);
|
||||
}
|
||||
|
||||
public function executePointsEarn()
|
||||
{
|
||||
$this->config_points = stConfig::getInstance(sfContext::getInstance(), 'stPointsBackend');
|
||||
$this->config_points->setCulture($this->getRequestParameter('culture', stLanguage::getOptLanguage()));
|
||||
$this->points_earn = stPoints::getOrderTotalPointsEarn($this->order);
|
||||
}
|
||||
|
||||
|
||||
public function executeProductLastOrderWidget()
|
||||
{
|
||||
$backendMainConfig = stConfig::getInstance($this->getContext(), 'stBackendMain');
|
||||
|
||||
if ($this->getRequestParameter('date_type'))
|
||||
{
|
||||
$date_type = $this->getRequestParameter('date_type');
|
||||
$backendMainConfig->set('date_type', $date_type);
|
||||
$backendMainConfig->save();
|
||||
}
|
||||
else
|
||||
{
|
||||
$date_type = $backendMainConfig->get('date_type');
|
||||
}
|
||||
|
||||
if ($date_type == "day")
|
||||
{
|
||||
$from_date = date('Y-m-d H:i:s', time() - 86400);
|
||||
}
|
||||
elseif ($date_type == "week")
|
||||
{
|
||||
$from_date = date('Y-m-d H:i:s', time() - 604800);
|
||||
}
|
||||
elseif ($date_type == "month")
|
||||
{
|
||||
$from_date = date('Y-m-d H:i:s', time() - 2419200);
|
||||
}
|
||||
elseif ($date_type == "lastlog")
|
||||
{
|
||||
$c = new Criteria();
|
||||
$c->add(sfGuardUserPeer::ID, $this->getUser()->getAttribute('user_id', null, 'sfGuardSecurityUser'));
|
||||
$user = sfGuardUserPeer::doSelectOne($c);
|
||||
|
||||
$from_date = $this->getUser()->getLastLogin();
|
||||
}
|
||||
$to_date = date('Y-m-d H:i:s');
|
||||
|
||||
$this->date_type = $date_type;
|
||||
$this->from_date = $from_date;
|
||||
$this->to_date = $to_date;
|
||||
|
||||
//produkty
|
||||
$c = new Criteria();
|
||||
$criterion = $c->getNewCriterion(OrderProductPeer::CREATED_AT, $from_date, Criteria::GREATER_EQUAL);
|
||||
$criterion->addAnd($c->getNewCriterion(OrderProductPeer::CREATED_AT, $to_date, Criteria::LESS_EQUAL));
|
||||
$c->add($criterion);
|
||||
$c->addDescendingOrderByColumn(OrderProductPeer::CREATED_AT);
|
||||
$c->setLimit(100);
|
||||
$orderProducts = OrderProductPeer::doSelectJoinProduct($c);
|
||||
|
||||
$this->orderProducts = $orderProducts;
|
||||
}
|
||||
|
||||
public function executeSummary()
|
||||
{
|
||||
|
||||
$filters = stAdminGeneratorHelper::getFilters('stOrder', 'list');;
|
||||
|
||||
if ((!$this->pager->getNbResults()) || (!$filters)){
|
||||
return sfView::NONE;
|
||||
}
|
||||
|
||||
$c = clone $this->pager->getCriteria();
|
||||
|
||||
$c->setLimit(null);
|
||||
$c->setOffset(0);
|
||||
$c->clearOrderByColumns();
|
||||
$c->clearSelectColumns();
|
||||
|
||||
$c->addSelectColumn(sprintf('COUNT(%s)', OrderPeer::ID, OrderCurrencyPeer::EXCHANGE));
|
||||
$c->addSelectColumn(sprintf('SUM(%s * %s)', OrderPeer::OPT_TOTAL_AMOUNT, OrderCurrencyPeer::EXCHANGE));
|
||||
$c->addSelectColumn(sprintf('AVG(%s * %s)', OrderPeer::OPT_TOTAL_AMOUNT, OrderCurrencyPeer::EXCHANGE));
|
||||
|
||||
$c->addJoin(OrderPeer::ORDER_CURRENCY_ID, OrderCurrencyPeer::ID);
|
||||
|
||||
$rs = OrderPeer::doSelectRS($c);
|
||||
|
||||
$this->count = 0;
|
||||
$this->averageAmount = 0;
|
||||
$this->totalAmount = 0;
|
||||
|
||||
if ($rs)
|
||||
{
|
||||
$rs->setFetchmode(ResultSet::FETCHMODE_NUM);
|
||||
|
||||
if ($rs->next())
|
||||
{
|
||||
list($this->count, $this->totalAmount, $this->averageAmount) = $rs->getRow();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
33
apps/backend/modules/stOrder/config/config.php
Normal file
33
apps/backend/modules/stOrder/config/config.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SOTESHOP/stOrder
|
||||
*
|
||||
* Ten plik należy do aplikacji stOrder 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 stOrder
|
||||
* @subpackage configs
|
||||
* @copyright SOTE (www.sote.pl)
|
||||
* @license http://www.sote.pl/license/sote (Professional License SOTE)
|
||||
* @version $Id: config.php 16748 2012-01-17 12:30:49Z marcin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* SOTESHOP/stOrder
|
||||
* Ten plik należy do aplikacji stOrder 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 stOrder
|
||||
* @subpackage libs
|
||||
*/
|
||||
|
||||
stPluginHelper::addRouting('stOrder', '/order/:action/*', 'stOrder', 'list', 'backend');
|
||||
stPluginHelper::addRouting('stOrderPriceModifiers', '/order/price-modifiers/:id/:ids', 'stOrder', 'ajaxPriceModifiers', 'backend');
|
||||
stPluginHelper::addRouting('stOrderDefault', '/order/list', 'stOrder', 'list', 'backend');
|
||||
|
||||
stNotificationConfiguration::addGroup('stOrder');
|
||||
188
apps/backend/modules/stOrder/config/generator.yml
Normal file
188
apps/backend/modules/stOrder/config/generator.yml
Normal file
@@ -0,0 +1,188 @@
|
||||
generator:
|
||||
class: stAdminGenerator
|
||||
param:
|
||||
model_class: Order
|
||||
order_status_model_class: OrderStatus
|
||||
theme: simple
|
||||
head:
|
||||
package: stOrder
|
||||
custom_actions:
|
||||
list: [order_status]
|
||||
edit: [order_status]
|
||||
|
||||
documentation:
|
||||
pl: "https://www.sote.pl/docs/zamowienia"
|
||||
en: "https://www.soteshop.com/docs/orders"
|
||||
|
||||
order_status_list:
|
||||
use_helper: [stOrder]
|
||||
title: Statusy
|
||||
display: [name, _order_status_type, is_default, has_mail_notification, has_coupon_code, send_delivery_tracking_url]
|
||||
fields:
|
||||
name: {name: Nazwa, callback: st_order_status}
|
||||
order_status_type: {name: Rodzaj}
|
||||
is_default: {name: Domyślny}
|
||||
has_mail_notification: {name: Powiadomienie e-mail}
|
||||
has_coupon_code: {name: Dołącz kod rabatowy}
|
||||
send_delivery_tracking_url: {name: Śledzenie przesyłki}
|
||||
menu: {use: list.menu}
|
||||
actions:
|
||||
_create: {name: Dodaj}
|
||||
object_actions:
|
||||
_edit: -
|
||||
_delete: -
|
||||
|
||||
order_status_edit:
|
||||
display:
|
||||
"NONE": [name, ~order_status_type, _is_default, _color]
|
||||
"Powiadomienie e-mail": [has_mail_notification, _order_status_description, _attach_coupon_code, send_delivery_tracking_url]
|
||||
"Kod rabatowy": [_coupon_code_discount, _coupon_code_valid_for]
|
||||
"Faktura": [has_invoice_proforma, has_invoice]
|
||||
fields:
|
||||
color: {name: Kolor}
|
||||
name: {name: Nazwa, type: input_tag}
|
||||
order_status_type: {name: Rodzaj}
|
||||
is_default: {name: Domyślny, help: "Domyślny status jest ustawiany dla każdego nowo złożonego zamówienia. <br/>Domyślnym statusem może być wyłącznie status rodzaju <b>oczekuje</b>"}
|
||||
has_mail_notification: {name: Wysyłaj powiadomienie e-mail, help: Powiadomienie e-mail wysyłane jest w momencie wybrania statusu w zamówieniu}
|
||||
attach_coupon_code: {name: Dołącz kod rabatowy, type: checkbox_tag, help: "Do powiadomienia e-mail zostanie dołączony jednorazowy kod rabatowy.<br/>Kod rabatowy może być generowany wyłącznie dla statusów rodzaju <b>zrealizowane</b>"}
|
||||
has_invoice_proforma: {name: Dołącz link do faktury proforma, type: checkbox_tag, help: Do powiadomienia e-mail zostanie dołączony link do faktury proforma}
|
||||
has_invoice: {name: Dołącz link do faktury, type: checkbox_tag, help: Do powiadomienia e-mail zostanie dołączony link do faktury}
|
||||
coupon_code_discount: {name: Rabat}
|
||||
coupon_code_valid_for: {name: Ważny przez, help: "Określa ilość dni, po upływie których, wygenerowany kod rabatowy staje się nieważny.<br/>Wartość 0 oznacza brak limitu"}
|
||||
order_status_description: {name: Opis}
|
||||
send_delivery_tracking_url: {name: Dodaj link do śledzenia przesyłki}
|
||||
actions:
|
||||
_list: {name: Statusy, i18n: stOrder}
|
||||
_save: {name: Zapisz}
|
||||
_save_and_add: {name: Zapisz i dodaj nowy}
|
||||
_delete: {name: Usuń}
|
||||
|
||||
list:
|
||||
use_helper: [stOrder, sfGuardUser]
|
||||
title: Lista
|
||||
display: [=number, created_at, opt_order_status, assigned_id, is_confirmed, _is_payed, client, _review_order_product_id, _total_amount, _order_import_list]
|
||||
mark_as: true
|
||||
hide: [assigned_id]
|
||||
fields:
|
||||
number: {name: Numer, width: 1%}
|
||||
client: {name: Klient, callback: st_order_client_name, filterable: false, width: 15%}
|
||||
total_amount: {name: Kwota, sort_field: order.opt_total_amount, filterable: false, align: right, width: 1%}
|
||||
opt_order_status: {name: Status, callback: st_order_status_by_order, width: 15%}
|
||||
created_at: {name: Złożone, filterable: false, width: 1%}
|
||||
is_confirmed: {name: Potwierdzone, filterable: false, width: 1%, align: center}
|
||||
is_payed: {name: Opłacone, sort_field: order.opt_is_payed, filterable: false, width: 1%, align: center}
|
||||
review_order_product_id:{name: Recenzja, filterable: false, width: 1%}
|
||||
order_product: {name: Produkt, filterable: false, i18n: stProduct}
|
||||
payment: {name: Płatność}
|
||||
delivery: {name: Dostawa}
|
||||
assigned_id: {name: Opiekun, width: 1%}
|
||||
order_import_list: {name: ""}
|
||||
|
||||
|
||||
sort: [created_at, desc]
|
||||
menu:
|
||||
display: [list, order_status]
|
||||
fields:
|
||||
list: {name: Lista, action: @stOrderDefault}
|
||||
order_status: {name: Statusy, action: stOrder/orderStatusList}
|
||||
config: {name: Konfiguracja, action: stOrder/config}
|
||||
actions: []
|
||||
filters:
|
||||
client: {partial: filter_client}
|
||||
total_amount: {filter_field: order.opt_total_amount}
|
||||
assigned_id: {partial: filter_assigned}
|
||||
opt_order_status: {partial: filter_order_status}
|
||||
is_payed: {partial: filter_is_payed}
|
||||
is_confirmed: {partial: filter_is_confirmed}
|
||||
order_product: {partial: filter_order_product}
|
||||
created_at: {empty: false}
|
||||
payment: {partial: filter_payment}
|
||||
delivery: {partial: filter_delivery}
|
||||
discount_coupon_code: {name: Kod rabatowy, partial: filter_discount_coupon_code}
|
||||
gift_card_coupon_code: {name: Bon zakupowy, partial: filter_gift_card_code}
|
||||
|
||||
additional_filters: [created_at, order_product, total_amount, client, is_payed, is_confirmed, payment, delivery, discount_coupon_code, gift_card_coupon_code]
|
||||
select_actions:
|
||||
display:
|
||||
"NONE": []
|
||||
"Status": { callback: OrderStatusPeer::doSelectCachedArray, action: bulkStatusUpdate }
|
||||
"Opłacone": { actions: { 1: Tak, 0: Nie }, action: bulkPaymentStatusUpdate }
|
||||
"Potwierdzone": { actions: { 1: Tak, 0: Nie }, action: bulkConfirmedStatusUpdate }
|
||||
actions:
|
||||
_delete: -
|
||||
object_actions:
|
||||
_edit: -
|
||||
_delete: -
|
||||
peer_method: doSelectJoinOrderCurrency
|
||||
edit:
|
||||
editable: true
|
||||
old_config:
|
||||
"Punkty": true
|
||||
use_helper: [stOrder]
|
||||
use_stylesheet: [backend/stOrder.css]
|
||||
display:
|
||||
"Allegro": [opt_allegro_checkout_form_id, opt_allegro_nick]
|
||||
"NONE": [_order_status_id, _assigned_id, created_at, _sf_guard_user, is_confirmed, _proforma, _invoice, _invoice_request, not_professional_purchase_label]
|
||||
"Dane bilingowe": [_order_user_billing_data]
|
||||
"Dane dostawy": [_order_user_delivery_data]
|
||||
"Zawartość": [_order_products]
|
||||
"Dostawa": [delivery_type_id, delivery_cost, delivery_is_weekend_delivery, delivery_is_express_delivery, delivery_number]
|
||||
"Płatność": [~payment]
|
||||
"Punkty": [~points_spend, ~points_earn, ~points_status]
|
||||
"Informacje Dodatkowe": [info_client_notes, merchant_notes, info_show_opinion]
|
||||
"Podsumowanie": [summary_discount_coupon_code, summary_total_amount, summary_discount, summary_total_amount_to_pay, summary_paid, summary_left_to_pay]
|
||||
fields:
|
||||
summary_discount_coupon_code: {name: "Kod rabatowy", callback: st_order_summary_discount_coupon_code, type: plain}
|
||||
summary_total_amount: {name: Łączna wartość, callback: st_order_summary_total_amount_field, type: plain}
|
||||
summary_discount: {name: Udzielony rabat, callback: st_order_summary_discount_field, type: plain}
|
||||
summary_total_amount_to_pay: {name: Razem do zapłaty, type: plain, callback: st_order_summary_total_amount_to_pay_field}
|
||||
summary_paid: {name: Zapłacono, type: plain, callback: st_order_summary_paid_field}
|
||||
summary_left_to_pay: {name: Pozostało do zapłaty, type: plain, callback: st_order_summary_left_to_pay_field}
|
||||
delivery_type_id: {name: Rodzaj, type: plain, callback: st_order_delivery_type_id_field}
|
||||
delivery_cost: {name: Koszt, type: plain, callback: st_order_delivery_cost_field}
|
||||
delivery_is_weekend_delivery: {name: Dostawa w weekend, type: plain, callback: st_order_delivery_is_weekend_delivery_field, i18n: stDeliveryBackend}
|
||||
delivery_is_express_delivery: {name: Dostawa ekspresowa, type: plain, callback: st_order_delivery_is_express_delivery_field, i18n: stDeliveryBackend}
|
||||
delivery_number: {name: Numer przesyłki, type: plain, callback: st_order_delivery_number_field}
|
||||
order_user_billing_data: {hide_label: true}
|
||||
order_user_delivery_data: {hide_label: true}
|
||||
not_professional_purchase_label: {name: Zakup o charakterze zawodowym, type: plain}
|
||||
opt_allegro_checkout_form_id: {name: Numer zamówienia, type: plain, i18n: stAllegroBackend}
|
||||
opt_allegro_nick: {name: Nazwa użytkownika, type: plain, i18n: stAllegroBackend}
|
||||
order_status_id: {name: Status, params: text_method=getNameWithMailNotification}
|
||||
assigned_id: {name: Opiekun}
|
||||
culture: {name: Złożone w języku}
|
||||
amount_to_pay: {name: Do zapłaty}
|
||||
sf_guard_user: {name: Klient, type: plain}
|
||||
created_at: {name: Złożone, type: plain}
|
||||
order_products: {hide_label: true}
|
||||
delivery: {hide_label: true}
|
||||
payment: {name: Płatność, hide_label: true}
|
||||
total_amount_summary: {hide_label: true}
|
||||
discount_coupon_code: {name: Kod rabatowy}
|
||||
is_confirmed: {name: Potwierdzone}
|
||||
proforma: {name: Faktura proforma, type: plain}
|
||||
invoice: {name: Faktura VAT, type: plain}
|
||||
invoice_request: {name: Klient prosi o fakturę, type: plain}
|
||||
points_spend: {name: Wydane}
|
||||
points_earn: {name: Zarobione}
|
||||
points_status: {name: Rozliczone}
|
||||
info_client_notes: {name: Uwagi od klienta, callback: st_order_info_client_notes_field, type: custom}
|
||||
merchant_notes: {name: Notatki sprzedawcy, help: Notatki sprzedawcy nie są widoczne dla klienta}
|
||||
info_show_opinion: {name: Zgoda na przesyłanie danych w celu zbadania opinii, callback: st_order_info_show_opinion_field, type: custom}
|
||||
actions:
|
||||
_delete: {name: Usuń}
|
||||
_list: {name: Lista}
|
||||
_printPdf: {name: Pobierz, action: printPdf, i18n: stOrder, icon: download}
|
||||
_save: {name: Zapisz}
|
||||
config:
|
||||
title: Konfiguracja
|
||||
menu: {use: list.menu}
|
||||
display:
|
||||
"NONE": [number_format, _min_amount, show_not_professional_purchase, disable_min_amount_for_uk]
|
||||
fields:
|
||||
number_format: {name: Format numeru zamówienia, params: size=50, help: "Dostępne parametry: {NUMER}, {DZIEN}, {MIESIAC}, {ROK}", i18n: stOrder}
|
||||
min_amount: {name: Minimalna wartość zamówienia, help: Wartość 0 oznacza brak progu}
|
||||
show_not_professional_purchase: {name: Aktywuj zakup o charakterze niezawodowym dla firm, help: W zamówieniu dla firm pojawi się dodatkowa opcja oznaczenia zakupu jako niezawodowy., type: checkbox}
|
||||
disable_min_amount_for_uk: {name: Wyłącz minimalną wartość zamówienia dla Wielkiej Brytanii, help: Wyłącza wymuszone sprawdzanie minimalnej wartości zamówienia wynoszącej 135 funtów dla klientów z Wielkiej Brytanii, type: checkbox_tag}
|
||||
actions:
|
||||
_save: {name: Zapisz konfigurację, i18n: stOrder}
|
||||
2
apps/backend/modules/stOrder/config/security.yml
Normal file
2
apps/backend/modules/stOrder/config/security.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
soap:
|
||||
is_secure: off
|
||||
3
apps/backend/modules/stOrder/config/view.yml
Normal file
3
apps/backend/modules/stOrder/config/view.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
all:
|
||||
stylesheets: [backend/stOrder.css?v5]
|
||||
|
||||
938
apps/backend/modules/stOrder/lib/stModuleWebApi.class.php
Normal file
938
apps/backend/modules/stOrder/lib/stModuleWebApi.class.php
Normal file
@@ -0,0 +1,938 @@
|
||||
<?php
|
||||
/**
|
||||
* SOTESHOP/stWebApiPlugin
|
||||
*
|
||||
* Ten plik należy do aplikacji stWebApiPlugin opartej na licencji (Open License SOTE) Otwarta Licencja 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 stWebApiPlugin
|
||||
* @subpackage libs
|
||||
* @copyright SOTE (www.sote.pl)
|
||||
* @license http://www.sote.pl/license/open (Open License SOTE) Otwarta Licencja SOTE
|
||||
* @version $Id: stModuleWebApi.class.php 16567 2011-12-21 13:38:08Z piotr $
|
||||
* @author Michal Prochowski <michal.prochowski@sote.pl>
|
||||
*/
|
||||
|
||||
/**
|
||||
* Klasa stOrderWebApi
|
||||
*
|
||||
* @package stWebApiPlugin
|
||||
* @subpackage libs
|
||||
*/
|
||||
class stOrderWebApi extends autoStOrderWebApi
|
||||
{
|
||||
/**
|
||||
*
|
||||
* @var Order
|
||||
*/
|
||||
protected $currentOrder = null;
|
||||
|
||||
protected $updateOrderStatus = false;
|
||||
|
||||
public static function setStatusId(Order $order, int $statusId)
|
||||
{
|
||||
$orderStatus = OrderStatusPeer::retrieveByPKCached($statusId);
|
||||
|
||||
if (null === $orderStatus)
|
||||
{
|
||||
self::throwSoapFault('INVALID_ORDER_STATUS_ID', 'Status o id "%%id%%" - nie istnieje', [
|
||||
'%%id%%' => $statusId,
|
||||
]);
|
||||
}
|
||||
|
||||
$order->setOrderStatus($orderStatus);
|
||||
}
|
||||
|
||||
public static function setUser(Order $order, stdClass $userData)
|
||||
{
|
||||
$guardUser = sfGuardUserPeer::retrieveByUsername($userData->email);
|
||||
|
||||
if (null === $guardUser)
|
||||
{
|
||||
$guardUser = sfGuardUserPeer::createAnonymous($userData->email);
|
||||
}
|
||||
|
||||
$order->setSfGuardUser($guardUser);
|
||||
|
||||
$billingCountry = CountriesPeer::retrieveByIsoA2($userData->billing->country);
|
||||
$deliveryCountry = CountriesPeer::retrieveByIsoA2($userData->delivery->country);
|
||||
|
||||
unset($userData->billing->country);
|
||||
unset($userData->delivery->country);
|
||||
|
||||
if (null === $billingCountry)
|
||||
{
|
||||
self::throwSoapFault('INVALID_ORDER_USER_DATA_BILLING_COUNTRY', 'Kraj o kodzie "%%iso_code%%" - nie istnieje lub nie jest aktywny');
|
||||
}
|
||||
|
||||
if (null === $deliveryCountry)
|
||||
{
|
||||
self::throwSoapFault('INVALID_ORDER_USER_DATA_DELIVERY_COUNTRY', 'Kraj o kodzie "%%iso_code%%" - nie istnieje lub nie jest aktywny');
|
||||
}
|
||||
|
||||
|
||||
|
||||
$order->getOrderUserDataBilling()->fromArray(get_object_vars($userData->billing), BasePeer::TYPE_FIELDNAME);
|
||||
$order->getOrderUserDataBilling()->setZipCode($userData->billing->zip_code);
|
||||
$order->getOrderUserDataBilling()->setCountries($deliveryCountry);
|
||||
|
||||
$order->getOrderUserDataDelivery()->fromArray(get_object_vars($userData->delivery), BasePeer::TYPE_FIELDNAME);
|
||||
$order->getOrderUserDataDelivery()->setZipCode($userData->delivery->zip_code);
|
||||
$order->getOrderUserDataDelivery()->setCountries($deliveryCountry);
|
||||
}
|
||||
|
||||
public function getGetOrderListCriteria($object)
|
||||
{
|
||||
$criteria = parent::getGetOrderListCriteria($object);
|
||||
|
||||
if (isset($object->order_status_id))
|
||||
{
|
||||
$criteria->add(OrderPeer::ORDER_STATUS_ID, $object->order_status_id);
|
||||
}
|
||||
|
||||
if (isset($object->sf_guard_user_id))
|
||||
{
|
||||
$criteria->add(OrderPeer::SF_GUARD_USER_ID, $object->sf_guard_user_id);
|
||||
}
|
||||
|
||||
if (isset($object->client_email))
|
||||
{
|
||||
$criteria->add(OrderPeer::OPT_CLIENT_EMAIL, $object->client_email);
|
||||
}
|
||||
|
||||
if (isset($object->number))
|
||||
{
|
||||
$criteria->add(OrderPeer::NUMBER, $object->number);
|
||||
}
|
||||
|
||||
if (isset($object->is_confirmed))
|
||||
{
|
||||
$criteria->add(OrderPeer::IS_CONFIRMED, $object->is_confirmed);
|
||||
}
|
||||
|
||||
if (isset($object->is_allegro_order))
|
||||
{
|
||||
$criteria->add(OrderPeer::OPT_ALLEGRO_CHECKOUT_FORM_ID, null, $object->is_allegro_order ? Criteria::ISNOTNULL : Criteria::ISNULL);
|
||||
}
|
||||
|
||||
return $criteria;
|
||||
}
|
||||
|
||||
public static function setPayments(Order $order, array $paymentsData)
|
||||
{
|
||||
foreach ($paymentsData as $paymentData)
|
||||
{
|
||||
$deliveryPaymentType = $order->getOrderDelivery()->getDelivery()->getDeliveryPaymentType($paymentData->payment_type_id);
|
||||
|
||||
if (null === $deliveryPaymentType)
|
||||
{
|
||||
self::throwSoapFault('INVALID_PAYMENT_TYPE_ID', 'Typ płatności o id "%%id%%" - nie istnieje lub nie jest dostępny dla wybranej dostawy', ['%%id%%' => $paymentData->payment_type_id]);
|
||||
}
|
||||
|
||||
if (!$deliveryPaymentType->getIsActive())
|
||||
{
|
||||
self::throwSoapFault('INVALID_DELIVERY_PAYMENT_TYPE_ID', 'Typ płatności o id "%%id%%" - nie jest dostępny dla wybranej dostawy', ['%%id%%' => $paymentData->payment_type_id]);
|
||||
}
|
||||
|
||||
$payment = stPayment::newPaymentInstance($paymentData->payment_type_id, $order->getUnpaidAmount(), [
|
||||
'is_paid' => isset($paymentData->is_paid) && $paymentData->is_paid
|
||||
]);
|
||||
|
||||
$orderHasPayment = new OrderHasPayment();
|
||||
$orderHasPayment->setPayment($payment);
|
||||
$order->addOrderHasPayment($orderHasPayment);
|
||||
}
|
||||
}
|
||||
|
||||
public static function setProducts(Order $order, array $productsData)
|
||||
{
|
||||
foreach ($productsData as $productData)
|
||||
{
|
||||
$product = ProductPeer::retrieveByPK($productData->product_id);
|
||||
|
||||
if (!isset($productData->quantity))
|
||||
{
|
||||
$productData->quantity = 1;
|
||||
}
|
||||
|
||||
if (null === $product)
|
||||
{
|
||||
self::throwSoapFault('INVALID_PRODUCT_ID', 'Produkt o id "%%id%%" - nie istnieje', ['%%id%%' => $productData->product_id]);
|
||||
}
|
||||
|
||||
if (!$product->getActive())
|
||||
{
|
||||
self::throwSoapFault('INACTIVE_PRODUCT', 'Produkt o id "%%id%%" - nie jest aktywny', ['%%id%%' => $productData->product_id]);
|
||||
}
|
||||
|
||||
if ($product->hasOptions() && (!isset($productData->options) || empty($productData->options)))
|
||||
{
|
||||
self::throwSoapFault('PRODUCT_REQUIRE_PRODUCT_OPTIONS', 'Produkt o id "%%id%%" - wymaga przekazania opcji produktu', ['%%id%%' => $productData->product_id]);
|
||||
}
|
||||
|
||||
if ($product->hasOptions())
|
||||
{
|
||||
self::addProductOptions($product, $productData->options);
|
||||
}
|
||||
|
||||
if ($product->getIsStockValidated() && $product->getStock() < $productData->quantity)
|
||||
{
|
||||
self::throwSoapFault('PRODUCT_OUTOFSTOCK', 'Produkt o id "%%id%%" - nie ma dostępnej ilości w magazynie (dostępnych: %%available%%)', [
|
||||
'%%id%%' => $productData->product_id,
|
||||
'%%available%%' => $product->getStock(),
|
||||
]);
|
||||
}
|
||||
|
||||
if (isset($productData->discount))
|
||||
{
|
||||
$product->setDiscount([
|
||||
'value' => $productData->discount->value,
|
||||
'type' => isset($productData->discount->value) ? $productData->discount->value : '%',
|
||||
]);
|
||||
}
|
||||
|
||||
$orderProduct = OrderProductPeer::createFromProduct($product, $productData->quantity);
|
||||
$order->addOrderProduct($orderProduct);
|
||||
}
|
||||
}
|
||||
|
||||
public static function setCurrency(Order $order, string $isoCode)
|
||||
{
|
||||
$currency = CurrencyPeer::retrieveByIso($isoCode);
|
||||
|
||||
if (null === $currency)
|
||||
{
|
||||
self::throwSoapFault('INVALID_CURRENCY', 'Waluta "%%iso%%" - nie istnieje', ['%%iso%%' => $isoCode]);
|
||||
}
|
||||
|
||||
if (!$currency->getActive())
|
||||
{
|
||||
self::throwSoapFault('INACTIVE_CURRENCY', 'Waluta "%%iso%%" - nie jest aktywna', ['%%iso%%' => $isoCode]);
|
||||
}
|
||||
|
||||
$orderCurrency = OrderCurrencyPeer::create($currency);
|
||||
$order->setOrderCurrency($orderCurrency);
|
||||
}
|
||||
|
||||
public static function setDelivery(Order $order, stdClass $deliveryData)
|
||||
{
|
||||
$delivery = DeliveryPeer::retrieveByPK($deliveryData->delivery_id);
|
||||
|
||||
if (null === $delivery)
|
||||
{
|
||||
self::throwSoapFault('INVALID_DELIVERY_ID', 'Dostawa o id "%%id%%" - nie istnieje', ['%%id%%' => $deliveryData->delivery_id]);
|
||||
}
|
||||
|
||||
if (!$delivery->getIsActive())
|
||||
{
|
||||
self::throwSoapFault('INACTIVE_DELIVERY', 'Dostawa o id "%%id%%" - nie jest aktywna', ['%%id%%' => $deliveryData->delivery_id]);
|
||||
}
|
||||
|
||||
$productInfo = new stDeliveryOrderProductInfo($order, $order->getOrderCurrency());
|
||||
$orderDelivery = OrderDeliveryPeer::create($delivery, $productInfo);
|
||||
$orderDelivery->setIsExpressDelivery(isset($deliveryData->is_express_delivery) && $deliveryData->is_express_delivery);
|
||||
$orderDelivery->setIsWeekendDelivery(isset($deliveryData->is_weekend_delivery) && $deliveryData->is_weekend_delivery);
|
||||
|
||||
if (isset($deliveryData->tracking_numbers))
|
||||
{
|
||||
$orderDelivery->setTrackingNumbers($deliveryData->tracking_numbers);
|
||||
}
|
||||
|
||||
$order->setOrderDelivery($orderDelivery);
|
||||
}
|
||||
|
||||
public static function getOrderUserDataDeliveryCountry($item) {
|
||||
return $item->getOrderUserDataDelivery()->getCountry();
|
||||
}
|
||||
|
||||
public static function getHasAllegroSmartDelivery(Order $order)
|
||||
{
|
||||
return $order->getOrderDelivery() ? $order->getOrderDelivery()->getOptAllegroDeliverySmart() : false;
|
||||
}
|
||||
|
||||
public static function getOrderUserDataDeliveryName($item) {
|
||||
return $item->getOrderUserDataDelivery()->getName();
|
||||
}
|
||||
|
||||
public static function getOrderUserDataDeliverySurname($item) {
|
||||
return $item->getOrderUserDataDelivery()->getSurname();
|
||||
}
|
||||
|
||||
public static function getOrderUserDataDeliveryStreet($item) {
|
||||
return $item->getOrderUserDataDelivery()->getStreet();
|
||||
}
|
||||
|
||||
public static function getOrderUserDataDeliveryHouse($item) {
|
||||
return $item->getOrderUserDataDelivery()->getHouse();
|
||||
}
|
||||
|
||||
public static function getOrderUserDataDeliveryFlat($item) {
|
||||
return $item->getOrderUserDataDelivery()->getFlat();
|
||||
}
|
||||
|
||||
public static function getOrderUserDataDeliveryCode($item) {
|
||||
return $item->getOrderUserDataDelivery()->getCode();
|
||||
}
|
||||
|
||||
public static function getOrderUserDataDeliveryTown($item) {
|
||||
return $item->getOrderUserDataDelivery()->getTown();
|
||||
}
|
||||
|
||||
public static function getOrderUserDataDeliveryPhone($item) {
|
||||
return $item->getOrderUserDataDelivery()->getPhone();
|
||||
}
|
||||
|
||||
public static function getOrderUserDataDeliveryCompany($item) {
|
||||
return $item->getOrderUserDataDelivery()->getCompany();
|
||||
}
|
||||
|
||||
public static function getOrderUserDataDeliveryVatNumber($item) {
|
||||
return $item->getOrderUserDataDelivery()->getVatNumber();
|
||||
}
|
||||
|
||||
public static function getOrderUserDataBillingCountry($item) {
|
||||
return $item->getOrderUserDataBilling()->getCountry();
|
||||
}
|
||||
|
||||
public static function getOrderUserDataBillingName($item) {
|
||||
return $item->getOrderUserDataBilling()->getName();
|
||||
}
|
||||
|
||||
public static function getOrderUserDataBillingSurname($item) {
|
||||
return $item->getOrderUserDataBilling()->getSurname();
|
||||
}
|
||||
|
||||
public static function getOrderUserDataBillingStreet($item) {
|
||||
return $item->getOrderUserDataBilling()->getStreet();
|
||||
}
|
||||
|
||||
public static function getOrderUserDataBillingHouse($item) {
|
||||
return $item->getOrderUserDataBilling()->getHouse();
|
||||
}
|
||||
|
||||
public static function getOrderUserDataBillingFlat($item) {
|
||||
return $item->getOrderUserDataBilling()->getFlat();
|
||||
}
|
||||
|
||||
public static function getOrderUserDataBillingCode($item) {
|
||||
return $item->getOrderUserDataBilling()->getCode();
|
||||
}
|
||||
|
||||
public static function getOrderUserDataBillingTown($item) {
|
||||
return $item->getOrderUserDataBilling()->getTown();
|
||||
}
|
||||
|
||||
public static function getOrderUserDataBillingPhone($item) {
|
||||
return $item->getOrderUserDataBilling()->getPhone();
|
||||
}
|
||||
|
||||
public static function getOrderUserDataBillingCompany($item) {
|
||||
return $item->getOrderUserDataBilling()->getCompany();
|
||||
}
|
||||
|
||||
public static function getOrderUserDataBillingVatNumber($item) {
|
||||
return $item->getOrderUserDataBilling()->getVatNumber();
|
||||
}
|
||||
|
||||
public static function getOrderDeliveryName($item) {
|
||||
return $item->getOrderDelivery()->getName();
|
||||
}
|
||||
|
||||
public static function getOrderDeliveryCost($item) {
|
||||
return $item->getOrderDelivery()->getCost(true, true);
|
||||
}
|
||||
|
||||
public static function getOrderDeliveryTax($item) {
|
||||
return $item->getOrderDelivery()->getOptTax();
|
||||
}
|
||||
|
||||
public static function getOrderDeliveryNumber($item) {
|
||||
return $item->getOrderDelivery()->getNumber();
|
||||
}
|
||||
|
||||
public static function getOrderDeliveryInpost($item) {
|
||||
return $item->getOrderDelivery()->getPaczkomatyNumber();
|
||||
}
|
||||
|
||||
public static function getOrderCurrencyName($item) {
|
||||
return $item->getOrderCurrency()->getName();
|
||||
}
|
||||
|
||||
public static function getOrderCurrencyExchange($item) {
|
||||
return $item->getOrderCurrency()->getExchange();
|
||||
}
|
||||
|
||||
public static function getOrderCurrencyShortcut($item) {
|
||||
return $item->getOrderCurrency()->getShortcut();
|
||||
}
|
||||
|
||||
public static function setOrderDeliveryNumber($item, $value) {
|
||||
return $item->getOrderDelivery()->setNumber($value);
|
||||
}
|
||||
|
||||
public static function getOrderUserDataBillingAddress($item) {
|
||||
return $item->getOrderUserDataBilling()->getAddress();
|
||||
}
|
||||
|
||||
public static function getOrderUserDataBillingAddressMore($item) {
|
||||
return $item->getOrderUserDataBilling()->getAddressMore();
|
||||
}
|
||||
|
||||
public static function getOrderUserDataBillingFullName($item) {
|
||||
return $item->getOrderUserDataBilling()->getFullName();
|
||||
}
|
||||
|
||||
public static function getOrderUserDataDeliveryAddress($item) {
|
||||
return $item->getOrderUserDataDelivery()->getAddress();
|
||||
}
|
||||
|
||||
public static function getOrderUserDataDeliveryAddressMore($item) {
|
||||
return $item->getOrderUserDataDelivery()->getAddressMore();
|
||||
}
|
||||
|
||||
public static function getOrderUserDataDeliveryFullName($item) {
|
||||
return $item->getOrderUserDataDelivery()->getFullName();
|
||||
}
|
||||
|
||||
public static function getOptions($item) {
|
||||
return $item->getPriceModifierLabels();
|
||||
}
|
||||
|
||||
public static function getOrderAllegroDeliveryMethodId(Order $order)
|
||||
{
|
||||
return $order->getOrderDelivery()->getOptAllegroDeliveryMethodId();
|
||||
}
|
||||
|
||||
public static function getOrderAllegroCheckoutFormId(Order $order)
|
||||
{
|
||||
return $order->getOptAllegroCheckoutFormId();
|
||||
}
|
||||
|
||||
public static function getOrderAllegroUsername(Order $order)
|
||||
{
|
||||
return $order->getOptAllegroNick();
|
||||
}
|
||||
|
||||
public static function getClientEmail(Order $order)
|
||||
{
|
||||
return $order->getOptClientEmail();
|
||||
}
|
||||
|
||||
public static function getAllegroOfferId(OrderProduct $orderProduct)
|
||||
{
|
||||
return $orderProduct->getAllegroAuctionId();
|
||||
}
|
||||
|
||||
public static function getOrderDeliveryType(Order $order)
|
||||
{
|
||||
$delivery = $order->getOrderDelivery()->getDelivery();
|
||||
|
||||
return $delivery && $delivery->getDeliveryType() ? $delivery->getDeliveryType()->getType() : null;
|
||||
}
|
||||
|
||||
public static function getOrderDeliveryPickupPoint(Order $order)
|
||||
{
|
||||
return $order->getOrderDelivery()->getPickupPoint();
|
||||
}
|
||||
|
||||
public function getFieldsForGetOrderProductList( $object, $item ) {
|
||||
parent::getFieldsForGetOrderProductList($object, $item);
|
||||
$object->discount_amount = stWebApi::formatData($item->getDiscountValue(), "double");
|
||||
$object->discount_type = stWebApi::formatData($item->getDiscountType(), "string");
|
||||
}
|
||||
|
||||
/**
|
||||
* Pobieranie danych
|
||||
*
|
||||
* @param object $object obiekt z parametrami
|
||||
* @return object okiekt z danymi
|
||||
* @throws WEBAPI_INCORRECT_ID WEBAPI_REQUIRE_ERROR
|
||||
*/
|
||||
public function GetOrderProductList( $object )
|
||||
{
|
||||
if (isset($object->_culture)) { $this->__setCulture($object->_culture);}
|
||||
stWebApi::getLogin($object->_session_hash, 'webapi_read');
|
||||
$this->TestAndValidateGetOrderProductListFields( $object );
|
||||
$c = new Criteria( );
|
||||
|
||||
if (isset($object->_modified_from) && isset($object->_modified_to)) {
|
||||
$criterion = $c->getNewCriterion(OrderProductPeer::UPDATED_AT, $object->_modified_from, Criteria::GREATER_EQUAL);
|
||||
$criterion->addAnd($c->getNewCriterion(OrderProductPeer::UPDATED_AT, $object->_modified_to, Criteria::LESS_EQUAL));
|
||||
$c->add($criterion);
|
||||
} else {
|
||||
if (isset($object->_modified_from)) {
|
||||
$criterion = $c->getNewCriterion(OrderProductPeer::UPDATED_AT, $object->_modified_from, Criteria::GREATER_EQUAL);
|
||||
$c->add($criterion);
|
||||
}
|
||||
|
||||
if (isset($object->_modified_to)) {
|
||||
$criterion = $c->getNewCriterion(OrderProductPeer::UPDATED_AT, $object->_modified_to, Criteria::LESS_EQUAL);
|
||||
$c->add($criterion);
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($object->_limit)) $object->_limit = 20;
|
||||
|
||||
// ustawiamy kryteria wyboru
|
||||
$c->setLimit( $object->_limit );
|
||||
$c->setOffset( $object->_offset );
|
||||
$c->add(OrderProductPeer::ORDER_ID, $object->order_id);
|
||||
|
||||
$items = OrderProductPeer::doSelect( $c );
|
||||
|
||||
$without_discount = isset($object->without_discount) && $object->without_discount;
|
||||
|
||||
if ( $items )
|
||||
{
|
||||
// Zwracanie wyniku, dla wszystkich pol z tablicy 'out'
|
||||
$items_array = array();
|
||||
$order = OrderPeer::retrieveByPK($object->order_id);
|
||||
$prev = self::initOrder($order);
|
||||
foreach ( $items as $item )
|
||||
{
|
||||
$order_product = new StdClass( );
|
||||
$this->getFieldsForGetOrderProductList( $order_product, $item );
|
||||
|
||||
if ($without_discount)
|
||||
{
|
||||
$order_product->price = stWebApi::formatData($item->getPriceNetto(true, false), "double");
|
||||
$order_product->price_brutto = stWebApi::formatData($item->getPriceBrutto(true, false), "double");
|
||||
}
|
||||
|
||||
if ($item->getIsSet() && $item->getVersion() < 3)
|
||||
{
|
||||
$c = new Criteria();
|
||||
$c->addJoin(ProductPeer::ID, OrderProductHasSetPeer::PRODUCT_ID);
|
||||
$c->add(OrderProductHasSetPeer::ORDER_PRODUCT_ID, $item->getId());
|
||||
|
||||
$product = $item->getProduct();
|
||||
|
||||
$product->setCulture($order->getClientCulture());
|
||||
|
||||
$total = $order_product->price_brutto;
|
||||
|
||||
$products = ProductPeer::doSelectWithI18n($c);
|
||||
|
||||
$cnt = count($products) + 1;
|
||||
|
||||
$price_brutto = stPrice::round($total / $cnt);
|
||||
|
||||
$price_netto = stPrice::extract($price_brutto, $order_product->vat);
|
||||
|
||||
$left = stPrice::round($total - $price_brutto * $cnt);
|
||||
|
||||
$set = array(
|
||||
self::createSet($product->getId(), $product->getCode(), $product->getName(), stPrice::extract($price_brutto + $left, $order_product->vat), $price_brutto + $left)
|
||||
);
|
||||
|
||||
foreach ($products as $index => $product)
|
||||
{
|
||||
$set[] = self::createSet($product->getId(), $product->getCode(), $product->getName(), $price_netto, $price_brutto);
|
||||
}
|
||||
|
||||
$order_product->set = $set;
|
||||
}
|
||||
elseif ($item->getIsSet())
|
||||
{
|
||||
$set = array();
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(OrderProductHasSetPeer::ORDER_PRODUCT_ID, $item->getId());
|
||||
|
||||
$ophs = OrderProductHasSetPeer::doSelect($c);
|
||||
|
||||
foreach ($ophs as $current)
|
||||
{
|
||||
$set[] = self::createSet($current->getProductId(), $current->getCode(), $current->getName(), $current->getPriceNetto(), $current->getPriceBrutto());
|
||||
}
|
||||
|
||||
$order_product->set = $set;
|
||||
}
|
||||
else
|
||||
{
|
||||
$order_product->set = array();
|
||||
}
|
||||
|
||||
$items_array[] = $order_product;
|
||||
}
|
||||
self::restoreDefaults($prev);
|
||||
return $items_array;
|
||||
} else {
|
||||
return array( );
|
||||
}
|
||||
}
|
||||
|
||||
public function GetOrderPayment( $object )
|
||||
{
|
||||
if (isset($object->_culture)) { $this->__setCulture($object->_culture);}
|
||||
stWebApi::getLogin($object->_session_hash, 'webapi_read');
|
||||
$this->TestAndValidateGetOrderPaymentFields( $object );
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(OrderHasPaymentPeer::ORDER_ID,$object->order_id);
|
||||
$c->addJoin(OrderHasPaymentPeer::PAYMENT_ID, PaymentPeer::ID);
|
||||
|
||||
$items = PaymentPeer::doSelect( $c );
|
||||
if ( $items )
|
||||
{
|
||||
$items_array = array();
|
||||
foreach ( $items as $item )
|
||||
{
|
||||
$object = new StdClass( );
|
||||
$this->getFieldsForGetOrderPayment( $object, $item );
|
||||
$items_array[] = $object;
|
||||
}
|
||||
return $items_array;
|
||||
} else {
|
||||
throw new SoapFault( "1", $this->__(WEBAPI_INCORRECT_ID) );
|
||||
}
|
||||
}
|
||||
|
||||
public static function getPaymentOptName($item) {
|
||||
if (is_object($item->getPaymentType())) {
|
||||
$name = $item->getPaymentType()->getOptName();
|
||||
|
||||
if ($item->getAllegroPaymentType()) {
|
||||
sfLoader::loadHelpers(array('Helper', 'stAllegro'));
|
||||
$name .= " - ".st_allegro_payment_type($item->getAllegroPaymentType());
|
||||
}
|
||||
|
||||
return $name;
|
||||
}
|
||||
else if (is_object($item->getGiftCard())) {
|
||||
return "Kod: ".$item->getGiftCard()->getCode();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Aktualizacja danych
|
||||
*
|
||||
* @param object $object obiekt z parametrami
|
||||
* @return object obiekt z true
|
||||
* @throws WEBAPI_INCORRECT_ID WEBAPI_UPDATE_ERROR WEBAPI_REQUIRE_ERROR
|
||||
* @todo dodać walidacje danych
|
||||
*/
|
||||
public function SetOrderPaymentStatus( $object )
|
||||
{
|
||||
if (isset($object->_culture)) { $this->__setCulture($object->_culture);}
|
||||
stWebApi::getLogin($object->_session_hash, 'webapi_write');
|
||||
$this->TestAndValidateSetOrderPaymentStatusFields( $object );
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(OrderHasPaymentPeer::ORDER_ID,$object->order_id);
|
||||
$c->addJoin(OrderHasPaymentPeer::PAYMENT_ID, PaymentPeer::ID);
|
||||
|
||||
$item = PaymentPeer::doSelectOne( $c );
|
||||
if ( $item )
|
||||
{
|
||||
$this->setFieldsForSetOrderPaymentStatus( $object, $item );
|
||||
//Zapisywanie danych do bazy
|
||||
try {
|
||||
$item->save( );
|
||||
} catch ( Exception $e ) {
|
||||
throw new SoapFault( "2", sprintf($this->__(WEBAPI_UPDATE_ERROR),$e->getMessage()) );
|
||||
}
|
||||
|
||||
// Zwracanie danych
|
||||
$object = new StdClass( );
|
||||
$object->_update = true;
|
||||
return $object;
|
||||
|
||||
} else {
|
||||
throw new SoapFault( "1", $this->__(WEBAPI_INCORRECT_ID) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Pobieranie danych
|
||||
*
|
||||
* @param object $object obiekt z parametrami
|
||||
* @return object okiekt z danymi
|
||||
* @throws WEBAPI_INCORRECT_ID WEBAPI_REQUIRE_ERROR
|
||||
*/
|
||||
public function GetOrderByNumber( $object )
|
||||
{
|
||||
if (isset($object->_culture)) { $this->__setCulture($object->_culture);}
|
||||
stWebApi::getLogin($object->_session_hash, 'webapi_read');
|
||||
$this->TestAndValidateGetOrderByNumberFields( $object );
|
||||
|
||||
$item = OrderPeer::retrieveByNumber( $object->number );
|
||||
|
||||
if ( $item )
|
||||
{
|
||||
$object = new StdClass( );
|
||||
$this->getFieldsForGetOrderByNumber( $object, $item );
|
||||
return $object;
|
||||
} else {
|
||||
throw new SoapFault( "1", $this->__(WEBAPI_INCORRECT_ID) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Pobieranie danych
|
||||
*
|
||||
* @param object $object obiekt z parametrami
|
||||
* @return object okiekt z danymi
|
||||
* @throws WEBAPI_INCORRECT_ID WEBAPI_REQUIRE_ERROR
|
||||
*/
|
||||
public function GetOrderListByUser( $object )
|
||||
{
|
||||
if (isset($object->_culture)) { $this->__setCulture($object->_culture);}
|
||||
stWebApi::getLogin($object->_session_hash, 'webapi_read');
|
||||
$this->TestAndValidateGetOrderListFields( $object );
|
||||
|
||||
if (!isset($object->user_id) && !isset($object->user_name)) return array();
|
||||
|
||||
$userId = null;
|
||||
if (isset($object->user_id)) $userId = $object->user_id;
|
||||
|
||||
if ($userId == null && isset($object->user_name))
|
||||
{
|
||||
$userC = new Criteria();
|
||||
$userC->add(sfGuardUserPeer::USERNAME, $object->user_name);
|
||||
$user = sfGuardUserPeer::doSelectOne($userC);
|
||||
|
||||
if(!is_object($user)) return array();
|
||||
$userId = $user->getId();
|
||||
}
|
||||
|
||||
if ($userId == null) return array();
|
||||
|
||||
$c = new Criteria( );
|
||||
|
||||
$c->add(OrderPeer::SF_GUARD_USER_ID, $userId);
|
||||
|
||||
if (isset($object->_modified_from) && isset($object->_modified_to)) {
|
||||
$criterion = $c->getNewCriterion(OrderPeer::UPDATED_AT, $object->_modified_from, Criteria::GREATER_EQUAL);
|
||||
$criterion->addAnd($c->getNewCriterion(OrderPeer::UPDATED_AT, $object->_modified_to, Criteria::LESS_EQUAL));
|
||||
$c->add($criterion);
|
||||
} else {
|
||||
if (isset($object->_modified_from)) {
|
||||
$criterion = $c->getNewCriterion(OrderPeer::UPDATED_AT, $object->_modified_from, Criteria::GREATER_EQUAL);
|
||||
$c->add($criterion);
|
||||
}
|
||||
|
||||
if (isset($object->_modified_to)) {
|
||||
$criterion = $c->getNewCriterion(OrderPeer::UPDATED_AT, $object->_modified_to, Criteria::LESS_EQUAL);
|
||||
$c->add($criterion);
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($object->_limit)) $object->_limit = 20;
|
||||
|
||||
// ustawiamy kryteria wyboru
|
||||
$c->setLimit( $object->_limit );
|
||||
$c->setOffset( $object->_offset );
|
||||
|
||||
$items = OrderPeer::doSelect( $c );
|
||||
|
||||
if ( $items )
|
||||
{
|
||||
// Zwracanie wyniku, dla wszystkich pol z tablicy 'out'
|
||||
$items_array = array();
|
||||
foreach ( $items as $item )
|
||||
{
|
||||
$object = new StdClass( );
|
||||
$this->getFieldsForGetOrderList( $object, $item );
|
||||
$items_array[] = $object;
|
||||
}
|
||||
return $items_array;
|
||||
} else {
|
||||
return array( );
|
||||
}
|
||||
}
|
||||
|
||||
public function GetOrderProductCount( $object )
|
||||
{
|
||||
if (isset($object->_culture)) { $this->__setCulture($object->_culture);}
|
||||
stWebApi::getLogin($object->_session_hash, 'webapi_read');
|
||||
|
||||
try{
|
||||
$c = new Criteria( );
|
||||
$c->add(OrderProductPeer::ORDER_ID, $object->order_id);
|
||||
|
||||
if (isset($object->_modified_from) && isset($object->_modified_to)) {
|
||||
$criterion = $c->getNewCriterion(OrderProductPeer::UPDATED_AT, $object->_modified_from, Criteria::GREATER_EQUAL);
|
||||
$criterion->addAnd($c->getNewCriterion(OrderProductPeer::UPDATED_AT, $object->_modified_to, Criteria::LESS_EQUAL));
|
||||
$c->add($criterion);
|
||||
} else {
|
||||
if (isset($object->_modified_from)) {
|
||||
$criterion = $c->getNewCriterion(OrderProductPeer::UPDATED_AT, $object->_modified_from, Criteria::GREATER_EQUAL);
|
||||
$c->add($criterion);
|
||||
}
|
||||
|
||||
if (isset($object->_modified_to)) {
|
||||
$criterion = $c->getNewCriterion(OrderProductPeer::UPDATED_AT, $object->_modified_to, Criteria::LESS_EQUAL);
|
||||
$c->add($criterion);
|
||||
}
|
||||
}
|
||||
|
||||
//Zwracanie danych
|
||||
$obj = new StdClass( );
|
||||
$obj->_count = OrderProductPeer::doCount($c);
|
||||
return $obj;
|
||||
} catch ( Exception $e ) {
|
||||
throw new SoapFault( "1", sprintf($this->__(WEBAPI_COUNT_ERROR),$e->getMessage()) );
|
||||
}
|
||||
}
|
||||
|
||||
public function UpdateOrderStatus($object) {
|
||||
$return = parent::UpdateOrderStatus($object);
|
||||
|
||||
if ($this->updateOrderStatus) {
|
||||
$notification = new stOrderMailNotification(sfContext::getInstance());
|
||||
$notification->sendStatusChangeNotification($this->currentOrder);
|
||||
}
|
||||
|
||||
$obj = new StdClass();
|
||||
$obj->order = $this->currentOrder;
|
||||
stEventDispatcher::getInstance()->notify(new sfEvent($obj, 'stOrderApiActions.postUpdateStatus', array()));
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param object $object
|
||||
* @param Order $item
|
||||
* @return void
|
||||
*/
|
||||
public function setFieldsForUpdateOrderStatus( $object, $item ) {
|
||||
parent::setFieldsForUpdateOrderStatus($object, $item);
|
||||
|
||||
$this->currentOrder = $item;
|
||||
$this->updateOrderStatus = $item->isColumnModified(OrderPeer::ORDER_STATUS_ID);
|
||||
}
|
||||
|
||||
public static function initOrder(Order $order)
|
||||
{
|
||||
$context = sfContext::getInstance();
|
||||
$currency = stCurrency::getInstance($context);
|
||||
$prev_culture = $context->getUser()->getCulture();
|
||||
$context->getUser()->setCulture($order->getClientCulture());
|
||||
|
||||
$prev_currency_id = $currency->get()->getId();
|
||||
|
||||
$order_currency = CurrencyPeer::retrieveByIso($order->getOrderCurrency()->getShortcut());
|
||||
|
||||
if ($order_currency) {
|
||||
$currency->set($order_currency->getId());
|
||||
$dispatcher = $context->getController()->getDispatcher();
|
||||
$dispatcher->connect('Product.postHydrate', array('appAddPricePluginListener', 'productPostHydrate'));
|
||||
$dispatcher->connect('ProductOptionsValue.postHydrate', array('appAddPricePluginListener', 'productOptionsValuePostHydrate'));
|
||||
$dispatcher->connect('ProductPeer.postAddSelectColumns', array('appAddPricePluginListener', 'productPostAddSelectColumns'));
|
||||
$dispatcher->connect('BasePeer.preDoSelectRs', array('appAddPricePluginListener', 'preDoSelectRs'));
|
||||
}
|
||||
|
||||
Product::enableFrontendFunctions();
|
||||
|
||||
return array('currency' => $prev_currency_id, );
|
||||
}
|
||||
|
||||
public static function restoreDefaults($prev)
|
||||
{
|
||||
$currency = stCurrency::getInstance(sfContext::getInstance());
|
||||
$currency->set($prev['currency']);
|
||||
|
||||
Product::enableFrontendFunctions(false);
|
||||
}
|
||||
|
||||
public static function createSet($id, $code, $name, $price_netto = null, $price_brutto = null)
|
||||
{
|
||||
return array(
|
||||
'id' => stWebApi::formatData($id, 'integer'),
|
||||
'code' => stWebApi::formatData($code, 'string'),
|
||||
'name' => stWebApi::formatData($name, 'string'),
|
||||
'price' => stWebApi::formatData($price_netto, 'double'),
|
||||
'price_brutto' => stWebApi::formatData($price_brutto, 'double'),
|
||||
);
|
||||
}
|
||||
|
||||
public static function getOrderDiscountValue(Order $order)
|
||||
{
|
||||
$discount = $order->getOrderDiscount();
|
||||
|
||||
return $discount ? $discount['value'] : 0;
|
||||
}
|
||||
|
||||
public static function getOrderDiscountType(Order $order)
|
||||
{
|
||||
$discount = $order->getOrderDiscount();
|
||||
|
||||
return $discount ? $discount['type'] : 0;
|
||||
}
|
||||
|
||||
public static function getTotalAmount(Order $order)
|
||||
{
|
||||
return $order->getOptTotalAmount();
|
||||
}
|
||||
|
||||
public static function getOrderAllegroAuctionId(Order $order)
|
||||
{
|
||||
return null !== $order->getOptAllegroCheckoutFormId() || null !== $order->getOptAllegroNick();
|
||||
}
|
||||
|
||||
protected function saveOrderForAddOrder(Order $item): int
|
||||
{
|
||||
$result = parent::saveOrderForAddOrder($item);
|
||||
|
||||
$proforma = stInvoice::createInvoiceProforma($item);
|
||||
|
||||
if ($item->getClientRequestInvoice())
|
||||
{
|
||||
stInvoice::createInvoiceRequest($item, $proforma);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
protected static function addProductOptions(Product $product, array $productOptionsIds)
|
||||
{
|
||||
$allowedParentIds = [];
|
||||
$selectedfieldIds = [];
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(ProductOptionsValuePeer::ID, $productOptionsIds, Criteria::IN);
|
||||
$c->add(ProductOptionsValuePeer::PRODUCT_ID, $product->getId());
|
||||
|
||||
$productOptions = ProductOptionsValuePeer::doSelectJoinProductOptionsField($c);
|
||||
|
||||
if (count($productOptions) < count($productOptionsIds))
|
||||
{
|
||||
$currentProductOptionIds = [];
|
||||
|
||||
foreach ($productOptions as $productOption)
|
||||
{
|
||||
$currentProductOptionIds[] = $productOption->getId();
|
||||
}
|
||||
|
||||
$invalidProductOptionIds = array_diff($productOptionsIds, $currentProductOptionIds);
|
||||
|
||||
self::throwSoapFault('INVALID_PRODUT_OPTION_ID', 'Opcje o id "%%option_id%%" nie istnieją lub nie należą do produktu o id "%%id%%"', [
|
||||
'%%option_id%%' => implode('", "C', $invalidProductOptionIds),
|
||||
'%%id%%' => $product->getId(),
|
||||
]);
|
||||
}
|
||||
|
||||
foreach ($productOptions as $productOption)
|
||||
{
|
||||
if (!$productOption->isLeaf())
|
||||
{
|
||||
self::throwSoapFault('INVALID_PRODUCT_OPTION', 'Opcja o id "%%option_id%%" - musi być opcją ostatniego poziomu', [
|
||||
'%%option_id%%' => $productOption->getId(),
|
||||
]);
|
||||
}
|
||||
|
||||
if (!stNewProductOptions::updateProductBySelectedOptions($product, $productOption->getPathWithoutRoot(true), $allowedParentIds, $selectedfieldIds))
|
||||
{
|
||||
self::throwSoapFault('INVALID_PRODUCT_OPTION_COMBINATION', 'Produktu o id "%%id%%" - posiada niedozwoloną kombinację opcji', [
|
||||
'%%id%%' => $product->getId(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
class stOrderBreadcrumbsBuilder extends autoStOrderBreadcrumbsBuilder
|
||||
{
|
||||
public function getEditBreadcrumbs(Order $order)
|
||||
{
|
||||
if ($order->isAllegroOrder())
|
||||
{
|
||||
$i18n = $this->context->getI18N();
|
||||
$this->getDefaultBreadcrumbs()->add($i18n->__('Zamówienia Allegro', null, 'stOrder'), '@stOrder?action=allegroList');
|
||||
}
|
||||
|
||||
return parent::getEditBreadcrumbs($order);
|
||||
}
|
||||
}
|
||||
61
apps/backend/modules/stOrder/lib/stOrderValidator.class.php
Normal file
61
apps/backend/modules/stOrder/lib/stOrderValidator.class.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/**
|
||||
* SOTESHOP/stOrder
|
||||
*
|
||||
* Ten plik należy do aplikacji stOrder 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 stOrder
|
||||
* @subpackage libs
|
||||
* @copyright SOTE (www.sote.pl)
|
||||
* @license http://www.sote.pl/license/sote (Professional License SOTE)
|
||||
* @version $Id: stOrderValidator.class.php 31 2009-08-24 13:59:34Z marcin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* SOTESHOP/stOrder
|
||||
* Ten plik należy do aplikacji stOrder 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 stOrder
|
||||
* @subpackage libs
|
||||
*/
|
||||
class stOrderValidator extends sfValidator
|
||||
{
|
||||
|
||||
|
||||
public function execute(&$value, &$error)
|
||||
{
|
||||
$constants = array('NUMER', 'DZIEN', 'MIESIAC', 'ROK');
|
||||
|
||||
if (strpos($value, '{NUMER}') === false)
|
||||
{
|
||||
$error = 'Parametr {NUMER} jest wymagany...';
|
||||
return false;
|
||||
}
|
||||
|
||||
if (preg_match('/[^a-zA-Z0-9{}_\/,. -]+/', $value))
|
||||
{
|
||||
$error = 'Format może zawierać wyłącznie litery alfabetu angielskiego (a-z), cyfry oraz znaki "/.,-"';
|
||||
return false;
|
||||
}
|
||||
|
||||
preg_match_all('/{([^}]+)}/', $value, $matches, PREG_PATTERN_ORDER);
|
||||
|
||||
foreach ($matches[1] as $name)
|
||||
{
|
||||
if (array_search($name, $constants) === false)
|
||||
{
|
||||
$error = 'Podany parametr {'.$name.'} nie istnieje...';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1 @@
|
||||
<strong><?php echo st_order_price_format(stPayment::getUnpayedAmountByOrder($order), $order->getOrderCurrency()); ?></strong>
|
||||
26
apps/backend/modules/stOrder/templates/_assigned_id.php
Normal file
26
apps/backend/modules/stOrder/templates/_assigned_id.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
use_helper('sfGuardUser');
|
||||
|
||||
echo sf_guard_user_admin_select_tag('order[assigned_id]', $order->getAssignedId(), array('include_custom' => __('Brak')));
|
||||
?>
|
||||
<p class="mt-1<?php echo $order->getAssignedId() == $sf_user->getGuardUser()->getId() ? ' d-none' : '' ?>" id="order_assin_me">
|
||||
<?php echo st_get_admin_button('default', __("Przypisz mnie"), '#', array('data-id' => $sf_user->getGuardUser()->getId(), 'size' => 'small')); ?>
|
||||
</p>
|
||||
|
||||
<script>
|
||||
jQuery(function($) {
|
||||
var assignMe = $('#order_assin_me');
|
||||
var select = $('#order_assigned_id').change(function() {
|
||||
if (select.val() != assignMe.find('a').data('id')) {
|
||||
assignMe.show();
|
||||
} else {
|
||||
assignMe.hide();
|
||||
}
|
||||
});
|
||||
|
||||
assignMe.on('click', 'a', function() {
|
||||
var link = $(this);
|
||||
select.val(link.data('id')).change().trigger("chosen:updated");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php if ($order_status->isCouponCodeEnabled()): ?>
|
||||
<?php echo st_admin_checkbox_tag('order_status[attach_coupon_code]', true, $order_status->getAttachCouponCode(), array('disabled' => !$order_status->getHasMailNotification() || $order_status->getType() != OrderStatusPeer::ST_COMPLETE))?>
|
||||
<script type="text/javascript">
|
||||
var attach_coupon_code = $('order_status_attach_coupon_code');
|
||||
|
||||
var has_email_notification = $('order_status_has_mail_notification');
|
||||
|
||||
var order_status_type = $('order_status_order_status_type');
|
||||
|
||||
attach_coupon_code.observe('click', function() {
|
||||
|
||||
$$('.coupon_code_field').each(function(i) {
|
||||
if (i.id != attach_coupon_code.id)
|
||||
{
|
||||
i.disabled = !attach_coupon_code.checked;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
has_email_notification.observe('click', function() {
|
||||
|
||||
attach_coupon_code.disabled = !has_email_notification.checked;
|
||||
|
||||
$$('.coupon_code_field').each(function(i) {
|
||||
i.disabled = !has_email_notification.checked || !attach_coupon_code.checked;
|
||||
});
|
||||
});
|
||||
|
||||
order_status_type.observe('change', function() {
|
||||
|
||||
var value = this.options[this.selectedIndex].value;
|
||||
|
||||
attach_coupon_code.disabled = !has_email_notification.checked || value != '<?php echo OrderStatusPeer::ST_COMPLETE ?>';
|
||||
|
||||
$$('.coupon_code_field').each(function(i) {
|
||||
i.disabled = !has_email_notification.checked || !attach_coupon_code.checked || value != '<?php echo OrderStatusPeer::ST_COMPLETE ?>';
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php else: ?>
|
||||
<?php echo __('Kody rabatowe są wyłączone') ?> <?php echo st_external_link_to(__('Włącz kody rabatowe'), 'stDiscountBackend/config') ?>
|
||||
<?php endif; ?>
|
||||
3
apps/backend/modules/stOrder/templates/_auction_id.php
Normal file
3
apps/backend/modules/stOrder/templates/_auction_id.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php foreach (AllegroAuctionPeer::getAuctionsByOrder($order) as $auction):?>
|
||||
<?php echo st_external_link_to($auction->getAuctionId(), $auction->getAuctionLink(), array('target'=>'_new'));?><br />
|
||||
<?php endforeach;?>
|
||||
1
apps/backend/modules/stOrder/templates/_color.php
Normal file
1
apps/backend/modules/stOrder/templates/_color.php
Normal file
@@ -0,0 +1 @@
|
||||
<?php echo st_colorpicker_input_tag('order_status[color]', $order_status->getColor() ? $order_status->getColor() : 'ffffff') ?>
|
||||
@@ -0,0 +1 @@
|
||||
<?php echo input_tag('coupon_code[discount]', $order_status->getCouponCodeDiscount(), array('size' => 3, 'disabled' => !$order_status->getAttachCouponCode(), 'class' => 'coupon_code_field')) ?> %
|
||||
@@ -0,0 +1 @@
|
||||
<?php echo input_tag('coupon_code[valid_for]', $order_status->getCouponCodeValidFor(), array('size' => 3, 'disabled' => !$order_status->getAttachCouponCode(), 'class' => 'coupon_code_field')) ?> <?php echo __('dni') ?>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?php if ($order->getDiscountCouponCode()): ?>
|
||||
<?php echo st_external_link_to($order->getDiscountCouponCode()->getCode(), 'stDiscountBackend/couponCodeEdit?id='.$order->getDiscountCouponCode()->getId()) ?> (<?php echo $order->getDiscountCouponCode()->getDiscount() ?>%)
|
||||
<?php else: ?>
|
||||
<?php echo __('Brak') ?>
|
||||
<?php endif; ?>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php echo sf_guard_user_admin_select_tag(
|
||||
'filters[assigned_id]',
|
||||
isset($filters['assigned_id']) ? $filters['assigned_id'] : null,
|
||||
array('include_custom' => [
|
||||
'' => '---',
|
||||
'none' => 'Brak',
|
||||
])
|
||||
) ?>
|
||||
@@ -0,0 +1 @@
|
||||
<?php echo input_tag('filters[filter_client]', isset($filters['filter_client']) ? $filters['filter_client'] : '', 'size=15') ?>
|
||||
15
apps/backend/modules/stOrder/templates/_filter_delivery.php
Normal file
15
apps/backend/modules/stOrder/templates/_filter_delivery.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
$options = array("" => "---");
|
||||
|
||||
$c = new Criteria();
|
||||
$c->addAscendingOrderByColumn(DeliveryI18nPeer::NAME);
|
||||
|
||||
foreach (DeliveryPeer::doSelectWithI18n($c) as $delivery)
|
||||
{
|
||||
$options[$delivery->getId()] = $delivery->getName();
|
||||
}
|
||||
|
||||
echo select_tag(
|
||||
'filters[filter_delivery]',
|
||||
options_for_select($options, isset($filters['filter_delivery']) ? $filters['filter_delivery'] : null)
|
||||
);
|
||||
@@ -0,0 +1 @@
|
||||
<?php echo input_tag('filters[discount_coupon_code]', isset($filters['discount_coupon_code']) ? $filters['discount_coupon_code'] : null) ?>
|
||||
@@ -0,0 +1 @@
|
||||
<?php echo input_tag('filters[gift_card_code]', isset($filters['gift_card_code']) ? $filters['gift_card_code'] : null) ?>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?php echo select_tag('filters[is_confirmed]',
|
||||
options_for_select(array(1 => __('tak', array(), 'stAdminGeneratorPlugin'), 0 => __('nie', array(), 'stAdminGeneratorPlugin')), isset($filters['is_confirmed']) ? $filters['is_confirmed'] : null, array (
|
||||
'include_custom' => __("---", null, 'stAdminGeneratorPlugin'),
|
||||
)), array (
|
||||
)) ?>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?php echo select_tag('filters[is_payed]',
|
||||
options_for_select(array(1 => __('tak', array(), 'stAdminGeneratorPlugin'), 0 => __('nie', array(), 'stAdminGeneratorPlugin')), isset($filters['is_payed']) ? $filters['is_payed'] : null, array (
|
||||
'include_custom' => __("---", null, 'stAdminGeneratorPlugin'),
|
||||
)), array (
|
||||
)) ?>
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
sfLoader::loadHelpers('stProduct', 'stProduct');
|
||||
|
||||
$id = null;
|
||||
$token = null;
|
||||
|
||||
if (isset($filters['order_product']) && $filters['order_product'])
|
||||
{
|
||||
if (is_numeric($filters['order_product']))
|
||||
{
|
||||
$token = array("id" => $filters['order_product']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$tokens = stJQueryToolsHelper::parseTokensFromRequest($filters['order_product']);
|
||||
|
||||
$token = $tokens ? $tokens[0] : null;
|
||||
}
|
||||
}
|
||||
|
||||
if ($token && !isset($token['new']))
|
||||
{
|
||||
$c = new Criteria();
|
||||
$c->add(ProductPeer::ID, $token['id']);
|
||||
|
||||
$defaults = ProductPeer::doSelectTokens($c);
|
||||
}
|
||||
elseif ($token)
|
||||
{
|
||||
$defaults = array($token);
|
||||
}
|
||||
else
|
||||
{
|
||||
$defaults = array();
|
||||
}
|
||||
|
||||
$results_formatter = _token_input_product_results_formatter();
|
||||
|
||||
$token_formatter = _token_input_product_token_formatter();
|
||||
|
||||
echo st_tokenizer_input_tag('filters[order_product]', st_url_for('@stProduct?action=ajaxProductsToken'), $defaults, array('tokenizer' => array(
|
||||
'preventDuplicates' => true,
|
||||
'resultsFormatter' => $results_formatter,
|
||||
'tokenFormatter' => $token_formatter,
|
||||
'hintText' => __('Wpisz kod/nazwę szukanego produktu', null, 'stProduct'),
|
||||
'additionalDataFields' => array('code'),
|
||||
'tokenLimit' => 1,
|
||||
'sortable' => false,
|
||||
'createNew' => true,
|
||||
'addNewText' => __('Szukaj w historii zamówień'),
|
||||
'addNewIcon' => '/images/backend/beta/icons/20x20/search.png',
|
||||
)));
|
||||
?>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?php echo st_order_status_filter_select_tag(
|
||||
'filters[filter_order_status]',
|
||||
isset($filters['filter_order_status']) ? $filters['filter_order_status'] : null,
|
||||
array('style' => 'max-width: 140px')
|
||||
) ?>
|
||||
14
apps/backend/modules/stOrder/templates/_filter_payment.php
Normal file
14
apps/backend/modules/stOrder/templates/_filter_payment.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
$options = array("" => "---", "gift_card" => __('Bon zakupowy'));
|
||||
|
||||
foreach (PaymentTypePeer::doSelectCached() as $payment)
|
||||
{
|
||||
$options[$payment->getId()] = $payment->getName();
|
||||
}
|
||||
|
||||
asort($options, SORT_NATURAL | SORT_FLAG_CASE);
|
||||
|
||||
echo select_tag(
|
||||
'filters[filter_payment]',
|
||||
options_for_select($options, isset($filters['filter_payment']) ? $filters['filter_payment'] : null)
|
||||
);
|
||||
16
apps/backend/modules/stOrder/templates/_invoice.php
Normal file
16
apps/backend/modules/stOrder/templates/_invoice.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* @var Order $order
|
||||
*/
|
||||
if (!$order->getInvoice())
|
||||
{
|
||||
echo __('Brak');
|
||||
}
|
||||
else
|
||||
{
|
||||
echo st_get_admin_button('preview', __("Pokaż"),"stInvoiceBackend/confirmEdit?id=".$order->getInvoice()->getId()."&type=".$type."&mode=show", array('size' => 'small'));
|
||||
echo st_get_admin_button('download', __("Pobierz"),"stInvoicePdf/show?id=".$order->getInvoice()->getId()."&download=true&culture=".$order->getClientCulture(), array('size' => 'small'));
|
||||
echo st_get_admin_button('refresh', __("Aktualizuj"), 'stInvoiceBackend/update?id='.$order->getId().'&invoice_id='.$order->getInvoice()->getId(), array('size' => 'small'));
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<?php echo $order->getInvoice() ? st_get_admin_button('add', __("wystaw"), "stInvoiceBackend/makeConfirmInvoice?id=".$order->getInvoice()->getId()."&type=".$order->getInvoice()->getType(), array('size' => 'small')) : __("Nie"); ?>
|
||||
5
apps/backend/modules/stOrder/templates/_is_default.php
Normal file
5
apps/backend/modules/stOrder/templates/_is_default.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php $is_blocked = ($order_status->getType() != OrderStatusPeer::ST_PENDING || $order_status->getIsDefault()) ?>
|
||||
<?php echo st_admin_checkbox_tag('order_status[is_default]', true, $order_status->getIsDefault(), array('disabled' => $is_blocked)) ?>
|
||||
<?php if ($is_blocked && $order_status->getIsDefault()): ?>
|
||||
<?php echo input_hidden_tag('order_status[is_default]', true) ?>
|
||||
<?php endif; ?>
|
||||
10
apps/backend/modules/stOrder/templates/_is_payed.php
Normal file
10
apps/backend/modules/stOrder/templates/_is_payed.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* @var Order $order
|
||||
*/
|
||||
echo $order->getIsPayed() ? st_admin_get_icon('check-circle') : ' ';
|
||||
|
||||
if ($order->getIsPayed() && !$order->hasValidPayment())
|
||||
{
|
||||
echo st_admin_get_icon('warning', array('title' => __('Status płatności został zmieniony bezpośrednio w bazie danych', null, 'stPayment')));
|
||||
}
|
||||
137
apps/backend/modules/stOrder/templates/_lastOrderWidget.php
Normal file
137
apps/backend/modules/stOrder/templates/_lastOrderWidget.php
Normal file
@@ -0,0 +1,137 @@
|
||||
<?php use_helper('stWidgets');?>
|
||||
<?php echo st_open_widget('Order',__('Zamówienia'));?>
|
||||
|
||||
<div style="float:right;">
|
||||
<?php echo __('Ostatnie', null, 'stBackendMain'); ?>:
|
||||
|
||||
<?php if($date_type == "day"): ?>
|
||||
<b><?php echo link_to_remote(__('24h', null, 'stBackendMain'), array('update'=>'last-order-widget', 'url'=>'stOrder/lastOrderWidget?date_type=day',)) ?></b>
|
||||
<?php else: ?>
|
||||
<?php echo link_to_remote(__('24h', null, 'stBackendMain'), array('update'=>'last-order-widget', 'url'=>'stOrder/lastOrderWidget?date_type=day',)) ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if($date_type == "week"): ?>
|
||||
<b><?php echo link_to_remote(__('7 dni', null, 'stBackendMain'), array('update'=>'last-order-widget', 'url'=>'stOrder/lastOrderWidget?date_type=week',)) ?></b>
|
||||
<?php else: ?>
|
||||
<?php echo link_to_remote(__('7 dni', null, 'stBackendMain'), array('update'=>'last-order-widget', 'url'=>'stOrder/lastOrderWidget?date_type=week',)) ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if($date_type == "month"): ?>
|
||||
<b><?php echo link_to_remote(__('miesiąc', null, 'stBackendMain'), array('update'=>'last-order-widget', 'url'=>'stOrder/lastOrderWidget?date_type=month',)) ?></b>
|
||||
<?php else: ?>
|
||||
<?php echo link_to_remote(__('miesiąc', null, 'stBackendMain'), array('update'=>'last-order-widget', 'url'=>'stOrder/lastOrderWidget?date_type=month',)) ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if($date_type == "lastlog"): ?>
|
||||
<b><?php echo link_to_remote(__('logowanie', null, 'stBackendMain'), array('update'=>'last-order-widget', 'url'=>'stOrder/lastOrderWidget?date_type=lastlog',)) ?></b>
|
||||
<?php else: ?>
|
||||
<?php echo link_to_remote(__('logowanie', null, 'stBackendMain'), array('update'=>'last-order-widget', 'url'=>'stOrder/lastOrderWidget?date_type=lastlog',)) ?>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
|
||||
<b><?php echo st_link_to(__('Wartość'), 'stOrder/'); ?></b> (<?php echo $orderQuantity; ?>)
|
||||
|
||||
<?php if($price == ""): ?>
|
||||
<?php $price = 0; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<b><?php echo st_back_price($price, true, true) ?></b>
|
||||
|
||||
<table class="st_record_list" cellspacing="0" width="100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="20px"><?php echo __('nr') ?></th>
|
||||
<th width="60px"><?php echo __('złożone') ?></th>
|
||||
<th width="20px"><?php echo __('pot.') ?></th>
|
||||
<th><?php echo __('klient') ?></th>
|
||||
<th width="80px"><?php echo __('kwota') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<?php $i = 1; ?>
|
||||
<?php foreach ($orders as $index => $order): ?>
|
||||
|
||||
<?php if($i <= 20): ?>
|
||||
<tr class="<?php
|
||||
$date = explode(" ",$order->getCreatedAt());
|
||||
if($date[0]== date('Y-m-d')){ echo ' st_row-new';}else{
|
||||
echo $index % 2 ? 'st_row-highlight' : 'st_row-no-highlight';
|
||||
};
|
||||
?>">
|
||||
<td><?php echo st_link_to($order->getNumber(), 'stOrder/edit?id='.$order->getId()); ?></td>
|
||||
|
||||
<td>
|
||||
<?php
|
||||
|
||||
|
||||
$createdAt = explode(" ",$order->getCreatedAt());
|
||||
|
||||
$d = $createdAt[0];
|
||||
$t = $createdAt[1];
|
||||
|
||||
$d = explode("-",$d);
|
||||
|
||||
if(date('Y-m-d')==$createdAt[0])
|
||||
{
|
||||
echo $time = $createdAt[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $d[2]."-".$d[1]."-".$d[0];
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
</td>
|
||||
<td><?php if($order->getIsConfirmed()==1): echo image_tag('/sf/sf_admin/images/tick.png'); else: echo "-"; endif; ?></td>
|
||||
|
||||
<td>
|
||||
<div style="text-align: left">
|
||||
<?php if ($order->getOrderUserDataBillingId()): ?>
|
||||
|
||||
<?php if ($order->getsfGuardUserId()): ?>
|
||||
|
||||
<?php if ($order->getOrderUserDataBilling()->getCompany()): ?>
|
||||
<?php echo st_external_link_to( $order->getOrderUserDataBilling()->getCompany(), 'user/edit?id=' . $order->getsfGuardUserId()) ?>
|
||||
<?php else: ?>
|
||||
<?php if($order->getOrderUserDataBilling()->getName() && $order->getOrderUserDataBilling()->getSurname()): ?>
|
||||
<?php echo st_external_link_to($order->getOrderUserDataBilling()->getName()." ".$order->getOrderUserDataBilling()->getSurname(), 'user/edit?id=' . $order->getsfGuardUserId()) ?>
|
||||
<?php else: ?>
|
||||
<?php echo st_external_link_to(truncate_text($order->getsfGuardUser()->getUsername(), 25), 'user/edit?id=' . $order->getsfGuardUserId()) ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo st_back_price($order->getTotalAmount(true), true, true) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php $i++; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php endforeach ; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<br/>
|
||||
<?php if ($countOrder!=0): ?>
|
||||
<?php echo __('Zamówienia o statusie "oczekuje"') ?>: <b><?php echo $countOrder; ?></b> <?php echo st_link_to(__('pokaż'), 'order/list?filters[filter_order_status]=2'); ?>
|
||||
<?php else: ?>
|
||||
<br>
|
||||
<?php endif; ?>
|
||||
<br>
|
||||
<?php if ($countInvoice!=0): ?>
|
||||
<?php echo __('Faktury do wystawienia') ?>: <b><?php echo $countInvoice; ?></b> <?php echo st_link_to(__('pokaż'), 'invoice/requestList'); ?>
|
||||
<?php else: ?>
|
||||
<br>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php echo st_close_widget(); ?>
|
||||
5
apps/backend/modules/stOrder/templates/_list.php
Normal file
5
apps/backend/modules/stOrder/templates/_list.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
include st_admin_get_template_path(__FILE__);
|
||||
|
||||
echo st_get_component('stOrder', 'summary', array('pager' => $pager)) ?>
|
||||
2
apps/backend/modules/stOrder/templates/_list_header.php
Normal file
2
apps/backend/modules/stOrder/templates/_list_header.php
Normal file
@@ -0,0 +1,2 @@
|
||||
<?php echo st_get_component('stSecurityBackend','showUncryptOrderBillingUsers'); ?>
|
||||
<?php echo st_get_component('stSecurityBackend','showUncryptOrderDeliveryUsers'); ?>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
if ($order->getOrderUserDataBillingId())
|
||||
{
|
||||
if ($order->getOptClientName())
|
||||
{
|
||||
echo "<p>".$order->getOptClientName()."</p>";
|
||||
}
|
||||
elseif($order->getsfGuardUser())
|
||||
{
|
||||
echo "<p>".$order->getsfGuardUser()->getUsername()."</p>";
|
||||
}
|
||||
}
|
||||
|
||||
if ($order->getsfGuardUserId())
|
||||
{
|
||||
if ($order->getOptClientEmail())
|
||||
{
|
||||
echo st_external_link_to($order->getOptClientEmail(), 'user/edit?id=' . $order->getsfGuardUserId());
|
||||
}
|
||||
elseif($order->getsfGuardUser())
|
||||
{
|
||||
echo st_external_link_to($order->getsfGuardUser()->getUsername(), 'user/edit?id=' . $order->getsfGuardUserId());
|
||||
}
|
||||
}
|
||||
?>
|
||||
1
apps/backend/modules/stOrder/templates/_min_amount.php
Normal file
1
apps/backend/modules/stOrder/templates/_min_amount.php
Normal file
@@ -0,0 +1 @@
|
||||
<?php echo input_tag('config[min_amount]', $config->get('min_amount', 0), array('size' => 6)); ?> <?php echo stConfig::getInstance($sf_context, 'stCurrencyPlugin')->get('default_currency') ?>
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php foreach (AllegroAuctionPeer::getAuctionsByOrder($order) as $auction):?>
|
||||
<?php echo st_external_link_to($auction->getAuctionId(), $auction->getAuctionLink(), array('target' => '_new'));?><br />
|
||||
<?php endforeach;?>
|
||||
11
apps/backend/modules/stOrder/templates/_opt_allegro_nick.php
Normal file
11
apps/backend/modules/stOrder/templates/_opt_allegro_nick.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php echo $order->getOptAllegroNick() ? $order->getOptAllegroNick() : '-';?>
|
||||
|
||||
<?php if (!$order->isAllegroOrder()):?>
|
||||
<script type="text/javascript">
|
||||
jQuery(function($) {
|
||||
$(document).ready(function() {
|
||||
$('#sf_fieldset_allegro').hide();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php endif;?>
|
||||
16
apps/backend/modules/stOrder/templates/_orderStatusType.php
Normal file
16
apps/backend/modules/stOrder/templates/_orderStatusType.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php echo select_tag('order_status[order_status_type]', options_for_select($select_options, $order_status->getType()), array('disabled' => $order_status->getIsSystemDefault())) ?>
|
||||
|
||||
<script type="text/javascript">
|
||||
$('order_status_order_status_type').observe('change', function()
|
||||
{
|
||||
var is_default_field = $('order_status_is_default');
|
||||
|
||||
is_default_field.disabled = this.options[this.selectedIndex].value != '<?php echo OrderStatusPeer::ST_PENDING ?>';
|
||||
|
||||
if (is_default_field.disabled)
|
||||
{
|
||||
is_default_field.checked = false;
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
30
apps/backend/modules/stOrder/templates/_order_ads_list.php
Normal file
30
apps/backend/modules/stOrder/templates/_order_ads_list.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
if($order->getAdsTracker() == NULL){
|
||||
|
||||
$order->setAdsTracker("none");
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(AdsTrackerOrderPeer::ORDER_ID , $order->getId());
|
||||
$adsTrackerOrder = AdsTrackerOrderPeer::doSelectOne($c);
|
||||
if($adsTrackerOrder){
|
||||
|
||||
if($adsTrackerOrder->getAdsTrackerList()){
|
||||
if(!$adsTrackerOrder->getAdsTrackerList()->getIsSystemDefault()){
|
||||
$order->setAdsTracker(appAdsTracker::getFullAdsName($adsTrackerOrder->getAdsTrackerList()->getId()));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$order->save();
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php if($order->getAdsTracker()!="none"): ?>
|
||||
<a class="list_tooltip" title="<?php echo __("Zamówienie z reklamy")?>:<br><?php echo $order->getAdsTracker() ?>">
|
||||
<?php echo st_admin_get_icon('adstracker') ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
194
apps/backend/modules/stOrder/templates/_order_ads_raport.php
Normal file
194
apps/backend/modules/stOrder/templates/_order_ads_raport.php
Normal file
@@ -0,0 +1,194 @@
|
||||
<div style="width: 100%;">
|
||||
<?php
|
||||
$config = stConfig::getInstance(sfContext::getInstance(), 'appAdsTrackerBackend');
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(AdsTrackerOrderPeer::ORDER_ID , $order->getId());
|
||||
$adsTracker = AdsTrackerOrderPeer::doSelectOne($c);
|
||||
|
||||
if($adsTracker){
|
||||
|
||||
$cookie_array = $adsTracker->getOrderCookieData();
|
||||
$remote_address_array = $adsTracker->getOrderRemoteAddressData();
|
||||
$merge_array = $adsTracker->getOrderMergeData();
|
||||
|
||||
$cookie_array = json_decode($cookie_array,true);
|
||||
$remote_address_array = json_decode($remote_address_array,true);
|
||||
$merge_array = json_decode($merge_array,true);
|
||||
|
||||
|
||||
// echo "<pre>";
|
||||
// print_r($cookie_array);
|
||||
// echo "</pre>";
|
||||
//
|
||||
// echo "<pre>";
|
||||
// print_r($remote_address_array);
|
||||
// echo "</pre>";
|
||||
//
|
||||
// echo "<pre>";
|
||||
// print_r($merge_array);
|
||||
// echo "</pre>";
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<?php echo __('Konwersja z wejścia', '', 'appAdsTrackerBackend') ?>: <b><?php echo appAdsTracker::langFilter($adsTracker->getOrderLastAds()); ?></b>
|
||||
<br>
|
||||
|
||||
<?php if($adsTracker->getOrderAdsConversion()==1): ?>
|
||||
<?php echo __('Pierwsze wejście', '', 'appAdsTrackerBackend') ?>:
|
||||
<b><?php echo date('d-m-y H:i', strtotime($adsTracker->getOrderFirstAdsEntering())); ?></b>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if($adsTracker->getOrderAdsConversion()==2): ?>
|
||||
<?php echo __('Ostatnie wejście', '', 'appAdsTrackerBackend') ?>:
|
||||
<b><?php echo date('d-m-y H:i', strtotime($adsTracker->getOrderFirstAdsEntering())); ?></b>
|
||||
<?php endif; ?>
|
||||
<br>
|
||||
|
||||
<?php echo __('Ilość wejść', '', 'appAdsTrackerBackend') ?>:
|
||||
<b><?php echo $adsTracker->getOrderAdsEntering(); ?></b>
|
||||
<br><br>
|
||||
|
||||
<?php if($config->get('is_debug')==1 || $config->get('is_extend')==0): ?>
|
||||
<?php
|
||||
if ($config->get('is_debug')==1) {
|
||||
echo __('Ścieżka wejść Cookie', '', 'appAdsTrackerBackend');
|
||||
}else{
|
||||
echo __('Wejścia', '', 'appAdsTrackerBackend');
|
||||
}
|
||||
?>
|
||||
<table class="st_record_list" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo __('Data', '', 'appAdsTrackerBackend') ?></th>
|
||||
<th><?php echo __('Platforma', '', 'appAdsTrackerBackend') ?></th>
|
||||
<th><?php echo __('Kampania', '', 'appAdsTrackerBackend') ?></th>
|
||||
<th><?php echo __('Reklama', '', 'appAdsTrackerBackend') ?></th>
|
||||
<th><?php echo __('Wejść', '', 'appAdsTrackerBackend') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<?php foreach ($cookie_array as $data): ?>
|
||||
|
||||
<tr>
|
||||
<td><?php echo date('d-m-y H:i', strtotime($data['created_at'])); ?></td>
|
||||
<td><?php echo appAdsTracker::langFilter($data['platform']); ?></td>
|
||||
<td><?php echo appAdsTracker::langFilter($data['campaign']); ?></td>
|
||||
<td><?php echo appAdsTracker::langFilter($data['name']); ?></td>
|
||||
<td><?php echo $data['entering']; ?></td>
|
||||
</tr>
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if($config->get('is_debug')==1 && $config->get('is_extend')==1): ?>
|
||||
|
||||
<?php
|
||||
if ($config->get('is_debug')==1) {
|
||||
echo __('Ścieżka wejść IP', '', 'appAdsTrackerBackend');
|
||||
}else{
|
||||
echo __('Wejścia', '', 'appAdsTrackerBackend');
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<table class="st_record_list" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo __('Data', '', 'appAdsTrackerBackend') ?></th>
|
||||
<th><?php echo __('Platforma', '', 'appAdsTrackerBackend') ?></th>
|
||||
<th><?php echo __('Kampania', '', 'appAdsTrackerBackend') ?></th>
|
||||
<th><?php echo __('Reklama', '', 'appAdsTrackerBackend') ?></th>
|
||||
<th><?php echo __('Wejść', '', 'appAdsTrackerBackend') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<?php foreach ($remote_address_array as $data): ?>
|
||||
|
||||
<tr>
|
||||
<td><?php echo date('d-m-y H:i', strtotime($data['created_at'])); ?></td>
|
||||
<td><?php echo appAdsTracker::langFilter($data['platform']); ?></td>
|
||||
<td><?php echo appAdsTracker::langFilter($data['campaign']); ?></td>
|
||||
<td><?php echo appAdsTracker::langFilter($data['name']); ?></td>
|
||||
<td><?php echo $data['entering']; ?></td>
|
||||
</tr>
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<?php if($config->get('is_extend')==1): ?>
|
||||
|
||||
<?php
|
||||
if ($config->get('is_debug')==1) {
|
||||
echo __('Ścieżka wejść Cookie & IP', '', 'appAdsTrackerBackend');
|
||||
}else{
|
||||
echo __('Wejścia', '', 'appAdsTrackerBackend');
|
||||
}
|
||||
?>
|
||||
<table class="st_record_list" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo __('Data', '', 'appAdsTrackerBackend') ?></th>
|
||||
<th><?php echo __('Platforma', '', 'appAdsTrackerBackend') ?></th>
|
||||
<th><?php echo __('Kampania', '', 'appAdsTrackerBackend') ?></th>
|
||||
<th><?php echo __('Reklama', '', 'appAdsTrackerBackend') ?></th>
|
||||
<th><?php echo __('Wejść', '', 'appAdsTrackerBackend') ?></th>
|
||||
<?php if($config->get('is_debug')==1): ?>
|
||||
<th><?php echo __('Pozyskano', '', 'appAdsTrackerBackend') ?></th>
|
||||
<?php endif; ?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<?php
|
||||
$entering = 0;
|
||||
foreach ($merge_array as $data): ?>
|
||||
|
||||
<tr>
|
||||
<td><?php echo date('d-m-Y H:i', strtotime($data['created_at'])); ?></td>
|
||||
<td><?php echo appAdsTracker::langFilter($data['platform']); ?></td>
|
||||
<td><?php echo appAdsTracker::langFilter($data['campaign']); ?></td>
|
||||
<td><?php echo appAdsTracker::langFilter($data['name']); ?></td>
|
||||
<td><?php echo $data['entering']; ?></td>
|
||||
<?php if($config->get('is_debug')==1): ?>
|
||||
<td>
|
||||
<?php
|
||||
if($data['type'] == "remote_address"){
|
||||
echo __('Adres IP');
|
||||
}else{
|
||||
echo $data['type'];
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
</tr>
|
||||
|
||||
<?php endforeach;
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
|
||||
}else{
|
||||
echo __('Brak danych', '', 'appAdsTrackerBackend');
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php if ($order->hasDiscount()): $discount = $order->getTotalProductDiscountAmount(true, true) ?>
|
||||
-<?php echo st_order_price_format($discount, $order->getOrderCurrency()) ?>
|
||||
<?php if ($order->getDiscount()): ?>
|
||||
(<a target="_blank" href="<?php echo st_url_for('@stDiscountPlugin?action=edit&id='.$order->getDiscountId()) ?>"><?php echo $order->getDiscount()->getName() ?></a>)
|
||||
<?php endif ?>
|
||||
<?php else: ?>
|
||||
<?php __('Brak') ?>
|
||||
<?php endif ?>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
if ($order->getImportName()):
|
||||
|
||||
$product_imports = unserialize($order->getImportName());
|
||||
|
||||
$imports_name = "";
|
||||
|
||||
foreach ($product_imports as $product_import){
|
||||
|
||||
$configuration = stTaskSchedulerImportConfiguration::getByHashId($product_import);
|
||||
|
||||
$imports_name .= $configuration->getLabel()." ";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<a class="list_tooltip" title="<?php echo __("Zamówienie zawiera produkty z importu") ?>:<br> <b><?php echo $imports_name ?></b>">
|
||||
<?php echo st_admin_get_icon('/images/backend/applications/stImportExportPlugin.svg') ?>
|
||||
</a>
|
||||
|
||||
<?php endif; ?>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php if ($value->getGiftCard()) : ?>
|
||||
<?php echo st_external_link_to(__('Bon zakupowy: %code%', array('%code%' => $value->getGiftCard()->getCode())), 'stGiftCardBackend/edit?id=' . $value->getGiftCard()->getId()) ?>
|
||||
<?php else : ?>
|
||||
<?php echo $value->getPaymentTypeName() ?>
|
||||
<?php if ($value->getAllegroPaymentType()) : ?>
|
||||
<?php echo st_allegro_payment_type($value->getAllegroPaymentType()) ?>
|
||||
<?php endif ?>
|
||||
<?php if ($value->getTransactionId()) : ?>
|
||||
<p style="color: #848484"><?php echo __('Numer transakcji', null, 'stPayment') ?>: <?php echo $value->getTransactionId() ?></p>
|
||||
<?php endif ?>
|
||||
<?php endif; ?>
|
||||
444
apps/backend/modules/stOrder/templates/_order_products.php
Normal file
444
apps/backend/modules/stOrder/templates/_order_products.php
Normal file
@@ -0,0 +1,444 @@
|
||||
<?php
|
||||
/**
|
||||
* @var Order $order
|
||||
*/
|
||||
use_helper('stCurrency', 'stOrder', 'stPrice', 'stJQueryTools', 'stProductImage', 'stDiscount');
|
||||
sfLoader::loadHelpers('stProduct', 'stProduct');
|
||||
?>
|
||||
<div class="st-responsive">
|
||||
<?php if (!$sf_user->getAttribute('edit_mode', false, 'soteshop/stOrder')) : ?>
|
||||
<table id="st_order-product-list" class="st_record_list" cellspacing="0" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th style="padding: 3px 2px"> </th>
|
||||
<th><?php echo __('Kod') ?></th>
|
||||
<th class="text-left"><?php echo __('Nazwa') ?></th>
|
||||
<th><?php echo __('Recenzja') ?></th>
|
||||
<th class="text-right"><?php echo __('Netto') ?></th>
|
||||
<th class="text-right"><?php echo __('Vat') ?></th>
|
||||
<th class="text-right"><?php echo __('Brutto') ?></th>
|
||||
<th class="text-right"><?php echo __('Rabat') ?></th>
|
||||
<th class="text-right"><?php echo __('Brutto') ?>(-%)</th>
|
||||
<th class="text-right"><?php echo __('Ilość') ?></th>
|
||||
<th class="text-right"><?php echo __('Suma') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="11" style="text-align: right"><?php echo __('Łącznie') ?>:</th>
|
||||
<th style="text-align: right"><?php echo st_order_product_total_amount($order, true, false) ?></th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<?php foreach ($order->getOrderProductsJoinProduct() as $key => $order_product) : ?>
|
||||
<tr>
|
||||
<td><?php echo $key + 1; ?>
|
||||
|
||||
|
||||
</td>
|
||||
<td style="padding: 3px 2px" class="img"><?php echo st_product_image_tag($order_product->getImage(), 'icon', array('style' => 'max-height: 42px; max-width: 42px')) ?></td>
|
||||
<td class="text-left"><?php echo $order_product->getCode() ?>
|
||||
|
||||
<?php
|
||||
if ($order_product->getImportName()):
|
||||
$configuration = stTaskSchedulerImportConfiguration::getByHashId($order_product->getImportName());
|
||||
?>
|
||||
<a class="list_tooltip" title="<?php echo __("Produkty z importu") ?>: <b><?php echo $configuration->getLabel(); ?></b>">
|
||||
<?php echo st_admin_get_icon('/images/backend/applications/stImportExportPlugin.svg') ?>
|
||||
</a>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</td>
|
||||
<td class="text-left st_record_list-item-name">
|
||||
<?php if ($order_product->productValidate()) : ?>
|
||||
<?php echo st_external_link_to($order_product->getName(), 'stProduct/edit?id=' . $order_product->getProductId()) ?>
|
||||
<?php else : ?>
|
||||
<?php echo $order_product->getName() ?>
|
||||
<?php endif; ?>
|
||||
<?php if ($order_product->hasPriceModifiers() || $order_product->hasOldOptions()) : ?>
|
||||
<?php echo st_order_render_product_options_backend($order_product) ?>
|
||||
<?php endif; ?>
|
||||
<?php if ($order_product->getIsSet()) : ?>
|
||||
<?php st_order_display_product_set($order_product) ?>
|
||||
<?php endif; ?>
|
||||
<?php if ($order_product->getOnlineCode()) : ?>
|
||||
<?php $codes = unserialize($order_product->getOnlineCode()); ?>
|
||||
<?php if (!empty($codes)) : ?>
|
||||
<div>
|
||||
<div style="float: left;">
|
||||
<?php echo (count($codes) == 1) ? __('Kod') : __('Kody'); ?>:
|
||||
</div>
|
||||
<div style="float: left; padding-left: 5px;">
|
||||
<ul>
|
||||
<?php foreach ($codes as $code) : ?>
|
||||
<li><?php echo $code; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
<div style="clear:both;">
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if ($order->isAllegroOrder()) : ?>
|
||||
<p><?php echo __('Oferta Allegro', null, 'stAllegroBackend') ?>: <a href="<?php echo url_for('@stAllegroPlugin?action=edit&id=' . $order_product->getAllegroAuctionId()) ?>" target="_blank"><?php echo $order_product->getAllegroAuctionId() ?></a></p>
|
||||
<?php endif ?>
|
||||
</td>
|
||||
<td><?php echo !$order->isAllegroOrder() ? st_get_component("stReview", "reviewStatus", array('order_product' => $order_product)) : ''; ?></td>
|
||||
<td class="text-right text-nowrap"><?php echo st_order_product_price($order_product, false, false) ?></td>
|
||||
<td class="text-right text-nowrap"><?php echo $order_product->getVat() ?> %</td>
|
||||
<td class="text-right text-nowrap"><?php echo st_order_product_price($order_product, true, false) ?></td>
|
||||
<td class="text-right text-nowrap"><?php echo $order_product->getDiscountInPercent() ?> %</td>
|
||||
<td class="text-right text-nowrap"><?php echo st_order_product_price($order_product, true) ?></td>
|
||||
<td class="text-right text-nowrap"><?php echo $order_product->getQuantity() ?> <?php echo st_product_uom($order_product->getProduct()) ?></td>
|
||||
<td class="text-right text-nowrap"><?php echo st_order_product_total_amount($order_product, true) ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php else : ?>
|
||||
<?php
|
||||
use_javascript('/jQueryTools/jquery/effects.core.js?v5');
|
||||
|
||||
use_javascript('/jQueryTools/stTableRecordManager/js/script.js?v5');
|
||||
|
||||
use_stylesheet('/jQueryTools/stTableRecordManager/css/style.css?v5');
|
||||
|
||||
use_javascript('backend/stOrder.js?v5');
|
||||
|
||||
/**
|
||||
* @var Tax[]
|
||||
*/
|
||||
$taxes = TaxPeer::doSelect(new Criteria());
|
||||
|
||||
$tax_values = array();
|
||||
|
||||
$default_tax = null;
|
||||
|
||||
$has_valid_vat_eu = $order->getOrderUserDataBilling()->getHasValidVatEu();
|
||||
|
||||
foreach ($taxes as $tax)
|
||||
{
|
||||
$tax->setDeliveryCountry($order->getOrderUserDataDelivery()->getCountry());
|
||||
|
||||
$tax_values[] = $tax->getVat();
|
||||
|
||||
$tax_options[$tax->getId()] = $tax->getVat() . '% ('.$tax->getVatName().')';
|
||||
|
||||
if (!$default_tax && (!$has_valid_vat_eu && $tax->getIsDefault() || $has_valid_vat_eu && $tax->getVat() === 0))
|
||||
{
|
||||
$default_tax = $tax->getId();
|
||||
}
|
||||
}
|
||||
|
||||
echo form_error('order{products}', [
|
||||
'class' => 'form-error-msg',
|
||||
]);
|
||||
|
||||
?>
|
||||
<table id="st_order-product-list" class="st_record_list st_record_manager" cellspacing="0" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="padding: 3px 2px"> </th>
|
||||
<th><?php echo __('Kod') ?></th>
|
||||
<th><?php echo __('Nazwa') ?></th>
|
||||
<th><?php echo __('Netto') ?></th>
|
||||
<th><?php echo __('Vat') ?></th>
|
||||
<th><?php echo __('Brutto') ?></th>
|
||||
<th><?php echo __('Rabat') ?></th>
|
||||
<th><?php echo __('Brutto') ?>(-%)</th>
|
||||
<th><?php echo __('Ilość') ?></th>
|
||||
<th><?php echo __('Suma') ?></th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
<tr class="template">
|
||||
<th> </th>
|
||||
|
||||
<th>
|
||||
<?php echo st_autocompleter_input_tag("code", null, array(
|
||||
'autocompleter' => array(
|
||||
'serviceUrl' => url_for('stOrder/ajaxSearchProduct?by=code&order_id=' . $order->getId() . '&vat_eu=' . $has_valid_vat_eu),
|
||||
'deferRequestBy' => 300,
|
||||
'onSelect' => 'stOrderProductPriceManagment.updateProductForm(value, data, el);',
|
||||
'resultFormat' => 'stOrderProductPriceManagment.fnFormatResult',
|
||||
),
|
||||
'class' => 'st-responsive',
|
||||
)) ?>
|
||||
</th>
|
||||
<th>
|
||||
<?php echo st_autocompleter_input_tag("name", null, array('class' => 'name-field st-responsive', 'autocompleter' => array(
|
||||
'serviceUrl' => url_for('stOrder/ajaxSearchProduct?by=name&order_id=' . $order->getId() . '&vat_eu=' . $has_valid_vat_eu),
|
||||
'deferRequestBy' => 300, 'minChars' => 3,
|
||||
'onSelect' => 'stOrderProductPriceManagment.updateProductForm(value, data, el);',
|
||||
'resultFormat' => 'stOrderProductPriceManagment.fnFormatResult',
|
||||
))) ?>
|
||||
</th>
|
||||
<th><?php echo input_tag("price_netto", '0.00', array('class' => 'price-field st-responsive', 'size' => 9)) ?></th>
|
||||
<th><?php echo select_tag('tax', options_for_select($tax_options, $default_tax), array('class' => 'st-responsive')) ?></th>
|
||||
<th><?php echo input_tag("price_brutto", '0.00', array('class' => 'price-field st-responsive', 'size' => 9)) ?></th>
|
||||
<th><?php echo input_tag("discount", 0, array('class' => 'discount-field')) ?> <?php echo st_discount_type_select_tag("discount_type", '%', array('currency' => $order->getOrderCurrency())) ?></th>
|
||||
<th><?php echo input_tag("price_brutto_discount", '0.00', array('class' => 'price-field st-responsive', 'disabled st-responsive' => true, 'size' => 9)) ?></th>
|
||||
<th><?php echo input_tag("quantity", 1, array('class' => 'quantity-field st-responsive', 'size' => 5)) ?></th>
|
||||
<th>
|
||||
<?php echo input_tag("total_amount", '0.00', array('class' => 'price-field total-amount st-responsive ', 'disabled' => true, 'size' => 9)) ?>
|
||||
<?php echo input_hidden_tag('oid', null) ?>
|
||||
<?php //echo input_hidden_tag('hidden_data', null, array('class' => 'hidden_data'))
|
||||
?>
|
||||
</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 ($order->getOrderProducts() as $index => $order_product) : if ($order_product->isDeleted()) continue; ?>
|
||||
<?php if (form_has_error('order{product}{' . $index . '}{code}')) : ?>
|
||||
<tr class="errors">
|
||||
<td colspan="12"><?php echo form_error('order{product}{' . $index . '}{code}', ['class' => 'form-error-msg']) ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php if (form_has_error('order{product}{' . $index . '}{name}')) : ?>
|
||||
<tr class="errors">
|
||||
<td colspan="12"><?php echo form_error('order{product}{' . $index . '}{name}', ['class' => 'form-error-msg']) ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<tr>
|
||||
<td><?php echo $index + 1; ?></td>
|
||||
<td class="<?php echo form_has_error('order{product}{' . $index . '}{code}') ? 'form-error' : 'none' ?>"><?php echo input_tag("order[product][" . $index . "][code]", $order_product->getCode(), array('class' => 'st-responsive')) ?></td>
|
||||
<td class="<?php echo form_has_error('order{product}{' . $index . '}{name}') ? 'form-error' : 'none' ?>">
|
||||
<?php echo input_tag("order[product][" . $index . "][name]", $order_product->getName(), array('class' => 'name-field st-responsive ')) ?>
|
||||
<?php if ($order_product->hasPriceModifiers() || $order_product->hasOldOptions()) : ?>
|
||||
<?php echo st_order_render_product_options_backend($order_product) ?>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td><?php echo input_tag("order[product][" . $index . "][price_netto]", $order_product->getPriceNetto(true, false), array('class' => 'price-field st-responsive', 'size' => 9)) ?></td>
|
||||
<td><?php echo select_tag("order[product][" . $index . "][tax]", options_for_select($tax_options, $order_product->getTaxId())); ?></td>
|
||||
<td><?php echo input_tag("order[product][" . $index . "][price_brutto]", stPrice::round($order_product->getPriceBrutto(true, false)), array('class' => 'price-field st-responsive', 'size' => 9)) ?></td>
|
||||
<td><?php echo input_tag("order[product][" . $index . "][discount]", $order_product->getDiscountType() == 'P' ? stPrice::round($order_product->getDiscountValue()) : stPrice::round($order_product->getDiscountInPercent(), 1), array('class' => 'discount-field')) ?> <?php echo st_discount_type_select_tag("order[product][" . $index . "][discount_type]", $order_product->getDiscountType(), array('currency' => $order->getOrderCurrency())) ?></td>
|
||||
<td><?php echo input_tag("order[product][" . $index . "][price_brutto_discount]", $order_product->getPriceBrutto(true), array('class' => 'price-field st-responsive', 'disabled' => true, 'size' => 9)) ?></td>
|
||||
<td><?php echo input_tag("order[product][" . $index . "][quantity]", $order_product->getQuantity(), array('class' => 'quantity-field st-responsive', 'size' => 5)) ?></td>
|
||||
<td>
|
||||
<?php echo input_tag("order[product][" . $index . "][total_amount]", $order_product->getTotalAmount(true, true), array('class' => 'price-field total-amount st-responsive', 'disabled' => true, 'size' => 9)) ?>
|
||||
<?php
|
||||
echo input_hidden_tag('order[product][' . $index . '][oid]', $order_product->getId());
|
||||
/*
|
||||
$hidden_data = array('id' => $order_product->getProductId(), 'io' => $order_product->getImage());
|
||||
|
||||
if ($order_product->hasPriceModifiers() || $order_product->hasOldOptions())
|
||||
{
|
||||
$hidden_data['pm'] = $order_product->getPriceModifiers();
|
||||
}
|
||||
|
||||
echo input_hidden_tag('order[product]['.$index.'][hidden_data]', json_encode($hidden_data), array('class' => 'hidden_data'));
|
||||
*/
|
||||
?>
|
||||
</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>
|
||||
<div id="st_order-autocomplete-template">
|
||||
<div class="st_order-autocomplete-item">
|
||||
<div class="image"><img src="" alt="" /></div>
|
||||
<div class="content">
|
||||
<h2></h2>
|
||||
<ul>
|
||||
<li><b><?php echo __('Cena:') ?></b> <?php echo $order->getOrderCurrency()->getFrontSymbol() ?><span class="price_netto"></span> <?php echo $order->getOrderCurrency()->getBackSymbol() ?> / <?php echo $order->getOrderCurrency()->getFrontSymbol() ?><span class="price_brutto"></span> <?php echo $order->getOrderCurrency()->getBackSymbol() ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
stOrderProductPriceManagment.setParams({
|
||||
taxValues: <?php echo json_encode($tax_values) ?>
|
||||
});
|
||||
jQuery(function($) {
|
||||
|
||||
function updatePayment() {
|
||||
var locale = "<?php echo str_replace("_", "-", $sf_user->getCulture()); ?>";
|
||||
var numberFormat = new Intl.NumberFormat(locale, {
|
||||
minimumFractionDigits: 2,
|
||||
maximumFractionDigits: 2
|
||||
});
|
||||
var priceFormat = "<?php echo $order->getOrderCurrency()->getFrontSymbol() . '%price% ' . $order->getOrderCurrency()->getBackSymbol() ?>";
|
||||
var payment = $('#st_record_manager-payment tbody tr .price-field').not('[data-gift-card=1]');
|
||||
|
||||
var paid = 0;
|
||||
var manager = $('#st_record_manager-payment');
|
||||
|
||||
manager.find('tbody tr .price-field').each(function() {
|
||||
var current = $(this);
|
||||
|
||||
if (current.closest('tr').find('.payment-status').prop('checked')) {
|
||||
paid += Number(current.val());
|
||||
}
|
||||
});
|
||||
|
||||
var total = 0;
|
||||
|
||||
$('#st_order-product-list tbody .total-amount').each(function() {
|
||||
total += Number($(this).val());
|
||||
});
|
||||
|
||||
var totalAmount = total;
|
||||
|
||||
total += Number($('#order_delivery_cost').val());
|
||||
|
||||
var totalAmountWithOrder = total;
|
||||
|
||||
var discountOption = $('#order_summary_discount option:selected');
|
||||
|
||||
if (discountOption.data('discount-type')) {
|
||||
if (discountOption.data('discount-type') == '%') {
|
||||
var toPay = total - totalAmount * (discountOption.data('discount-value') / 100);
|
||||
} else {
|
||||
var toPay = total - discountOption.data('discount-value');
|
||||
}
|
||||
} else {
|
||||
var toPay = total;
|
||||
}
|
||||
|
||||
if (toPay < 0) {
|
||||
toPay = 0;
|
||||
}
|
||||
|
||||
var leftToPay = toPay - paid;
|
||||
|
||||
if (leftToPay < 0) {
|
||||
leftToPay = 0;
|
||||
}
|
||||
|
||||
$('#order-total-amount-container').html(priceFormat.replace('%price%', numberFormat.format(totalAmountWithOrder)));
|
||||
|
||||
$('#order-to-pay-amount-container').html(priceFormat.replace('%price%', numberFormat.format(toPay)));
|
||||
|
||||
$('#order-left-to-pay-amount-container').html(priceFormat.replace('%price%', numberFormat.format(leftToPay)));
|
||||
|
||||
$('#order-paid-amount-container').html(priceFormat.replace('%price%', numberFormat.format(paid > toPay ? toPay : paid)));
|
||||
|
||||
$('#st_order-product-list').data('total-amount', total);
|
||||
|
||||
if (!manager.data('update')) {
|
||||
var whatsLeft = total;
|
||||
|
||||
payment.each(function() {
|
||||
whatsLeft -= Number($(this).val());
|
||||
});
|
||||
|
||||
if (whatsLeft >= 0 && !manager.data('update')) {
|
||||
$('#payment_amount').val(whatsLeft.toFixed(2));
|
||||
$('#payment_status').prop('disabled', false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$('#order_summary_discount').change(updatePayment);
|
||||
|
||||
$('#order_summary_discount').change();
|
||||
|
||||
stOrderPriceModifiers.params.url = '<?php echo st_url_for('stOrder/ajaxPriceModifiers') ?>';
|
||||
|
||||
$('#st_order-product-list').stTableRecordManager({
|
||||
namespace: 'order[product]',
|
||||
confirmMsg: '<?php echo __('Jesteś pewien?', null, 'stAdminGeneratorPlugin') ?>'
|
||||
});
|
||||
|
||||
$('#order_delivery_cost').on('change', updatePayment);
|
||||
|
||||
$('#st_order-product-list').bind('preRemove', function(event, row) {
|
||||
row = row.prev('tr');
|
||||
|
||||
while (row.hasClass('errors')) {
|
||||
var tmp = row.prev('tr');
|
||||
row.remove();
|
||||
row = tmp;
|
||||
}
|
||||
});
|
||||
|
||||
$('#st_order-product-list').bind('postRemove', function(event) {
|
||||
updatePayment();
|
||||
});
|
||||
|
||||
$('#st_order-product-list').bind('postAdd', function(event, row, fields) {
|
||||
$.each(fields, function() {
|
||||
$(this).css('background-color', $(this).attr('prev-background-color'));
|
||||
});
|
||||
|
||||
new stOrderProductPriceManagment(fields, updatePayment);
|
||||
|
||||
$(fields.discount).after(' ');
|
||||
|
||||
stOrderProductPriceManagment.updateTotalAmount(fields);
|
||||
|
||||
updatePayment();
|
||||
});
|
||||
|
||||
$('#admin_edit_form').submit(function() {
|
||||
|
||||
var form = $(this);
|
||||
var data = form.serializeArray();
|
||||
|
||||
var json = {};
|
||||
|
||||
var index = null;
|
||||
|
||||
var current = {};
|
||||
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
|
||||
if (data[i] && data[i].name.indexOf("order[product]") > -1) {
|
||||
|
||||
var matches = data[i].name.match(/order\[product\]\[(\d+)\]\[([^\]]+)\]/);
|
||||
|
||||
if (index === null) {
|
||||
index = matches[1];
|
||||
} else if (index != matches[1]) {
|
||||
json[index] = (current);
|
||||
current = {};
|
||||
index = matches[1];
|
||||
}
|
||||
|
||||
current[matches[2]] = data[i].value;
|
||||
}
|
||||
}
|
||||
|
||||
if (current && index !== null) {
|
||||
json[index] = (current);
|
||||
}
|
||||
|
||||
hidden = $("<input type=\"hidden\" name=\"order[product]\" />");
|
||||
|
||||
hidden.val(JSON.stringify(json));
|
||||
|
||||
form.append(hidden);
|
||||
|
||||
form.append("<input type=\"hidden\" name=\"validation_token\" />");
|
||||
|
||||
$('#st_order-product-list').find('select, input').attr('disabled', true);
|
||||
|
||||
});
|
||||
|
||||
$('#st_order-product-list tr').each(function() {
|
||||
var fields = $(this).find('input, select');
|
||||
if (fields.length) {
|
||||
new stOrderProductPriceManagment({
|
||||
price_netto: fields[2],
|
||||
tax: fields[3],
|
||||
price_brutto: fields[4],
|
||||
discount: fields[5],
|
||||
discount_type: fields[6],
|
||||
price_brutto_discount: fields[7],
|
||||
quantity: fields[8],
|
||||
total_amount: fields[9]
|
||||
}, updatePayment);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?php echo textarea_tag('order_status[order_status_description]', $order_status->getDescription(), array(
|
||||
'size' => '80x20',
|
||||
'rich' => true,
|
||||
'tinymce_options' => "theme:'advanced'",
|
||||
'disabled' => !$order_status->getHasMailNotification())) ?>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
/**
|
||||
* @var Order $order
|
||||
*/
|
||||
echo st_order_status_select_tag('order[order_status_id]', $order->getOrderStatusId());
|
||||
@@ -0,0 +1 @@
|
||||
<?php echo __(OrderStatusPeer::getNameFromType($order_status->getOrderStatusType())) ?>
|
||||
@@ -0,0 +1 @@
|
||||
<?php st_include_partial('user_data', array('user_data' => $order->getOrderUserDataBilling(), 'type' => 'billing')); ?>
|
||||
@@ -0,0 +1,4 @@
|
||||
<div class="st-order-code-town">
|
||||
<?php echo input_tag($params['name'].'[code]', $value->getCode(), array('class' => 'st-responsive')) ?>
|
||||
<?php echo input_tag($params['name'].'[town]', $value->getTown(), array('class' => 'st-responsive')) ?>
|
||||
</div>
|
||||
@@ -0,0 +1 @@
|
||||
<?php st_include_partial('user_data', array('user_data' => $order->getOrderUserDataDelivery(), 'type' => 'delivery')); ?>
|
||||
208
apps/backend/modules/stOrder/templates/_payment.php
Normal file
208
apps/backend/modules/stOrder/templates/_payment.php
Normal file
@@ -0,0 +1,208 @@
|
||||
<?php use_helper('stCurrency', 'stAllegro'); ?>
|
||||
|
||||
<div class="st-responsive">
|
||||
<?php echo form_error('order{payments}', [
|
||||
'class' => 'form-error-msg',
|
||||
]) ?>
|
||||
<?php if (!$sf_user->getAttribute('edit_mode', false, 'soteshop/stOrder')) : ?>
|
||||
<?php if (count($payments) > 1): ?>
|
||||
<table class="st_record_list" cellspacing="0" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="1%"><?php echo __('Data płatności') ?></th>
|
||||
<th><?php echo __('Typ płatności') ?></th>
|
||||
<th width="1%" class="text-right"><?php echo __('Kwota') ?></th>
|
||||
<th width="1%"><?php echo __('Rozliczona') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($payments as $index => $ohp) : $payment = $ohp->getPayment();
|
||||
$transaction_id = $payment->getTransactionId(); ?>
|
||||
<tr>
|
||||
<td>
|
||||
<?php echo $payment->getPayedAt() ? st_format_date($payment->getPayedAt()) : '-' ?>
|
||||
<?php echo input_hidden_tag('order[payment][' . $index . '][payment_id]', $payment->getId()) ?>
|
||||
</td>
|
||||
<?php if ($payment->getGiftCard()) : ?>
|
||||
<td><?php echo st_external_link_to(__('Bon zakupowy: %code%', array('%code%' => $payment->getGiftCard()->getCode())), 'stGiftCardBackend/edit?id=' . $payment->getGiftCard()->getId()) ?></td>
|
||||
<?php else : ?>
|
||||
<td>
|
||||
<?php echo $payment->getPaymentTypeName() ?>
|
||||
<?php if ($payment->getAllegroPaymentType()) : ?>
|
||||
<?php echo st_allegro_payment_type($payment->getAllegroPaymentType()) ?>
|
||||
<?php endif ?>
|
||||
<?php if ($transaction_id) : ?>
|
||||
<p style="color: #848484"><?php echo __('Numer transakcji', null, 'stPayment') ?>: <?php echo $transaction_id ?></p>
|
||||
<?php endif ?>
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
<td class="text-right text-nowrap"><?php echo st_order_price_format($payment->getAmount(), $order->getOrderCurrency()) ?></td>
|
||||
<td>
|
||||
<?php echo st_admin_checkbox_tag('order[payment][' . $index . '][payment_status]', 1, $payment->getStatus(), array('disabled' => $payment->getGiftCard(), 'style' => 'vertical-align: middle')); ?>
|
||||
<?php if ($payment->getGiftCard()) : ?>
|
||||
<?php echo input_hidden_tag('order[payment][' . $index . '][payment_status]', true); ?>
|
||||
<?php endif; ?>
|
||||
<?php if ($payment->getStatus() && !$payment->isValid()) : ?>
|
||||
<?php echo image_tag('/images/backend/icons/warning.png', array('title' => __('Status płatności został zmieniony bezpośrednio w bazie danych', null, 'stPayment'), 'class' => 'list_tooltip', 'style' => 'vertical-align: middle')) ?>
|
||||
<?php endif ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php else: $payment = !empty($payments) ? $payments[0]->getPayment() : null ?>
|
||||
<div class="st-responsive">
|
||||
<?php if (null !== $payment): ?>
|
||||
<?php echo input_hidden_tag('order[payment][0][payment_id]', $payment->getId()) ?>
|
||||
<?php echo st_admin_get_form_field(null, __('Typ płatności'), $payment, '_order_payment_type', array('type' => 'custom')) ?>
|
||||
<?php echo st_admin_get_form_field(null, __('Kwota'), st_order_price_format($payment->getAmount(), $order->getOrderCurrency()), 'plain') ?>
|
||||
<?php echo st_admin_get_form_field(null, __('Data płatności'), $payment->getPayedAt() ? st_format_date($payment->getPayedAt()) : '-', 'plain') ?>
|
||||
<?php echo st_admin_get_form_field('order[payment][0][payment_status]', __('Rozliczona'), 1, 'checkbox_tag', array('disabled' => $payment->getGiftCard(), 'checked' => $payment->getStatus())) ?>
|
||||
<?php else: ?>
|
||||
<?php echo st_admin_get_form_field(null, __('Typ płatności'), __('Brak'), 'plain', array('type' => 'custom')) ?>
|
||||
<?php echo st_admin_get_form_field(null, __('Kwota'), st_order_price_format($order->getUnpaidAmount(), $order->getOrderCurrency()), 'plain') ?>
|
||||
<?php echo st_admin_get_form_field(null, __('Data płatności'), '-', 'plain') ?>
|
||||
<?php echo st_admin_get_form_field(null, __('Rozliczona'), __('Nie'), 'plain') ?>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<?php else : ?>
|
||||
<table id="st_record_manager-payment" class="st_record_list st_record_manager" cellspacing="0" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="1%"><?php echo __('Data płatności') ?></th>
|
||||
<th><?php echo __('Typ płatności') ?></th>
|
||||
<th width="1%"><?php echo __('Kwota') ?></th>
|
||||
<th width="1%"><?php echo __('Rozliczona') ?></th>
|
||||
<th width="1%"> </th>
|
||||
</tr>
|
||||
<tr class="template">
|
||||
<th> <?php echo input_hidden_tag('payment_id', null) ?></th>
|
||||
<th><?php echo select_tag("payment_type", options_for_select($paymentsType), array("class" => 'st-responsive')) ?></th>
|
||||
<th><?php echo input_tag("payment_amount", '0.00', array('class' => 'price-field')) ?></th>
|
||||
<th><?php echo st_admin_checkbox_tag("payment_status", true, false, array('class' => 'payment-status')) ?></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 ($payments as $index => $ohp) : $payment = $ohp->getPayment() ?>
|
||||
<tr>
|
||||
<td>
|
||||
<?php echo $payment->getPayedAt() ? st_format_date($payment->getPayedAt()) : '-' ?>
|
||||
<?php echo input_hidden_tag('order[payment][' . $index . '][payment_id]', $payment->getId()) ?>
|
||||
</td>
|
||||
<?php if ($payment->getAllegroPaymentType()) : ?>
|
||||
<td>
|
||||
<?php echo input_hidden_tag('order[payment][' . $index . '][payment_type]', $payment->getPaymentTypeId()) ?>
|
||||
<?php echo $payment->getPaymentType() ?> - <?php echo st_allegro_payment_type($payment->getAllegroPaymentType()) ?>
|
||||
</td>
|
||||
<?php elseif ($payment->getGiftCard()) : ?>
|
||||
<td><?php echo st_external_link_to($payment->getGiftCard()->getCode(), 'stGiftCardBackend/edit?id=' . $payment->getGiftCard()->getId()) ?></td>
|
||||
<?php else : ?>
|
||||
<td><?php echo select_tag("order[payment][" . $index . "][payment_type]", options_for_select($paymentsType, $payment->getPaymentTypeId())) ?></td>
|
||||
<?php endif; ?>
|
||||
<td>
|
||||
<?php echo input_tag('order[payment][' . $index . '][payment_amount]', stPrice::round($payment->getAmount()), array('disabled' => $payment->getGiftCard() || $payment->getStatus(), 'class' => 'price-field', 'data-gift-card' => null !== $payment->getGiftCard())) ?>
|
||||
|
||||
<?php echo input_hidden_tag('order[payment][' . $index . '][payment_amount]', stPrice::round($payment->getAmount()), array('disabled' => !$payment->getStatus(), 'id' => 'order_payment_' . $index . '_payment_amount_hidden')) ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo st_admin_checkbox_tag('order[payment][' . $index . '][payment_status]', 1, $payment->getStatus(), array('disabled' => $payment->getGiftCard(), 'class' => 'payment-status')); ?>
|
||||
</td>
|
||||
<td class="actions">
|
||||
<?php if (!$payment->getGiftCard()) : ?>
|
||||
<a href="#" class="remove"><?php echo st_admin_get_icon('delete-circle', array('size' => 'medium')) ?></a>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<script type="text/javascript">
|
||||
jQuery(function($) {
|
||||
function statusUpdate() {
|
||||
|
||||
var status = $(this);
|
||||
var priceField = status.closest('tr').find('.price-field');
|
||||
|
||||
if (priceField.data('gift-card')) {
|
||||
return;
|
||||
}
|
||||
|
||||
priceField.prop('disabled', status.prop('checked'));
|
||||
|
||||
var hiddenId = priceField.attr('id') + '_hidden';
|
||||
|
||||
var hidden = $('#' + hiddenId);
|
||||
|
||||
if (hidden.length) {
|
||||
hidden.prop('disabled', !status.prop('checked'));
|
||||
hidden.val(priceField.val());
|
||||
} else {
|
||||
hidden = $('<input type="hidden" id="' + hiddenId + '" name="' + priceField.attr('name') + '" value="' + priceField.val() + '">');
|
||||
priceField.after(hidden);
|
||||
}
|
||||
|
||||
|
||||
|
||||
totalAmountUpdate();
|
||||
|
||||
|
||||
}
|
||||
|
||||
function paymentAmountUpdate() {
|
||||
var input = $(this);
|
||||
input.val(stPrice.fixNumberFormat(input.val()));
|
||||
var value = Number(input.val());
|
||||
var payment = $('#st_record_manager-payment tbody tr .price-field').not('[data-gift-card=1]');
|
||||
|
||||
var leftToPay = Number($('#st_order-product-list').data('total-amount'));
|
||||
|
||||
payment.each(function() {
|
||||
var current = $(this);
|
||||
if (input.attr('id') !== current.attr('id')) {
|
||||
leftToPay -= Number(current.val());
|
||||
}
|
||||
});
|
||||
|
||||
if (leftToPay < 0) {
|
||||
leftToPay = 0;
|
||||
}
|
||||
|
||||
if (value > leftToPay) {
|
||||
value = leftToPay;
|
||||
}
|
||||
|
||||
input.val(value.toFixed(2));
|
||||
}
|
||||
|
||||
function totalAmountUpdate() {
|
||||
manager = $('#st_record_manager-payment');
|
||||
manager.data('update', true);
|
||||
$('#order_summary_discount').change();
|
||||
manager.data('update', false);
|
||||
}
|
||||
|
||||
$('#st_record_manager-payment').stTableRecordManager({
|
||||
namespace: 'order[payment]',
|
||||
confirmMsg: '<?php echo __('Jesteś pewien?', null, 'stAdminGeneratorPlugin') ?>'
|
||||
});
|
||||
$('#payment_amount').change(paymentAmountUpdate);
|
||||
|
||||
$('#st_record_manager-payment').on('postAdd', function(event, row, fields) {
|
||||
statusUpdate.call(fields.payment_status);
|
||||
totalAmountUpdate();
|
||||
}).on('postRemove', function() {
|
||||
totalAmountUpdate();
|
||||
});
|
||||
|
||||
$('#st_record_manager-payment tbody')
|
||||
.on('change', '.price-field', paymentAmountUpdate)
|
||||
.on('change', '.payment-status', statusUpdate);
|
||||
});
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
7
apps/backend/modules/stOrder/templates/_pointsEarn.php
Normal file
7
apps/backend/modules/stOrder/templates/_pointsEarn.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
if($points_earn>0){
|
||||
echo $points_earn." ".$config_points->get('points_shortcut', null, true);
|
||||
}else{
|
||||
echo "-";
|
||||
}
|
||||
?>
|
||||
7
apps/backend/modules/stOrder/templates/_pointsSpend.php
Normal file
7
apps/backend/modules/stOrder/templates/_pointsSpend.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
if($points_value>0){
|
||||
echo $points_value." ".$config_points->get('points_shortcut', null, true);
|
||||
}else{
|
||||
echo "-";
|
||||
}
|
||||
?>
|
||||
10
apps/backend/modules/stOrder/templates/_pointsStatus.php
Normal file
10
apps/backend/modules/stOrder/templates/_pointsStatus.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
if($points_status == 1){
|
||||
echo __("tak");
|
||||
}elseif($points_earn>0){
|
||||
echo __("nie")." ".st_link_to(__("(rozlicz)"),"stPointsBackend/addPointsForOrder?id=".$order_id);
|
||||
}else{
|
||||
echo "-";
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,91 @@
|
||||
<?php use_helper('stWidgets');?>
|
||||
<?php echo st_open_widget('Order',__('Ostatnio sprzedane produkty'));?>
|
||||
|
||||
<div style="float:right;">
|
||||
|
||||
<?php echo __('Ostatnie', null, 'stBackendMain'); ?>:
|
||||
|
||||
<?php if($date_type == "day"): ?>
|
||||
<b><?php echo link_to_remote(__('24h', null, 'stBackendMain'), array('update'=>'product-last-order-widget', 'url'=>'stOrder/productLastOrderWidget?date_type=day',)) ?></b>
|
||||
<?php else: ?>
|
||||
<?php echo link_to_remote(__('24h', null, 'stBackendMain'), array('update'=>'product-last-order-widget', 'url'=>'stOrder/productLastOrderWidget?date_type=day',)) ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if($date_type == "week"): ?>
|
||||
<b><?php echo link_to_remote(__('7 dni', null, 'stBackendMain'), array('update'=>'product-last-order-widget', 'url'=>'stOrder/productLastOrderWidget?date_type=week',)) ?></b>
|
||||
<?php else: ?>
|
||||
<?php echo link_to_remote(__('7 dni', null, 'stBackendMain'), array('update'=>'product-last-order-widget', 'url'=>'stOrder/productLastOrderWidget?date_type=week',)) ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if($date_type == "month"): ?>
|
||||
<b><?php echo link_to_remote(__('miesiąc', null, 'stBackendMain'), array('update'=>'product-last-order-widget', 'url'=>'stOrder/productLastOrderWidget?date_type=month',)) ?></b>
|
||||
<?php else: ?>
|
||||
<?php echo link_to_remote(__('miesiąc', null, 'stBackendMain'), array('update'=>'product-last-order-widget', 'url'=>'stOrder/productLastOrderWidget?date_type=month',)) ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if($date_type == "lastlog"): ?>
|
||||
<b><?php echo link_to_remote(__('logowanie', null, 'stBackendMain'), array('update'=>'product-last-order-widget', 'url'=>'stOrder/productLastOrderWidget?date_type=lastlog',)) ?></b>
|
||||
<?php else: ?>
|
||||
<?php echo link_to_remote(__('logowanie', null, 'stBackendMain'), array('update'=>'product-last-order-widget', 'url'=>'stOrder/productLastOrderWidget?date_type=lastlog',)) ?>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
<div style="clear:both"></div>
|
||||
<div id="sf_admin_container">
|
||||
|
||||
|
||||
<?php $width = (count($orderProducts) * 100)+100; ?>
|
||||
<div style="height:160px; overflow:auto;">
|
||||
<div style="width:<?php echo $width ?>px">
|
||||
|
||||
<?php $i = 0; ?>
|
||||
<?php foreach ($orderProducts as $product): ?>
|
||||
<?php $i++; ?>
|
||||
|
||||
<?php if($order != $product->getOrderId() && $i!=1): ?>
|
||||
|
||||
<div style="width:10px; height:10px; float:left;"></div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<div style="float:left; width:100px; text-align: center;">
|
||||
|
||||
<div onmouseout="document.getElementById('buttons<?php echo $i.$product->getProductId(); ?>').style.visibility = 'hidden'" onMouseOver="document.getElementById('buttons<?php echo $i.$product->getProductId(); ?>').style.visibility = 'visible'">
|
||||
|
||||
<div style="border-radius: 5px 5px 5px 5px; height:90px; width:90px; border:1px solid #ccc; margin:0px auto; background: url(<?php echo st_product_image_path($product->getProduct(), 'thumb'); ?>) no-repeat; background-position:center; ">
|
||||
|
||||
<div style="float:left; margin-left: 3px;">
|
||||
<?php if($product->getQuantity() != 1):?>
|
||||
<b><?php echo __('szt.') ?> <?php echo $product->getQuantity(); ?></b>
|
||||
<?php else: ?>
|
||||
<?php echo __('szt.') ?> <?php echo $product->getQuantity(); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div style="visibility:hidden" id="buttons<?php echo $i.$product->getProductId(); ?>">
|
||||
|
||||
<div style="float:right;">
|
||||
<?php echo st_link_to(image_tag('/images/backend/main/icons/order.png'), 'stOrder/edit?id='.$product->getOrderId()); ?>
|
||||
<?php echo st_link_to(image_tag('/images/backend/main/icons/user.png'), 'stUser/edit?id='.$product->getOrder()->getSfGuardUserId()); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div style="font-size:10px; line-height: 12px; padding-top: 3px; padding-bottom: 5px; width: 100px; height: 12px; text-align: left; padding-left: 5px;">
|
||||
|
||||
</div>
|
||||
<?php echo st_back_price($product->getPriceBrutto(), true, true) ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php $order = $product->getOrderId(); ?>
|
||||
<?php endforeach ; ?>
|
||||
<div style="clear: both;"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="clear:both"></div>
|
||||
|
||||
|
||||
<?php echo st_close_widget(); ?>
|
||||
14
apps/backend/modules/stOrder/templates/_proforma.php
Normal file
14
apps/backend/modules/stOrder/templates/_proforma.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* @var Order $order
|
||||
*/
|
||||
if ($order->getProforma())
|
||||
{
|
||||
echo st_get_admin_button('preview', __("Pokaż"), "stInvoiceBackend/proformaEdit?id=".$order->getProforma()->getId()."&type=".$order->getProforma()->getType()."&mode=show", array('size' => 'small'));
|
||||
echo st_get_admin_button('download', __("Pobierz"), "stInvoicePdf/show?id=".$order->getProforma()->getId()."&download=true&culture=".$order->getClientCulture(), array('size' => 'small'));
|
||||
echo st_get_admin_button('refresh', __("Aktualizuj"), "stInvoiceBackend/update?id=".$order->getId().'&invoice_id='.$order->getProforma()->getId(), array('size' => 'small'));
|
||||
}
|
||||
else
|
||||
{
|
||||
echo __('Brak');
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
if($order->getReviewOrderProductId() == NULL){
|
||||
|
||||
$config = stConfig::getInstance('stReview');
|
||||
|
||||
if($order->getOrderProducts()) {
|
||||
if ($config -> get("send_type") == 1){
|
||||
$c = new Criteria();
|
||||
$c->setLimit(1);
|
||||
$c->addDescendingOrderByColumn(OrderProductPeer::PRICE);
|
||||
} elseif ($config -> get("send_type") == 2) {
|
||||
$c = new Criteria();
|
||||
$c->setLimit(1);
|
||||
}
|
||||
|
||||
$orderProducts = $order->getOrderProducts($c);
|
||||
$orderProduct = $orderProducts ? $orderProducts[0] : null;
|
||||
|
||||
} else {
|
||||
|
||||
$orderProduct = null;
|
||||
$order_product_id = null;
|
||||
|
||||
}
|
||||
|
||||
if($orderProduct){
|
||||
$order_product_id = $orderProduct->getId();
|
||||
$order->setReviewSend($orderProduct->getSendReview());
|
||||
}
|
||||
|
||||
$order->setReviewOrderProductId($order_product_id);
|
||||
$order->save();
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div style="text-align: center;">
|
||||
<?php if ($order->getReviewOrderProductId() == NULL) : ?>
|
||||
<?php echo st_admin_get_icon('delete-circle', array('color' => 'default')) ?>
|
||||
<?php else: ?>
|
||||
<a style="text-decoration: none; background: none; padding: 0px; margin: 0px;"
|
||||
href="<?php echo st_url_for('stReview/sendReviewRequest') ?>?order_product_id=<?php echo $order->getReviewOrderProductId() ?>"
|
||||
id="st_review_ajax_<?php echo $order->getReviewOrderProductId() ?>"
|
||||
class="tooltip"
|
||||
title="<?php echo $order->getReviewSend() != "" ? stReview::getSendTime($order->getReviewSend()).'<br>'.$i18n->__('Kliknij aby wysłać ponownie.') : __("Kliknij aby wysłać prośbę o recenzję.") ?>">
|
||||
<?php echo st_admin_get_icon('envelop') ?>
|
||||
<?php echo $order->getReviewSend() != "" ? st_admin_get_icon('check-circle', array('size' => 15, 'style' => 'margin-left: -12px; margin-bottom: -13px')) : st_admin_get_icon('arrow-right', array('size' => 12, 'style' => 'margin-left: -11px; margin-bottom: -14px')) ?>
|
||||
</a>
|
||||
<script>
|
||||
jQuery(function($) {
|
||||
$('#st_review_ajax_<?php echo $order->getReviewOrderProductId() ?>').click(function() {
|
||||
var link = $(this);
|
||||
$.preloader.show();
|
||||
$.post(link.attr('href'), {}, function(response) {
|
||||
link.data('title', response.title);
|
||||
link.html(response.content);
|
||||
$.preloader.hide();
|
||||
});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
12
apps/backend/modules/stOrder/templates/_sf_guard_user.php
Normal file
12
apps/backend/modules/stOrder/templates/_sf_guard_user.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @var Order $order
|
||||
*/
|
||||
?>
|
||||
<?php if ($order->getsfGuardUserId()): ?>
|
||||
<span class="align-middle"><?php echo st_external_link_to($order->getsfGuardUser()->getUsername(), 'user/edit?id=' . $order->getsfGuardUserId()) ?></span>
|
||||
<?php else: ?>
|
||||
<span class="align-middle"><?php echo $order->getOptClientEmail() ?></span>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php echo $order->getOrderLanguage() ? get_language_flag_icon($order->getOrderLanguage()->getShortcut(), array('size' => 18)) : '' ?>
|
||||
22
apps/backend/modules/stOrder/templates/_summary.php
Normal file
22
apps/backend/modules/stOrder/templates/_summary.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php use_helper('stCurrency') ?>
|
||||
|
||||
<div class="bs-d-flex bs-justify-content-end bs-mt-4">
|
||||
<div>
|
||||
<?php st_admin_table_start(array(), array('min_width' => false, 'compact' => true, 'highlight' => false)); ?>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-right"><?php echo __('Ilość zamówień') ?>:</td>
|
||||
<td><?php echo $count ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-right"><?php echo __('Średnia wartość brutto') ?>:</td>
|
||||
<td><?php echo st_currency_default_format($averageAmount) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-right"><?php echo __('Suma brutto') ?>:</td>
|
||||
<td><b><?php echo st_currency_default_format($totalAmount) ?></b></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<?php st_admin_table_end() ?>
|
||||
</div>
|
||||
</div>
|
||||
11
apps/backend/modules/stOrder/templates/_total_amount.php
Normal file
11
apps/backend/modules/stOrder/templates/_total_amount.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
use_helper('stOrder');
|
||||
$total_amount = $order->getOptTotalAmount();
|
||||
?>
|
||||
<?php if ($order->getOrderCurrency()->getExchange() != 1): $currency = stCurrency::getDefault() ?>
|
||||
<spam class="list_tooltip" title="<?php echo st_order_price_format($order->getOrderCurrency()->exchange($total_amount, true), $currency) ?>">
|
||||
<?php echo st_order_price_format($total_amount, $order->getOrderCurrency()) ?>
|
||||
</span>
|
||||
<?php else: ?>
|
||||
<?php echo st_order_price_format($total_amount, $order->getOrderCurrency()) ?>
|
||||
<?php endif; ?>
|
||||
109
apps/backend/modules/stOrder/templates/_total_amount_summary.php
Normal file
109
apps/backend/modules/stOrder/templates/_total_amount_summary.php
Normal file
@@ -0,0 +1,109 @@
|
||||
<?php
|
||||
use_helper('stOrder');
|
||||
?>
|
||||
|
||||
<?php if ($order->getDiscountCouponCode()): ?>
|
||||
<div class="row">
|
||||
<span class="label"><?php echo __('Kod rabatowy') ?>:</span>
|
||||
<div class="field">
|
||||
<?php echo st_external_link_to($order->getDiscountCouponCode()->getCode(), 'stDiscountBackend/couponCodeEdit?id='.$order->getDiscountCouponCode()->getId()) ?> (<?php echo $order->getDiscountCouponCode()->getDiscount() ?>%)
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if (!$sf_user->getAttribute('edit_mode', false, 'soteshop/stOrder')): ?>
|
||||
<?php if ($order->hasDiscount()): $discount = $order->getTotalProductDiscountAmount(true, true) ?>
|
||||
<div class="row">
|
||||
<span class="label"><?php echo __('Łączna wartość') ?>:</span>
|
||||
<div class="field">
|
||||
<span id="order-total-amount-container"><?php echo st_order_total_amount($order, true, true, false) ?></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<span class="label"><?php echo __('Udzielony rabat') ?>:</span>
|
||||
<div class="field">
|
||||
-<?php echo st_order_price_format($discount, $order->getOrderCurrency()) ?>
|
||||
<?php if ($order->getDiscount()): ?>
|
||||
(<a target="_blank" href="<?php echo st_url_for('@stDiscountPlugin?action=edit&id='.$order->getDiscountId()) ?>"><?php echo $order->getDiscount()->getName() ?></a>)
|
||||
<?php endif ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<?php else:
|
||||
$discounts = DiscountPeer::doSelectActiveCached();
|
||||
$options = '<option value="">---</option>';
|
||||
$currency = $order->getOrderCurrency();
|
||||
|
||||
if ($discounts && isset($discounts['O']))
|
||||
{
|
||||
foreach ($discounts['O'] as $discount)
|
||||
{
|
||||
$type = $discount->getPriceType();
|
||||
$from_amount = $currency->exchange($discount->getCondition('from_amount'));
|
||||
|
||||
if ($type == '%')
|
||||
{
|
||||
$discount_value = $discount->getValue();
|
||||
}
|
||||
else
|
||||
{
|
||||
$discount_value = $currency->exchange($discount->getValue());
|
||||
}
|
||||
|
||||
$label = $discount->getName().' ('.__('Rabat %discount% od kwoty: %amount%', array('%discount%' => $type == '%' ? $discount_value.'%' : st_order_price_format($discount_value, $currency),'%amount%' => st_order_price_format($from_amount, $currency))).')';
|
||||
|
||||
if ($discount->getId() == $order->getDiscountId())
|
||||
{
|
||||
$options .= '<option value="'.$discount->getId().'" data-discount-value="'.$discount_value.'" data-discount-type="'.$type.'" selected>'.$label.'</option>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$options .= '<option value="'.$discount->getId().'" data-discount-value="'.$discount_value.'" data-discount-type="'.$type.'">'.$label.'</option>';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
<div class="row">
|
||||
<span class="label"><?php echo __('Łączna wartość') ?>:</span>
|
||||
<div class="field">
|
||||
<span id="order-total-amount-container"><?php echo st_order_total_amount($order, true, true, false) ?></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<span class="label"><?php echo __('Udzielony rabat') ?>:</span>
|
||||
<div class="field">
|
||||
<?php echo select_tag('order[discount]', $options); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<div class="row">
|
||||
<span class="label"><?php echo __('Razem do zapłaty', null, 'stInvoiceBackend') ?>:</span>
|
||||
<div class="field">
|
||||
<strong id="order-to-pay-amount-container"><?php echo st_order_total_amount($order) ?></strong>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<span class="label"><?php echo __('Zapłacono', null, 'stInvoiceBackend') ?>:</span>
|
||||
<div class="field" style="color: #54903E; font-weight: bold">
|
||||
<span id="order-paid-amount-container" data-amount="<?php echo $order->getPaidAmount() ?>"><?php echo st_order_price_format($order->getPaidAmount(), $order->getOrderCurrency()); ?></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="display: none">
|
||||
<span class="label"><?php echo __('Do zwrotu', null, 'stInvoiceBackend') ?>:</span>
|
||||
<div class="field" style="color: #C62929; font-weight: bold">
|
||||
<span id="order-refund-amount-container"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<span class="label"><?php echo __('Pozostało do zapłaty', null, 'stInvoiceBackend') ?>:</span>
|
||||
<div class="field" style="color: #C62929; font-weight: bold">
|
||||
<span id="order-left-to-pay-amount-container"><?php echo st_order_price_format($order->getUnpaidAmount(), $order->getOrderCurrency()); ?></span>
|
||||
</div>
|
||||
</div>
|
||||
61
apps/backend/modules/stOrder/templates/_user_data.php
Normal file
61
apps/backend/modules/stOrder/templates/_user_data.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php if(!$sf_user->getAttribute('edit_mode', false, 'soteshop/stOrder')): ?>
|
||||
<?php $culture = sfContext::getInstance()->getUser()->getCulture();?>
|
||||
<address class="st-order-user-data">
|
||||
<?php if($user_data->getCompany()): ?>
|
||||
<p>
|
||||
<?php echo $user_data->getCompany(); ?>
|
||||
</p>
|
||||
<?php endif;?>
|
||||
<p>
|
||||
<span class="st_order-address-name"><?php echo $user_data->getFullName(); ?></span>
|
||||
</p>
|
||||
<p>
|
||||
<span class="st_order-address-street"><?php echo $user_data->getAddress(); ?></span><br>
|
||||
|
||||
<?php if($user_data->getAddressMore()): ?>
|
||||
<span class="st_order-address-street"><?php echo $user_data->getAddressMore(); ?></span><br>
|
||||
<?php endif;?>
|
||||
<?php if($user_data->getRegion()): ?>
|
||||
<span class="st_order-address-street"><?php echo $user_data->getRegion(); ?></span><br>
|
||||
<?php endif;?>
|
||||
<span class="st_order-address-code"><?php echo $user_data->getCode() ?></span>
|
||||
<span class="st_order-address-town"><?php echo $user_data->getTown() ?></span>
|
||||
<span class="st_order-address-country"><?php $user_data->getCountry()->setCulture($culture); echo $user_data->getCountry()->getName() ?></span>
|
||||
<?php if($user_data->getPesel()): ?>
|
||||
<br><span class="st_order-address-street"><?php echo __('PESEL') ?> <?php echo $user_data->getPesel() ?></span>
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<?php echo $user_data->getPhone() ?>
|
||||
</p>
|
||||
<?php if($user_data->getVatNumber()): ?>
|
||||
<p>
|
||||
<?php if ($user_data->getHasValidVatEu()): ?>
|
||||
<?php echo __('VAT UE') ?>: <?php echo $user_data->getVatNumber() ?>
|
||||
<a class="help" target="_blank" title="<?php echo __('Numer VAT UE został zweryfikowany za pośrednictwem usługi VIES. Kliknij na ikonkę, aby przejść do informacji szczegółowych.') ?>" href="<?php echo stTaxVies::checkVatUrl($user_data->getVatNumber()) ?>" style="background: url(/images/backend/eu.png) no-repeat 0px 2px"></a>
|
||||
<?php else: ?>
|
||||
<?php echo __('NIP') ?>: <?php echo $user_data->getVatNumber() ?>
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
</address>
|
||||
<?php else: ?>
|
||||
<div class="st-order-user-data">
|
||||
<?php use_helper('Countries') ?>
|
||||
<?php echo st_admin_get_form_field('order[user_data]['.$type.'][company]', __('firma'), $user_data->getCompany(), 'input_tag', array('class' => 'st-responsive')) ?>
|
||||
<?php echo st_admin_get_form_field('order[user_data]['.$type.'][full_name]', __('imię i nazwisko'), $user_data->getFullName(), 'input_tag', array('class' => 'st-responsive')) ?>
|
||||
<?php echo st_admin_get_form_field('order[user_data]['.$type.'][address]', __('adres'), $user_data->getAddress(), 'input_tag', array('class' => 'st-responsive', 'required' => true)) ?>
|
||||
<?php echo st_admin_get_form_field('order[user_data]['.$type.'][address_more]', __('adres cd'), $user_data->getAddressMore(), 'input_tag', array('class' => 'st-responsive')) ?>
|
||||
<?php echo st_admin_get_form_field('order[user_data]['.$type.'][region]', __('województwo'), $user_data->getRegion(), 'input_tag', array('class' => 'st-responsive')) ?>
|
||||
<?php echo st_admin_get_form_field('order[user_data]['.$type.'][code_town]', __('kod, miasto'), $user_data, '_order_user_data_code_town', array('name' => 'order[user_data]['.$type.']', 'required' => true)) ?>
|
||||
<?php echo st_admin_get_form_field('order[user_data]['.$type.'][countries_id]', __('kraj'), $user_data->getCountry()->getId(), 'st_countries_select_tag', array('class' => 'st-responsive', 'required' => true)); ?>
|
||||
<?php if ($user_data instanceof OrderUserDataBilling): ?>
|
||||
<?php echo st_admin_get_form_field('order[user_data]['.$type.'][pesel]', __('pesel'), $user_data->getPesel(), 'input_tag', array('class' => 'st-responsive')) ?>
|
||||
<?php endif ?>
|
||||
<?php echo st_admin_get_form_field('order[user_data]['.$type.'][phone]', __('telefon'), $user_data->getPhone(), 'input_tag', array('class' => 'st-responsive')) ?>
|
||||
<?php if ($user_data instanceof OrderUserDataBilling): ?>
|
||||
<?php echo st_admin_get_form_field('order[user_data]['.$type.'][vat_number]', __('nip'), $user_data->getVatNumber(), 'input_tag', array('class' => 'st-responsive')) ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
9
apps/backend/modules/stOrder/templates/_user_info.php
Normal file
9
apps/backend/modules/stOrder/templates/_user_info.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<div class="st_order-user-data">
|
||||
<h3><?php echo __('Dane bilingowe') ?></h3>
|
||||
<?php st_include_partial('user_data', array('user_data' => $order->getOrderUserDataBilling(), 'type' => 'billing')); ?>
|
||||
</div>
|
||||
<div class="st_order-user-data">
|
||||
<h3><?php echo __('Dane dostawy') ?></h3>
|
||||
<?php st_include_partial('user_data', array('user_data' => $order->getOrderUserDataDelivery(), 'type' => 'delivery')); ?>
|
||||
</div>
|
||||
<br class="st_clear_all" />
|
||||
404
apps/backend/modules/stOrder/templates/orderStatusHtmlMail.php
Normal file
404
apps/backend/modules/stOrder/templates/orderStatusHtmlMail.php
Normal file
@@ -0,0 +1,404 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
<head style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
<?php
|
||||
/**
|
||||
* @var Order $order
|
||||
*/
|
||||
?>
|
||||
<meta name="viewport" content="width=device-width" style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
<title style="margin: 0;padding: 0;font-family: Arial, sans-serif;">ZURBemails</title>
|
||||
|
||||
<style style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
|
||||
/* -------------------------------------
|
||||
GLOBAL
|
||||
------------------------------------- */
|
||||
* {
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
* { font-family: Arial, sans-serif; }
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
}
|
||||
.collapse {
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
body {
|
||||
-webkit-font-smoothing:antialiased;
|
||||
-webkit-text-size-adjust:none;
|
||||
width: 100%!important;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------
|
||||
ELEMENTS
|
||||
------------------------------------- */
|
||||
a { color: #<?php echo $mail_config->get('link_color'); ?>;}
|
||||
|
||||
.btn {
|
||||
text-decoration:none;
|
||||
color: #FFF;
|
||||
background-color: #666;
|
||||
padding:10px 16px;
|
||||
font-weight:bold;
|
||||
margin-right:10px;
|
||||
text-align:center;
|
||||
cursor:pointer;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
p.callout {
|
||||
padding:15px;
|
||||
background-color:#ECF8FF;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.callout a {
|
||||
font-weight:bold;
|
||||
color: #2BA6CB;
|
||||
}
|
||||
|
||||
table.social {
|
||||
|
||||
background-color: #ebebeb;
|
||||
|
||||
}
|
||||
.social .soc-btn {
|
||||
padding: 3px 7px;
|
||||
font-size:12px;
|
||||
margin-bottom:10px;
|
||||
text-decoration:none;
|
||||
color: #FFF;font-weight:bold;
|
||||
display:block;
|
||||
text-align:center;
|
||||
}
|
||||
a.fb { background-color: #3B5998!important; }
|
||||
a.tw { background-color: #1daced!important; }
|
||||
a.gp { background-color: #DB4A39!important; }
|
||||
a.ms { background-color: #000!important; }
|
||||
|
||||
.sidebar .soc-btn {
|
||||
display:block;
|
||||
width:100%;
|
||||
}
|
||||
|
||||
/* -------------------------------------
|
||||
HEADER
|
||||
------------------------------------- */
|
||||
table.head-wrap { width: 100%;}
|
||||
|
||||
.header.container table td.logo { padding: 15px; }
|
||||
.header.container table td.label { padding: 15px; padding-left:0px;}
|
||||
|
||||
|
||||
/* -------------------------------------
|
||||
BODY
|
||||
------------------------------------- */
|
||||
table.body-wrap { width: 100%;}
|
||||
|
||||
|
||||
/* -------------------------------------
|
||||
FOOTER
|
||||
------------------------------------- */
|
||||
table.footer-wrap { width: 100%; clear:both!important;
|
||||
}
|
||||
.footer-wrap .container td.content p { border-top: 1px solid rgb(215,215,215); padding-top:15px;}
|
||||
.footer-wrap .container td.content p {
|
||||
font-size:10px;
|
||||
font-weight: bold;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------
|
||||
TYPOGRAPHY
|
||||
------------------------------------- */
|
||||
h1,h2,h3,h4,h5,h6 {
|
||||
font-family: Arial, sans-serif; line-height: 1.1; margin-bottom:15px; color:#000;
|
||||
}
|
||||
h1 small, h2 small, h3 small, h4 small, h5 small, h6 small { font-size: 60%; color: #6f6f6f; line-height: 0; text-transform: none; }
|
||||
|
||||
h1 { font-weight:200; font-size: 44px;}
|
||||
h2 { font-weight:200; font-size: 37px;}
|
||||
h3 { font-weight:500; font-size: 27px;}
|
||||
h4 { font-weight:500; font-size: 23px;}
|
||||
h5 { font-weight:900; font-size: 17px;}
|
||||
h6 { font-weight:900; font-size: 14px; text-transform: uppercase; color:#444;}
|
||||
|
||||
.collapse { margin:0!important;}
|
||||
|
||||
p, ul {
|
||||
margin-bottom: 10px;
|
||||
font-weight: normal;
|
||||
font-size:12px;
|
||||
line-height:1.6;
|
||||
}
|
||||
p.lead { font-size:17px; }
|
||||
p.last { margin-bottom:0px;}
|
||||
|
||||
ul li {
|
||||
margin-left:5px;
|
||||
list-style-position: inside;
|
||||
}
|
||||
|
||||
/* -------------------------------------
|
||||
SIDEBAR
|
||||
------------------------------------- */
|
||||
ul.sidebar {
|
||||
background:#ebebeb;
|
||||
display:block;
|
||||
list-style-type: none;
|
||||
}
|
||||
ul.sidebar li { display: block; margin:0;}
|
||||
ul.sidebar li a {
|
||||
text-decoration:none;
|
||||
color: #666;
|
||||
padding:10px 16px;
|
||||
/* font-weight:bold; */
|
||||
margin-right:10px;
|
||||
/* text-align:center; */
|
||||
cursor:pointer;
|
||||
border-bottom: 1px solid #777777;
|
||||
border-top: 1px solid #FFFFFF;
|
||||
display:block;
|
||||
margin:0;
|
||||
}
|
||||
ul.sidebar li a.last { border-bottom-width:0px;}
|
||||
ul.sidebar li a h1,ul.sidebar li a h2,ul.sidebar li a h3,ul.sidebar li a h4,ul.sidebar li a h5,ul.sidebar li a h6,ul.sidebar li a p { margin-bottom:0!important;}
|
||||
|
||||
|
||||
|
||||
/* ---------------------------------------------------
|
||||
RESPONSIVENESS
|
||||
Nuke it from orbit. It's the only way to be sure.
|
||||
------------------------------------------------------ */
|
||||
|
||||
/* Set a max-width, and make it display as block so it will automatically stretch to that width, but will also shrink down on a phone or something */
|
||||
.container {
|
||||
display:block!important;
|
||||
max-width:600px!important;
|
||||
margin:0 auto!important; /* makes it centered */
|
||||
clear:both!important;
|
||||
}
|
||||
|
||||
/* This should also be a block element, so that it will fill 100% of the .container */
|
||||
.content {
|
||||
padding:15px;
|
||||
max-width:600px;
|
||||
margin:0 auto;
|
||||
display:block;
|
||||
}
|
||||
|
||||
/* Let's make sure tables in the content area are 100% wide */
|
||||
.content table { width: 100%; }
|
||||
|
||||
|
||||
/* Odds and ends */
|
||||
.column {
|
||||
width: 300px;
|
||||
float:left;
|
||||
}
|
||||
.social .column tr td { padding: 15px; }
|
||||
|
||||
.user_data .column tr td { padding-bottom: 15px; }
|
||||
|
||||
.column-wrap {
|
||||
padding:0!important;
|
||||
margin:0 auto;
|
||||
max-width:600px!important;
|
||||
}
|
||||
.column table { width:100%;}
|
||||
|
||||
.social .column {
|
||||
width: 280px;
|
||||
min-width: 279px;
|
||||
float:left;
|
||||
}
|
||||
|
||||
.user_data .column {
|
||||
width: 280px;
|
||||
min-width: 279px;
|
||||
float:left;
|
||||
}
|
||||
|
||||
/* Be sure to place a .clear element after each set of columns, just to be safe */
|
||||
.clear { display: block; clear: both; }
|
||||
|
||||
|
||||
/* -------------------------------------------
|
||||
PHONE
|
||||
For clients that support media queries.
|
||||
Nothing fancy.
|
||||
-------------------------------------------- */
|
||||
@media only screen and (max-width: 600px) {
|
||||
|
||||
a[class="btn"] { display:block!important; margin-bottom:10px!important; background-image:none!important; margin-right:0!important;}
|
||||
|
||||
div[class="column"] { width: auto!important; float:none!important;}
|
||||
|
||||
table.social div[class="column"] {
|
||||
width:auto!important;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body bgcolor="#FFFFFF" style="margin: 0;padding: 0;font-family: Arial, sans-serif;font-size: 12px;-webkit-font-smoothing: antialiased;-webkit-text-size-adjust: none;height: 100%;width: 100%!important;">
|
||||
|
||||
<!-- HEADER -->
|
||||
<table class="head-wrap" bgcolor="#<?php echo $mail_config->get('bg_header_color'); ?>" style="margin: 0;padding: 0;font-family: Arial, sans-serif;font-size: 12px;width: 100%;">
|
||||
<tr style="margin: 0;padding: 0;font-family: Arial, sans-serif;font-size: 12px;">
|
||||
<td style="margin: 0;padding: 0;font-family: Arial, sans-serif;font-size: 12px;"></td>
|
||||
<td class="header container" style="margin: 0 auto!important;padding: 0;font-family: Arial, sans-serif;font-size: 12px;display: block!important;max-width: 600px!important;clear: both!important;">
|
||||
|
||||
<div class="content" style="margin: 0 auto;padding: 15px;font-family: Arial, sans-serif;font-size: 12px;max-width: 600px;display: block;">
|
||||
<table bgcolor="#<?php echo $mail_config->get('bg_header_color'); ?>" style="margin: 0;padding: 0;font-family: Arial, sans-serif;font-size: 12px;width: 100%;">
|
||||
<tr style="margin: 0;padding: 0;font-family: Arial, sans-serif;font-size: 12px;">
|
||||
<td style="margin: 0;padding: 0;font-family: Arial, sans-serif;font-size: 12px;"><?php if ($mail_config->get('logo')!=""): ?><img src="http://<?php echo $sf_request->getHost(); ?>/uploads<?php echo $mail_config->get('logo'); ?>?version=1" style="margin: 0;padding: 0;font-family: Arial, sans-serif;font-size: 12px;max-width: 100%; max-height: 50px;"><?php endif; ?></td>
|
||||
<td align="right" style="margin: 0;padding: 0;font-family: Arial, sans-serif;"><h6 class="collapse" style="margin: 0!important;padding: 0;font-family: "helveticaneue-light": ;, ": ;helvetica neue light": ;helvetica neue": ;, helvetica, arial, ": ;lucida grande": ;, sans-serif: ;line-height: 1.1;margin-bottom: 15px;color: #444;font-weight: 900;font-size: 14px;text-transform: uppercase;"><?php echo date('d-m-Y H:i'); ?></h6></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
<td style="margin: 0;padding: 0;font-family: Arial, sans-serif;"></td>
|
||||
</tr>
|
||||
</table><!-- /HEADER -->
|
||||
|
||||
|
||||
<!-- BODY -->
|
||||
<table class="body-wrap" cellpadding="0" cellspacing="0" style="margin: 0;padding: 0;font-family: Arial, sans-serif;width: 100%;">
|
||||
<tr style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
<td style="margin: 0;padding: 0;font-family: Arial, sans-serif;"></td>
|
||||
<td class="container" bgcolor="#FFFFFF" style="margin: 0 auto!important;padding: 0;font-family: Arial, sans-serif;display: block!important;max-width: 600px!important;clear: both!important;">
|
||||
|
||||
<div class="content" style="margin: 0 auto;padding: 15px;font-family: Arial, sans-serif;max-width: 600px;display: block;">
|
||||
<table cellpadding="0" cellspacing="0" style="margin: 0;padding: 0;font-family: Arial, sans-serif;width: 100%;">
|
||||
<tr style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
<td style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
<p style="font-size: 12px;margin: 0;padding: 0;font-family: Arial, sans-serif;margin-bottom: 10px;font-weight: normal;line-height: 1.6;"><?php echo $head; ?></p>
|
||||
|
||||
<h4 style="margin: 0;padding: 0;font-family: "helveticaneue-light": ;, ": ;helvetica neue light": ;helvetica neue": ;, helvetica, arial, ": ;lucida grande": ;, sans-serif: ;line-height: 1.1;margin-bottom: 15px;color: #000;font-weight: 500;font-size: 23px;"><?php echo __('Zamówienie numer:') ?> <?php echo $order->getNumber(); ?></h4>
|
||||
|
||||
<div style="font-size:12px; color:#576278;">
|
||||
<?php echo __('Data złożenia zamówienia:') ?><span style="color:#404040; padding-left: 5px"><?php echo $order->getCreatedAt(); ?><span>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
||||
<p style="font-size: 12px;margin: 0;padding: 0;font-family: Arial, sans-serif;margin-bottom: 10px;font-weight: normal;line-height: 1.6;"><?php echo $head_content; ?></p>
|
||||
|
||||
<div>
|
||||
|
||||
<?php if(!$order->isAllegroOrder() && $order->getOrderDelivery()->getNumber()): ?>
|
||||
<?php foreach ($order->getOrderDelivery()->getNumbers() as $number): ?>
|
||||
<p style="margin-bottom: 15px;">
|
||||
<span style="font-size:12px; color:#576278;">
|
||||
<?php echo __('Numer przesyłki:'); ?> <b><?php echo $number ?></b>
|
||||
|
||||
<?php if($order->getOrderDelivery()->getTrackingUrl($number)): ?>
|
||||
<a href="<?php echo $order->getOrderDelivery()->getTrackingUrl($number) ?>"><?php echo __('Sprawdź status dostawy', null, 'stDeliveryBackend') ?></a>
|
||||
<?php endif ?>
|
||||
</span>
|
||||
</p>
|
||||
<?php endforeach ?>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (!$order->isAllegroOrder() && $order->getOrderStatus()->getHasInvoiceProforma()==1): ?>
|
||||
<p style="margin-bottom: 15px;">
|
||||
<span style="font-size:12px; color:#576278;"><?php echo st_link_to(__('Pobierz fakturę proforma'), 'stOrder/downloadInvoice?id='.$order->getId().'&hash_code='.$order->getHashCode().'&proforma=1', array('absolute' => true, 'for_app' => 'frontend', 'for_lang' => $order->getClientCulture())) ?></span>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!$order->isAllegroOrder() && $order->getOrderStatus()->getHasInvoice()==1 && $send_link == 1): ?>
|
||||
<p style="margin-bottom: 15px;">
|
||||
<span style="font-size:12px; color:#576278;"><?php echo st_link_to(__('Pobierz fakturę'), 'stOrder/downloadInvoice?id='.$order->getId().'&hash_code='.$order->getHashCode().'&proforma=0', array('absolute' => true, 'for_app' => 'frontend')) ?></span>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php $color_link = "color:#".$mail_config->get('bg_action_link_color'); ?>
|
||||
<p class="callout" style="text-align: center;margin: 0;padding: 15px;font-family: Arial, sans-serif;font-size: 12px;margin-bottom: 15px;font-weight: normal;line-height: 1.6;background-color: #<?php echo $mail_config->get('bg_action_color'); ?>;">
|
||||
<span style="font-size:12px;"><?php echo st_link_to(__('Przejdź do zamówienia'), !$order->isAllegroOrder() ? 'stOrder/show?id='.$order->getId().'&hash_code='.$order->getHashCode() : stAllegroApi::getOrderUrl($order->getOptAllegroCheckoutFormId()), array('style' => $color_link, 'absolute' => true, 'for_app' => 'frontend', 'for_lang' => $order->getClientCulture())) ?></span>
|
||||
</p><!-- /Callout Panel -->
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<br />
|
||||
|
||||
|
||||
<div style="margin:10px 0px 7px 0px">
|
||||
|
||||
<div style="font-family:Verdana,Arial,Helvetica,sans-serif; line-height:18px; font-size:10px;">
|
||||
<?php echo $order->getOrderStatus()->getDescription(); ?>
|
||||
</div>
|
||||
|
||||
|
||||
<?php if ($coupon_code): ?>
|
||||
<br/>
|
||||
|
||||
<table cellpadding="0" cellspacing="0" width="300" style="margin:0px auto;">
|
||||
<tr>
|
||||
<td colspan="2" bgcolor="#576278" style="color:#fff;" align="center"><b><?php echo __('Kod rabatowy') ?></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="150" align="right" bgcolor="#F0F4F7">
|
||||
<span style="font-family:Verdana,Arial,Helvetica,sans-serif; line-height:18px; font-size:12px;"><?php echo __('Kod') ?>:</span>
|
||||
</td>
|
||||
<td width="150" style="padding-left:5px;" bgcolor="#F0F4F7">
|
||||
<b><?php echo $coupon_code->getCode() ?></b>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#F0F4F7" align="right" style="font-family:Verdana,Arial,Helvetica,sans-serif; line-height:18px; font-size:12px;"><?php echo __('Rabat') ?>:</td>
|
||||
<td bgcolor="#F0F4F7" style="padding-left:5px;"><b><?php echo $coupon_code->getDiscount(); ?>%</b></td>
|
||||
</tr>
|
||||
<?php if ($coupon_code->getValidTo()): ?>
|
||||
<tr>
|
||||
<td bgcolor="#F0F4F7" align="right" style="font-family:Verdana,Arial,Helvetica,sans-serif; line-height:18px; font-size:12px;"><?php echo __('Ważny do') ?>:</td>
|
||||
<td bgcolor="#F0F4F7" style="padding-left:5px; font-family:Verdana,Arial,Helvetica,sans-serif; line-height:18px; font-size:12px;"><b><?php echo $coupon_code->getValidTo('d-m-Y H:i') ?></b></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
|
||||
</table>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<div style="font-family:Verdana,Arial,Helvetica,sans-serif; line-height:18px; font-size:12px;">
|
||||
<?php echo $foot_content; ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- social & contact -->
|
||||
<table class="social" width="100%" style="margin: 0;padding: 0;font-family: Arial, sans-serif;background-color: #<?php echo $mail_config->get('bg_footer_color'); ?>;width: 100%;">
|
||||
<tr style="margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
<td style="font-size: 12px;margin: 0;padding: 0;font-family: Arial, sans-serif;">
|
||||
<?php echo $foot; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table><!-- /social & contact -->
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><!-- /content -->
|
||||
|
||||
</td>
|
||||
<td style="margin: 0;padding: 0;font-family: Arial, sans-serif;"></td>
|
||||
</tr>
|
||||
</table><!-- /BODY -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
use_helper('stCurrency');
|
||||
/**
|
||||
* @package stOrder
|
||||
*/
|
||||
?>
|
||||
<?php echo __('Data złożenia zamówienia:') ?> <?php echo $order->getCreatedAt(); ?>
|
||||
|
||||
<?php echo __('Zamówienie numer:') ?> <?php echo $order->getNumber(); ?>
|
||||
|
||||
<?php echo $head_content ?>
|
||||
|
||||
<?php echo $order->getOrderStatus()->getDescription(); ?>
|
||||
|
||||
<?php if (!$order->isAllegroOrder() && $order->getOrderStatus()->getHasInvoiceProforma()==1): ?>
|
||||
<?php echo st_link_to(__('Pobierz fakturę proforma'), 'stOrder/downloadInvoice?id='.$order->getId().'&hash_code='.$order->getHashCode().'&proforma=1', array('absolute' => true, 'for_app' => 'frontend', 'for_lang' => $order->getClientCulture())) ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!$order->isAllegroOrder() && $order->getOrderStatus()->getHasInvoice()==1 && $send_link == 1): ?>
|
||||
<?php echo st_link_to(__('Pobierz fakturę'), 'stOrder/downloadInvoice?id='.$order->getId().'&hash_code='.$order->getHashCode().'&proforma=0', array('absolute' => true, 'for_app' => 'frontend', 'for_lang' => $order->getClientCulture())) ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($coupon_code): ?>
|
||||
<?php echo __('Kod rabatowy') ?>
|
||||
|
||||
<?php echo __('Kod') ?>: <?php echo $coupon_code->getCode() ?>
|
||||
|
||||
<?php echo __('Rabat') ?>: <?php echo $coupon_code->getDiscount().'%' ?>
|
||||
|
||||
<?php echo __('Ważny do') ?>: <?php echo $coupon_code->getValidTo('d-m-Y H:i') ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php echo __('Przejdź do zamówienia') ?>: <?php echo !$order->isAllegroOrder() ? st_url_for('stOrder/show?id='.$order->getId().'&hash_code='.$order->getHashCode(), true) : stAllegroApi::getOrderUrl($order->getOptAllegroCheckoutFormId()) ?>
|
||||
10
apps/backend/modules/stOrder/validate/config.yml
Normal file
10
apps/backend/modules/stOrder/validate/config.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
fields:
|
||||
config{min_amount}:
|
||||
required:
|
||||
msg: Podaj minimalna wartość zamówienia
|
||||
sfNumberValidator:
|
||||
type: any
|
||||
min: 0
|
||||
min_error: Wartość nie może być mniejsza od 0
|
||||
type_error: "Nieprawidłowy format (przykład: 10, 10.00)"
|
||||
nan_error: "Nieprawidłowy format (przykład: 10, 10.00)"
|
||||
@@ -0,0 +1,8 @@
|
||||
fields:
|
||||
order_status{name}:
|
||||
required:
|
||||
msg: Brak nazwy statusu
|
||||
sfPropelUniqueValidator:
|
||||
class: OrderStatus
|
||||
column: opt_name
|
||||
unique_error: Status o podanej nazwie już istnieje
|
||||
Reference in New Issue
Block a user