forked from Wavyzz/dolibarr
NEW : stock transfer sheet proforma + default model system like cmd invoice, etc...
This commit is contained in:
@@ -125,7 +125,7 @@ if ($action == 'updateMask') {
|
|||||||
} elseif ($action == 'set') { // Activate a model
|
} elseif ($action == 'set') { // Activate a model
|
||||||
$ret = addDocumentModel($value, 'stocktransfer', $label, $scandir);
|
$ret = addDocumentModel($value, 'stocktransfer', $label, $scandir);
|
||||||
} elseif ($action == 'del') {
|
} elseif ($action == 'del') {
|
||||||
$tmpobjectkey = GETPOST('object');
|
$tmpobjectkey = 'StockTransfer';
|
||||||
|
|
||||||
$ret = delDocumentModel($value, 'stocktransfer');
|
$ret = delDocumentModel($value, 'stocktransfer');
|
||||||
if ($ret > 0) {
|
if ($ret > 0) {
|
||||||
@@ -133,7 +133,7 @@ if ($action == 'updateMask') {
|
|||||||
if ($conf->global->$constforval == "$value") dolibarr_del_const($db, $constforval, $conf->entity);
|
if ($conf->global->$constforval == "$value") dolibarr_del_const($db, $constforval, $conf->entity);
|
||||||
}
|
}
|
||||||
} elseif ($action == 'setdoc') { // Set default model
|
} elseif ($action == 'setdoc') { // Set default model
|
||||||
$tmpobjectkey = GETPOST('object');
|
$tmpobjectkey = 'StockTransfer';
|
||||||
$constforval = strtoupper($tmpobjectkey).'_ADDON_PDF';
|
$constforval = strtoupper($tmpobjectkey).'_ADDON_PDF';
|
||||||
if (dolibarr_set_const($db, $constforval, $value, 'chaine', 0, '', $conf->entity)) {
|
if (dolibarr_set_const($db, $constforval, $value, 'chaine', 0, '', $conf->entity)) {
|
||||||
// The constant that was read before the new set
|
// The constant that was read before the new set
|
||||||
@@ -149,7 +149,7 @@ if ($action == 'updateMask') {
|
|||||||
} elseif ($action == 'setmod') {
|
} elseif ($action == 'setmod') {
|
||||||
// TODO Check if numbering module chosen can be activated
|
// TODO Check if numbering module chosen can be activated
|
||||||
// by calling method canBeActivated
|
// by calling method canBeActivated
|
||||||
$tmpobjectkey = GETPOST('object');
|
$tmpobjectkey = 'StockTransfer';
|
||||||
$constforval = 'STOCKTRANSFER_'.strtoupper($tmpobjectkey)."_ADDON";
|
$constforval = 'STOCKTRANSFER_'.strtoupper($tmpobjectkey)."_ADDON";
|
||||||
dolibarr_set_const($db, $constforval, $value, 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, $constforval, $value, 'chaine', 0, '', $conf->entity);
|
||||||
}
|
}
|
||||||
|
|||||||
1753
htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php
Normal file
1753
htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php
Normal file
File diff suppressed because it is too large
Load Diff
@@ -65,6 +65,7 @@ CREATE TABLE llx_stocktransfer_stocktransfer(
|
|||||||
fk_user_modif integer,
|
fk_user_modif integer,
|
||||||
import_key varchar(14),
|
import_key varchar(14),
|
||||||
model_pdf varchar(255),
|
model_pdf varchar(255),
|
||||||
|
last_main_doc varchar(255),
|
||||||
status smallint NOT NULL
|
status smallint NOT NULL
|
||||||
-- END MODULEBUILDER FIELDS
|
-- END MODULEBUILDER FIELDS
|
||||||
) ENGINE=innodb;
|
) ENGINE=innodb;
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ CREATE TABLE llx_stocktransfer_stocktransfer(
|
|||||||
fk_user_modif integer,
|
fk_user_modif integer,
|
||||||
import_key varchar(14),
|
import_key varchar(14),
|
||||||
model_pdf varchar(255),
|
model_pdf varchar(255),
|
||||||
|
last_main_doc varchar(255),
|
||||||
status smallint NOT NULL
|
status smallint NOT NULL
|
||||||
-- END MODULEBUILDER FIELDS
|
-- END MODULEBUILDER FIELDS
|
||||||
) ENGINE=innodb;
|
) ENGINE=innodb;
|
||||||
|
|||||||
@@ -286,6 +286,7 @@ TypeContact_stocktransfer_internal_STFROM=Sender of stocks transfer
|
|||||||
TypeContact_stocktransfer_internal_STDEST=Recipient of stocks transfer
|
TypeContact_stocktransfer_internal_STDEST=Recipient of stocks transfer
|
||||||
TypeContact_stocktransfer_internal_STRESP=Responsible of stocks transfer
|
TypeContact_stocktransfer_internal_STRESP=Responsible of stocks transfer
|
||||||
StockTransferSheet=Stocks transfer sheet
|
StockTransferSheet=Stocks transfer sheet
|
||||||
|
StockTransferSheetProforma=Proforma stocks transfer sheet
|
||||||
StockTransferDecrementation=Decrease source warehouses
|
StockTransferDecrementation=Decrease source warehouses
|
||||||
StockTransferIncrementation=Increase destination warehouses
|
StockTransferIncrementation=Increase destination warehouses
|
||||||
StockTransferDecrementationCancel=Cancel decrease of source warehouses
|
StockTransferDecrementationCancel=Cancel decrease of source warehouses
|
||||||
|
|||||||
@@ -281,6 +281,7 @@ TypeContact_stocktransfer_internal_STFROM=Contact expéditeur transfert de stock
|
|||||||
TypeContact_stocktransfer_internal_STDEST=Contact destinataire transfert de stocks
|
TypeContact_stocktransfer_internal_STDEST=Contact destinataire transfert de stocks
|
||||||
TypeContact_stocktransfer_internal_STRESP=Responsable du transfert de stocks
|
TypeContact_stocktransfer_internal_STRESP=Responsable du transfert de stocks
|
||||||
StockTransferSheet=Bon de transfert
|
StockTransferSheet=Bon de transfert
|
||||||
|
StockTransferSheetProforma=Bon de transfert proforma
|
||||||
StockTransferDecrementation=Décrémenter les entrepôts sources
|
StockTransferDecrementation=Décrémenter les entrepôts sources
|
||||||
StockTransferIncrementation=Incrémenter les entrepôts de destination
|
StockTransferIncrementation=Incrémenter les entrepôts de destination
|
||||||
StockTransferDecrementationCancel=Annuler décrémentation des entrepôts sources
|
StockTransferDecrementationCancel=Annuler décrémentation des entrepôts sources
|
||||||
|
|||||||
@@ -223,6 +223,8 @@ class StockTransfer extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public function create(User $user, $notrigger = false)
|
public function create(User $user, $notrigger = false)
|
||||||
{
|
{
|
||||||
|
$model_pdf = GETPOST('model');
|
||||||
|
if(!empty($model_pdf)) $this->model_pdf = $model_pdf;
|
||||||
$this->status = (int) $this->status;
|
$this->status = (int) $this->status;
|
||||||
if ($this->fk_warehouse_source <= 0) $this->fk_warehouse_source = 0;
|
if ($this->fk_warehouse_source <= 0) $this->fk_warehouse_source = 0;
|
||||||
if ($this->fk_warehouse_destination <= 0) $this->fk_warehouse_destination = 0;
|
if ($this->fk_warehouse_destination <= 0) $this->fk_warehouse_destination = 0;
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/stocktransfer/class/stocktransfer.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/product/stock/stocktransfer/class/stocktransfer.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/stocktransfer/class/stocktransferline.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/product/stock/stocktransfer/class/stocktransferline.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/stocktransfer/lib/stocktransfer_stocktransfer.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/product/stock/stocktransfer/lib/stocktransfer_stocktransfer.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/modules/stocktransfer/modules_stocktransfer.php';
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array("stocks", "other", "productbatch", "companies"));
|
$langs->loadLangs(array("stocks", "other", "productbatch", "companies"));
|
||||||
@@ -420,6 +421,16 @@ if ($action == 'create') {
|
|||||||
// Common attributes
|
// Common attributes
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php';
|
||||||
|
|
||||||
|
// Template to use by default
|
||||||
|
print '<tr><td>'.$langs->trans('DefaultModel').'</td>';
|
||||||
|
print '<td>';
|
||||||
|
print img_picto('', 'pdf', 'class="pictofixedwidth"');
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/core/modules/commande/modules_commande.php';
|
||||||
|
$liste = ModelePDFStockTransfer::liste_modeles($db);
|
||||||
|
$preselected = $conf->global->STOCKTRANSFER_ADDON_PDF;
|
||||||
|
print $form->selectarray('model', $liste, $preselected, 0, 0, 0, '', 0, 0, 0, '', 'maxwidth200 widthcentpercentminusx', 1);
|
||||||
|
print "</td></tr>";
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user