Skip to content

Commit

Permalink
Merge pull request #939 from inbaz/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
BigAndini authored Apr 8, 2017
2 parents 00ce2ab + e59a531 commit 62fdd9d
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 21 deletions.
Binary file added data/ers.mwb.bak
Binary file not shown.
4 changes: 2 additions & 2 deletions module/Admin/src/Admin/Controller/BankaccountController.php
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ public function deleteUploadAction()
}
$em = $this->getServiceLocator()
->get('Doctrine\ORM\EntityManager');
$csv = $em->getRepository('ErsBase\Entity\PaymentTypeCsv')
$csv = $em->getRepository('ErsBase\Entity\BankAccountCsv')
->findOneBy(array('id' => $id));

$request = $this->getRequest();
Expand All @@ -460,7 +460,7 @@ public function deleteUploadAction()

if ($del == 'Yes') {
$id = (int) $request->getPost('id');
$csv = $em->getRepository('ErsBase\Entity\PaymentTypeCsv')
$csv = $em->getRepository('ErsBase\Entity\BankAccountCsv')
->findOneBy(array('id' => $id));
if($csv->hasMatch()) {
return $this->redirect()->toRoute('admin/bankaccount');
Expand Down
34 changes: 25 additions & 9 deletions module/Admin/src/Admin/Controller/CronController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
use Zend\Console\Request as ConsoleRequest;

class CronController extends AbstractActionController {
protected $debug = false;

public function autoMatchingAction() {
/*
* Status of BankStatements
Expand All @@ -24,13 +26,17 @@ public function autoMatchingAction() {
* 4. disabled
*/

$this->debug = false;

$em = $this->getServiceLocator()
->get('Doctrine\ORM\EntityManager');

$statements = $em->getRepository('ErsBase\Entity\BankStatement')
->findAll();

echo "Phase 1: check ".count($statements)." statements".PHP_EOL.PHP_EOL;
if($this->debug) {
echo "Phase 1: check ".count($statements)." statements".PHP_EOL.PHP_EOL;
}
$longest_match = 0;
foreach($statements as $statement) {
$time_start = microtime(true);
Expand Down Expand Up @@ -79,7 +85,7 @@ public function autoMatchingAction() {
}
}
if(!$found) {
echo "WARNING: Unable to find any code in system.".PHP_EOL;
echo "WARNING: Unable to find any code in system: ";
echo $statement->getBankStatementColByNumber($statement_format->matchKey)->getValue().PHP_EOL;
}
$time_end = microtime(true);
Expand All @@ -89,7 +95,7 @@ public function autoMatchingAction() {
}
}
}
echo 'INFO: The longest match took '.$longest_match.' seconds.'.PHP_EOL;
#echo 'INFO: The longest match took '.$longest_match.' seconds.'.PHP_EOL;

/*
* check status of unpaid orders
Expand All @@ -102,22 +108,30 @@ public function autoMatchingAction() {

$orders = $qb->getQuery()->getResult();

echo PHP_EOL."Phase 2: check ".count($orders)." orders and set payment status.".PHP_EOL;
if($this->debug) {
echo PHP_EOL."Phase 2: check ".count($orders)." orders and set payment status.".PHP_EOL;
}

foreach($orders as $order) {
$statement_amount = $order->getStatementAmount();
$order_amount = $order->getSum();
if($order_amount == ($statement_amount*$statement_format->factor)) {
if($order_amount == $statement_amount) {
$paid = true;
echo ".";
if($this->debug) {
echo ".";
}
#echo "INFO: found match for order ".$order->getCode()->getValue()." ".$order_amount." <=> ".$statement_amount." (exact)".PHP_EOL;
} elseif($order_amount < $statement_amount) {
$paid = true;
echo "!";
if($this->debug) {
echo "!";
}
#echo "INFO: found match for order ".$order->getCode()->getValue()." ".$order_amount." <=> ".$statement_amount." (overpaid)".PHP_EOL;
} else {
$paid = false;
echo "-";
if($this->debug) {
echo "-";
}
#echo "INFO: found match for order ".$order->getCode()->getValue()." ".$order_amount." <=> ".$statement_amount." (partial)".PHP_EOL;
}
if($paid) {
Expand Down Expand Up @@ -156,7 +170,9 @@ public function autoMatchingAction() {
}
}
$em->flush();
echo PHP_EOL.PHP_EOL."done.".PHP_EOL;
if($this->debug) {
echo PHP_EOL.PHP_EOL."done.".PHP_EOL;
}
}

/*
Expand Down
2 changes: 1 addition & 1 deletion module/Admin/view/admin/order/detail.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ $this->headTitle($title);
</tr>
<tr>
<th>bank account</th>
<td><?php echo $statement->getBankAccount()->getName(); ?></td>
<td><?php echo $statement->getPaymentType()->getName(); ?></td>
</tr>
<tr>
<th>name</th>
Expand Down
2 changes: 1 addition & 1 deletion module/ErsBase/src/ErsBase/Service/ETicketService.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ public function generatePdf() {
$textImage = imagecreatetruecolor($image_width, $image_height+1);

// Allocate text and background colors (RGB format):
$text_color = imagecolorallocate($textImage,244,128,41);
$text_color = imagecolorallocate($textImage,237,28,36);
$bg_color = imagecolorallocate($textImage, 255, 255, 255);

// Fill image:
Expand Down
2 changes: 1 addition & 1 deletion module/PreReg/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function($e) use ($sm) {
public function bootstrapSession($e)
{
if(\Zend\Console\Console::isConsole()) {
echo "not starting session -> console".PHP_EOL;
#echo "not starting session -> console".PHP_EOL;
return;
}

Expand Down
17 changes: 10 additions & 7 deletions module/PreReg/view/pdf/eticket.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
h3, h4 {
margin:0;
padding:0;
color: #f0882c;
color: #ed1c24;
}
table {
width: 100%;
Expand All @@ -76,7 +76,7 @@
right: 250px;
top: 10px;
font-size: 48px;
color: #f0882c;
color: #ed1c24;
font-weight: bold;
}
.codes {
Expand Down Expand Up @@ -118,7 +118,7 @@
}
.cc-option {
font-size: 20px;
color: #f0882c;
color: #ed1c24;
width: 30px;
}
.ticket-heading {
Expand All @@ -144,6 +144,9 @@
margin-top: 35px;
padding-top: 5px;
}
a {
text-decoration: underline;
}
</style>
</head>
<body>
Expand All @@ -152,7 +155,7 @@
<?php /* <img src="<?php echo $barcode; ?>" alt="Barcode is missing, please regenerate this E-Ticket" /> */ ?>
</div>
<h1>
<img class="logo" src="<?php echo getcwd(); ?>/pdf/img/MuenchenCon_Logo_2016_150.png" alt="Logo" width="150" />
<img class="logo" src="<?php echo getcwd(); ?>/pdf/img/E-Ticket_logo_150.png" alt="Logo" width="150" />
<span class="ticket-heading">E-Ticket</span>
</h1>
<?php if($agegroup): ?>
Expand All @@ -162,9 +165,9 @@
<?php endif; ?>
<div class="left-field">
<h3><?php echo $this->translate('Brief instruction'); ?></h3>
<p><?php printf($this->translate('Dies ist dein <strong>E-Ticket</strong> für die %s. Bitte bringe es zur Veranstaltung mit! Es ist nicht unbedingt nötig, das E-Ticket auszudrucken. Du kannst es auch auf einem elektronischen Gerät dabei haben und vorzeigen.'), $config['ERS']['name_with_year']); ?></p>
<p><?php printf($this->translate('This is your <strong>E-Ticket</strong> for the %s. Please bring this document with you to the event! It\'s not necessarily needed to print your E-Ticket. You can present it on any electronical device.'), $config['ERS']['name_with_year']); ?></p>
<?php if($personalized): ?>
<p><?php printf($this->translate('Stelle bitte unbedingt sicher, dass deine Daten (Name, Vorname, Geburtsdatum) auf diesem E-Ticket mit den Daten auf deinem <strong>Ausweis</strong> übereinstimmen. Andernfalls können wir dich vor Ort leider nicht anmelden! ')) ?></p>
<p><?php printf($this->translate('Please make sure that your data (name, firstname, date of birth) on this E-Ticket are the same as the ones on your <strong>ID card</strong> or <strong>passport</strong>. This will help us that only you can enter with your E-ticket and nobody else.')) ?></p>

<?php if($agegroup):
switch($agegroup->getName()):
Expand All @@ -175,7 +178,7 @@
<?php
$youthFormUrl = $this->url('info', array('action' => 'forms'), array('force_canonical' => true));
$youthFormLink = '<a href="'.$youthFormUrl.'">'.$youthFormUrl.'</a>';
printf($this->translate('<strong>Auf keinen Fall vergessen: Bringe einen ausgedruckten, ausgefüllten und von einem Erziehungsberechtigten unterschrieben U16/U18 Zettel mit.</strong> Auf diesem erlaubt dir ein Erziehungsberechtigter, allein (U18) oder mit einer verantwortungsbewussten Person über 18 (U16) an der Veranstaltung teilzunehmen. Ohne die nötige Unterschrift können wir dich nicht auf das Gelände lassen! Du findest den passenden Zettel unter %s.'),
printf($this->translate('<strong>Do not forget: Bring a filled and signed U16/U18 form with you.</strong> This form needs to be signed by your parents or your legal guardian. Without this signed form we\'re not allowed to let you access the EJC area. You can find this form at %s.'),
$youthFormLink) ?>
</p>
<?php break;
Expand Down
Binary file added pdf/img/E-Ticket_logo_150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 62fdd9d

Please sign in to comment.