Skip to content

Commit

Permalink
Merge pull request #5360 from GPCsolutions/5350
Browse files Browse the repository at this point in the history
Fix #5350 date_pointoftax prevented creating invoices
  • Loading branch information
eldy committed Jun 16, 2016
2 parents 255867b + eb54c3f commit f45fcc9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion htdocs/compta/facture/class/facture.class.php
Expand Up @@ -358,7 +358,7 @@ function create($user,$notrigger=0,$forceduedate=0)
$sql.= ", ".($this->remise_absolue>0?$this->remise_absolue:'NULL');
$sql.= ", ".($this->remise_percent>0?$this->remise_percent:'NULL');
$sql.= ", '".$this->db->idate($this->date)."'";
$sql.= ", '".$this->db->idate($this->date_pointoftax)."'";
$sql.= ", ".(strval($this->date_pointoftax)!='' ? "'".$this->db->idate($this->date_pointoftax)."'" : 'null');
$sql.= ", ".($this->note_private?"'".$this->db->escape($this->note_private)."'":"null");
$sql.= ", ".($this->note_public?"'".$this->db->escape($this->note_public)."'":"null");
$sql.= ", ".($this->ref_client?"'".$this->db->escape($this->ref_client)."'":"null");
Expand Down
4 changes: 2 additions & 2 deletions htdocs/install/mysql/migration/3.9.0-4.0.0.sql
Expand Up @@ -111,7 +111,7 @@ ALTER TABLE llx_cronjob ADD COLUMN test varchar(255) DEFAULT '1';

ALTER TABLE llx_facture ADD INDEX idx_facture_fk_statut (fk_statut);

ALTER TABLE llx_facture ADD COLUMN date_pointoftax date;
ALTER TABLE llx_facture ADD COLUMN date_pointoftax date DEFAULT NULL;

UPDATE llx_projet as p set p.opp_percent = (SELECT percent FROM llx_c_lead_status as cls WHERE cls.rowid = p.fk_opp_status) WHERE p.opp_percent IS NULL AND p.fk_opp_status IS NOT NULL;

Expand Down Expand Up @@ -506,4 +506,4 @@ CREATE TABLE llx_oauth_state (
entity integer
)ENGINE=InnoDB;

ALTER TABLE llx_import_model MODIFY COLUMN type varchar(50);
ALTER TABLE llx_import_model MODIFY COLUMN type varchar(50);
2 changes: 1 addition & 1 deletion htdocs/install/mysql/tables/llx_facture.sql
Expand Up @@ -38,7 +38,7 @@ create table llx_facture
fk_soc integer NOT NULL,
datec datetime, -- date de creation de la facture
datef date, -- date invoice
date_pointoftax date, -- date point of tax (for GB)
date_pointoftax date DEFAULT NULL, -- date point of tax (for GB)
date_valid date, -- date validation
tms timestamp, -- date creation/modification
paye smallint DEFAULT 0 NOT NULL,
Expand Down

0 comments on commit f45fcc9

Please sign in to comment.