This commit is contained in:
miroman-afk
2023-05-04 10:41:36 +03:00
parent fb46c8e739
commit 5c3a8a464b
13 changed files with 623 additions and 251 deletions

View File

@@ -1368,8 +1368,8 @@ class GETDataReport extends HRCCommand implements HRCCommandInterface
$average_sum_one_guest = round($clients_sum / $one_client_count, 2);
//Pay methods
$pay_cash_sum = ExchangeOrders::where('who_open', '>', 0)
->where('order_sum', '>', 0)
->where('cash', '>', 0)
//->where('order_sum', '>', 0)
//->where('cash', '>', 0)
->where('is_deleted', 0)
->where('shift_id', $shift_id)
->sum('cash');
@@ -1545,6 +1545,7 @@ class GETDataReport extends HRCCommand implements HRCCommandInterface
]
];
}
if (isset($input['start_date']) && isset($input['end_date'])) {
$end_date = date('Y-m-d H:i:s', strtotime($input['end_date'] . ' 23:59:59'));
$start_date = date('Y-m-d H:i:s', strtotime($input['start_date'] . ' 00:00:01'));
@@ -1702,8 +1703,8 @@ class GETDataReport extends HRCCommand implements HRCCommandInterface
$average_sum_one_guest = round($clients_sum / $one_client_count, 2);
//Pay methods
$pay_cash_sum += ExchangeOrders::where('who_open', '>', 0)
->where('order_sum', '>', 0)
->where('cash', '>', 0)
//->where('order_sum', '>', 0)
//->where('cash', '>', 0)
->where('is_deleted', 0)
->where('shift_id', $shift_id)
->sum('cash');
@@ -1827,6 +1828,17 @@ class GETDataReport extends HRCCommand implements HRCCommandInterface
->sum('order_sum');
}
}
if (Report::where('start_date', $start_date)->where('end_date', $end_date)->where('report_type', 'statistics')->count() < 1) {
$report = new Report;
$report->user_id = intval($input['admin_user_id']);
$report->name = 'Отчет по статистике';
$report->shift_id = 0;
$report->start_date = $start_date;
$report->end_date = $end_date;
$report->report_type = 'statistics';
$report->save();
}
return [
'status' => 'success',
'fiscal' => [
@@ -1882,6 +1894,200 @@ class GETDataReport extends HRCCommand implements HRCCommandInterface
}
}
if ($reportType == 'payment') {
if (isset($input['shift_id'])) {
$shift_id = $input['shift_id'];
$shift_time = ExchangeShifts::where('id', $shift_id)->first();
$shift_start_time = $shift_time['opened'];
$shift_end_time = $shift_time['closed'];
$printers = Printer::get();
foreach ($printers as $printer) {
$report[$printer['code']]['cash'] = $report[$printer['code']]['credit'] = 0;
$report[$printer['code']]['presale'] = $report[$printer['code']]['self'] = 0;
$report[$printer['code']]['clearing'] = $report[$printer['code']]['emoney'] = 0;
$report[$printer['code']]['online'] = 0;
}
$report[0]['cash'] = $report[0]['credit'] = 0;
$report[0]['presale'] = $report[0]['self'] = 0;
$report[0]['clearing'] = $report[0]['emoney'] = 0;
$report[0]['online'] = 0;
$orders = ExchangeOrders::where('shift_id', $shift_id)
->where('is_deleted', 0)
->where('is_closed', 1)
->where('order_sum', '>=', 0)
->get();
foreach ($orders as $order) {
$order_emoney = 0;
$order_online = 0;
$sum_payments = $order['cash'] + $order['credit'] + $order['presale'] + $order['self'] + $order['clearing'] + $order_emoney + $order_online;
if ($sum_payments == 0) {
$count_online_open = ExchangeActions::where('shift_id', $shift_id)
->where('order_code', $order['code'])
->where('action_type', 45)
->where('more', '<>', '0')
->count();
$count_online_close = ExchangeActions::where('shift_id', $shift_id)
->where('order_code', $order['code'])
->where('action_type', 6)
->count();
if ($count_online_open > 0 && $count_online_close > 0) {
$order_online = $order['order_sum'];
}
$count_another = ExchangeActions::where('order_code', $order['code'])
->where('action_type', 51)
->where('shift_id', $shift_id)
->count();
if ($count_another > 0) {
$order_emoney = $order['order_sum'];
}
}
$sum_payments = $order['cash'] + $order['credit'] + $order['presale'] + $order['self'] + $order['clearing'] + $order_emoney + $order_online;
if ($sum_payments == 0) {
continue;
}
$cash_cof = round($order['cash'] / $sum_payments, 2);
$credit_cof = round($order['credit'] / $sum_payments, 2);
$presale_cof = round($order['presale'] / $sum_payments, 2);
$self_cof = round($order['self'] / $sum_payments, 2);
$clearing_cof = round($order['clearing'] / $sum_payments, 2);
$online_cof = round($order_online / $sum_payments, 2);
$emoney_cof = round($order_emoney / $sum_payments, 2);
$items = ExchangeItems::where('shift_id', $shift_id)
->where('order_code', $order['code'])
->get();
foreach ($items as $item) {
$sum = round(($item['count'] - $item['count_return']) * $item['sale_price'], 2);
$printer_code = Dishes::GetPrinterCode($item['dishes_code']);
$report[$printer_code]['cash'] += round($sum * $cash_cof, 2);
$report[$printer_code]['credit'] += round($sum * $credit_cof, 2);
$report[$printer_code]['presale'] += round($sum * $presale_cof, 2);
$report[$printer_code]['self'] += round($sum * $self_cof, 2);
$report[$printer_code]['clearing'] += round($sum * $clearing_cof, 2);
$report[$printer_code]['emoney'] += round($sum * $emoney_cof, 2);
$report[$printer_code]['online'] += round($sum * $online_cof, 2);
}
}
foreach ($report as $key => $item) {
$item['cash'] = round($item['cash'], 2);
$item['credit'] = round($item['credit'], 2);
$item['presale'] = round($item['presale'], 2);
$item['self'] = round($item['self'], 2);
$item['clearing'] = round($item['clearing'], 2);
$item['emoney'] = round($item['emoney'], 2);
$item['online'] = round($item['online'], 2);
$out[] = array(
'printer_name' => Printer::getName($key),
'full_sum' => round($item['cash'] + $item['credit'] + $item['presale'] + $item['self'] + $item['clearing'] + $item['emoney'] + $item['online'], 2),
'payments' => $item
);
}
$return = [
'status' => 'success',
'items' => $out
];
return $return;
}
if (isset($input['start_date']) && isset($input['end_date'])) {
$end_date = date('Y-m-d H:i:s', strtotime($input['end_date'] . ' 23:59:59'));
$start_date = date('Y-m-d H:i:s', strtotime($input['start_date'] . ' 00:00:01'));
$printers = Printer::get();
foreach ($printers as $printer) {
$report[$printer['code']]['cash'] = $report[$printer['code']]['credit'] = 0;
$report[$printer['code']]['presale'] = $report[$printer['code']]['self'] = 0;
$report[$printer['code']]['clearing'] = $report[$printer['code']]['emoney'] = 0;
$report[$printer['code']]['online'] = 0;
}
$report[0]['cash'] = $report[0]['credit'] = 0;
$report[0]['presale'] = $report[0]['self'] = 0;
$report[0]['clearing'] = $report[0]['emoney'] = 0;
$report[0]['online'] = 0;
$shifts = ExchangeShifts::select('id')
->where('opened', '>', $start_date)
->where('closed', '<', $end_date)
->get();
foreach ($shifts as $shift) {
$shift_id = $shift['id'];
$orders = ExchangeOrders::where('shift_id', $shift_id)
->where('is_deleted', 0)
->where('is_closed', 1)
->where('order_sum', '>=', 0)
->get();
foreach ($orders as $order) {
$order_emoney = 0;
$order_online = 0;
$sum_payments = $order['cash'] + $order['credit'] + $order['presale'] + $order['self'] + $order['clearing'] + $order_emoney + $order_online;
if ($sum_payments == 0) {
$count_online_open = ExchangeActions::where('shift_id', $shift_id)
->where('order_code', $order['code'])
->where('action_type', 45)
->where('more', '<>', '0')
->count();
$count_online_close = ExchangeActions::where('shift_id', $shift_id)
->where('order_code', $order['code'])
->where('action_type', 6)
->count();
if ($count_online_open > 0 && $count_online_close > 0) {
$order_online = $order['order_sum'];
}
$count_another = ExchangeActions::where('order_code', $order['code'])
->where('action_type', 51)
->where('shift_id', $shift_id)
->count();
if ($count_another > 0) {
$order_emoney = $order['order_sum'];
}
}
$sum_payments = $order['cash'] + $order['credit'] + $order['presale'] + $order['self'] + $order['clearing'] + $order_emoney + $order_online;
if ($sum_payments == 0) {
continue;
}
$cash_cof = round($order['cash'] / $sum_payments, 2);
$credit_cof = round($order['credit'] / $sum_payments, 2);
$presale_cof = round($order['presale'] / $sum_payments, 2);
$self_cof = round($order['self'] / $sum_payments, 2);
$clearing_cof = round($order['clearing'] / $sum_payments, 2);
$online_cof = round($order_online / $sum_payments, 2);
$emoney_cof = round($order_emoney / $sum_payments, 2);
$items = ExchangeItems::where('shift_id', $shift_id)
->where('order_code', $order['code'])
->get();
foreach ($items as $item) {
$sum = round(($item['count'] - $item['count_return']) * $item['sale_price'], 2);
$printer_code = Dishes::GetPrinterCode($item['dishes_code']);
Log::debug($printer_code);
$report[$printer_code]['cash'] += round($sum * $cash_cof, 2);
$report[$printer_code]['credit'] += round($sum * $credit_cof, 2);
$report[$printer_code]['presale'] += round($sum * $presale_cof, 2);
$report[$printer_code]['self'] += round($sum * $self_cof, 2);
$report[$printer_code]['clearing'] += round($sum * $clearing_cof, 2);
$report[$printer_code]['emoney'] += round($sum * $emoney_cof, 2);
$report[$printer_code]['online'] += round($sum * $online_cof, 2);
}
}
}
foreach ($report as $key => $item) {
$item['cash'] = round($item['cash'], 2);
$item['credit'] = round($item['credit'], 2);
$item['presale'] = round($item['presale'], 2);
$item['self'] = round($item['self'], 2);
$item['clearing'] = round($item['clearing'], 2);
$item['emoney'] = round($item['emoney'], 2);
$item['online'] = round($item['online'], 2);
$out[] = array(
'printer_name' => Printer::getName($key),
'full_sum' => round($item['cash'] + $item['credit'] + $item['presale'] + $item['self'] + $item['clearing'] + $item['emoney'] + $item['online'], 2),
'payments' => $item
);
}
$return = [
'status' => 'success',
'items' => $out
];
return $return;
}
}
} else {
return [
'status' => 'success',

View File

@@ -39,23 +39,11 @@ class GETTopDishes extends HRCCommand implements HRCCommandInterface {
$out[] = $value;
}
foreach ($out as $key => $item) {
$dishInfo = Dishes::where('code', '=', $item['menu_code'])
->where('legacy_code', '=', $item['dish_code'])
->where('is_history', '=', 0)
->first();
$onlineDishInfo = ShiftOnlineItems::where('menu_code', '=', $item['menu_code'])
->where('dish_code', '=', $item['dish_code'])
->whereIn('order_code', $orders)
->first();
if ($dishInfo['name'] == '') {
$dishHistInfo = Dishes::where('code', '=', $item['menu_code'])
->where('legacy_code', '=', $item['dish_code'])
->whereIn('order_code', $orders)
->first();
$dishName = $dishHistInfo['name'];
} else {
$dishName = $dishInfo['name'];
}
$dishName = Dishes::getName($item['dish_code']);
$dishCount = ShiftOnlineItems::where('menu_code', '=', $item['menu_code'])
->whereIn('order_code', $orders)
->sum('count');

View File

@@ -12,17 +12,21 @@ use App\Component\Models\ShiftOnlineDeleted;
use App\Component\Models\ShiftOnlineItems;
use App\Component\Models\ShiftOnlineOrders;
use App\Component\Models\Shifts;
use App\Component\Models\Terminal;
use App\Component\Models\TerminalUpdate;
use App\Console\Commands\HRCCommand;
use App\Console\Commands\HRCCommandInterface;
use Illuminate\Support\Facades\Log;
class POSTRestoreShift extends HRCCommand implements HRCCommandInterface {
class POSTRestoreShift extends HRCCommand implements HRCCommandInterface
{
protected $signature = 'postrestoreshift';
public function command($input, $output = null) {
public function command($input, $output = null)
{
function dirDel($dir) {
function dirDel($dir)
{
$d = opendir($dir);
while (($entry = readdir($d)) !== false) {
if ($entry != "." && $entry != "..") {
@@ -36,6 +40,7 @@ class POSTRestoreShift extends HRCCommand implements HRCCommandInterface {
closedir($d);
rmdir($dir);
}
$shift_id = $input['shift_id'];
$cache_dir = __DIR__ . "\\..\\..\\..\\Cache\\";
@@ -43,7 +48,8 @@ class POSTRestoreShift extends HRCCommand implements HRCCommandInterface {
$nowTime = time();
$update = true;
function decode_text($data) {
function decode_text($data)
{
$alph = [
"А", "Б", "В", "Г", "Д",
"Е", "Ё", "Ж", "З", "И",
@@ -97,12 +103,22 @@ class POSTRestoreShift extends HRCCommand implements HRCCommandInterface {
return $retval;
}
$exchange_shifts = ExchangeShifts::where('id', '=', $shift_id)->first();
$exchange_orders = ExchangeOrders::where('shift_id', '=', $shift_id)->get();
$exchange_items = ExchangeItems::where('shift_id', '=', $shift_id)->get();
$exchange_actions = ExchangeActions::where('shift_id', '=', $shift_id)->get();
$exchange_deleted = ExchangeDeleted::where('shift_id', '=', $shift_id)->get();
$terminal_online = TerminalUpdate::where('method', 'online')->where('terminal_id', $exchange_shifts['terminal_id'])->first();
$terminal = Terminal::where('is_active', 1)
->where('soft', '1')
->first();
$exchange_shifts = ExchangeShifts::where('id', '=', $shift_id)
->first();
$exchange_orders = ExchangeOrders::where('shift_id', '=', $shift_id)
->get();
$exchange_items = ExchangeItems::where('shift_id', '=', $shift_id)
->get();
$exchange_actions = ExchangeActions::where('shift_id', '=', $shift_id)
->get();
$exchange_deleted = ExchangeDeleted::where('shift_id', '=', $shift_id)
->get();
$terminal_online = TerminalUpdate::where('method', 'online')
->where('terminal_id', $terminal['id'])
->first();
$baseTime = date_create($terminal_online['next_at']);
$baseTime = date_format($baseTime, 'U');
$old_date = date_create($terminal_online['next_at']);
@@ -130,7 +146,6 @@ class POSTRestoreShift extends HRCCommand implements HRCCommandInterface {
//clear shift_online_orders
ShiftOnlineOrders::truncate();
Log::debug('ShiftOnlineOrders cleaned');
foreach ($exchange_orders as $key => $exchange_order) {
$shift_online_order = new ShiftOnlineOrders;
$shift_online_order->cash = $exchange_order["cash"];
@@ -164,7 +179,6 @@ class POSTRestoreShift extends HRCCommand implements HRCCommandInterface {
$shift_online_order->order_sum = $exchange_order["order_sum"];
$shift_online_order->params_code = $exchange_order["params_id"];
$shift_online_order->place_name = mb_convert_encoding(decode_text($exchange_order["place_name"]), 'UTF-8', 'UTF-8');
log::debug(decode_text($exchange_order["place_name"]));
$shift_online_order->presale = $exchange_order["presale"];
$shift_online_order->sale_sum = $exchange_order["sale_sum"];
$shift_online_order->self = $exchange_order["self"];
@@ -178,7 +192,6 @@ class POSTRestoreShift extends HRCCommand implements HRCCommandInterface {
}
ShiftOnlineItems::truncate();
Log::debug('ShiftOnlineItems cleaned');
foreach ($exchange_items as $key => $exchange_item) {
$shift_online_item = new ShiftOnlineItems;
$shift_online_item->code = $exchange_item["code"];
@@ -204,7 +217,6 @@ class POSTRestoreShift extends HRCCommand implements HRCCommandInterface {
}
ShiftOnlineActions::truncate();
Log::debug('ShiftOnlineActions cleaned');
foreach ($exchange_actions as $key => $exchange_action) {
$shift_online_action = new ShiftOnlineActions;
$shift_online_action->type_action = $exchange_action["action_type"];
@@ -222,7 +234,6 @@ class POSTRestoreShift extends HRCCommand implements HRCCommandInterface {
}
ShiftOnlineDeleted::truncate();
Log::debug('ShiftOnlineDeleted cleaned');
foreach ($exchange_deleted as $key => $exchange_deleted_item) {
$shift_online_deleted_item = new ShiftOnlineDeleted;
$shift_online_deleted_item->code = $exchange_deleted_item["code"];

View File

@@ -1,6 +1,6 @@
{
"name": "hrc-admin/hello-world",
"version": "2.27",
"version": "2.28",
"require": {
"horeca/admin-php-module-core": "dev-master",
"guzzlehttp/guzzle": "^7.4",

View File

@@ -0,0 +1,50 @@
<?php
use App\Component\Models\Filesystem;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Schema;
class AddIndexesForTables extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up() {
Schema::table('exchange_actions', static function (Blueprint $table) {
$schemaManager = Schema::getConnection()->getDoctrineSchemaManager();
$indexesFound = $schemaManager->listTableIndexes('exchange_actions');
if (! array_key_exists('action_type_index', $indexesFound)) {
$table->index('action_type', 'action_type_index');
}
});
Schema::table('exchange_actions', static function (Blueprint $table) {
$schemaManager = Schema::getConnection()->getDoctrineSchemaManager();
$indexesFound = $schemaManager->listTableIndexes('exchange_actions');
if (! array_key_exists('order_code_index', $indexesFound)) {
$table->index('order_code', 'order_code_index');
}
});
Schema::table('exchange_actions', static function (Blueprint $table) {
$schemaManager = Schema::getConnection()->getDoctrineSchemaManager();
$indexesFound = $schemaManager->listTableIndexes('exchange_actions');
if (! array_key_exists('shift_id_index', $indexesFound)) {
$table->index('shift_id', 'shift_id_index');
}
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down() {
//
}
}

View File

@@ -0,0 +1,91 @@
<?php
use App\Component\Models\Filesystem;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Schema;
class AddIndexesForTablesV2 extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up() {
Schema::table('dishes', static function (Blueprint $table) {
$schemaManager = Schema::getConnection()->getDoctrineSchemaManager();
$indexesFound = $schemaManager->listTableIndexes('dishes');
if (! array_key_exists('code_index', $indexesFound)) {
$table->index('code', 'code_index');
}
if (! array_key_exists('legacy_code_index', $indexesFound)) {
$table->index('legacy_code', 'legacy_code_index');
}
});
Schema::table('exchange_deleted', static function (Blueprint $table) {
$schemaManager = Schema::getConnection()->getDoctrineSchemaManager();
$indexesFound = $schemaManager->listTableIndexes('exchange_deleted');
if (! array_key_exists('shift_id_index', $indexesFound)) {
$table->index('shift_id', 'shift_id_index');
}
if (! array_key_exists('menu_code_index', $indexesFound)) {
$table->index('menu_code', 'menu_code_index');
}
if (! array_key_exists('dishes_code_index', $indexesFound)) {
$table->index('dishes_code', 'dishes_code_index');
}
});
Schema::table('exchange_items', static function (Blueprint $table) {
$schemaManager = Schema::getConnection()->getDoctrineSchemaManager();
$indexesFound = $schemaManager->listTableIndexes('exchange_items');
if (! array_key_exists('shift_id_index', $indexesFound)) {
$table->index('shift_id', 'shift_id_index');
}
if (! array_key_exists('menu_code_index', $indexesFound)) {
$table->index('menu_code', 'menu_code_index');
}
if (! array_key_exists('dishes_code_index', $indexesFound)) {
$table->index('dishes_code', 'dishes_code_index');
}
});
Schema::table('exchange_orders', static function (Blueprint $table) {
$schemaManager = Schema::getConnection()->getDoctrineSchemaManager();
$indexesFound = $schemaManager->listTableIndexes('exchange_orders');
if (! array_key_exists('shift_id_index', $indexesFound)) {
$table->index('shift_id', 'shift_id_index');
}
if (! array_key_exists('code_index', $indexesFound)) {
$table->index('code', 'code_index');
}
});
Schema::table('shift_online_actions', static function (Blueprint $table) {
$schemaManager = Schema::getConnection()->getDoctrineSchemaManager();
$indexesFound = $schemaManager->listTableIndexes('shift_online_actions');
if (! array_key_exists('order_code_index', $indexesFound)) {
$table->index('order_code', 'order_code_index');
}
if (! array_key_exists('type_action_index', $indexesFound)) {
$table->index('type_action', 'type_action_index');
}
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down() {
//
}
}

View File

@@ -78,7 +78,7 @@ class Client extends Model
if (isset($client_name)) {
$client_name = $client_name['name'];
} else {
$client_name = 'Связанный персонал не найден';
$client_name = 'Связанный гость не найден';
}
return $client_name;
}

View File

@@ -85,6 +85,19 @@ class Dishes extends Model {
$printer_code = 0;
}
}
if ($printer_code == 0) {
$dish = Dishes::where('code', $data)->where('is_history', 0)->first();
if ($dish) {
$printer_code = $dish['printer_code'];
} else {
$dish = Dishes::where('code', $data)->where('is_history', 1)->first();
if ($dish) {
$printer_code = $dish['printer_code'];
} else {
$printer_code = 0;
}
}
}
return $printer_code;
}
}

View File

@@ -1,5 +1,5 @@
[info]
name=V1
version=2.27
version=2.28
[build]
version=2.27
version=2.28

View File

@@ -182,8 +182,8 @@
};
$scope.reportPay = function () {
smartRequest.get('report/payment?start_date=' + encodeURIComponent($scope.start_date) + '&end_date=' + encodeURIComponent($scope.end_date), function (data) {
$scope.printers = data.printers;
smartRequest.get('v1/datareport?type=payment&start_date=' + encodeURIComponent($scope.start_date) + '&end_date=' + encodeURIComponent($scope.end_date), function (data) {
$scope.printers = data.items;
$('#report-payment').modal();
$scope.update();
});

View File

@@ -263,8 +263,8 @@
};
$scope.reportPay = function (shift) {
smartRequest.get('report/payment?shift_id=' + shift.id, function (data) {
$scope.printers = data.printers;
smartRequest.get('v1/datareport?type=payment&shift_id=' + shift.id, function (data) {
$scope.printers = data.items;
$scope.start_date = shift.opened;
$scope.end_date = shift.closed;

View File

@@ -11,32 +11,45 @@
</div>
<div class="modal-body p-lg">
<div class="col-md-6" ng-repeat="printer in printers">
<div class="table-responsive">
<div class="table-responsive" ng-if="printer.full_sum > 0">
<table class="table table-border">
<thead>
<th colspan="2">{{printer.name}}</th>
<th colspan="2">{{printer.printer_name}}</th>
</thead>
<tbody>
<tr ng-if="printer.cash > 0">
<tr ng-if="printer.payments.cash > 0">
<td>Наличный расчет:</td>
<td class="text-right">{{printer.cash | curr}}</td>
<td class="text-right">{{printer.payments.cash | curr}}</td>
</tr>
<tr ng-if="printer.credit > 0">
<tr ng-if="printer.payments.credit > 0">
<td>Кредитными картами:</td>
<td class="text-right">{{printer.credit | curr}}</td>
<td class="text-right">{{printer.payments.credit | curr}}</td>
</tr>
<tr ng-if="printer.clearing > 0">
<tr ng-if="printer.payments.clearing > 0">
<td>Безналичный расчет: </td>
<td class="text-right">{{printer.clearing | curr}}</td>
<td class="text-right">{{printer.payments.clearing | curr}}</td>
</tr>
<tr ng-if="printer.self_pay > 0">
<tr ng-if="printer.payments.self > 0">
<td>Питание штата: </td>
<td class="text-right"> {{printer.payments.self | curr}}</td>
</tr>
<tr ng-if="printer.payments.emoney > 0">
<td>Иными способами оплаты: </td>
<td class="text-right"> {{printer.payments.emoney | curr}}</td>
</tr>
<tr ng-if="printer.payments.online > 0">
<td>Онлайн: </td>
<td class="text-right"> {{printer.payments.online | curr}}</td>
</tr>
<tr ng-if="printer.payments.presale > 0">
<td>По ранее полученному авансу: </td>
<td class="text-right"> {{printer.self_pay | curr}}</td>
<td class="text-right"> {{printer.payments.presale | curr}}</td>
</tr>
</tbody>
<thead>
<th colspan="2">Итого: {{printer.total | curr}} BYN</th>
<th colspan="2">Итого: {{printer.payments.cash + printer.payments.credit + printer.payments.clearing + printer.payments.self + printer.payments.emoney + printer.payments.online + printer.payments.presale | curr}} BYN</th>
</thead>
</table>
</div>

View File

@@ -170,11 +170,11 @@
<td>Иные способы оплаты</td>
<td style="text-align: right">{{ payments.pay_another | curr}} BYN</td>
</tr>
<tr ng-if="pay_delivery > 0">
<tr ng-if="payments.pay_delivery > 0">
<td>Доставка</td>
<td style="text-align: right">{{ payments.pay_delivery | curr}} BYN</td>
</tr>
<tr ng-if="pay_echeck > 0">
<tr ng-if="payments.pay_echeck > 0">
<td>Электронный чек</td>
<td style="text-align: right">{{ payments.pay_echeck | curr}} BYN</td>
</tr>