diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index d9c5a3f616a..a3109647939 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -194,10 +194,10 @@ if (! empty($conf->expedition->enabled)) } print ''; -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 '
'; // Title rule for stock increase diff --git a/htdocs/cashdesk/affContenu.php b/htdocs/cashdesk/affContenu.php index 9940e70cc93..dd57a2fd988 100644 --- a/htdocs/cashdesk/affContenu.php +++ b/htdocs/cashdesk/affContenu.php @@ -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 '
'; $page=GETPOST('menu','alpha'); @@ -72,13 +82,10 @@ print '
'; - // Right area with selected articles (shopping cart) print '
'; require ('tpl/liste_articles.tpl.php'); -$obj_facturation->prixTotalHt($lst_total_ht); -$obj_facturation->prixTotalTtc($lst_total_ttc); print '
'; diff --git a/htdocs/cashdesk/css/style.css b/htdocs/cashdesk/css/style.css index 0972527a73b..f62a9193830 100644 --- a/htdocs/cashdesk/css/style.css +++ b/htdocs/cashdesk/css/style.css @@ -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; } diff --git a/htdocs/cashdesk/facturation_verif.php b/htdocs/cashdesk/facturation_verif.php index 42e1c00f651..8953f7b0ccc 100644 --- a/htdocs/cashdesk/facturation_verif.php +++ b/htdocs/cashdesk/facturation_verif.php @@ -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); diff --git a/htdocs/cashdesk/tpl/facturation1.tpl.php b/htdocs/cashdesk/tpl/facturation1.tpl.php index f2258c6473e..47116705320 100644 --- a/htdocs/cashdesk/tpl/facturation1.tpl.php +++ b/htdocs/cashdesk/tpl/facturation1.tpl.php @@ -43,6 +43,7 @@ $langs->load("cashdesk"); @@ -147,7 +148,7 @@ $langs->load("cashdesk"); - +
diff --git a/htdocs/cashdesk/tpl/liste_articles.tpl.php b/htdocs/cashdesk/tpl/liste_articles.tpl.php index 2fac2e2a16a..160c9afd8a8 100644 --- a/htdocs/cashdesk/tpl/liste_articles.tpl.php +++ b/htdocs/cashdesk/tpl/liste_articles.tpl.php @@ -67,8 +67,6 @@ else } } -$obj_facturation->calculTotaux(); -$total_ttc = $obj_facturation->prixTotalTtc(); echo ('

'.$langs->trans("Total").' : '.price(price2num($total_ttc, 'MT'),0,$langs,0,0,-1,$conf->currency).'

'."\n"); ?> diff --git a/htdocs/cashdesk/tpl/validation1.tpl.php b/htdocs/cashdesk/tpl/validation1.tpl.php index 15762ecf494..1aa1c0c4723 100644 --- a/htdocs/cashdesk/tpl/validation1.tpl.php +++ b/htdocs/cashdesk/tpl/validation1.tpl.php @@ -17,6 +17,7 @@ */ $langs->load("main"); +$langs->load("bills"); // Object $form must de defined @@ -111,8 +112,9 @@ $langs->load("main");

trans("Notes"); ?>

- " /> -

trans("RestartSelling"); ?>

+
" />
+
trans("RestartSelling"); ?> +
diff --git a/htdocs/cashdesk/tpl/validation2.tpl.php b/htdocs/cashdesk/tpl/validation2.tpl.php index 9ebab951eb9..b00268d7b0a 100644 --- a/htdocs/cashdesk/tpl/validation2.tpl.php +++ b/htdocs/cashdesk/tpl/validation2.tpl.php @@ -18,10 +18,11 @@ */ $langs->load("main"); +$langs->load("bills"); ?> -

trans("SellFinished"); ?>

+

trans("SellFinished"); ?>


diff --git a/htdocs/cashdesk/validation_verif.php b/htdocs/cashdesk/validation_verif.php index a03256bfed4..fa943acda96 100644 --- a/htdocs/cashdesk/validation_verif.php +++ b/htdocs/cashdesk/validation_verif.php @@ -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++; } diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 3e20d071cee..5d1a2323ff0 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -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 diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 5bd7999e2e3..f53931955d3 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -627,12 +627,14 @@ if ($resql) print ''.$obj->reel.($obj->reel<0?' '.img_warning():'').''; // PMP print ''.(price2num($obj->pmp)?price2num($obj->pmp,'MU'):'').''; // Ditto : Show PMP from movement or from product + // Value purchase print ''.(price2num($obj->pmp)?price(price2num($obj->pmp*$obj->reel,'MT')):'').''; // Ditto : Show PMP from movement or from product // Sell price print ''; if (empty($conf->global->PRODUIT_MULTI_PRICES)) print price(price2num($product->price,'MU'),1); else print $langs->trans("Variable"); print ''; // Ditto : Show PMP from movement or from product + // Value sell print ''; if (empty($conf->global->PRODUIT_MULTI_PRICES)) print price(price2num($product->price*$obj->reel,'MT'),1).''; // Ditto : Show PMP from movement or from product else print $langs->trans("Variable"); @@ -663,6 +665,7 @@ print ''.$total.''; print ''; print ($totalwithpmp?price($totalvalue/$totalwithpmp):' '); print ''; +// Value purchase print ''; print price(price2num($totalvalue,'MT'),1); print ''; @@ -670,6 +673,7 @@ print ''; if (empty($conf->global->PRODUIT_MULTI_PRICES)) print ($total?price($totalvaluesell/$total,1):' '); else print $langs->trans("Variable"); print ''; +// Value to sell print ''; if (empty($conf->global->PRODUIT_MULTI_PRICES)) print price(price2num($totalvaluesell,'MT'),1); else print $langs->trans("Variable");