Fixed: Ton of old bugs when debugging POS.

This commit is contained in:
Laurent Destailleur 2014-11-30 01:35:58 +01:00
parent b9ea7d4d13
commit 7303983610
11 changed files with 45 additions and 30 deletions

View File

@ -194,10 +194,10 @@ if (! empty($conf->expedition->enabled))
} }
print '</table>'; print '</table>';
if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) || ! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) //if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) || ! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT))
{ //{
print info_admin($langs->trans("IfYouUsePointOfSaleCheckModule")); print info_admin($langs->trans("IfYouUsePointOfSaleCheckModule"));
} //}
print '<br>'; print '<br>';
// Title rule for stock increase // Title rule for stock increase

View File

@ -45,7 +45,17 @@ else
// Left area with selected articles (shopping cart) $obj_facturation->calculTotaux(); // Redefine prix_total_ttc, prix_total_ht et montant_tva from $_SESSION['poscart']
$total_ttc = $obj_facturation->prixTotalTtc();
/*var_dump($obj_facturation);
var_dump($_SESSION['poscart']);
var_dump($total_ttc);
exit;*/
// Left area with selected articles (area for article, amount and payments)
print '<div class="principal">'; print '<div class="principal">';
$page=GETPOST('menu','alpha'); $page=GETPOST('menu','alpha');
@ -72,13 +82,10 @@ print '</div>';
// Right area with selected articles (shopping cart) // Right area with selected articles (shopping cart)
print '<div class="liste_articles">'; print '<div class="liste_articles">';
require ('tpl/liste_articles.tpl.php'); require ('tpl/liste_articles.tpl.php');
$obj_facturation->prixTotalHt($lst_total_ht);
$obj_facturation->prixTotalTtc($lst_total_ttc);
print '</div>'; print '</div>';

View File

@ -222,6 +222,7 @@ p.titre {
margin: 0 15px; margin: 0 15px;
padding: 0; padding: 0;
max-width: 500px; max-width: 500px;
width: 100%;
} }
.titre1 { .titre1 {
@ -308,7 +309,7 @@ p.titre {
} }
.texte_ref { .texte_ref {
width: 80px; min-width: 150px;
} }
.texte1,.texte1_off { .texte1,.texte1_off {
@ -321,8 +322,8 @@ p.titre {
/* ------------------- */ /* ------------------- */
.textarea_note { .textarea_note {
width: 300px; width: 100%;
height: 150px; height: 50px;
padding: 2px 2px; padding: 2px 2px;
} }
@ -362,7 +363,7 @@ p.titre {
} }
.resume_label,.note_label { .resume_label,.note_label {
width: 200px; min-width: 200px;
font-weight: bold; font-weight: bold;
font-size: 1.1em; font-size: 1.1em;
} }

View File

@ -137,15 +137,16 @@ switch ( $_GET['action'] )
case 'ajout_article': // We have clicked on button "Add product" case 'ajout_article': // We have clicked on button "Add product"
//var_dump($obj_facturation); //var_dump('ajout_article');
//exit; //exit;
if (! empty($obj_facturation->id)) // A product has been selected and stored in session if (! empty($obj_facturation->id)) // A product was previously selected and stored in session, so we can add it
{ {
$obj_facturation->qte($_POST['txtQte']); $obj_facturation->qte($_POST['txtQte']);
$obj_facturation->tva($_POST['selTva']); $obj_facturation->tva($_POST['selTva']);
$obj_facturation->remisePercent($_POST['txtRemise']); $obj_facturation->remisePercent($_POST['txtRemise']);
$obj_facturation->ajoutArticle(); $obj_facturation->ajoutArticle(); // This add an entry into $_SESSION['poscart']
// We update prixTotalTtc
} }
@ -160,7 +161,7 @@ switch ( $_GET['action'] )
} }
// We saved object obj_facturation
$_SESSION['serObjFacturation'] = serialize($obj_facturation); $_SESSION['serObjFacturation'] = serialize($obj_facturation);
header('Location: '.$redirection); header('Location: '.$redirection);

View File

@ -43,6 +43,7 @@ $langs->load("cashdesk");
<!-- Affichage de la reference et de la designation --> <!-- Affichage de la reference et de la designation -->
<td><input class="texte_ref" type="text" id ="txtRef" name="txtRef" value="<?php echo $obj_facturation->ref() ?>" <td><input class="texte_ref" type="text" id ="txtRef" name="txtRef" value="<?php echo $obj_facturation->ref() ?>"
onchange="javascript: setSource('REF');" onchange="javascript: setSource('REF');"
onkeyup="javascript: verifResultat('resultats_dhtml', this.value);"
onfocus="javascript: this.select(); verifResultat('resultats_dhtml', this.value);" onfocus="javascript: this.select(); verifResultat('resultats_dhtml', this.value);"
onBlur="javascript: document.getElementById('resultats_dhtml').innerHTML = '';"/> onBlur="javascript: document.getElementById('resultats_dhtml').innerHTML = '';"/>
</td> </td>
@ -147,7 +148,7 @@ $langs->load("cashdesk");
</form> </form>
</fieldset> </fieldset>
<!-- ========================= Cadre "Difference" ============================= --> <!-- ========================= Cadre "Amount" ============================= -->
<form id="frmDifference" class="formulaire1" method="post" onsubmit="javascript: return verifReglement()" action="validation_verif.php?action=valide_achat"> <form id="frmDifference" class="formulaire1" method="post" onsubmit="javascript: return verifReglement()" action="validation_verif.php?action=valide_achat">
<input type="hidden" name="hdnChoix" value="" /> <input type="hidden" name="hdnChoix" value="" />
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" /> <input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" />

View File

@ -67,8 +67,6 @@ else
} }
} }
$obj_facturation->calculTotaux();
$total_ttc = $obj_facturation->prixTotalTtc();
echo ('<p class="cadre_prix_total">'.$langs->trans("Total").' : '.price(price2num($total_ttc, 'MT'),0,$langs,0,0,-1,$conf->currency).'<br></p>'."\n"); echo ('<p class="cadre_prix_total">'.$langs->trans("Total").' : '.price(price2num($total_ttc, 'MT'),0,$langs,0,0,-1,$conf->currency).'<br></p>'."\n");
?></div> ?></div>

