Totale in € della merce in magazzino: si può?

Questo forum è dedicato alle discussioni riguardanti le contribution per osCommerce

Moderatore: mod Generali

Rispondi
talkin
membro Junior
membro Junior
Messaggi: 7
Iscritto il: 12/07/2004, 0:00
Località: CATANZARO

Totale in € della merce in magazzino: si può?

Messaggio da talkin »

ciao a tutti, cerco una contrib che mi segnali anche il valore in € della merce in magazzino.

esiste??

Grazie!
T@lkin
Fabrizio88
membro Senior
membro Senior
Messaggi: 488
Iscritto il: 11/10/2005, 21:49
Contatta:

Messaggio da Fabrizio88 »

Stessa Richiesta...
Ci sono un sacco di Statistiche e non c'è questa contribution? :roll:
Qualcuno usa una contribution per questo scopo?
skizo
membro Senior
membro Senior
Messaggi: 293
Iscritto il: 21/06/2003, 0:00
Località: Italy

Messaggio da skizo »

up
http://www.ardigosnc.com [TUTTO PER LA CARTOLERIA]
skizo
membro Senior
membro Senior
Messaggi: 293
Iscritto il: 21/06/2003, 0:00
Località: Italy

Messaggio da skizo »

up
http://www.ardigosnc.com [TUTTO PER LA CARTOLERIA]
robysoldtamiya
membro Baby
membro Baby
Messaggi: 73
Iscritto il: 10/09/2008, 23:31

Re: Totale in € della merce in magazzino: si può?

Messaggio da robysoldtamiya »

Ciao,
mi son ritrovato ad avere questa necessità e mi son creato una contrib :)


create nella cartella admin questo file stats_warehouse_value.php

Codice: Seleziona tutto

<?php
/*
  $Id: stats_warehouse_value.php 1739 
  2008-12-15  Buso Roberto

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
*/

  require('includes/application_top.php');
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<script language="javascript" src="includes/general.js"></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
  <tr>
    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
        </table></td>
<!-- body_text //-->
    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr class="dataTableHeadingRow">
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_NUMBER; ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_QUANTITY; ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRICE; ?></td>
                <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_VALUE; ?> </td>
              </tr>

<?php
  if (isset($HTTP_GET_VARS['page']) && ($HTTP_GET_VARS['page'] > 1)) $rows = $HTTP_GET_VARS['page'] * MAX_DISPLAY_SEARCH_RESULTS - MAX_DISPLAY_SEARCH_RESULTS;
  $products_query_raw = "select p.products_id, p.products_quantity, p.products_price, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id = p.products_id and pd.language_id = '" . $languages_id. "' and p.products_quantity > 0 group by pd.products_id order by pd.products_name";
  $products_query = tep_db_query($products_query_raw);
  $warehouse_value = 0;
  while ($products = tep_db_fetch_array($products_query)) {
    $products_value = 0;
    $products['products_price'] = $products['products_price'] + ($products['products_price'] * 20/100);
    $products_value = $products['products_quantity'] * $products['products_price'];
    $warehouse_value = $warehouse_value + $products_value;
  }

  $products_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $products_query_raw, $products_query_numrows);

  $rows = 0;
  $products_query = tep_db_query($products_query_raw);
  while ($products = tep_db_fetch_array($products_query)) {
    $products['products_price'] = $products['products_price'] + ($products['products_price'] * 20/100);
    $products_value = $products['products_quantity'] * $products['products_price'];
    $rows++;

    if (strlen($rows) < 2) {
      $rows = '0' . $rows;
    }
?>
              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href='<?php echo tep_href_link(FILENAME_CATEGORIES, 'action=new_product_preview&read=only&pID=' . $products['products_id'] . '&origin=' . FILENAME_STATS__WAREHOUSE_VALUE . '?page=' . $HTTP_GET_VARS['page'], 'NONSSL'); ?>'">
                <td class="dataTableContent"><?php echo $rows; ?>.</td>
                <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'action=new_product_preview&read=only&pID=' . $products['products_id'] . '&origin=' . FILENAME_STATS_WAREHOUSE_VALUE . '?page=' . $HTTP_GET_VARS['page'], 'NONSSL') . '">' . $products['products_name'] . '</a>'; ?></td>
                <td class="dataTableContent" align="center"><?php echo $products['products_quantity']; ?> </td>
                <td class="dataTableContent" align="center"><?php printf ("%01.2f",$products['products_price']); ?> </td>
                <td class="dataTableContent" align="center"><?php printf ("%01.2f",$products_value); ?> </td>
              </tr>
<?php
  }
?>
            </table></td>
          </tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr class="dataTableHeadingRow">
                <td class="dataTableHeadingContent" align="center"><?php echo HEADING_TITLE, '     :     ';printf ("%01.2f",$warehouse_value); ?></td>
              </tr>
          <tr>
            <td colspan="3"><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr>
                <td class="smallText" align="top"><?php echo $products_split->display_count($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
                <td class="smallText" align="right"><?php echo $products_split->display_links($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?> </td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
<!-- body_text_eof //-->
  </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
aggiungete prima dell'ultima riga del blocco al file admin\includes\boxes\reports.php
che serve ad inserire il report nel menu di sinistra

Codice: Seleziona tutto

                                   '<a href="' . tep_href_link(FILENAME_STATS_WAREHOUSE_VALUE, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_WAREHOUSE_VALUE . '</a><br>' .
aggiungete prima dell'ultima riga admin\includes\filenames.php

Codice: Seleziona tutto

  define('FILENAME_STATS_WAREHOUSE_VALUE', 'stats_warehouse_value.php');
aggiungete dopo la riga " // reports box text in includes/boxes/reports.php" nel file
admin\includes\languages\italian.php

Codice: Seleziona tutto

define('BOX_REPORTS_WAREHOUSE_VALUE', 'Valore Magazzino');
create nella cartella admin\includes\languages\italian questo file stats_warehouse_value.php

Codice: Seleziona tutto

<?php
/*
  $Id: stats_warehouse_value.php,v 1.5 2002/03/30 15:52:31 harley_vb Exp $
  15.12.2008 Buso Roberto

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2002 osCommerce

  Released under the GNU General Public License
*/

define('HEADING_TITLE', 'Valore magazzino');

define('TABLE_HEADING_NUMBER', 'Num.');
define('TABLE_HEADING_PRODUCTS', 'Prodotti');
define('TABLE_HEADING_QUANTITY', 'Q.tà a magazzino');
define('TABLE_HEADING_PRICE', 'Prezzo Ivato');
define('TABLE_HEADING_VALUE', 'Valore Ivato');
?>


Tutti i prezzi verranno esposti Ivati al 20%, io nel mio negozio uso solo quella e l'ho inserita a codice.
Se preferite avere i prezzi al netto, cercate '*20/100' nel codice principale ed eliminatelo.
Avrei voluto inserire anche il valore di acquisto della merce, scorporando il rincaro ad ogni prodotto.
Puo' darsi lo faccia più avanti.
Roby
Rispondi