Merge branch 'develop' of https://github.com/Dolibarr/dolibarr into FIX_inventory
This commit is contained in:
commit
428e16341c
@ -42,15 +42,25 @@ $langs->load("members");
|
||||
if (! $user->admin) accessforbidden();
|
||||
|
||||
$action = GETPOST('action','alpha');
|
||||
$cancel = GETPOST('cancel','alpha');
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($cancel) {
|
||||
$action='';
|
||||
}
|
||||
|
||||
if ($action == 'update')
|
||||
{
|
||||
dolibarr_set_const($db, "MAIN_PDF_FORMAT", $_POST["MAIN_PDF_FORMAT"],'chaine',0,'',$conf->entity);
|
||||
|
||||
|
||||
dolibarr_set_const($db, "MAIN_PDF_MARGIN_LEFT", $_POST["MAIN_PDF_MARGIN_LEFT"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_PDF_MARGIN_RIGHT", $_POST["MAIN_PDF_MARGIN_RIGHT"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_PDF_MARGIN_TOP", $_POST["MAIN_PDF_MARGIN_TOP"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_PDF_MARGIN_BOTTOM", $_POST["MAIN_PDF_MARGIN_BOTTOM"],'chaine',0,'',$conf->entity);
|
||||
|
||||
dolibarr_set_const($db, "MAIN_PROFID1_IN_ADDRESS", $_POST["MAIN_PROFID1_IN_ADDRESS"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_PROFID2_IN_ADDRESS", $_POST["MAIN_PROFID2_IN_ADDRESS"],'chaine',0,'',$conf->entity);
|
||||
@ -133,7 +143,20 @@ if ($action == 'edit') // Edit
|
||||
print $formadmin->select_paper_format($selected,'MAIN_PDF_FORMAT');
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_MARGIN_LEFT").'</td><td>';
|
||||
print '<input type="text" class="maxwidth50" name="MAIN_PDF_MARGIN_LEFT" value="'.(empty($conf->global->MAIN_PDF_MARGIN_LEFT)?10:$conf->global->MAIN_PDF_MARGIN_LEFT).'">';
|
||||
print '</td></tr>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_MARGIN_RIGHT").'</td><td>';
|
||||
print '<input type="text" class="maxwidth50" name="MAIN_PDF_MARGIN_RIGHT" value="'.(empty($conf->global->MAIN_PDF_MARGIN_RIGHT)?10:$conf->global->MAIN_PDF_MARGIN_RIGHT).'">';
|
||||
print '</td></tr>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_MARGIN_TOP").'</td><td>';
|
||||
print '<input type="text" class="maxwidth50" name="MAIN_PDF_MARGIN_TOP" value="'.(empty($conf->global->MAIN_PDF_MARGIN_TOP)?10:$conf->global->MAIN_PDF_MARGIN_TOP).'">';
|
||||
print '</td></tr>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_MARGIN_BOTTOM").'</td><td>';
|
||||
print '<input type="text" class="maxwidth50" name="MAIN_PDF_MARGIN_BOTTOM" value="'.(empty($conf->global->MAIN_PDF_MARGIN_BOTTOM)?10:$conf->global->MAIN_PDF_MARGIN_BOTTOM).'">';
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
@ -270,7 +293,9 @@ if ($action == 'edit') // Edit
|
||||
print '</table>';
|
||||
|
||||
print '<br><div class="center">';
|
||||
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">';
|
||||
print '<input class="button" type="submit" name="save" value="'.$langs->trans("Save").'">';
|
||||
print ' ';
|
||||
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
@ -314,6 +339,20 @@ else // Show
|
||||
print $pdfformatlabel;
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_MARGIN_LEFT").'</td><td>';
|
||||
print empty($conf->global->MAIN_PDF_MARGIN_LEFT)?10:$conf->global->MAIN_PDF_MARGIN_LEFT;
|
||||
print '</td></tr>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_MARGIN_RIGHT").'</td><td>';
|
||||
print empty($conf->global->MAIN_PDF_MARGIN_RIGHT)?10:$conf->global->MAIN_PDF_MARGIN_RIGHT;
|
||||
print '</td></tr>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_MARGIN_TOP").'</td><td>';
|
||||
print empty($conf->global->MAIN_PDF_MARGIN_TOP)?10:$conf->global->MAIN_PDF_MARGIN_TOP;
|
||||
print '</td></tr>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_MARGIN_BOTTOM").'</td><td>';
|
||||
print empty($conf->global->MAIN_PDF_MARGIN_BOTTOM)?10:$conf->global->MAIN_PDF_MARGIN_BOTTOM;
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
@ -90,6 +90,8 @@ class DolibarrApi
|
||||
// Remove linkedObjects. We should already have linkedObjectIds that avoid huge responses
|
||||
unset($object->linkedObjects);
|
||||
|
||||
unset($object->fields);
|
||||
|
||||
unset($object->oldline);
|
||||
|
||||
unset($object->error);
|
||||
|
||||
@ -48,7 +48,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
|
||||
* $object->actionmsg (note, long text)
|
||||
* $object->actionmsg2 (label, short text)
|
||||
* $object->sendtoid (id of contact or array of ids)
|
||||
* $object->socid
|
||||
* $object->socid (id of thirdparty)
|
||||
* $object->fk_project
|
||||
* $object->fk_element
|
||||
* $object->elementtype
|
||||
|
||||
@ -96,11 +96,11 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (80
|
||||
|
||||
-- FRANCE (id country=1)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 11, 1, '20','0','VAT standard rate (France hors DOM-TOM)',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,code,recuperableonly,note,active) values ( 12, 1, '8.5', '8.5', '0','VAT standard rate (DOM sauf Guyane et Saint-Martin)',0);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 14, 1, '5.5','0','VAT reduced rate (France hors DOM-TOM)',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 15, 1, '0','0','VAT Rate 0 ou non applicable',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 16, 1, '2.1','0','VAT super-reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 17, 1, '10','0','VAT reduced rate',1);
|
||||
insert into llx_c_tva(fk_pays,taux,code,recuperableonly,note,active) values (1, '8.5', '85', '0','VAT standard rate (DOM sauf Guyane et Saint-Martin)',0);
|
||||
insert into llx_c_tva(fk_pays,taux,code,recuperableonly,note,active) values (1, '8.5', '85NPR', '1','VAT standard rate (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0);
|
||||
insert into llx_c_tva(fk_pays,taux,code,recuperableonly,localtax1,localtax1_type,note,active) values (1, '8.5', '85NPROM', '1', 2, 3, 'VAT standard rate (DOM sauf Guyane et Saint-Martin), NPR, Octroi de Mer',0);
|
||||
insert into llx_c_tva(fk_pays,taux,code,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values (1, '8.5', '85NPROMOMR', '1', 2, 3, 2.5, 3, 'VAT standard rate (DOM sauf Guyane et Saint-Martin), NPR, Octroi de Mer et Octroi de Mer Regional',0);
|
||||
|
||||
@ -141,6 +141,8 @@ ALTER TABLE llx_societe_remise_except ADD CONSTRAINT fk_soc_remise_fk_invoice_su
|
||||
ALTER TABLE llx_societe_remise_except ADD CONSTRAINT fk_societe_remise_fk_invoice_supplier FOREIGN KEY (fk_invoice_supplier) REFERENCES llx_facture_fourn (rowid);
|
||||
ALTER TABLE llx_societe_remise_except ADD CONSTRAINT fk_societe_remise_fk_invoice_supplier_source FOREIGN KEY (fk_invoice_supplier) REFERENCES llx_facture_fourn (rowid);
|
||||
|
||||
ALTER TABLE llx_facture_rec ADD COLUMN vat_src_code varchar(10) DEFAULT '';
|
||||
|
||||
UPDATE llx_const set value='moono-lisa' where value = 'moono' AND name = 'FCKEDITOR_SKIN';
|
||||
|
||||
ALTER TABLE llx_product_price ADD COLUMN default_vat_code varchar(10) after tva_tx;
|
||||
@ -227,9 +229,9 @@ fk_inventory integer DEFAULT 0,
|
||||
fk_warehouse integer DEFAULT 0,
|
||||
fk_product integer DEFAULT 0,
|
||||
batch varchar(30) DEFAULT NULL,
|
||||
qty_view double DEFAULT 0,
|
||||
qty_stock double DEFAULT 0,
|
||||
qty_regulated double DEFAULT 0,
|
||||
qty_view double DEFAULT NULL,
|
||||
qty_stock double DEFAULT NULL,
|
||||
qty_regulated double DEFAULT NULL,
|
||||
pmp double DEFAULT 0,
|
||||
pa double DEFAULT 0,
|
||||
new_pmp double DEFAULT 0
|
||||
@ -240,4 +242,9 @@ ALTER TABLE llx_inventory ADD INDEX idx_inventory_tms (tms);
|
||||
ALTER TABLE llx_inventory ADD INDEX idx_inventory_datec (datec);
|
||||
ALTER TABLE llx_inventorydet ADD INDEX idx_inventorydet_tms (tms);
|
||||
ALTER TABLE llx_inventorydet ADD INDEX idx_inventorydet_datec (datec);
|
||||
ALTER TABLE llx_inventorydet ADD INDEX idx_inventorydet_fk_inventory (fk_inventory);
|
||||
ALTER TABLE llx_inventorydet ADD INDEX idx_inventorydet_fk_inventory (fk_inventory);
|
||||
|
||||
insert into llx_c_tva(fk_pays,taux,code,recuperableonly,note,active) values (1, '8.5', '85', '0','VAT standard rate (DOM sauf Guyane et Saint-Martin)',0);
|
||||
insert into llx_c_tva(fk_pays,taux,code,recuperableonly,note,active) values (1, '8.5', '85NPR', '1','VAT standard rate (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0);
|
||||
insert into llx_c_tva(fk_pays,taux,code,recuperableonly,localtax1,localtax1_type,note,active) values (1, '8.5', '85NPROM', '1', 2, 3, 'VAT standard rate (DOM sauf Guyane et Saint-Martin), NPR, Octroi de Mer',0);
|
||||
insert into llx_c_tva(fk_pays,taux,code,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values (1, '8.5', '85NPROMOMR', '1', 2, 3, 2.5, 3, 'VAT standard rate (DOM sauf Guyane et Saint-Martin), NPR, Octroi de Mer et Octroi de Mer Regional',0);
|
||||
|
||||
@ -32,6 +32,7 @@ create table llx_facture_rec
|
||||
remise_percent real DEFAULT 0,
|
||||
remise_absolue real DEFAULT 0,
|
||||
|
||||
vat_src_code varchar(10) DEFAULT '', -- Vat code used as source of vat fields. Not strict foreign key here.
|
||||
tva double(24,8) DEFAULT 0,
|
||||
localtax1 double(24,8) DEFAULT 0, -- amount localtax1
|
||||
localtax2 double(24,8) DEFAULT 0, -- amount localtax2
|
||||
|
||||
@ -25,10 +25,10 @@ tms timestamp,
|
||||
fk_inventory integer DEFAULT 0,
|
||||
fk_warehouse integer DEFAULT 0,
|
||||
fk_product integer DEFAULT 0,
|
||||
batch varchar(30) DEFAULT NULL, -- Lot or serial number
|
||||
qty_view double DEFAULT 0,
|
||||
qty_stock double DEFAULT 0,
|
||||
qty_regulated double DEFAULT 0,
|
||||
batch varchar(30) DEFAULT NULL, -- Lot or serial number
|
||||
qty_view double DEFAULT NULL, -- must be filled once regulation is done
|
||||
qty_stock double DEFAULT NULL, -- can be filled during draft edition
|
||||
qty_regulated double DEFAULT NULL, -- must be filled once regulation is done
|
||||
pmp double DEFAULT 0,
|
||||
pa double DEFAULT 0,
|
||||
new_pmp double DEFAULT 0
|
||||
|
||||
@ -41,11 +41,12 @@ if (! isset($argv[1]) || ! $argv[1]) {
|
||||
exit(-1);
|
||||
}
|
||||
$id=$argv[1];
|
||||
if (! isset($argv[2]) || !empty($argv[2])) $login = $argv[2];
|
||||
if (isset($argv[2]) || !empty($argv[2])) $login = $argv[2];
|
||||
else $login = '';
|
||||
|
||||
require_once ($path."../../htdocs/master.inc.php");
|
||||
require_once (DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php");
|
||||
require_once (DOL_DOCUMENT_ROOT."/comm/mailing/class/mailing.class.php");
|
||||
|
||||
|
||||
// Global variables
|
||||
@ -70,9 +71,8 @@ $user = new User($db);
|
||||
// for signature, we use user send as parameter
|
||||
if (! empty($login)) $user->fetch('',$login);
|
||||
|
||||
// We get list of emailing to process
|
||||
$sql = "SELECT m.rowid, m.titre, m.sujet, m.body,";
|
||||
$sql.= " m.email_from, m.email_replyto, m.email_errorsto";
|
||||
// We get list of emailing id to process
|
||||
$sql = "SELECT m.rowid";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."mailing as m";
|
||||
$sql.= " WHERE m.statut IN (1,2)";
|
||||
if ($id != 'all')
|
||||
@ -96,12 +96,15 @@ if ($resql)
|
||||
dol_syslog("Process mailing with id ".$obj->rowid);
|
||||
print "Process mailing with id ".$obj->rowid."\n";
|
||||
|
||||
$id = $obj->rowid;
|
||||
$subject = $obj->sujet;
|
||||
$message = $obj->body;
|
||||
$from = $obj->email_from;
|
||||
$replyto = $obj->email_replyto;
|
||||
$errorsto = $obj->email_errorsto;
|
||||
$emailing = new Mailing($db);
|
||||
$emailing->fetch($obj->rowid);
|
||||
|
||||
$id = $emailing->id;
|
||||
$subject = $emailing->sujet;
|
||||
$message = $emailing->body;
|
||||
$from = $emailing->email_from;
|
||||
$replyto = $emailing->email_replyto;
|
||||
$errorsto = $emailing->email_errorsto;
|
||||
// Le message est-il en html
|
||||
$msgishtml=-1; // Unknown by default
|
||||
if (preg_match('/[\s\t]*<html>/i',$message)) $msgishtml=1;
|
||||
@ -232,6 +235,24 @@ if ($resql)
|
||||
|
||||
dol_syslog("ok for emailing id ".$id." #".$i.($mail->error?' - '.$mail->error:''), LOG_DEBUG);
|
||||
|
||||
// Note: If emailing is 100 000 targets, 100 000 entries are added, so we don't enter events for each target here
|
||||
// We must union table llx_mailing_taget for event tab OR enter 1 event with a special table link (id of email in event)
|
||||
// Run trigger
|
||||
/*
|
||||
if ($obj2->source_type == 'contact')
|
||||
{
|
||||
$emailing->sendtoid = $obj2->source_id;
|
||||
}
|
||||
if ($obj2->source_type == 'thirdparty')
|
||||
{
|
||||
$emailing->socid = $obj2->source_id;
|
||||
}
|
||||
// Call trigger
|
||||
$result=$emailing->call_trigger('EMAILING_SENTBYMAIL',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
*/
|
||||
|
||||
$sqlok ="UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
|
||||
$sqlok.=" SET statut=1, date_envoi='".$db->idate($now)."' WHERE rowid=".$obj2->rowid;
|
||||
$resqlok=$db->query($sqlok);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user