View File

@ -17,6 +17,7 @@
*/ */
$langs->load("main"); $langs->load("main");
$langs->load("bills");
// Object $form must de defined // Object $form must de defined
@ -111,8 +112,9 @@ $langs->load("main");
</p> </p>
<p class="note_label"><?php echo $langs->trans("Notes"); ?><br><textarea class="textarea_note" name="txtaNotes"></textarea></p> <p class="note_label"><?php echo $langs->trans("Notes"); ?><br><textarea class="textarea_note" name="txtaNotes"></textarea></p>
<span><input class="bouton_validation" type="submit" name="btnValider" value="<?php echo $langs->trans("ValidateInvoice"); ?>" /></span> <div class="center"><input class="button" type="submit" name="btnValider" value="<?php echo $langs->trans("ValidateInvoice"); ?>" /><br>
<p><a class="lien1" href="affIndex.php?menu=facturation"><?php echo $langs->trans("RestartSelling"); ?></a></p> <br><a class="lien1" href="affIndex.php?menu=facturation"><?php echo $langs->trans("RestartSelling"); ?></a>
</div>
</form> </form>

View File

@ -18,10 +18,11 @@
*/ */
$langs->load("main"); $langs->load("main");
$langs->load("bills");
?> ?>
<h3 class="titre1"><?php echo $langs->trans("SellFinished"); ?></h3> <h3 class="titre1"><?php echo $langs->trans("SellFinished"); ?></h3><br>
<div class="cadre_facturation"> <div class="cadre_facturation">

View File

