Fixed: Ton of old bugs when debugging POS.
This commit is contained in:
parent
b9ea7d4d13
commit
7303983610
@ -194,10 +194,10 @@ if (! empty($conf->expedition->enabled))
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) || ! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT))
|
||||
{
|
||||
print info_admin($langs->trans("IfYouUsePointOfSaleCheckModule"));
|
||||
}
|
||||
//if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) || ! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT))
|
||||
//{
|
||||
print info_admin($langs->trans("IfYouUsePointOfSaleCheckModule"));
|
||||
//}
|
||||
print '<br>';
|
||||
|
||||
// Title rule for stock increase
|
||||
|
||||
@ -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">';
|
||||
|
||||
$page=GETPOST('menu','alpha');
|
||||
@ -72,13 +82,10 @@ print '</div>';
|
||||
|
||||
|
||||
|
||||
|
||||
// Right area with selected articles (shopping cart)
|
||||
print '<div class="liste_articles">';
|
||||
|
||||
require ('tpl/liste_articles.tpl.php');
|
||||
$obj_facturation->prixTotalHt($lst_total_ht);
|
||||
$obj_facturation->prixTotalTtc($lst_total_ttc);
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
@ -222,6 +222,7 @@ p.titre {
|
||||
margin: 0 15px;
|
||||
padding: 0;
|
||||
max-width: 500px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.titre1 {
|
||||
@ -308,7 +309,7 @@ p.titre {
|
||||
}
|
||||
|
||||
.texte_ref {
|
||||
width: 80px;
|
||||
min-width: 150px;
|
||||
}
|
||||
|
||||
.texte1,.texte1_off {
|
||||
@ -321,8 +322,8 @@ p.titre {
|
||||
|
||||
/* ------------------- */
|
||||
.textarea_note {
|
||||
width: 300px;
|
||||
height: 150px;
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
padding: 2px 2px;
|
||||
}
|
||||
|
||||
@ -362,7 +363,7 @@ p.titre {
|
||||
}
|
||||
|
||||
.resume_label,.note_label {
|
||||
width: 200px;
|
||||
min-width: 200px;
|
||||
font-weight: bold;
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
@ -137,16 +137,17 @@ switch ( $_GET['action'] )
|
||||
|
||||
case 'ajout_article': // We have clicked on button "Add product"
|
||||
|
||||
//var_dump($obj_facturation);
|
||||
//var_dump('ajout_article');
|
||||
//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->tva($_POST['selTva']);
|
||||
$obj_facturation->remisePercent($_POST['txtRemise']);
|
||||
$obj_facturation->ajoutArticle();
|
||||
|
||||
$obj_facturation->ajoutArticle(); // This add an entry into $_SESSION['poscart']
|
||||
// We update prixTotalTtc
|
||||
|
||||
}
|
||||
|
||||
$redirection = DOL_URL_ROOT.'/cashdesk/affIndex.php?menu=facturation';
|
||||
@ -160,7 +161,7 @@ switch ( $_GET['action'] )
|
||||
|
||||
}
|
||||
|
||||
|
||||
// We saved object obj_facturation
|
||||
$_SESSION['serObjFacturation'] = serialize($obj_facturation);
|
||||
|
||||
header('Location: '.$redirection);
|
||||
|
||||
@ -43,6 +43,7 @@ $langs->load("cashdesk");
|
||||
<!-- 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() ?>"
|
||||
onchange="javascript: setSource('REF');"
|
||||
onkeyup="javascript: verifResultat('resultats_dhtml', this.value);"
|
||||
onfocus="javascript: this.select(); verifResultat('resultats_dhtml', this.value);"
|
||||
onBlur="javascript: document.getElementById('resultats_dhtml').innerHTML = '';"/>
|
||||
</td>
|
||||
@ -147,7 +148,7 @@ $langs->load("cashdesk");
|
||||
</form>
|
||||
</fieldset>
|
||||
|
||||
<!-- ========================= Cadre "Difference" ============================= -->
|
||||
<!-- ========================= Cadre "Amount" ============================= -->
|
||||
<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="token" value="<?php echo $_SESSION['newtoken']; ?>" />
|
||||
|
||||
@ -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");
|
||||
|
||||
?></div>
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
*/
|
||||
|
||||
$langs->load("main");
|
||||
$langs->load("bills");
|
||||
|
||||
// Object $form must de defined
|
||||
|
||||
@ -111,8 +112,9 @@ $langs->load("main");
|
||||
</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>
|
||||
<p><a class="lien1" href="affIndex.php?menu=facturation"><?php echo $langs->trans("RestartSelling"); ?></a></p>
|
||||
<div class="center"><input class="button" type="submit" name="btnValider" value="<?php echo $langs->trans("ValidateInvoice"); ?>" /><br>
|
||||
<br><a class="lien1" href="affIndex.php?menu=facturation"><?php echo $langs->trans("RestartSelling"); ?></a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
@ -18,10 +18,11 @@
|
||||
*/
|
||||
|
||||
$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">
|
||||
|
||||
|
||||
@ -234,11 +234,11 @@ switch ($action)
|
||||
{
|
||||
if ($invoice->lines[$i]->fk_product > 0)
|
||||
{
|
||||
$mouvP = new MouvementStock($this->db);
|
||||
$mouvP = new MouvementStock($db);
|
||||
$mouvP->origin = &$invoice;
|
||||
// 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));
|
||||
else $result=$mouvP->livraison($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, $warehouseidtodecrease, $invoice->lines[$i]->qty, $invoice->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarrFromPos",$invoice->newref));
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
@ -274,11 +274,11 @@ switch ($action)
|
||||
{
|
||||
if ($invoice->lines[$i]->fk_product > 0)
|
||||
{
|
||||
$mouvP = new MouvementStock($this->db);
|
||||
$mouvP = new MouvementStock($db);
|
||||
$mouvP->origin = &$invoice;
|
||||
// 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));
|
||||
else $result=$mouvP->livraison($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, $warehouseidtodecrease, $invoice->lines[$i]->qty, $invoice->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarrFromPos",$invoice->newref));
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
@ -1418,7 +1418,7 @@ OSCommerceTestKo2=Connection to server '%s' with user '%s' failed.
|
||||
##### Stock #####
|
||||
StockSetup=Warehouse module setup
|
||||
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 #####
|
||||
MenuDeleted=Menu deleted
|
||||
TreeMenu=Tree menus
|
||||
|
||||
@ -627,12 +627,14 @@ if ($resql)
|
||||
print '<td align="right">'.$obj->reel.($obj->reel<0?' '.img_warning():'').'</td>';
|
||||
// PMP
|
||||
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
|
||||
// Sell price
|
||||
print '<td align="right">';
|
||||
if (empty($conf->global->PRODUIT_MULTI_PRICES)) print price(price2num($product->price,'MU'),1);
|
||||
else print $langs->trans("Variable");
|
||||
print '</td>'; // Ditto : Show PMP from movement or from product
|
||||
// Value sell
|
||||
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
|
||||
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 ($totalwithpmp?price($totalvalue/$totalwithpmp):' ');
|
||||
print '</td>';
|
||||
// Value purchase
|
||||
print '<td class="liste_total" align="right">';
|
||||
print price(price2num($totalvalue,'MT'),1);
|
||||
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):' ');
|
||||
else print $langs->trans("Variable");
|
||||
print '</td>';
|
||||
// Value to sell
|
||||
print '<td class="liste_total" align="right">';
|
||||
if (empty($conf->global->PRODUIT_MULTI_PRICES)) print price(price2num($totalvaluesell,'MT'),1);
|
||||
else print $langs->trans("Variable");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user