diff --git a/htdocs/cashdesk/affIndex.php b/htdocs/cashdesk/affIndex.php index b5432b94eec7e6fbae5e32b6a98b261292989adb..a2e467a35e302cee83838df14a74835ceaf7d2cb 100644 --- a/htdocs/cashdesk/affIndex.php +++ b/htdocs/cashdesk/affIndex.php @@ -27,6 +27,8 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/cashdesk/include/environnement.php'; require_once DOL_DOCUMENT_ROOT.'/cashdesk/include/keypad.php'; +$error=GETPOST('error'); + // Test if already logged if ( $_SESSION['uid'] <= 0 ) { @@ -54,9 +56,7 @@ print '<body>'."\n"; if (!empty($error)) { - print $error; - print '</body></html>'; - exit; + dol_htmloutput_events(); } print '<div class="conteneur">'."\n"; diff --git a/htdocs/cashdesk/css/style.css b/htdocs/cashdesk/css/style.css index ab8d660fcf1f56972e1741e9b12ff25c74f4bf55..216f53e946b294d7045f4be9521fcfaa5cb1e323 100644 --- a/htdocs/cashdesk/css/style.css +++ b/htdocs/cashdesk/css/style.css @@ -106,6 +106,14 @@ p { padding-right: 5px; } +/* Force values for small screen 570 */ +@media only screen and (max-width: 570px) +{ + .menu_choix0 { + max-width: 180px; + } +} + .menu_choix0 a { font-weight: normal; text-decoration: none; diff --git a/htdocs/cashdesk/tpl/menu.tpl.php b/htdocs/cashdesk/tpl/menu.tpl.php index 85de5ad9ab56cc6fec39ffa443f59d7cd7f13ff7..fd9bcbca77c555307b047ffe752d71598cd969de 100644 --- a/htdocs/cashdesk/tpl/menu.tpl.php +++ b/htdocs/cashdesk/tpl/menu.tpl.php @@ -79,10 +79,11 @@ print '</form>'; /*print $langs->trans("CashDeskBankCash").': '.$bankcashLink.'<br>'; print $langs->trans("CashDeskBankCB").': '.$bankcbLink.'<br>'; print $langs->trans("CashDeskBankCheque").': '.$bankchequeLink.'<br>';*/ +print '<div class="clearboth">'; if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && ! empty($conf->stock->enabled) && empty($conf->global->CASHDESK_NO_DECREASE_STOCK)) { print $langs->trans("CashDeskWarehouse").': '.$warehouseLink; } -print '</li></ul>'; +print '</div></li></ul>'; print '</div>'; print "\n".'<!-- menu.tpl.php end -->'."\n"; diff --git a/htdocs/cashdesk/validation_verif.php b/htdocs/cashdesk/validation_verif.php index ae5d7185f40e6f33281b63232ef53ad040ff437b..1b870d30f734b7c758354180530e9fd3483e98bd 100644 --- a/htdocs/cashdesk/validation_verif.php +++ b/htdocs/cashdesk/validation_verif.php @@ -32,7 +32,6 @@ require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; $obj_facturation = unserialize($_SESSION['serObjFacturation']); -unset ($_SESSION['serObjFacturation']); $action =GETPOST('action','aZ09'); $bankaccountid=GETPOST('cashdeskbank'); @@ -45,14 +44,14 @@ switch ($action) case 'valide_achat': $thirdpartyid = $_SESSION['CASHDESK_ID_THIRDPARTY']; - + $company=new Societe($db); $company->fetch($thirdpartyid); $invoice=new Facture($db); $invoice->date=dol_now(); $invoice->type= Facture::TYPE_STANDARD; - + // To use a specific numbering module for POS, reset $conf->global->FACTURE_ADDON and other vars here // and restore values just after $sav_FACTURE_ADDON=''; @@ -68,7 +67,7 @@ switch ($action) // To force rule only for POS with mercure //... } - + $num=$invoice->getNextNumRef($company); // Restore save values @@ -76,7 +75,7 @@ switch ($action) { $conf->global->FACTURE_ADDON = $sav_FACTURE_ADDON; } - + $obj_facturation->numInvoice($num); $obj_facturation->getSetPaymentMode($_POST['hdnChoix']); @@ -129,7 +128,7 @@ switch ($action) exit; } - switch ( $obj_facturation->getSetPaymentMode() ) + switch ($obj_facturation->getSetPaymentMode() ) { case 'DIF': $mode_reglement_id = 0; @@ -159,7 +158,6 @@ switch ($action) $note .= $_POST['txtaNotes']; dol_syslog("obj_facturation->getSetPaymentMode()=".$obj_facturation->getSetPaymentMode()." mode_reglement_id=".$mode_reglement_id." cond_reglement_id=".$cond_reglement_id); - $error=0; @@ -255,14 +253,15 @@ switch ($action) } else { - $error++; + setEventMessage($invoice->error, $invoice->errors, 'errors'); + $error++; } $id = $invoice->id; } else { - $resultcreate=$invoice->create($user,0,0); + $resultcreate=$invoice->create($user,0,0); if ($resultcreate > 0) { $warehouseidtodecrease=(isset($_SESSION["CASHDESK_ID_WAREHOUSE"])?$_SESSION["CASHDESK_ID_WAREHOUSE"]:0); @@ -287,7 +286,8 @@ switch ($action) if ($invoice->type == $invoice::TYPE_CREDIT_NOTE) $result=$mouvP->reception($user, $invoice->lines[$i]->fk_product, $warehouseidtodecrease, $invoice->lines[$i]->qty, $invoice->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarrFromPos",$invoice->newref)); else $result=$mouvP->livraison($user, $invoice->lines[$i]->fk_product, $warehouseidtodecrease, $invoice->lines[$i]->qty, $invoice->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarrFromPos",$invoice->newref)); if ($result < 0) { - $error++; + setEventMessages($mouvP->error, $mouvP->errors, 'errors'); + $error++; } } } @@ -331,15 +331,18 @@ switch ($action) } else { - $error++; + setEventMessages($invoice->error, $invoice->errors, 'errors'); + $error++; } } else { - $error++; + setEventMessages($invoice->error, $invoice->errors, 'errors'); + $error++; } } + if (! $error) { $db->commit(); @@ -348,14 +351,14 @@ switch ($action) else { $db->rollback(); - $redirection = 'affIndex.php?facid='.$id.'&mesg=ErrorFailedToCreateInvoice'; // Ajout de l'id de la facture, pour l'inclure dans un lien pointant directement vers celle-ci dans Dolibarr + $redirection = 'affIndex.php?facid='.$id.'&error=1&mesg=ErrorFailedToCreateInvoice'; // Ajout de l'id de la facture, pour l'inclure dans un lien pointant directement vers celle-ci dans Dolibarr } break; // End of case: valide_facture } - +unset ($_SESSION['serObjFacturation']); $_SESSION['serObjFacturation'] = serialize($obj_facturation);