@ -234,11 +234,11 @@ switch ($action)
{ {
if ($invoice->lines[$i]->fk_product > 0) if ($invoice->lines[$i]->fk_product > 0)
{ {
$mouvP = new MouvementStock($this->db); $mouvP = new MouvementStock($db);
$mouvP->origin = &$invoice; $mouvP->origin = &$invoice;
// We decrease stock for product // We decrease stock for product
if ($invoice->type == self::TYPE_CREDIT_NOTE) $result=$mouvP->reception($user, $invoice->lines[$i]->fk_product, $idwarehouse, $invoice->lines[$i]->qty, $invoice->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarrFromPos",$invoice->newref)); 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, $idwarehouse, $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) { if ($result < 0) {
$error++; $error++;
} }
@ -274,11 +274,11 @@ switch ($action)
{ {
if ($invoice->lines[$i]->fk_product > 0) if ($invoice->lines[$i]->fk_product > 0)
{ {
$mouvP = new MouvementStock($this->db); $mouvP = new MouvementStock($db);
$mouvP->origin = &$invoice; $mouvP->origin = &$invoice;
// We decrease stock for product // We decrease stock for product
if ($invoice->type == self::TYPE_CREDIT_NOTE) $result=$mouvP->reception($user, $invoice->lines[$i]->fk_product, $idwarehouse, $invoice->lines[$i]->qty, $invoice->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarrFromPos",$invoice->newref)); 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, $idwarehouse, $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) { if ($result < 0) {
$error++; $error++;
} }

View File

@ -1418,7 +1418,7 @@ OSCommerceTestKo2=Connection to server '%s' with user '%s' failed.
##### Stock ##### ##### Stock #####
StockSetup=Warehouse module setup StockSetup=Warehouse module setup
UserWarehouse=Use user personal warehouses UserWarehouse=Use user personal warehouses
IfYouUsePointOfSaleCheckModule=If you use a Point of Sale module (POS module provided by default or another external module), check also setup of this module: Most point of sales modules are designed to create immediatly an invoice. If you need to have a stock decrease when registering a sell from your Point Of Sale whatever is the option set here, check your POS module is set up for that. IfYouUsePointOfSaleCheckModule=If you use a Point of Sale module (POS module provided by default or another external module), this setup may be ignored by your Point Of Sale module. Most point of sales modules are designed to create immediatly an invoice and decrease stock by default whatever are options here. So, if you need or not to have a stock decrease when registering a sell from your Point Of Sale, check also your POS module set up.
##### Menu ##### ##### Menu #####
MenuDeleted=Menu deleted MenuDeleted=Menu deleted
TreeMenu=Tree menus TreeMenu=Tree menus

View File

@ -627,12 +627,14 @@ if ($resql)
print '<td align="right">'.$obj->reel.($obj->reel<0?' '.img_warning():'').'</td>'; print '<td align="right">'.$obj->reel.($obj->reel<0?' '.img_warning():'').'</td>';
// PMP // PMP
print '<td align="right">'.(price2num($obj->pmp)?price2num($obj->pmp,'MU'):'').'</td>'; // Ditto : Show PMP from movement or from product print '<td align="right">'.(price2num($obj->pmp)?price2num($obj->pmp,'MU'):'').'</td>'; // Ditto : Show PMP from movement or from product
// Value purchase
print '<td align="right">'.(price2num($obj->pmp)?price(price2num($obj->pmp*$obj->reel,'MT')):'').'</td>'; // Ditto : Show PMP from movement or from product print '<td align="right">'.(price2num($obj->pmp)?price(price2num($obj->pmp*$obj->reel,'MT')):'').'</td>'; // Ditto : Show PMP from movement or from product
// Sell price // Sell price
print '<td align="right">'; print '<td align="right">';
if (empty($conf->global->PRODUIT_MULTI_PRICES)) print price(price2num($product->price,'MU'),1); if (empty($conf->global->PRODUIT_MULTI_PRICES)) print price(price2num($product->price,'MU'),1);
else print $langs->trans("Variable"); else print $langs->trans("Variable");
print '</td>'; // Ditto : Show PMP from movement or from product print '</td>'; // Ditto : Show PMP from movement or from product
// Value sell
print '<td align="right">'; print '<td align="right">';
if (empty($conf->global->PRODUIT_MULTI_PRICES)) print price(price2num($product->price*$obj->reel,'MT'),1).'</td>'; // Ditto : Show PMP from movement or from product if (empty($conf->global->PRODUIT_MULTI_PRICES)) print price(price2num($product->price*$obj->reel,'MT'),1).'</td>'; // Ditto : Show PMP from movement or from product
else print $langs->trans("Variable"); else print $langs->trans("Variable");
@ -663,6 +665,7 @@ print '<td class="liste_total" align="right">'.$total.'</td>';
print '<td class="liste_total" align="right">'; print '<td class="liste_total" align="right">';
print ($totalwithpmp?price($totalvalue/$totalwithpmp):'&nbsp;'); print ($totalwithpmp?price($totalvalue/$totalwithpmp):'&nbsp;');
print '</td>'; print '</td>';
// Value purchase
print '<td class="liste_total" align="right">'; print '<td class="liste_total" align="right">';
print price(price2num($totalvalue,'MT'),1); print price(price2num($totalvalue,'MT'),1);
print '</td>'; print '</td>';
@ -670,6 +673,7 @@ print '<td class="liste_total" align="right">';
if (empty($conf->global->PRODUIT_MULTI_PRICES)) print ($total?price($totalvaluesell/$total,1):'&nbsp;'); if (empty($conf->global->PRODUIT_MULTI_PRICES)) print ($total?price($totalvaluesell/$total,1):'&nbsp;');
else print $langs->trans("Variable"); else print $langs->trans("Variable");
print '</td>'; print '</td>';
// Value to sell
print '<td class="liste_total" align="right">'; print '<td class="liste_total" align="right">';
if (empty($conf->global->PRODUIT_MULTI_PRICES)) print price(price2num($totalvaluesell,'MT'),1); if (empty($conf->global->PRODUIT_MULTI_PRICES)) print price(price2num($totalvaluesell,'MT'),1);
else print $langs->trans("Variable"); else print $langs->trans("Variable");