Merge remote-tracking branch 'origin/3.4' into develop

Conflicts:
	.travis.yml
	htdocs/fourn/facture/index.php
This commit is contained in:
Laurent Destailleur 2013-09-09 20:00:12 +02:00
commit 1b526b7aa5
8 changed files with 378 additions and 130 deletions

View File

@ -121,6 +121,9 @@ Fix: Mailing module : if an email is already in destinaires list all other email
Fix: Localtaxes balance not showing Fix: Localtaxes balance not showing
Fix: Intervention box links to contracts id Fix: Intervention box links to contracts id
Fix: Compatiblity with multicompany module Fix: Compatiblity with multicompany module
Fix: Edit propal line was losing product supplier price id
Fix: Delete linked element to supplier invoice when deleted
Qual: Add travis-ci integration
***** ChangeLog for 3.4 compared to 3.3.* ***** ***** ChangeLog for 3.4 compared to 3.3.* *****
For users: For users:
@ -178,6 +181,7 @@ For users:
- Fix: [Bug #958] LocalTax2 for Spain fails on Suppliers - Fix: [Bug #958] LocalTax2 for Spain fails on Suppliers
- Fix: [ bug #972 ] Auto completion contact field do not take account the min caract number before search - Fix: [ bug #972 ] Auto completion contact field do not take account the min caract number before search
- Fix: [ bug #971 ] html.form.class.php select_contact with autocomplete do not exclude id from exclude array - Fix: [ bug #971 ] html.form.class.php select_contact with autocomplete do not exclude id from exclude array
- Fix: Expedition creation, can retreive product from other expedition
For translators: For translators:
- Update language files. - Update language files.

File diff suppressed because one or more lines are too long

View File

@ -2999,7 +2999,7 @@ class PropaleLigne extends CommonObject
if (empty($this->info_bits)) $this->info_bits=0; if (empty($this->info_bits)) $this->info_bits=0;
if (empty($this->special_code)) $this->special_code=0; if (empty($this->special_code)) $this->special_code=0;
if (empty($this->fk_parent_line)) $this->fk_parent_line=0; if (empty($this->fk_parent_line)) $this->fk_parent_line=0;
if (empty($this->fk_parent_line)) $this->fk_fournprice=0; if (empty($this->fk_fournprice)) $this->fk_fournprice=0;
if (empty($this->pa_ht)) $this->pa_ht=0; if (empty($this->pa_ht)) $this->pa_ht=0;

View File

@ -224,6 +224,7 @@ class Expedition extends CommonObject
$sql.= ", ".(!empty($this->model_pdf)?"'".$this->db->escape($this->model_pdf)."'":"null"); $sql.= ", ".(!empty($this->model_pdf)?"'".$this->db->escape($this->model_pdf)."'":"null");
$sql.= ")"; $sql.= ")";
dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG);
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)
{ {
@ -323,6 +324,7 @@ class Expedition extends CommonObject
$sql.= ", ".$qty; $sql.= ", ".$qty;
$sql.= ")"; $sql.= ")";
dol_syslog(get_class($this)."::create_line sql=".$sql, LOG_DEBUG);
if (! $this->db->query($sql)) if (! $this->db->query($sql))
{ {
$error++; $error++;

View File

@ -88,6 +88,8 @@ if ($action == 'add')
{ {
$error=0; $error=0;
$object = new Expedition($db);
$db->begin(); $db->begin();
$object->note = GETPOST('note','alpha'); $object->note = GETPOST('note','alpha');

View File

@ -656,6 +656,13 @@ class FactureFournisseur extends CommonInvoice
// Fin appel triggers // Fin appel triggers
} }
if (! $error)
{
// Delete linked object
$res = $this->deleteObjectLinked();
if ($res < 0) $error++;
}
if (! $error) if (! $error)
{ {
// We remove directory // We remove directory

View File

@ -313,27 +313,24 @@ function getInvoice($authentication,$id='',$ref='',$ref_ext='')
'invoice'=>array( 'invoice'=>array(
'id' => $invoice->id, 'id' => $invoice->id,
'ref' => $invoice->ref, 'ref' => $invoice->ref,
'ref_ext' => $invoice->ref_ext?$invoice->ref_ext:'', // If not defined, field is not added into soap 'ref_ext' => $invoice->ref_ext?$invoice->ref_ext:'', // If not defined, field is not added into soap
'fk_user_author' => $invoice->user_author?$invoice->user_author:'', 'fk_user_author' => $invoice->user_author?$invoice->user_author:'',
'fk_user_valid' => $invoice->user_valid?$invoice->user_valid:'', 'fk_user_valid' => $invoice->user_valid?$invoice->user_valid:'',
'date' => $invoice->date?dol_print_date($invoice->date,'dayrfc'):'', 'date' => $invoice->date?dol_print_date($invoice->date,'dayrfc'):'',
'date_creation' => $invoice->date_creation?dol_print_date($invoice->date_creation,'dayhourrfc'):'', 'date_creation' => $invoice->date_creation?dol_print_date($invoice->date_creation,'dayhourrfc'):'',
'date_validation' => $invoice->date_validation?dol_print_date($invoice->date_creation,'dayhourrfc'):'', 'date_validation' => $invoice->date_validation?dol_print_date($invoice->date_creation,'dayhourrfc'):'',
'date_modification' => $invoice->datem?dol_print_date($invoice->datem,'dayhourrfc'):'', 'date_modification' => $invoice->datem?dol_print_date($invoice->datem,'dayhourrfc'):'',
'type' => $invoice->type, 'type' => $invoice->type,
'total_net' => $invoice->total_ht, 'total_net' => $invoice->total_ht,
'total_vat' => $invoice->total_tva, 'total_vat' => $invoice->total_tva,
'total' => $invoice->total_ttc, 'total' => $invoice->total_ttc,
'note_private' => $invoice->note_private?$invoice->note_private:'', 'note_private' => $invoice->note_private?$invoice->note_private:'',
'note_public' => $invoice->note_public?$invoice->note_public:'', 'note_public' => $invoice->note_public?$invoice->note_public:'',
'status'=> $invoice->statut, 'status'=> $invoice->statut,
'close_code' => $invoice->close_code?$invoice->close_code:'', 'close_code' => $invoice->close_code?$invoice->close_code:'',
'close_note' => $invoice->close_note?$invoice->close_note:'', 'close_note' => $invoice->close_note?$invoice->close_note:'',
'lines' => $linesresp 'lines' => $linesresp
// 'lines' => array('0'=>array('id'=>222,'type'=>1), ));
// '1'=>array('id'=>333,'type'=>1))
));
} }
else else
{ {
@ -393,10 +390,6 @@ function getInvoicesForThirdParty($authentication,$idthirdparty)
$sql.='SELECT f.rowid as facid, facnumber as ref, ref_ext, type, fk_statut as status, total_ttc, total, tva'; $sql.='SELECT f.rowid as facid, facnumber as ref, ref_ext, type, fk_statut as status, total_ttc, total, tva';
$sql.=' FROM '.MAIN_DB_PREFIX.'facture as f'; $sql.=' FROM '.MAIN_DB_PREFIX.'facture as f';
//$sql.=', '.MAIN_DB_PREFIX.'societe as s';
//$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON pt.fk_product = p.rowid';
//$sql.=" WHERE f.fk_soc = s.rowid AND nom = '".$db->escape($idthirdparty)."'";
//$sql.=" WHERE f.fk_soc = s.rowid AND nom = '".$db->escape($idthirdparty)."'";
$sql.=" WHERE f.entity = ".$conf->entity; $sql.=" WHERE f.entity = ".$conf->entity;
if ($idthirdparty != 'all' ) $sql.=" AND f.fk_soc = ".$db->escape($idthirdparty); if ($idthirdparty != 'all' ) $sql.=" AND f.fk_soc = ".$db->escape($idthirdparty);
@ -414,55 +407,58 @@ function getInvoicesForThirdParty($authentication,$idthirdparty)
$invoice->fetch($obj->facid); $invoice->fetch($obj->facid);
// Sécurité pour utilisateur externe // Sécurité pour utilisateur externe
if( $socid && ( $socid != $order->socid) ) if( $socid && ( $socid != $invoice->socid) )
{ {
$error++; $error++;
$errorcode='PERMISSION_DENIED'; $errorlabel=$order->socid.' User does not have permission for this request'; $errorcode='PERMISSION_DENIED'; $errorlabel=$invoice->socid.' User does not have permission for this request';
} }
// Define lines of invoice if(!$error)
$linesresp=array(); {
foreach($invoice->lines as $line) // Define lines of invoice
{ $linesresp=array();
$linesresp[]=array( foreach($invoice->lines as $line)
'id'=>$line->rowid, {
'type'=>$line->product_type, $linesresp[]=array(
'total_net'=>$line->total_ht, 'id'=>$line->rowid,
'total_vat'=>$line->total_tva, 'type'=>$line->product_type,
'total'=>$line->total_ttc, 'total_net'=>$line->total_ht,
'vat_rate'=>$line->tva_tx, 'total_vat'=>$line->total_tva,
'qty'=>$line->qty, 'total'=>$line->total_ttc,
'product_ref'=>$line->product_ref, 'vat_rate'=>$line->tva_tx,
'product_label'=>$line->product_label, 'qty'=>$line->qty,
'product_desc'=>$line->product_desc, 'product_ref'=>$line->product_ref,
); 'product_label'=>$line->product_label,
} 'product_desc'=>$line->product_desc,
);
}
// Now define invoice // Now define invoice
$linesinvoice[]=array( $linesinvoice[]=array(
'id' => $invoice->id, 'id' => $invoice->id,
'ref' => $invoice->ref, 'ref' => $invoice->ref,
'ref_ext' => $invoice->ref_ext?$invoice->ref_ext:'', // If not defined, field is not added into soap 'ref_ext' => $invoice->ref_ext?$invoice->ref_ext:'', // If not defined, field is not added into soap
'fk_user_author' => $invoice->user_author?$invoice->user_author:'', 'fk_user_author' => $invoice->user_author?$invoice->user_author:'',
'fk_user_valid' => $invoice->user_valid?$invoice->user_valid:'', 'fk_user_valid' => $invoice->user_valid?$invoice->user_valid:'',
'date' => $invoice->date?dol_print_date($invoice->date,'dayrfc'):'', 'date' => $invoice->date?dol_print_date($invoice->date,'dayrfc'):'',
'date_due' => $invoice->date_lim_reglement?dol_print_date($invoice->date_lim_reglement,'dayrfc'):'', 'date_due' => $invoice->date_lim_reglement?dol_print_date($invoice->date_lim_reglement,'dayrfc'):'',
'date_creation' => $invoice->date_creation?dol_print_date($invoice->date_creation,'dayhourrfc'):'', 'date_creation' => $invoice->date_creation?dol_print_date($invoice->date_creation,'dayhourrfc'):'',
'date_validation' => $invoice->date_validation?dol_print_date($invoice->date_creation,'dayhourrfc'):'', 'date_validation' => $invoice->date_validation?dol_print_date($invoice->date_creation,'dayhourrfc'):'',
'date_modification' => $invoice->datem?dol_print_date($invoice->datem,'dayhourrfc'):'', 'date_modification' => $invoice->datem?dol_print_date($invoice->datem,'dayhourrfc'):'',
'type' => $invoice->type, 'type' => $invoice->type,
'total_net' => $invoice->total_ht, 'total_net' => $invoice->total_ht,
'total_vat' => $invoice->total_tva, 'total_vat' => $invoice->total_tva,
'total' => $invoice->total_ttc, 'total' => $invoice->total_ttc,
'note_private' => $invoice->note_private?$invoice->note_private:'', 'note_private' => $invoice->note_private?$invoice->note_private:'',
'note_public' => $invoice->note_public?$invoice->note_public:'', 'note_public' => $invoice->note_public?$invoice->note_public:'',
'status'=> $invoice->statut, 'status'=> $invoice->statut,
'close_code' => $invoice->close_code?$invoice->close_code:'', 'close_code' => $invoice->close_code?$invoice->close_code:'',
'close_note' => $invoice->close_note?$invoice->close_note:'', 'close_note' => $invoice->close_note?$invoice->close_note:'',
'lines' => $linesresp 'lines' => $linesresp
); );
}
$i++; $i++;
} }
$objectresp=array( $objectresp=array(