Merge remote-tracking branch 'Upstream/3.7' into 3.7-accountancy

This commit is contained in:
aspangaro 2015-11-16 06:50:04 +01:00
commit 06f752b250
21 changed files with 288 additions and 57 deletions

141
ChangeLog
View File

@ -8,25 +8,94 @@ You may also experience troubles with Mysql 5.5.41 with error "Lost connection"
Upgrading to any other version or database system is abolutely required BEFORE trying to Upgrading to any other version or database system is abolutely required BEFORE trying to
make a Dolibarr upgrade. make a Dolibarr upgrade.
***** ChangeLog for 3.7.2 compared to 3.7.1 ***** ***** ChangeLog for 3.7.2 compared to 3.7.1 *****
FIX [ bug #2855 ] Wrong translation key in localtax report page FIX: #2957 : missing $langs object for trigger
FIX [ bug #1852 ] JS error when editing a customer order line FIX: #2983 Load gravatar avatar images securely over HTTPS
FIX [ bug #2900 ] Courtesy title is not stored in create thirdparty form FIX: #3009: Better filtering to prevent SQL injection
FIX [ bug #3055 ] Product image thumbnails were not deleted after deleting the image FIX: #3091 TotalHT amount in supplier order is bold unlike the rest of Dolibarr
FIX [ bug 1634 ] Error deleting a project when it had many linked objects FIX: #3262 Webservice getProductsForCategory()
FIX [ bug 1925 ] "Link to order" option in supplier invoices is not working properly FIX: #3318
FIX [ bug #3198 ] Trigger LINECONTRACT_INSERT passes Contrat as $object instead of ContratLigne FIX: [ #3460 ] Selected bank account was not saved when an error happened when trying to create a customer invoice
FIX: Not showing delivery date on rouget pdf FIX: #3530
FIX: #3630 - Wrong balance report when module salaries and donation disabled
FIX: #3679 Error when deleting a Localtax2 special payment
FIX: #3707 Thirdparty bank account page table has a glitch
FIX: #3724 Bug: Blank page after cloning proposal with changed client
FIX: #3836 Unable to upload a document to an invoice under some circunstances
FIX: #3841 creation of a task completed has not status set to finished by default
FIX: Add a protection to not make release if ChangeLog was not generated.
FIX: adjusted test for affecting supplier reference
FIX: Admin fiche inter page do not take good action
FIX: Avoid warning strict mode when hosting server do not have php5_curl installed
FIX: bad calculation for stock value
FIX: Bad condition into invoice export request making reporting too many rows.
FIX: bad stock valorisation
FIX: Bad visualization of suppliers name on Incomes-Expenses mode
FIX: Better management error into the color conversion functions
FIX: [ bug 1634 ] Error deleting a project when it had many linked objects
FIX: [ bug 1925 ] "Link to order" option in supplier invoices is not working properly
FIX: [ bug #2893 ] Dolibarr error when viewing an invoice after changing invoice mask
FIX: [ bug #3211 ] Error about sold to pay (Montant encours)
FIX: [ bug #3321 ] Users with certain permissions were shown a "forbidden access" page even if they had the rights
FIX: [ bug #3358 ] Tasks box does not work with PostgreSQL
FIX: [ bug #3383 ] Company name is overlapped with company direction in PDF models
FIX: [ bug #3426 ] Unable to create an invoice from a contract with extrafields
FIX: [ bug #3431 ] Invoice bank account is not respected
FIX: [ bug #3432 ] Spaces should be removed from IBAN when formatting it
FIX: Can create Proposal on close thridparty #3526
FIX: change order date on clone (as everywhere else)
FIX: Close #2835 Customer prices of a product shows incorrect history order
FIX: Close #2837 Product list table column header does not match column body
FIX: Close bug #2855 Wrong translation key in localtax report page
FIX: Close bug #2861 Undefined variable $res when migrating from 3.6.2 to 3.7.0
FIX: Close bug #2891 Category hooks do not work
FIX: Close bug #2900 Courtesy title is not stored in create thirdparty form
FIX: Close bug #2976: "Report" tab is the current tab but it is not marked as selected by the UI
FIX: contact country had wrong display if the country dont have translate
FIX: Display country name instead of country id (display country id makes no sense on vcard files)
FIX: display error on extrafields on ficheinter
FIX: double db escape add too quote
FIX: Email selector contact must not include inactive contact
FIX: End log must use same level then start log.
FIX: error in SQL due to a previous fix
FIX: event's data lost on user assign update
FIX: Export of tags for contact and member
FIX: facturestat bad sql when customer view is limited
FIX: if multicompany enabled, call to undifend method _setCookie instead of setCookie
FIX: If supplier invoice block linked element is display after other block total HT amount is not reset to 0 and sum other block (like customer orders values)
FIX: keep filter by category or by not enough stock if we switch page
FIX: Line break display as a block
FIX: load propal langs for availability traduction
FIX: loss data also if update was cancel by error of ended state with no end date, try a generic patch
FIX: Mass Mailing activity don't display all status
FIX: Missing to set context into workflow actions, so triggers can't know we are creating an invoice from order or an order from a proposal.
FIX: multientity warehouse management
FIX: New adherent from, always redirect on entity
FIX: No check warehouse is provided if module stock is not enabled.
FIX: no need to remove file into mail form, the temp dir will be deleted after any sending
FIX: no projet_task_time id from trigger TASK_TIMESPENT_CREATE
FIX: Not showing task extrafields when creating from left menu FIX: Not showing task extrafields when creating from left menu
FIX [ bug #3288 ] Tasks box is not properly drawn FIX: only active customer should be return into new invoice creation select list
FIX [ bug #3211 ] Outstading bill amount of a client showed wrong amounts FIX: Payed invoices are showed as canceled FIX: Bad date filter on customer order
FIX [ bug #3321 ] Users with certain permissions were shown a "forbidden access" page even if they had the rights FIX: WAP calculation
FIX [ bug #3426 ] Unable to create an invoice from a contract with extrafields FIX: Save of filters into export profiles failed.
FIX [ bug #3431 ] Invoice bank account is not respected FIX: supplier rights for orderToInvoice
FIX [ bug #3432 ] Spaces should be removed from IBAN when formatting it FIX: Syntax error in Debian Apache configuration
FIX [ bug #3358 ] Tasks box does not work with PostgreSQL FIX: The hours of date filter aren't correct
FIX [ bug #3383 ] Company name is overlapped with company direction in PDF models FIX: tool export handle the type "select" extrafields and return the value instead of id
FIX [ bug #3460 ] Bank account is not saved when creating a customer invoice and facing an error message FIX: total amount in tpl linked object are not reset
FIX: translate Jabberid on contact page with edit view
FIX: translation for 1 word do not work if product/service module are disabled because the translation search in products.lang
FIX: update2.php test res befre assign it
FIX: When delete actioncomm also delete actioncomm_resources
FIX: when fetch_optionnal_by_label in Extrafields with $this->db cannot work because this->db is never instanciated
FIX: when mailing is deleted, the targets list was kept in database
FIX: when multicompany was enabled, this function didn't check just on the good entity (problem when both company use same mask)
FIX: When we add an user on event in create mode, we lose linked object
FIX: When we automatically creta an order from a proposal with workflow module, if some extrafields of propal don't exist in order object, insertExtraFields() function tries to insert extrafields in unexistant column of commande_extrafields table.
FIX: When we clone a propal, if it has a project which is not assigned to a third, it was not on new propal because fk_project was always set to empty string if new propal is for another third.
FIX: XSS security using the onerror and missing escapement on type of member page.
NEW: Created new ContratLigne::insert function NEW: Created new ContratLigne::insert function
@ -246,9 +315,43 @@ Dolibarr better:
warehouse module and your Point Of Sale module setup if you use one. warehouse module and your Point Of Sale module setup if you use one.
- Replaced USER_UPDATE_SESSION trigger with an updateSession hook may break modules using it. - Replaced USER_UPDATE_SESSION trigger with an updateSession hook may break modules using it.
***** ChangeLog for 3.6.5 compared to 3.6.4 ***** ***** ChangeLog for 3.6.5 compared to 3.6.4 *****
- Fix: [ bug #1776 ] Undefined $deliverycompany variable in pdf_build_address FIX: #2957 : missing $langs object for trigger
- Fix: [ bug #1794 ] Error when cloning Proposal gives error in a malformed page FIX: #2983 Load gravatar avatar images securely over HTTPS
FIX: #3009: Better filtering to prevent SQL injection
FIX: #3841 creation of a task completed has not status set to finished by default
FIX: #3890 Expected transactions bank account page, shows negative numbers
FIX: #3928 Creating a Customer order and a Customer invoice from a project, does not inherit payment conditions and method of payment of customer card
FIX: bad calculation for stock value
FIX: bad stock valo
FIX: bad stock valorisation
FIX: [ bug #2893 ] Dolibarr error when viewing an invoice after changing invoice mask
FIX: button create payment hide if tax amount is less than 1
FIX: change object statut on close shipping and remove erratic db commit
FIX: change order date on clone (as everywhere else)
FIX: Close #2835 Customer prices of a product shows incorrect history order
FIX: Close #2837 Product list table column header does not match column body
FIX: Close bug #2861 Undefined variable $res when migrating from 3.6.2 to 3.7.0
FIX: Close bug #2891 Category hooks do not work
FIX: Close bug #2976: "Report" tab is the current tab but it is not marked as selected by the UI
FIX: contact country had wrong display if the country dont have translate
FIX: double db escape add too quote
FIX: End log must use same level then start log.
FIX: error in SQL due to a previous fix
FIX: event for restricted user was restricted if company null
FIX: facturestat bad sql when customer view is limited
FIX: If supplier invoice block linked element is display after other block total HT amount is not reset to 0 and sum other block (like customer orders values)
FIX: keep filter by category or by not enough stock if we switch page
FIX: no need to remove file into mail form, the temp dir will be deleted after any sending
FIX: no projet_task_time id from trigger TASK_TIMESPENT_CREATE
FIX: pmp
FIX: send mail, copy sendto don't read the list of contact
FIX: The hours of date filter aren't correct
FIX: tool export handle the type "select" extrafields and return the value instead of id
FIX: top links menu have target attribute with wrong value
FIX: total amount in tpl linked object are not reset
FIX: when multicompany was enabled, this function didn't check just on the good entity (problem when both company use same mask)
***** ChangeLog for 3.6.4 compared to 3.6.3 ***** ***** ChangeLog for 3.6.4 compared to 3.6.3 *****
- Fix: [ bug #2893 ] Dolibarr error when viewing an invoice after changing invoice mask - Fix: [ bug #2893 ] Dolibarr error when viewing an invoice after changing invoice mask

View File

@ -22,7 +22,8 @@ $PUBLISHSTABLE="eldy,dolibarr\@frs.sourceforge.net:/home/frs/project/dolibarr";
$PUBLISHBETARC="ldestailleur\@asso.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files"; $PUBLISHBETARC="ldestailleur\@asso.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files";
@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages #@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
%REQUIREMENTPUBLISH=( %REQUIREMENTPUBLISH=(
"SF"=>"git ssh rsync", "SF"=>"git ssh rsync",
"ASSO"=>"git ssh rsync" "ASSO"=>"git ssh rsync"
@ -344,6 +345,28 @@ if ($nboftargetok) {
print "Go to directory $SOURCE\n"; print "Go to directory $SOURCE\n";
$olddir=getcwd(); $olddir=getcwd();
chdir("$SOURCE"); chdir("$SOURCE");
# Test that the ChangeLog is ok
$ret=`grep "ChangeLog for $MAJOR.$MINOR\.$BUILD" "$SOURCE/ChangeLog" 2>&1`;
if (! $ret)
{
print "Error: The ChangeLogFile was not updated. Run the following command first:\n";
if (! $BUILD)
{
print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log `git rev-list --boundary '.$MAJOR.'.'.$MINOR.'..origin/develop`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e \'^FIX\|NEW\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa';
}
else
{
print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log '.$MAJOR.'.'.$MINOR.'.'.($BUILD-1).'.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e \'^FIX\|NEW\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa';
}
print "\n";
exit;
}
else
{
print "ChangeLog for $MAJOR.$MINOR\.$BUILD was found into '$SOURCE/ChangeLog'\n";
}
print 'Run git tag -a -m "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'" "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'"'."\n"; print 'Run git tag -a -m "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'" "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'"'."\n";
$ret=`git tag -a -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD" 2>&1`; $ret=`git tag -a -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD" 2>&1`;
if ($ret =~ /already exists/) if ($ret =~ /already exists/)

View File

@ -1,7 +1,7 @@
<?PHP <?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -19,7 +19,7 @@
/** /**
* \file htdocs/accountancy/customer/card.php * \file htdocs/accountancy/customer/card.php
* \ingroup Accounting Expert * \ingroup Accountancy
* \brief Card customer ventilation * \brief Card customer ventilation
*/ */
@ -84,7 +84,11 @@ if (! empty($id)) {
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON l.fk_code_ventilation = aa.rowid"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON l.fk_code_ventilation = aa.rowid";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = l.fk_facture"; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = l.fk_facture";
$sql .= " WHERE f.fk_statut > 0 AND l.rowid = " . $id; $sql .= " WHERE f.fk_statut > 0";
$sql .= " AND l.rowid = " . $id;
if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = '" . $conf->entity . "'";
}
if (! empty($conf->multicompany->enabled)) { if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = '" . $conf->entity . "'"; $sql .= " AND f.entity = '" . $conf->entity . "'";

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com> * Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
@ -21,7 +21,7 @@
/** /**
* \file htdocs/accountancy/customer/list.php * \file htdocs/accountancy/customer/list.php
* \ingroup Accounting Expert * \ingroup Accountancy
* \brief Ventilation page from customers invoices * \brief Ventilation page from customers invoices
*/ */
@ -121,7 +121,7 @@ if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
$offset = $limit * $page; $offset = $limit * $page;
$sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.total_ht, l.rowid, l.fk_code_ventilation,"; $sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.total_ht, l.rowid, l.fk_code_ventilation, l.product_type,";
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_sell as code_sell"; $sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_sell as code_sell";
$sql .= " , aa.rowid as aarowid"; $sql .= " , aa.rowid as aarowid";
$sql .= " FROM " . MAIN_DB_PREFIX . "facture as f"; $sql .= " FROM " . MAIN_DB_PREFIX . "facture as f";
@ -129,7 +129,9 @@ $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as l ON f.rowid = l.fk_fac
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON p.accountancy_code_sell = aa.account_number"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON p.accountancy_code_sell = aa.account_number";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version";
$sql .= " WHERE f.fk_statut > 0 AND fk_code_ventilation <= 0"; $sql .= " WHERE f.fk_statut > 0";
$sql .= " AND fk_code_ventilation <= 0";
$sql .= " AND product_type <= 2";
$sql .= " AND (accsys.rowid='" . $conf->global->CHARTOFACCOUNTS . "' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_sell ='')"; $sql .= " AND (accsys.rowid='" . $conf->global->CHARTOFACCOUNTS . "' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_sell ='')";
if (! empty($conf->multicompany->enabled)) { if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = '" . $conf->entity . "'"; $sql .= " AND f.entity = '" . $conf->entity . "'";

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com> * Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> * Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
@ -22,7 +22,7 @@
*/ */
/** /**
* \file htdocs/accountancy/supplier/card.php * \file htdocs/accountancy/supplier/card.php
* \ingroup Accounting Expert * \ingroup Accountancy
* \brief Card supplier ventilation * \brief Card supplier ventilation
*/ */
@ -85,7 +85,8 @@ if ($_GET["id"]) {
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON l.fk_code_ventilation = aa.rowid"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON l.fk_code_ventilation = aa.rowid";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn as f ON f.rowid = l.fk_facture_fourn "; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn as f ON f.rowid = l.fk_facture_fourn ";
$sql .= " WHERE f.fk_statut > 0 AND l.rowid = " . $id; $sql .= " WHERE f.fk_statut > 0";
$sql .= " AND l.rowid = " . $id;
if (! empty($conf->multicompany->enabled)) { if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = '" . $conf->entity . "'"; $sql .= " AND f.entity = '" . $conf->entity . "'";
} }

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com> * Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>s * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>s
@ -21,7 +21,7 @@
/** /**
* \file htdocs/accountancy/supplier/list.php * \file htdocs/accountancy/supplier/list.php
* \ingroup Accounting Expert * \ingroup Accountancy
* \brief Ventilation page from suppliers invoices * \brief Ventilation page from suppliers invoices
*/ */
@ -124,16 +124,17 @@ if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
$offset = $limit * $page; $offset = $limit * $page;
$sql = "SELECT f.ref, f.rowid as facid, f.ref_supplier, l.fk_product, l.description, l.total_ht as price, l.rowid, l.fk_code_ventilation, "; $sql = "SELECT f.ref, f.rowid as facid, f.ref_supplier, l.fk_product, l.description, l.total_ht as price, l.rowid, l.fk_code_ventilation, l.product_type,";
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_buy as code_buy"; $sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_buy as code_buy";
$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f"; $sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn_det as l ON f.rowid = l.fk_facture_fourn"; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn_det as l ON f.rowid = l.fk_facture_fourn";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON p.accountancy_code_buy = aa.account_number"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON p.accountancy_code_buy = aa.account_number";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version";
$sql .= " WHERE f.fk_statut > 0 AND fk_code_ventilation <= 0"; $sql .= " WHERE f.fk_statut > 0";
$sql .= " AND fk_code_ventilation <= 0";
$sql .= " AND product_type <= 2";
$sql .= " AND (accsys.rowid='".$conf->global->CHARTOFACCOUNTS."' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_buy ='')"; $sql .= " AND (accsys.rowid='".$conf->global->CHARTOFACCOUNTS."' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_buy ='')";
if (! empty($conf->multicompany->enabled)) { if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = '" . $conf->entity . "'"; $sql .= " AND f.entity = '" . $conf->entity . "'";
} }

View File

@ -88,7 +88,7 @@ $hookmanager->initHooks(array('actioncard','globalcard'));
/* /*
* Actions * Actions
*/ */
$listUserAssignedUpdated = false;
// Remove user to assigned list // Remove user to assigned list
if (GETPOST('removedassigned') || GETPOST('removedassigned') == '0') if (GETPOST('removedassigned') || GETPOST('removedassigned') == '0')
{ {
@ -106,6 +106,8 @@ if (GETPOST('removedassigned') || GETPOST('removedassigned') == '0')
$donotclearsession=1; $donotclearsession=1;
if ($action == 'add') $action = 'create'; if ($action == 'add') $action = 'create';
if ($action == 'update') $action = 'edit'; if ($action == 'update') $action = 'edit';
$listUserAssignedUpdated = true;
} }
// Add user to assigned list // Add user to assigned list
@ -125,6 +127,8 @@ if (GETPOST('addassignedtouser') || GETPOST('updateassignedtouser'))
$donotclearsession=1; $donotclearsession=1;
if ($action == 'add') $action = 'create'; if ($action == 'add') $action = 'create';
if ($action == 'update') $action = 'edit'; if ($action == 'update') $action = 'edit';
$listUserAssignedUpdated = true;
} }
// Add event // Add event
@ -803,6 +807,28 @@ if ($id > 0)
$result4=$object->fetch_userassigned(); $result4=$object->fetch_userassigned();
$result5=$object->fetch_optionals($id,$extralabels); $result5=$object->fetch_optionals($id,$extralabels);
if($listUserAssignedUpdated || $donotclearsession) {
$datep=dol_mktime($fulldayevent?'00':$aphour, $fulldayevent?'00':$apmin, 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]);
$datef=dol_mktime($fulldayevent?'23':$p2hour, $fulldayevent?'59':$p2min, $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]);
$object->fk_action = dol_getIdFromCode($db, GETPOST("actioncode"), 'c_actioncomm');
$object->label = GETPOST("label");
$object->datep = $datep;
$object->datef = $datef;
$object->percentage = $percentage;
$object->priority = GETPOST("priority");
$object->fulldayevent= GETPOST("fullday")?1:0;
$object->location = GETPOST('location');
$object->socid = GETPOST("socid");
$object->contactid = GETPOST("contactid",'int');
//$object->societe->id = $_POST["socid"]; // deprecated
//$object->contact->id = $_POST["contactid"]; // deprecated
$object->fk_project = GETPOST("projectid",'int');
$object->note = GETPOST("note");
}
if ($result1 < 0 || $result2 < 0 || $result3 < 0 || $result4 < 0 || $result5 < 0) if ($result1 < 0 || $result2 < 0 || $result3 < 0 || $result4 < 0 || $result5 < 0)
{ {
dol_print_error($db,$object->error); dol_print_error($db,$object->error);

View File

@ -1239,6 +1239,9 @@ if ($action == 'create' && $user->rights->commande->creer) {
if ($socid > 0) if ($socid > 0)
$res = $soc->fetch($socid); $res = $soc->fetch($socid);
$projectid = 0;
$remise_absolue = 0;
if (! empty($origin) && ! empty($originid)) { if (! empty($origin) && ! empty($originid)) {
// Parse element/subelement (ex: project_task) // Parse element/subelement (ex: project_task)
$element = $subelement = $origin; $element = $subelement = $origin;
@ -1249,6 +1252,20 @@ if ($action == 'create' && $user->rights->commande->creer) {
if ($element == 'project') { if ($element == 'project') {
$projectid = $originid; $projectid = $originid;
if (!$cond_reglement_id) {
$cond_reglement_id = $soc->cond_reglement_id;
}
if (!$mode_reglement_id) {
$mode_reglement_id = $soc->mode_reglement_id;
}
if (!$remise_percent) {
$remise_percent = $soc->remise_percent;
}
if (!$dateorder) {
// Do not set 0 here (0 for a date is 1970)
$dateorder = (empty($dateinvoice)?(empty($conf->global->MAIN_AUTOFILL_DATE_ODER)?-1:''):$dateorder);
}
} else { } else {
// For compatibility // For compatibility
if ($element == 'order' || $element == 'commande') { if ($element == 'order' || $element == 'commande') {
@ -1492,9 +1509,23 @@ if ($action == 'create' && $user->rights->commande->creer) {
print '<input type="hidden" name="origin" value="' . $objectsrc->element . '">'; print '<input type="hidden" name="origin" value="' . $objectsrc->element . '">';
print '<input type="hidden" name="originid" value="' . $objectsrc->id . '">'; print '<input type="hidden" name="originid" value="' . $objectsrc->id . '">';
$newclassname = $classname; switch ($classname) {
if ($newclassname == 'Propal') case 'Propal':
$newclassname = 'CommercialProposal'; $newclassname = 'CommercialProposal';
break;
case 'Commande':
$newclassname = 'Order';
break;
case 'Expedition':
$newclassname = 'Sending';
break;
case 'Contrat':
$newclassname = 'Contract';
break;
default:
$newclassname = $classname;
}
print '<tr><td>' . $langs->trans($newclassname) . '</td><td colspan="2">' . $objectsrc->getNomUrl(1) . '</td></tr>'; print '<tr><td>' . $langs->trans($newclassname) . '</td><td colspan="2">' . $objectsrc->getNomUrl(1) . '</td></tr>';
print '<tr><td>' . $langs->trans('TotalHT') . '</td><td colspan="2">' . price($objectsrc->total_ht) . '</td></tr>'; print '<tr><td>' . $langs->trans('TotalHT') . '</td><td colspan="2">' . price($objectsrc->total_ht) . '</td></tr>';
print '<tr><td>' . $langs->trans('TotalVAT') . '</td><td colspan="2">' . price($objectsrc->total_tva) . "</td></tr>"; print '<tr><td>' . $langs->trans('TotalVAT') . '</td><td colspan="2">' . price($objectsrc->total_tva) . "</td></tr>";

View File

@ -393,7 +393,7 @@ class Commande extends CommonOrder
{ {
$mouvP = new MouvementStock($this->db); $mouvP = new MouvementStock($this->db);
// We increment stock of product (and sub-products) // We increment stock of product (and sub-products)
$result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("OrderBackToDraftInDolibarr",$this->ref)); $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, 0, $langs->trans("OrderBackToDraftInDolibarr",$this->ref));
if ($result < 0) { $error++; } if ($result < 0) { $error++; }
} }
} }
@ -576,7 +576,7 @@ class Commande extends CommonOrder
{ {
$mouvP = new MouvementStock($this->db); $mouvP = new MouvementStock($this->db);
// We increment stock of product (and sub-products) // We increment stock of product (and sub-products)
$result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("OrderCanceledInDolibarr",$this->ref)); $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, 0, $langs->trans("OrderCanceledInDolibarr",$this->ref)); // price is 0, we don't want WAP to be changed
if ($result < 0) if ($result < 0)
{ {
$error++; $error++;
@ -920,6 +920,7 @@ class Commande extends CommonOrder
// Clear fields // Clear fields
$this->user_author_id = $user->id; $this->user_author_id = $user->id;
$this->user_valid = ''; $this->user_valid = '';
$this->date = dol_now();
$this->date_creation = ''; $this->date_creation = '';
$this->date_validation = ''; $this->date_validation = '';
$this->ref_client = ''; $this->ref_client = '';
@ -1042,7 +1043,7 @@ class Commande extends CommonOrder
$this->ref_client = $object->ref_client; $this->ref_client = $object->ref_client;
$this->note_private = $object->note_private; $this->note_private = $object->note_private;
$this->note_public = $object->note_public; $this->note_public = $object->note_public;
$this->origin = $object->element; $this->origin = $object->element;
$this->origin_id = $object->id; $this->origin_id = $object->id;
@ -1132,7 +1133,7 @@ class Commande extends CommonOrder
{ {
global $mysoc, $conf, $langs; global $mysoc, $conf, $langs;
dol_syslog(get_class($this)."::addline commandeid=$this->id, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_percent=$remise_percent, info_bits=$info_bits, fk_remise_except=$fk_remise_except, price_base_type=$price_base_type, pu_ttc=$pu_ttc, date_start=$date_start, date_end=$date_end, type=$type", LOG_DEBUG); dol_syslog(get_class($this)."::addline commandeid=$this->id, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_percent=$remise_percent, info_bits=$info_bits, fk_remise_except=$fk_remise_except, price_base_type=$price_base_type, pu_ttc=$pu_ttc, date_start=$date_start, date_end=$date_end, type=$type special_code=$special_code", LOG_DEBUG);
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';

View File

@ -2,6 +2,7 @@
/* Copytight (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com> /* Copytight (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2008-2009 Laurent Destailleur (Eldy) <eldy@users.sourceforge.net> * Copyright (C) 2008-2009 Laurent Destailleur (Eldy) <eldy@users.sourceforge.net>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr> * Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -312,7 +313,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
print "</td>"; print "</td>";
print "<td>".$ref."</td>"; print "<td>".$ref."</td>";
print "<td>".$refcomp."</td>"; print "<td>".$refcomp."</td>";
if ($obj->total_ttc < 0) { print "<td align=\"right\">".price($total_ttc)."</td><td>&nbsp;</td>"; }; if ($obj->total_ttc < 0) { print "<td align=\"right\">".price(abs($total_ttc))."</td><td>&nbsp;</td>"; };
if ($obj->total_ttc >= 0) { print "<td>&nbsp;</td><td align=\"right\">".price($total_ttc)."</td>"; }; if ($obj->total_ttc >= 0) { print "<td>&nbsp;</td><td align=\"right\">".price($total_ttc)."</td>"; };
print '<td align="right">'.price($solde).'</td>'; print '<td align="right">'.price($solde).'</td>';
print "</tr>"; print "</tr>";

View File

@ -1743,6 +1743,8 @@ if ($action == 'create')
$res = $soc->fetch($socid); $res = $soc->fetch($socid);
// Load objectsrc // Load objectsrc
$remise_absolue = 0;
if (! empty($origin) && ! empty($originid)) if (! empty($origin) && ! empty($originid))
{ {
// Parse element/subelement (ex: project_task) // Parse element/subelement (ex: project_task)
@ -1754,6 +1756,20 @@ if ($action == 'create')
if ($element == 'project') { if ($element == 'project') {
$projectid = $originid; $projectid = $originid;
if (!$cond_reglement_id) {
$cond_reglement_id = $soc->cond_reglement_id;
}
if (!$mode_reglement_id) {
$mode_reglement_id = $soc->mode_reglement_id;
}
if (!$remise_percent) {
$remise_percent = $soc->remise_percent;
}
if (!$dateinvoice) {
// Do not set 0 here (0 for a date is 1970)
$dateinvoice = (empty($dateinvoice)?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''):$dateinvoice);
}
} else { } else {
// For compatibility // For compatibility
if ($element == 'order' || $element == 'commande') { if ($element == 'order' || $element == 'commande') {
@ -1798,7 +1814,6 @@ if ($action == 'create')
$objectsrc->fetch_optionals($originid); $objectsrc->fetch_optionals($originid);
$object->array_options = $objectsrc->array_options; $object->array_options = $objectsrc->array_options;
} }
$dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE) ? -1 : ''; // Dot not set 0 here (0 for a date is 1970)
} }
else else
{ {
@ -1809,6 +1824,7 @@ if ($action == 'create')
$remise_absolue = 0; $remise_absolue = 0;
$dateinvoice = (empty($dateinvoice)?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''):$dateinvoice); // Do not set 0 here (0 for a date is 1970) $dateinvoice = (empty($dateinvoice)?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''):$dateinvoice); // Do not set 0 here (0 for a date is 1970)
} }
$absolute_discount = $soc->getAvailableDiscounts(); $absolute_discount = $soc->getAvailableDiscounts();
if (! empty($conf->use_javascript_ajax)) if (! empty($conf->use_javascript_ajax))
@ -1855,7 +1871,7 @@ if ($action == 'create')
else else
{ {
print '<td colspan="2">'; print '<td colspan="2">';
print $form->select_company('', 'socid', 's.client = 1 OR s.client = 3', 1); print $form->select_company('', 'socid', '(s.client = 1 OR s.client = 3) AND status=1', 1);
print '</td>'; print '</td>';
} }
print '</tr>' . "\n"; print '</tr>' . "\n";

View File

@ -1761,7 +1761,7 @@ class Facture extends CommonInvoice
$mouvP = new MouvementStock($this->db); $mouvP = new MouvementStock($this->db);
$mouvP->origin = &$this; $mouvP->origin = &$this;
// We decrease stock for product // We decrease stock for product
if ($this->type == self::TYPE_CREDIT_NOTE) $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarr",$num)); if ($this->type == self::TYPE_CREDIT_NOTE) $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, 0, $langs->trans("InvoiceValidatedInDolibarr",$num));
else $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarr",$num)); else $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarr",$num));
if ($result < 0) { if ($result < 0) {
$error++; $error++;

View File

@ -1,5 +1,6 @@
<?php <?php
/* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es> /* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -104,7 +105,7 @@ if ($_GET["action"] == 'delete')
if ($result > 0) if ($result > 0)
{ {
$db->commit(); $db->commit();
header("Location: ".DOL_URL_ROOT.'/compta/localtax/reglement.php'); header("Location: ".DOL_URL_ROOT.'/compta/localtax/reglement.php?localTaxType='.$localtax->ltt);
exit; exit;
} }
else else

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012-2013 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2012-2013 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -1041,6 +1042,9 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio
// Define $destpath (path to file including filename) and $destfile (only filename) // Define $destpath (path to file including filename) and $destfile (only filename)
$destpath=$upload_dir . "/" . $_FILES[$varfiles]['name']; $destpath=$upload_dir . "/" . $_FILES[$varfiles]['name'];
$destfile=$_FILES[$varfiles]['name']; $destfile=$_FILES[$varfiles]['name'];
$savingdocmask = dol_sanitizeFileName($savingdocmask);
if ($savingdocmask) if ($savingdocmask)
{ {
$destpath=$upload_dir . "/" . preg_replace('/__file__/',$_FILES[$varfiles]['name'],$savingdocmask); $destpath=$upload_dir . "/" . preg_replace('/__file__/',$_FILES[$varfiles]['name'],$savingdocmask);

View File

@ -1,6 +1,7 @@
<?php <?php
/* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr> /* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013-2014 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2013-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -48,7 +49,7 @@ if (empty($conf->global->MAIN_DISABLE_SUGGEST_REF_AS_PREFIX))
//var_dump($modulepart); //var_dump($modulepart);
if (in_array($modulepart,array('facture_fournisseur','commande_fournisseur','facture','commande','propal','ficheinter','contract','project','project_task'))) if (in_array($modulepart,array('facture_fournisseur','commande_fournisseur','facture','commande','propal','ficheinter','contract','project','project_task')))
{ {
$savingdocmask=$object->ref.'-__file__'; $savingdocmask=dol_sanitizeFileName($object->ref).'-__file__';
} }
/*if (in_array($modulepart,array('member'))) /*if (in_array($modulepart,array('member')))
{ {

View File

@ -451,7 +451,7 @@ jQuery(document).ready(function() {
<?php if (! empty($usemargins) && $user->rights->margins->creer) { ?> <?php if (! empty($usemargins) && $user->rights->margins->creer) { ?>
/* Code for margin */ /* Code for margin */
$("#fournprice_predef options").remove(); $("#fournprice_predef").find("option").remove();
$("#fournprice_predef").hide(); $("#fournprice_predef").hide();
$("#buying_price").val("").show(); $("#buying_price").val("").show();
$.post('<?php echo DOL_URL_ROOT; ?>/fourn/ajax/getSupplierPrices.php', { 'idprod': $(this).val() }, function(data) { $.post('<?php echo DOL_URL_ROOT; ?>/fourn/ajax/getSupplierPrices.php', { 'idprod': $(this).val() }, function(data) {

View File

@ -61,6 +61,10 @@ class InterfaceWorkflowManager extends DolibarrTriggers
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
$newobject = new Commande($this->db); $newobject = new Commande($this->db);
$newobject->context['createfrompropal'] = 'createfrompropal';
$newobject->context['origin'] = $object->element;
$newobject->context['origin_id'] = $object->id;
$ret=$newobject->createFromProposal($object); $ret=$newobject->createFromProposal($object);
if ($ret < 0) { $this->error=$newobject->error; $this->errors[]=$newobject->error; } if ($ret < 0) { $this->error=$newobject->error; $this->errors[]=$newobject->error; }
return $ret; return $ret;
@ -76,6 +80,10 @@ class InterfaceWorkflowManager extends DolibarrTriggers
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$newobject = new Facture($this->db); $newobject = new Facture($this->db);
$newobject->context['createfromorder'] = 'createfromorder';
$newobject->context['origin'] = $object->element;
$newobject->context['origin_id'] = $object->id;
$ret=$newobject->createFromOrder($object); $ret=$newobject->createFromOrder($object);
if ($ret < 0) { $this->error=$newobject->error; $this->errors[]=$newobject->error; } if ($ret < 0) { $this->error=$newobject->error; $this->errors[]=$newobject->error; }
return $ret; return $ret;

View File

@ -34,7 +34,7 @@ if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propa
if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
if (! empty($conf->productbatch->enabled)) require_once DOL_DOCUMENT_ROOT.'/expedition/class/expeditionbatch.class.php'; if (! empty($conf->productbatch->enabled)) require_once DOL_DOCUMENT_ROOT.'/expedition/class/expeditionbatch.class.php';
/** /**
* Class to manage shipments * Class to manage shipments
*/ */
@ -980,7 +980,7 @@ class Expedition extends CommonObject
$mouvS->origin = &$this; $mouvS->origin = &$this;
// We decrement stock of product (and sub-products) // We decrement stock of product (and sub-products)
// We use warehouse selected for each line // We use warehouse selected for each line
$result=$mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $obj->qty, $obj->subprice, $langs->trans("ShipmentDeletedInDolibarr",$this->ref)); $result=$mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $obj->qty, 0, $langs->trans("ShipmentDeletedInDolibarr",$this->ref));
if ($result < 0) if ($result < 0)
{ {
$error++; $error++;

View File

@ -119,7 +119,7 @@ if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->fichein
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) $result=fichinter_create($db, $object, GETPOST('model','alpha'), $outputlangs); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) $result=fichinter_create($db, $object, (!GETPOST('model','alpha'))?$object->modelpdf:GETPOST('model','alpha'), $outputlangs);
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit; exit;
@ -145,7 +145,7 @@ else if ($action == 'confirm_modify' && $confirm == 'yes' && $user->rights->fich
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) $result=fichinter_create($db, $object, (!GETPOST('model','alpha'))?$object->model:GETPOST('model','apha'), $outputlangs); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) $result=fichinter_create($db, $object, (!GETPOST('model','alpha'))?$object->modelpdf:GETPOST('model','alpha'), $outputlangs);
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit; exit;

View File

@ -682,9 +682,10 @@ if ( (! empty($conf->productbatch->enabled)) && $product->hasbatch()) {
print '</tr>'; print '</tr>';
} }
$sql = "SELECT e.rowid, e.label, ps.reel, ps.pmp, ps.rowid as product_stock_id"; $sql = "SELECT e.rowid, e.label, ps.reel, p.pmp, ps.rowid as product_stock_id";
$sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e,"; $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e,";
$sql.= " ".MAIN_DB_PREFIX."product_stock as ps"; $sql.= " ".MAIN_DB_PREFIX."product_stock as ps";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = ps.fk_product";
$sql.= " WHERE ps.reel != 0"; $sql.= " WHERE ps.reel != 0";
$sql.= " AND ps.fk_entrepot = e.rowid"; $sql.= " AND ps.fk_entrepot = e.rowid";
$sql.= " AND e.entity IN (".getEntity('stock',1).')'; $sql.= " AND e.entity IN (".getEntity('stock',1).')';

View File

@ -401,7 +401,14 @@ if ($socid && $action != 'edit' && $action != "create")
} }
if (count($rib_list) == 0) { if (count($rib_list) == 0) {
print '<tr '.$bc[0].'><td colspan="7" align="center">'.$langs->trans("NoBANRecord").'</td></tr>';
if (! empty($conf->prelevement->enabled)) {
$colspan = 8;
} else {
$colspan = 7;
}
print '<tr '.$bc[0].'><td colspan="'.$colspan.'" align="center">'.$langs->trans("NoBANRecord").'</td></tr>';
} }
print '</table>'; print '</table>';