Work on batch module. Add batch, eatby and sellby into movement table.

Clean language files for direct print module.
This commit is contained in:
Laurent Destailleur 2015-02-12 15:23:31 +01:00
parent b49c8f84b6
commit 6adfc6f6f4
16 changed files with 113 additions and 94 deletions

View File

@ -236,24 +236,12 @@ source_file = htdocs/langs/en_US/paypal.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[dolibarr.printgcp]
file_filter = htdocs/langs/<lang>/printgcp.lang
source_file = htdocs/langs/en_US/printgcp.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[dolibarr.printing]
file_filter = htdocs/langs/<lang>/printing.lang
source_file = htdocs/langs/en_US/printing.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[dolibarr.printipp]
file_filter = htdocs/langs/<lang>/printipp.lang
source_file = htdocs/langs/en_US/printipp.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[dolibarr.productbatch]
file_filter = htdocs/langs/<lang>/productbatch.lang
source_file = htdocs/langs/en_US/productbatch.lang

View File

@ -190,7 +190,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/opensurvey
%_datadir/dolibarr/htdocs/paybox
%_datadir/dolibarr/htdocs/paypal
%_datadir/dolibarr/htdocs/printipp
%_datadir/dolibarr/htdocs/printing
%_datadir/dolibarr/htdocs/product
%_datadir/dolibarr/htdocs/projet
%_datadir/dolibarr/htdocs/public

View File

@ -270,7 +270,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/opensurvey
%_datadir/dolibarr/htdocs/paybox
%_datadir/dolibarr/htdocs/paypal
%_datadir/dolibarr/htdocs/printipp
%_datadir/dolibarr/htdocs/printing
%_datadir/dolibarr/htdocs/product
%_datadir/dolibarr/htdocs/projet
%_datadir/dolibarr/htdocs/public

View File

@ -187,7 +187,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/opensurvey
%_datadir/dolibarr/htdocs/paybox
%_datadir/dolibarr/htdocs/paypal
%_datadir/dolibarr/htdocs/printipp
%_datadir/dolibarr/htdocs/printing
%_datadir/dolibarr/htdocs/product
%_datadir/dolibarr/htdocs/projet
%_datadir/dolibarr/htdocs/public

View File

@ -198,7 +198,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/opensurvey
%_datadir/dolibarr/htdocs/paybox
%_datadir/dolibarr/htdocs/paypal
%_datadir/dolibarr/htdocs/printipp
%_datadir/dolibarr/htdocs/printing
%_datadir/dolibarr/htdocs/product
%_datadir/dolibarr/htdocs/projet
%_datadir/dolibarr/htdocs/public

View File

@ -69,7 +69,7 @@ class printing_printgcp extends PrintingDriver
function listAvailablePrinters()
{
global $bc, $conf, $langs;
$langs->load('printgcp');
$langs->load('printing');
$var=true;
$html = '<tr class="liste_titre">';

View File

@ -105,8 +105,9 @@ ALTER TABLE llx_product_fournisseur_price ADD COLUMN delivery_time_days integer;
ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN comment varchar(255);
ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN status integer;
ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN tms timestamp;
ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN batch varchar(30) DEFAULT NULL;
ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN eatby date DEFAULT NULL;
ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN sellby date DEFAULT NULL;
ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN batch varchar(30) DEFAULT NULL;
ALTER TABLE llx_stock_mouvement ADD COLUMN batch varchar(30) DEFAULT NULL;
ALTER TABLE llx_stock_mouvement ADD COLUMN eatby date DEFAULT NULL;
ALTER TABLE llx_stock_mouvement ADD COLUMN sellby date DEFAULT NULL;

View File

@ -28,9 +28,9 @@ create table llx_commande_fournisseur_dispatch
fk_entrepot integer,
fk_user integer,
comment varchar(255), -- comment on movement
batch varchar(30) DEFAULT NULL,
eatby date DEFAULT NULL,
sellby date DEFAULT NULL,
batch varchar(30) DEFAULT NULL,
status integer,
datec datetime,
tms timestamp

View File

@ -23,6 +23,9 @@ create table llx_stock_mouvement
tms timestamp,
datem datetime,
fk_product integer NOT NULL,
batch varchar(30) DEFAULT NULL,
eatby date DEFAULT NULL,
sellby date DEFAULT NULL,
fk_entrepot integer NOT NULL,
value real,
price float(13,4) DEFAULT 0,

View File

@ -1,25 +0,0 @@
# Dolibarr language file - Source file is en_US - printgccp
PRINTGCP=Google Cloud Print
PrintGCPDesc=This driver allow to send documents directly to a printer with Google Cloud Print.
PrintingDriverDescprintgcp=Configuration variables for printing driver Google Cloud Print.
PrintTestDescprintgcp=List of Printers for Google Cloud Print.
PRINTGCP_LOGIN=Google Account Login
PRINTGCP_PASSWORD=Google Account Password
STATE_ONLINE=Online
STATE_UNKNOWN=Unknown
STATE_OFFLINE=Offline
STATE_DORMANT=Offline for quite a while
TYPE_GOOGLE=Google
TYPE_HP=HP Printer
TYPE_DOCS=DOCS
TYPE_DRIVE=Google Drive
TYPE_FEDEX=Fedex
TYPE_ANDROID_CHROME_SNAPSHOT=Android
TYPE_IOS_CHROME_SNAPSHOT=IOS
GCP_Name=Name
GCP_displayName=Display Name
GCP_Id=Printer Id
GCP_OwnerName=Owner Name
GCP_State=Printer State
GCP_connectionStatus=Online State
GCP_Type=Printer Type

View File

@ -1,4 +1,6 @@
# Dolibarr language file - Source file is en_US - printing
Module112000Name=Direct Printing
Module112000Desc=Enable Direct Printing System
PrintingSetup=Setup of Direct Printing System
PrintingDesc=This module adds a Print button to send documents directly to a printer (without opening document into an application) with various module.
ModuleDriverSetup=Setup Module Driver
@ -12,5 +14,61 @@ SetupDriver=Driver setup
TestDriver=Test
TargetedPrinter=Targeted printer
UserConf=Setup per user
Module112000Name=Direct Printing
Module112000Desc=Enable Direct Printing System
PRINTGCP=Google Cloud Print
PrintGCPDesc=This driver allow to send documents directly to a printer with Google Cloud Print.
PrintingDriverDescprintgcp=Configuration variables for printing driver Google Cloud Print.
PrintTestDescprintgcp=List of Printers for Google Cloud Print.
PRINTGCP_LOGIN=Google Account Login
PRINTGCP_PASSWORD=Google Account Password
STATE_ONLINE=Online
STATE_UNKNOWN=Unknown
STATE_OFFLINE=Offline
STATE_DORMANT=Offline for quite a while
TYPE_GOOGLE=Google
TYPE_HP=HP Printer
TYPE_DOCS=DOCS
TYPE_DRIVE=Google Drive
TYPE_FEDEX=Fedex
TYPE_ANDROID_CHROME_SNAPSHOT=Android
TYPE_IOS_CHROME_SNAPSHOT=IOS
GCP_Name=Name
GCP_displayName=Display Name
GCP_Id=Printer Id
GCP_OwnerName=Owner Name
GCP_State=Printer State
GCP_connectionStatus=Online State
GCP_Type=Printer Type
PRINTIPP=PrintIPP Driver
PrintIPPSetup=Setup of Direct Print module
PrintIPPDesc=This driver allow to send documents directly to a printer. It requires a Linux system with CUPS installed.
PrintingDriverDescprintipp=Configuration variables for printing driver PrintIPP.
PrintTestDescprintipp=List of Printers for driver PrintIPP.
PRINTIPP_ENABLED=Show "Direct print" icon in document lists
PRINTIPP_HOST=Print server
PRINTIPP_PORT=Port
PRINTIPP_USER=Login
PRINTIPP_PASSWORD=Password
NoPrinterFound=No printers found (check your CUPS setup)
FileWasSentToPrinter=File %s was sent to printer
NoDefaultPrinterDefined=No default printer defined
DefaultPrinter=Default printer
Printer=Printer
CupsServer=CUPS Server
IPP_Uri=Printer Uri
IPP_Name=Printer Name
IPP_State=Printer State
IPP_State_reason=State reason
IPP_State_reason1=State reason1
IPP_BW=BW
IPP_Color=Color
IPP_Device=Device
IPP_Media=Printer media
IPP_Supported=Type of media
STATE_IPP_idle=Idle
STATE_IPP_stopped=Stopped
STATE_IPP_paused=Paused
STATE_IPP_toner-low-report=Low Toner
STATE_IPP_none=None
MEDIA_IPP_stationery=Stationery
MEDIA_IPP_thermal=Thermal
IPP_COLOR_print-black=BW Printer

View File

@ -1,37 +0,0 @@
# Dolibarr language file - Source file is en_US - printipp
PRINTIPP=PrintIPP Driver
PrintIPPSetup=Setup of Direct Print module
PrintIPPDesc=This driver allow to send documents directly to a printer. It requires a Linux system with CUPS installed.
PrintingDriverDescprintipp=Configuration variables for printing driver PrintIPP.
PrintTestDescprintipp=List of Printers for driver PrintIPP.
PRINTIPP_ENABLED=Show "Direct print" icon in document lists
PRINTIPP_HOST=Print server
PRINTIPP_PORT=Port
PRINTIPP_USER=Login
PRINTIPP_PASSWORD=Password
NoPrinterFound=No printers found (check your CUPS setup)
FileWasSentToPrinter=File %s was sent to printer
NoDefaultPrinterDefined=No default printer defined
DefaultPrinter=Default printer
Printer=Printer
CupsServer=CUPS Server
IPP_Uri=Printer Uri
IPP_Name=Printer Name
IPP_State=Printer State
IPP_State_reason=State reason
IPP_State_reason1=State reason1
IPP_BW=BW
IPP_Color=Color
IPP_Device=Device
IPP_Media=Printer media
IPP_Supported=Type of media
STATE_IPP_idle=Idle
STATE_IPP_stopped=Stopped
STATE_IPP_paused=Paused
STATE_IPP_toner-low-report=Low Toner
STATE_IPP_none=None
MEDIA_IPP_stationery=Stationery
MEDIA_IPP_thermal=Thermal
IPP_COLOR_print-black=BW Printer
IPP_COLOR_print-color=Color Printer
IPP_COLOR_=No

View File

@ -1763,7 +1763,7 @@ class Product extends CommonObject
*
* @param int $socid Id societe pour filtrer sur une societe
* @param int $filtrestatut Id statut pour filtrer sur un statut
* @return array Tableau des stats
* @return array Array of stats (nb=nb of order, qty=qty ordered)
*/
function load_stats_commande($socid=0,$filtrestatut='')
{

View File

@ -468,7 +468,7 @@ else
if ($user->rights->stock->mouvement->creer)
{
print '<td align="center"><a href="'.DOL_URL_ROOT.'/product/stock/product.php?dwid='.$object->id.'&amp;id='.$objp->rowid.'&amp;action=transfert">';
print img_picto($langs->trans("StockMovement"),'uparrow.png').' '.$langs->trans("StockMovement");
print img_picto($langs->trans("StockMovement"),'uparrow.png','class="hideonsmartphone"').' '.$langs->trans("StockMovement");
print "</a></td>";
}

View File

@ -124,9 +124,15 @@ class MouvementStock extends CommonObject
$mvid = 0;
$sql = "INSERT INTO ".MAIN_DB_PREFIX."stock_mouvement";
$sql.= " (datem, fk_product, fk_entrepot, value, type_mouvement, fk_user_author, label, inventorycode, price, fk_origin, origintype)";
$sql.= " VALUES ('".$this->db->idate($now)."', ".$this->product_id.", ".$this->entrepot_id.", ".$this->qty.", ".$this->type.",";
$sql = "INSERT INTO ".MAIN_DB_PREFIX."stock_mouvement(";
$sql.= " datem, fk_product, batch, eatby, sellby,";
$sql.= " fk_entrepot, value, type_mouvement, fk_user_author, label, inventorycode, price, fk_origin, origintype";
$sql.= ")";
$sql.= " VALUES ('".$this->db->idate($now)."', ".$this->product_id.", ";
$sql.= " ".($batch?"'".$batch."'":"null").", ";
$sql.= " ".($eatby?"'".$this->db->idate($eatby)."'":"null").", ";
$sql.= " ".($sellby?"'".$this->db->idate($sellby)."'":"null").", ";
$sql.= " ".$this->entrepot_id.", ".$this->qty.", ".$this->type.",";
$sql.= " ".$user->id.",";
$sql.= " '".$this->db->escape($label)."',";
$sql.= " ".($inventorycode?"'".$this->db->escape($inventorycode)."'":"null").",";

View File

@ -122,6 +122,7 @@ $formproduct=new FormProduct($db);
$sql = "SELECT p.rowid, p.ref as product_ref, p.label as produit, p.fk_product_type as type,";
$sql.= " e.label as stock, e.rowid as entrepot_id, e.lieu,";
$sql.= " m.rowid as mid, m.value, m.datem, m.fk_user_author, m.label, m.inventorycode, m.fk_origin, m.origintype,";
$sql.= " m.batch,m.eatby,m.sellby,";
$sql.= " u.login";
$sql.= " FROM (".MAIN_DB_PREFIX."entrepot as e,";
$sql.= " ".MAIN_DB_PREFIX."product as p,";
@ -426,12 +427,22 @@ if ($resql)
if ($id) print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num,0,'');
else print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num);
print '<form method="get" action="'.$_SERVER["PHP_SELF"].'">';
if ($id) print '<input type="hidden" name="id" value="'.$id.'">';
print '<table class="noborder" width="100%">';
print "<tr class=\"liste_titre\">";
//print_liste_field_titre($langs->trans("Id"),$_SERVER["PHP_SELF"], "m.rowid","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"], "m.datem","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("ProductRef"),$_SERVER["PHP_SELF"], "p.ref","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("ProductLabel"),$_SERVER["PHP_SELF"], "p.ref","",$param,"",$sortfield,$sortorder);
if (! empty($conf->productbatch->enabled))
{
$langs->load("productbatch");
print '<td align="right" width="10%">'.$langs->trans("batch_number").'</td>';
print '<td align="center" width="10%">'.$langs->trans("l_eatby").'</td>';
print '<td align="center" width="10%">'.$langs->trans("l_sellby").'</td>';
}
print_liste_field_titre($langs->trans("Warehouse"),$_SERVER["PHP_SELF"], "","",$param,"",$sortfield,$sortorder); // We are on a specific warehouse card, no filter on other should be possible
print_liste_field_titre($langs->trans("Author"),$_SERVER["PHP_SELF"], "m.fk_user_author","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("InventoryCode"),$_SERVER["PHP_SELF"], "m.inventorycode","",$param,"",$sortfield,$sortorder);
@ -441,14 +452,14 @@ if ($resql)
print "</tr>\n";
// Lignes des champs de filtre
print '<form method="get" action="'.$_SERVER["PHP_SELF"].'">';
if ($id) print '<input type="hidden" name="id" value="'.$id.'">';
print '<tr class="liste_titre">';
print '<td class="liste_titre" valign="right">';
print $langs->trans('Month').': <input class="flat" type="text" size="2" maxlength="2" name="month" value="'.$month.'">';
print '&nbsp;'.$langs->trans('Year').': ';
$syear = GETPOST('year')?GETPOST('year'):-1;
if (empty($conf->productbatch->enabled)) print '&nbsp;';
else print '<br>';
print $langs->trans('Year').': ';
$syear = $year?$year:-1;
$formother->select_year($syear,'year',1, 20, 5);
print '</td>';
// Product Ref
@ -459,6 +470,13 @@ if ($resql)
print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" size="10" name="search_product" value="'.($idproduct?$product->libelle:$search_product).'">';
print '</td>';
// Batch
if (! empty($conf->productbatch->enabled))
{
print '<td></td>';
print '<td></td>';
print '<td></td>';
}
// Warehouse
print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" size="10" name="search_warehouse" value="'.($search_warehouse).'">';
@ -522,6 +540,13 @@ if ($resql)
$productstatic->type=$objp->type;
print $productstatic->getNomUrl(1,'',16);
print "</td>\n";
// Batch
if (! empty($conf->productbatch->enabled))
{
print '<td align="right">'.$objp->batch.'</td>';
print '<td align="center">'. dol_print_date($objp->eatby,'day') .'</td>';
print '<td align="center">'. dol_print_date($objp->sellby,'day') .'</td>';
}
// Warehouse
print '<td>';
$warehousestatic->id=$objp->entrepot_id;