From 31bcc47b68000ea0ce30990b597f7c120a980110 Mon Sep 17 00:00:00 2001 From: wdammak <26695620+wdammak@users.noreply.github.com> Date: Thu, 14 Feb 2019 13:47:02 +0100 Subject: [PATCH 01/50] Add default warehouse id for a user This will help to organize employees and know the default warehouse for a customer. --- htdocs/install/mysql/migration/9.0.0-10.0.0.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql index ddd164deba7..e0df233a733 100644 --- a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql +++ b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql @@ -157,3 +157,5 @@ INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VAL INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('H', '3600','hour','h', 'time', 1); INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('D','12960000','day','d', 'time', 1); +-- Default Warehouse id for a user +ALTER TABLE `llx_user` ADD `default_warehouse` INTEGER NULL AFTER `default_c_exp_tax_cat`; From bc8b6ed99368f10c5d6c070645741ee115dcda1c Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Thu, 14 Feb 2019 17:23:48 +0100 Subject: [PATCH 02/50] Fix count ref in contact list API --- htdocs/societe/class/api_contacts.class.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/htdocs/societe/class/api_contacts.class.php b/htdocs/societe/class/api_contacts.class.php index 38e6bb59ef4..77134a604b5 100644 --- a/htdocs/societe/class/api_contacts.class.php +++ b/htdocs/societe/class/api_contacts.class.php @@ -103,13 +103,14 @@ class Contacts extends DolibarrApi * @param string $sortorder Sort order * @param int $limit Limit for list * @param int $page Page number - * @param string $thirdparty_ids Thirdparty ids to filter contacts of. {@example '1' or '1,2,3'} {@pattern /^[0-9,]*$/i} - * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" + * @param string $thirdparty_ids Thirdparty ids to filter contacts of. {@example '1' or '1,2,3'} {@pattern /^[0-9,]*$/i} + * @param int $includecount Count and return also number of elements the contact is used as a link for + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" * @return array Array of contact objects * * @throws RestException */ - function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '') + function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $includecount = 0, $sqlfilters = '') { global $db, $conf; @@ -181,9 +182,14 @@ class Contacts extends DolibarrApi $obj = $db->fetch_object($result); $contact_static = new Contact($db); if ($contact_static->fetch($obj->rowid)) - { + { + if ($includecount) + { + $contact_static->load_ref_elements(); + } $obj_ret[] = $this->_cleanObjectDatas($contact_static); - } + } + $i++; } } From dc054e56ecf2ad3ee51aa5e28c98449a576d10d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 14 Feb 2019 18:10:10 +0100 Subject: [PATCH 03/50] Update compta-files.php --- htdocs/compta/compta-files.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/compta-files.php b/htdocs/compta/compta-files.php index 7bfd7565ab5..920037a5de1 100644 --- a/htdocs/compta/compta-files.php +++ b/htdocs/compta/compta-files.php @@ -243,7 +243,7 @@ if ($result && $action == "dl") $log='date,type,ref,total,paid,filename,item_id'."\n"; $zipname = $dirfortmpfile.'/'.dol_print_date($date_start, 'dayrfc')."-".dol_print_date($date_stop, 'dayrfc').'_export.zip'; - dol_delete_file(name); + dol_delete_file($zipname); $zip = new ZipArchive; $res = $zip->open($zipname, ZipArchive::OVERWRITE|ZipArchive::CREATE); From b892fc718262996e329e93728f252a2a8f867ff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 14 Feb 2019 18:22:35 +0100 Subject: [PATCH 04/50] Update api_invoices.class.php --- .../facture/class/api_invoices.class.php | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index af3626942de..3056fc1c7f4 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -338,7 +338,7 @@ class Invoices extends DolibarrApi throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } $request_data = (object) $request_data; - $updateRes = $this->invoice->updateline( + $updateRes = $this->invoice->updateline( $lineid, $request_data->desc, $request_data->subprice, @@ -362,7 +362,7 @@ class Invoices extends DolibarrApi $request_data->situation_percent, $request_data->fk_unit, $request_data->multicurrency_subprice - ); + ); if ($updateRes > 0) { $result = $this->get($id); @@ -392,7 +392,7 @@ class Invoices extends DolibarrApi throw new RestException(401); } - $result = $this->facture->fetch($id); + $result = $this->invoice->fetch($id); if(!$result) { throw new RestException(404, 'Invoice not found'); @@ -402,17 +402,17 @@ class Invoices extends DolibarrApi throw new RestException(500, 'Availables types: BILLING, SHIPPING OR CUSTOMER'); } - if(!DolibarrApi::_checkAccessToResource('invoice', $this->facture->id)) { + if(!DolibarrApi::_checkAccessToResource('invoice', $this->invoice->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - $result = $this->facture->add_contact($contactid, $type, 'external'); + $result = $this->invoice->add_contact($contactid, $type, 'external'); if (!$result) { throw new RestException(500, 'Error when added the contact'); } - return $this->facture; + return $this->_cleanObjectDatas($this->invoice); } /** @@ -434,23 +434,23 @@ class Invoices extends DolibarrApi throw new RestException(401); } - $result = $this->facture->fetch($id); + $result = $this->invoice->fetch($id); - if(!$result) { + if (!$result) { throw new RestException(404, 'Invoice not found'); } - if(!DolibarrApi::_checkAccessToResource('invoice', $this->facture->id)) { + if (!DolibarrApi::_checkAccessToResource('invoice', $this->invoice->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - $result = $this->facture->delete_contact($rowid); + $result = $this->invoice->delete_contact($rowid); if (!$result) { throw new RestException(500, 'Error when deleted the contact'); } - return $this->facture; + return $this->_cleanObjectDatas($this->invoice); } /** From 2ede3c1a4065981d249d84c524bf3e85be2317b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 14 Feb 2019 19:04:07 +0100 Subject: [PATCH 05/50] Update list.php --- htdocs/commande/list.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index ff8940854e7..95483513c72 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -727,24 +727,24 @@ if ($resql) if (! empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], 's.town', '', $param, '', $sortfield, $sortorder); if (! empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'], $_SERVER["PHP_SELF"], 's.zip', '', $param, '', $sortfield, $sortorder); if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'], $_SERVER["PHP_SELF"], "state.nom", "", $param, '', $sortfield, $sortorder); - if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, 'align="center"', $sortfield, $sortorder); - if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, 'align="center"', $sortfield, $sortorder); - if (! empty($arrayfields['c.date_commande']['checked'])) print_liste_field_titre($arrayfields['c.date_commande']['label'], $_SERVER["PHP_SELF"], 'c.date_commande', '', $param, 'align="center"', $sortfield, $sortorder); - if (! empty($arrayfields['c.date_delivery']['checked'])) print_liste_field_titre($arrayfields['c.date_delivery']['label'], $_SERVER["PHP_SELF"], 'c.date_livraison', '', $param, 'align="center"', $sortfield, $sortorder); - if (! empty($arrayfields['c.total_ht']['checked'])) print_liste_field_titre($arrayfields['c.total_ht']['label'], $_SERVER["PHP_SELF"], 'c.total_ht', '', $param, 'class="right"', $sortfield, $sortorder); - if (! empty($arrayfields['c.total_vat']['checked'])) print_liste_field_titre($arrayfields['c.total_vat']['label'], $_SERVER["PHP_SELF"], 'c.tva', '', $param, 'class="right"', $sortfield, $sortorder); - if (! empty($arrayfields['c.total_ttc']['checked'])) print_liste_field_titre($arrayfields['c.total_ttc']['label'], $_SERVER["PHP_SELF"], 'c.total_ttc', '', $param, 'class="right"', $sortfield, $sortorder); + if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, '', $sortfield, $sortorder, 'center '); + if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, '', $sortfield, $sortorder, 'center '); + if (! empty($arrayfields['c.date_commande']['checked'])) print_liste_field_titre($arrayfields['c.date_commande']['label'], $_SERVER["PHP_SELF"], 'c.date_commande', '', $param, '', $sortfield, $sortorder, 'center '); + if (! empty($arrayfields['c.date_delivery']['checked'])) print_liste_field_titre($arrayfields['c.date_delivery']['label'], $_SERVER["PHP_SELF"], 'c.date_livraison', '', $param, '', $sortfield, $sortorder, 'center '); + if (! empty($arrayfields['c.total_ht']['checked'])) print_liste_field_titre($arrayfields['c.total_ht']['label'], $_SERVER["PHP_SELF"], 'c.total_ht', '', $param, '', $sortfield, $sortorder, 'right '); + if (! empty($arrayfields['c.total_vat']['checked'])) print_liste_field_titre($arrayfields['c.total_vat']['label'], $_SERVER["PHP_SELF"], 'c.tva', '', $param, '', $sortfield, $sortorder, 'right '); + if (! empty($arrayfields['c.total_ttc']['checked'])) print_liste_field_titre($arrayfields['c.total_ttc']['label'], $_SERVER["PHP_SELF"], 'c.total_ttc', '', $param, '', $sortfield, $sortorder, 'right '); // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields $parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder); $reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; - if (! empty($arrayfields['c.datec']['checked'])) print_liste_field_titre($arrayfields['c.datec']['label'], $_SERVER["PHP_SELF"], "c.date_creation", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); - if (! empty($arrayfields['c.tms']['checked'])) print_liste_field_titre($arrayfields['c.tms']['label'], $_SERVER["PHP_SELF"], "c.tms", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); - if (! empty($arrayfields['c.fk_statut']['checked'])) print_liste_field_titre($arrayfields['c.fk_statut']['label'], $_SERVER["PHP_SELF"], "c.fk_statut", "", $param, 'class="right"', $sortfield, $sortorder); - if (! empty($arrayfields['c.facture']['checked'])) print_liste_field_titre($arrayfields['c.facture']['label'], $_SERVER["PHP_SELF"], 'c.facture', '', $param, 'align="center"', $sortfield, $sortorder, ''); - print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', $param, 'align="center"', $sortfield, $sortorder, 'maxwidthsearch '); + if (! empty($arrayfields['c.datec']['checked'])) print_liste_field_titre($arrayfields['c.datec']['label'], $_SERVER["PHP_SELF"], "c.date_creation", "", $param, '', $sortfield, $sortorder, 'center nowrap '); + if (! empty($arrayfields['c.tms']['checked'])) print_liste_field_titre($arrayfields['c.tms']['label'], $_SERVER["PHP_SELF"], "c.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap '); + if (! empty($arrayfields['c.fk_statut']['checked'])) print_liste_field_titre($arrayfields['c.fk_statut']['label'], $_SERVER["PHP_SELF"], "c.fk_statut", "", $param, '', $sortfield, $sortorder, 'right '); + if (! empty($arrayfields['c.facture']['checked'])) print_liste_field_titre($arrayfields['c.facture']['label'], $_SERVER["PHP_SELF"], 'c.facture', '', $param, '', $sortfield, $sortorder, 'center '); + print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'maxwidthsearch center '); print ''."\n"; $total=0; From 0a8c72c93b69b3b6fcf46c2a37999b133855074e Mon Sep 17 00:00:00 2001 From: wdammak <26695620+wdammak@users.noreply.github.com> Date: Thu, 14 Feb 2019 19:36:23 +0100 Subject: [PATCH 06/50] rename column default_warehouse to fk_warehouse --- htdocs/install/mysql/migration/9.0.0-10.0.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql index e0df233a733..34162ffa2b5 100644 --- a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql +++ b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql @@ -158,4 +158,4 @@ INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VAL INSERT INTO llx_c_units (code, scale, label, short_label, unit_type, active) VALUES ('D','12960000','day','d', 'time', 1); -- Default Warehouse id for a user -ALTER TABLE `llx_user` ADD `default_warehouse` INTEGER NULL AFTER `default_c_exp_tax_cat`; +ALTER TABLE `llx_user` ADD `fk_warehouse` INTEGER NULL AFTER `default_c_exp_tax_cat`; From 2fe3b7acc72b40462e2abd552b4ff934cffa18b3 Mon Sep 17 00:00:00 2001 From: wdammak <26695620+wdammak@users.noreply.github.com> Date: Thu, 14 Feb 2019 19:50:57 +0100 Subject: [PATCH 07/50] Add default warehouse for a user --- htdocs/install/mysql/tables/llx_user.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_user.sql b/htdocs/install/mysql/tables/llx_user.sql index 90dc8a835ef..cb9bf35ccd0 100644 --- a/htdocs/install/mysql/tables/llx_user.sql +++ b/htdocs/install/mysql/tables/llx_user.sql @@ -99,5 +99,6 @@ create table llx_user import_key varchar(14), -- import key default_range integer, - default_c_exp_tax_cat integer + default_c_exp_tax_cat integer, + fk_warehouse integer )ENGINE=innodb; From 81880b9602983322194317bd21ab912bb9024575 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 14 Feb 2019 20:32:11 +0100 Subject: [PATCH 08/50] Update stripe.class.php --- htdocs/stripe/class/stripe.class.php | 76 ++++++++++++++-------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 38432fbd5db..221928f7de7 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -251,7 +251,7 @@ class Stripe extends CommonObject */ public function getPaymentIntent($object, $customer, $key = null, $status = 0, $usethirdpartyemailforreceiptemail = 0, $mode = 'automatic') { - global $conf, $user; + global $conf, $user, $mysoc; if (empty($object->id)) { @@ -302,34 +302,34 @@ class Stripe extends CommonObject } else //if ($createifnotlinkedtostripe) { - $arrayzerounitcurrency=array('BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'VND', 'VUV', 'XAF', 'XOF', 'XPF'); - if (! in_array($object->multicurrency_code, $arrayzerounitcurrency)) $stripeamount=$object->multicurrency_total_ttc * 100; - else $stripeamount = $object->multicurrency_total_ttc; + $arrayzerounitcurrency=array('BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'VND', 'VUV', 'XAF', 'XOF', 'XPF'); + if (! in_array($object->multicurrency_code, $arrayzerounitcurrency)) $stripeamount=$object->multicurrency_total_ttc * 100; + else $stripeamount = $object->multicurrency_total_ttc; $fee = round(($amount * ($conf->global->STRIPE_APPLICATION_FEE_PERCENT / 100) + $conf->global->STRIPE_APPLICATION_FEE) * 100); if ($fee < ($conf->global->STRIPE_APPLICATION_FEE_MINIMAL * 100)) { $fee = round($conf->global->STRIPE_APPLICATION_FEE_MINIMAL * 100); } - $description=$object->element.$object->ref; + $description=$object->element.$object->ref; $dataforintent = array( "amount" => $stripeamount, "currency" => $object->multicurrency_code, - "customer" => $customer, - "allowed_source_types" => ["card"], - "statement_descriptor" => dol_trunc(dol_trunc(dol_string_unaccent($mysoc->name), 8, 'right', 'UTF-8', 1).' '.$description, 22, 'right', 'UTF-8', 1), // 22 chars that appears on bank receipt + "customer" => $customer, + "allowed_source_types" => ["card"], + "statement_descriptor" => dol_trunc(dol_trunc(dol_string_unaccent($mysoc->name), 8, 'right', 'UTF-8', 1).' '.$description, 22, 'right', 'UTF-8', 1), // 22 chars that appears on bank receipt "metadata" => array('dol_type'=>$object->element, 'dol_id'=>$object->id, 'dol_version'=>DOL_VERSION, 'dol_entity'=>$conf->entity, 'ipaddress'=>(empty($_SERVER['REMOTE_ADDR'])?'':$_SERVER['REMOTE_ADDR'])) ); - if ($conf->entity!=$conf->global->STRIPECONNECT_PRINCIPAL && $fee>0) - { - $dataforintent["application_fee"] = $fee; - } - if ($societe->email && $usethirdpartyemailforreceiptemail) - { - $dataforintent["receipt_email"] = $societe->email; - } + if ($conf->entity!=$conf->global->STRIPECONNECT_PRINCIPAL && $fee>0) + { + $dataforintent["application_fee"] = $fee; + } + if ($societe->email && $usethirdpartyemailforreceiptemail) + { + $dataforintent["receipt_email"] = $societe->email; + } try { // Force to use the correct API key @@ -341,14 +341,14 @@ class Stripe extends CommonObject } else { $paymentintent = \Stripe\PaymentIntent::create($dataforintent, array("idempotency_key" => "$description","stripe_account" => $key)); } - $now=dol_now(); + $now=dol_now(); $sql = "INSERT INTO " . MAIN_DB_PREFIX . "prelevement_facture_demande (fk_soc, date_demande, fk_user_demande, ext_payment_id, fk_facture, sourcetype, entity, ext_payment_site)"; $sql .= " VALUES ('".$object->socid."','".$this->db->idate($now)."', '0', '".$this->db->escape($paymentintent->id)."', ".$object->id.", '".$object->element."', " . $conf->entity . ", '" . $service . "')"; $resql = $this->db->query($sql); if (! $resql) { $this->error = $this->db->lasterror(); - dol_syslog(get_class($this) . "::PaymentIntent not insert with id=".$paymentintent->id); + dol_syslog(get_class($this) . "::PaymentIntent not insert with id=".$paymentintent->id); } } catch(Exception $e) @@ -395,7 +395,7 @@ class Stripe extends CommonObject { $obj = $this->db->fetch_object($resql); $cardref = $obj->stripe_card_ref; - dol_syslog("************* cardref=".$cardref); + dol_syslog(get_class($this) . "::cardStripe cardref=".$cardref); if ($cardref) { try { @@ -553,7 +553,7 @@ class Stripe extends CommonObject { if (preg_match('/acct_/i', $source)) { - $charge = \Stripe\Charge::create(array( + $charge = \Stripe\Charge::create(array( "amount" => "$stripeamount", "currency" => "$currency", "statement_descriptor" => dol_trunc(dol_trunc(dol_string_unaccent($mysoc->name), 8, 'right', 'UTF-8', 1).' '.$description, 22, 'right', 'UTF-8', 1), // 22 chars that appears on bank receipt @@ -589,25 +589,25 @@ class Stripe extends CommonObject } $paymentarray = array( - "amount" => "$stripeamount", - "currency" => "$currency", - "statement_descriptor" => dol_trunc(dol_trunc(dol_string_unaccent($mysoc->name), 8, 'right', 'UTF-8', 1).' '.$description, 22, 'right', 'UTF-8', 1), // 22 chars that appears on bank receipt - "description" => "Stripe payment: ".$description, - "capture" => $capture, - "metadata" => $metadata, - "source" => "$source", - "customer" => "$customer" - ); - if ($conf->entity!=$conf->global->STRIPECONNECT_PRINCIPAL && $fee>0) - { - $paymentarray["application_fee"] = $fee; - } - if ($societe->email && $usethirdpartyemailforreceiptemail) - { - $paymentarray["receipt_email"] = $societe->email; - } + "amount" => "$stripeamount", + "currency" => "$currency", + "statement_descriptor" => dol_trunc(dol_trunc(dol_string_unaccent($mysoc->name), 8, 'right', 'UTF-8', 1).' '.$description, 22, 'right', 'UTF-8', 1), // 22 chars that appears on bank receipt + "description" => "Stripe payment: ".$description, + "capture" => $capture, + "metadata" => $metadata, + "source" => "$source", + "customer" => "$customer" + ); + if ($conf->entity!=$conf->global->STRIPECONNECT_PRINCIPAL && $fee>0) + { + $paymentarray["application_fee"] = $fee; + } + if ($societe->email && $usethirdpartyemailforreceiptemail) + { + $paymentarray["receipt_email"] = $societe->email; + } - $charge = \Stripe\Charge::create($paymentarray, array("idempotency_key" => "$ref","stripe_account" => "$account")); + $charge = \Stripe\Charge::create($paymentarray, array("idempotency_key" => "$ref","stripe_account" => "$account")); } if (isset($charge->id)) {} From dd1d7121a83224ad6a18d52de5a351260d3323f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 14 Feb 2019 20:36:08 +0100 Subject: [PATCH 09/50] remove dead code in /societe/contact.php --- htdocs/societe/contact.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/htdocs/societe/contact.php b/htdocs/societe/contact.php index 62ba944eabb..a49500d930b 100644 --- a/htdocs/societe/contact.php +++ b/htdocs/societe/contact.php @@ -163,12 +163,6 @@ if ($action != 'presend') { $result=show_contacts($conf, $langs, $db, $object, $_SERVER["PHP_SELF"].'?socid='.$object->id); } - - // Addresses list - if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT)) - { - $result=show_addresses($conf, $langs, $db, $object, $_SERVER["PHP_SELF"].'?socid='.$object->id); - } } // End of page From b6d665a91c884f56d50710e6dfa3c28d914baeef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 14 Feb 2019 20:38:21 +0100 Subject: [PATCH 10/50] Update card.php --- htdocs/fourn/card.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index ec99653cec7..3cb2e585db6 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -862,12 +862,6 @@ if ($object->id > 0) show_contacts($conf, $langs, $db, $object, $_SERVER["PHP_SELF"].'?socid='.$object->id); } - // Addresses list - if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) && ! empty($conf->global->MAIN_REPEATADDRESSONEACHTAB)) - { - $result=show_addresses($conf, $langs, $db, $object, $_SERVER["PHP_SELF"].'?socid='.$object->id); - } - if (! empty($conf->global->MAIN_REPEATTASKONEACHTAB)) { print load_fiche_titre($langs->trans("ActionsOnCompany"), '', ''); From 7886b5900c63537fbb68a988452a6ccd95765031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 14 Feb 2019 20:40:03 +0100 Subject: [PATCH 11/50] Update card.php --- htdocs/comm/card.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index a30bbf5e4b4..9e319d70f91 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -7,8 +7,9 @@ * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2013 Alexandre Spangaro - * Copyright (C) 2015 Frederic France + * Copyright (C) 2015-2019 Frédéric France * Copyright (C) 2015 Marcos García + * * 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 * the Free Software Foundation; either version 3 of the License, or @@ -1327,12 +1328,6 @@ if ($object->id > 0) show_contacts($conf, $langs, $db, $object, $_SERVER["PHP_SELF"].'?socid='.$object->id); } - // Addresses list - if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) && ! empty($conf->global->MAIN_REPEATADDRESSONEACHTAB)) - { - show_addresses($conf, $langs, $db, $object, $_SERVER["PHP_SELF"].'?socid='.$object->id); - } - if (! empty($conf->global->MAIN_REPEATTASKONEACHTAB)) { print load_fiche_titre($langs->trans("ActionsOnCompany"), '', ''); From 8b9bf6464346f7d9558c44947961a49e2828fd42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 14 Feb 2019 20:44:07 +0100 Subject: [PATCH 12/50] Update interface_50_modMailmanspip_Mailmanspipsynchro.class.php --- ...terface_50_modMailmanspip_Mailmanspipsynchro.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php b/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php index 126ffdba8f6..6a595cbb77a 100644 --- a/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php +++ b/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php @@ -106,8 +106,8 @@ class InterfaceMailmanSpipsynchro extends DolibarrTriggers $return=0; if ($object->add_to_abo() < 0) { - if (! empty($object->error)) $this->error=$object->error; $this->errors=$object->errors; + if (! empty($object->error)) $this->errors[]=$object->error; $return=-1; } else @@ -129,8 +129,8 @@ class InterfaceMailmanSpipsynchro extends DolibarrTriggers { if ($object->oldcopy->del_to_abo() < 0) { - if (! empty($object->oldcopy->error)) $this->error=$object->oldcopy->error; $this->errors=$object->oldcopy->errors; + if (! empty($object->oldcopy->error)) $this->errors[]=$object->oldcopy->error; $return=-1; } else @@ -141,8 +141,8 @@ class InterfaceMailmanSpipsynchro extends DolibarrTriggers // We add subscription if new email or new type (new type may means more mailing-list to subscribe) if ($object->add_to_abo() < 0) { - if (! empty($object->error)) $this->error=$object->error; $this->errors=$object->errors; + if (! empty($object->error)) $this->errors[]=$object->error; $return=-1; } else @@ -161,8 +161,8 @@ class InterfaceMailmanSpipsynchro extends DolibarrTriggers // Remove from external tools (mailman, spip, etc...) if ($object->del_to_abo() < 0) { - if (! empty($object->error)) $this->error=$object->error; $this->errors=$object->errors; + if (! empty($object->error)) $this->errors[]=$object->error; $return=-1; } else From 31e9fd46a44df16acc48a0b8180fa2e86f16cdb4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Feb 2019 20:59:31 +0100 Subject: [PATCH 13/50] Merge --- htdocs/adherents/subscription/list.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index 6279d2c61cc..e3a31a0c4c2 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -84,8 +84,8 @@ $arrayfields=array( 'c.dateadh'=>array('label'=>$langs->trans("DateSubscription"), 'checked'=>1, 'position'=>100), 'c.datef'=>array('label'=>$langs->trans("EndSubscription"), 'checked'=>1, 'position'=>101), 'd.amount'=>array('label'=>$langs->trans("Amount"), 'checked'=>1, 'position'=>102), - 'd.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), - 'd.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), + 'c.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), + 'c.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), // 'd.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000) ); @@ -353,13 +353,13 @@ $parameters=array('arrayfields'=>$arrayfields); $reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation -if (! empty($arrayfields['d.datec']['checked'])) +if (! empty($arrayfields['c.datec']['checked'])) { print ''; print ''; } // Date modification -if (! empty($arrayfields['d.tms']['checked'])) +if (! empty($arrayfields['c.tms']['checked'])) { print ''; print ''; @@ -418,8 +418,8 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; $parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder); $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; -if (! empty($arrayfields['d.datec']['checked'])) print_liste_field_titre($arrayfields['d.datec']['label'],$_SERVER["PHP_SELF"],"d.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); -if (! empty($arrayfields['d.tms']['checked'])) print_liste_field_titre($arrayfields['d.tms']['label'],$_SERVER["PHP_SELF"],"d.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); +if (! empty($arrayfields['c.datec']['checked'])) print_liste_field_titre($arrayfields['c.datec']['label'],$_SERVER["PHP_SELF"],"c.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); +if (! empty($arrayfields['c.tms']['checked'])) print_liste_field_titre($arrayfields['c.tms']['label'],$_SERVER["PHP_SELF"],"c.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; @@ -525,7 +525,7 @@ while ($i < min($num, $limit)) $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation - if (! empty($arrayfields['d.datec']['checked'])) + if (! empty($arrayfields['c.datec']['checked'])) { print ''; print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); @@ -533,7 +533,7 @@ while ($i < min($num, $limit)) if (! $i) $totalarray['nbfield']++; } // Date modification - if (! empty($arrayfields['d.tms']['checked'])) + if (! empty($arrayfields['c.tms']['checked'])) { print ''; print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); From 8cc2662f01d362836b588887cd1e566b7d68fb7d Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Thu, 14 Feb 2019 20:59:32 +0100 Subject: [PATCH 14/50] Update TakePOS in Dolibarr 9 --- htdocs/langs/en_US/cashdesk.lang | 12 +- htdocs/takepos/admin/orderprinters.php | 1 - htdocs/takepos/admin/setup.php | 192 +++++++++++------ htdocs/takepos/css/pos.css | 180 +++++++++++++--- htdocs/takepos/invoice.php | 44 +++- htdocs/takepos/pay.php | 43 ++-- htdocs/takepos/receipt.php | 27 ++- htdocs/takepos/takepos.php | 286 +++++++++++++++++-------- 8 files changed, 563 insertions(+), 222 deletions(-) diff --git a/htdocs/langs/en_US/cashdesk.lang b/htdocs/langs/en_US/cashdesk.lang index 836a9489b25..0ca2382d214 100644 --- a/htdocs/langs/en_US/cashdesk.lang +++ b/htdocs/langs/en_US/cashdesk.lang @@ -32,7 +32,7 @@ DeleteArticle=Click to remove this article FilterRefOrLabelOrBC=Search (Ref/Label) UserNeedPermissionToEditStockToUsePos=You ask to decrease stock on invoice creation, so user that uses POS needs to have permission to edit stock. DolibarrReceiptPrinter=Dolibarr Receipt Printer -PointOfSale=Point of sales +PointOfSale=Point of Sale PointOfSaleShort=POS CloseBill=Close Bill Floors=Floors @@ -42,8 +42,16 @@ Place=Place TakeposConnectorNecesary='TakePOS Connector' required OrderPrinters=Order printers SearchProduct=Search product +Receipt=Receipt +Header=Header +Footer=Footer AmountAtEndOfPeriod=Amount at end of period (day, month or year) TheoricalAmount=Theorical amount RealAmount=Real amount CashFenceDone=Cash fence done for the period -NbOfInvoices=Nb of invoices \ No newline at end of file +NbOfInvoices=Nb of invoices +Paymentnumpad=Payment Num Pad +Numberspad=Numbers Pad +BillsCoinsPad=Bills and Coins Pad +DolistorePosCategory=TakePOS modules and other POS solutions for Dolibarr +TakeposNeedsCategories=TakePOS needs product categories to work \ No newline at end of file diff --git a/htdocs/takepos/admin/orderprinters.php b/htdocs/takepos/admin/orderprinters.php index a37a1d71c61..8306bb40e82 100644 --- a/htdocs/takepos/admin/orderprinters.php +++ b/htdocs/takepos/admin/orderprinters.php @@ -48,7 +48,6 @@ if (is_numeric($type)) $type=Categorie::$MAP_ID_TO_CODE[$type]; // For backward /* * Actions */ -print $action; if ($action=="SavePrinter1"){ $printedcategories=";"; if (is_array($printer1)) foreach ($printer1 as $cat){ diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php index aaec165baa5..9163b718077 100644 --- a/htdocs/takepos/admin/setup.php +++ b/htdocs/takepos/admin/setup.php @@ -25,13 +25,14 @@ require '../../main.inc.php'; // Load $user and permissions require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; // If socid provided by ajax company selector if (! empty($_REQUEST['CASHDESK_ID_THIRDPARTY_id'])) { - $_GET['CASHDESK_ID_THIRDPARTY'] = GETPOST('CASHDESK_ID_THIRDPARTY_id','alpha'); - $_POST['CASHDESK_ID_THIRDPARTY'] = GETPOST('CASHDESK_ID_THIRDPARTY_id','alpha'); - $_REQUEST['CASHDESK_ID_THIRDPARTY'] = GETPOST('CASHDESK_ID_THIRDPARTY_id','alpha'); + $_GET['CASHDESK_ID_THIRDPARTY'] = GETPOST('CASHDESK_ID_THIRDPARTY_id', 'alpha'); + $_POST['CASHDESK_ID_THIRDPARTY'] = GETPOST('CASHDESK_ID_THIRDPARTY_id', 'alpha'); + $_REQUEST['CASHDESK_ID_THIRDPARTY'] = GETPOST('CASHDESK_ID_THIRDPARTY_id', 'alpha'); } // Security check @@ -42,25 +43,28 @@ $langs->loadLangs(array("admin", "cashdesk")); /* * Actions */ -if (GETPOST('action','alpha') == 'set') +if (GETPOST('action', 'alpha') == 'set') { $db->begin(); - if (GETPOST('socid','int') < 0) $_POST["socid"]=''; + if (GETPOST('socid', 'int') < 0) $_POST["socid"]=''; - $res = dolibarr_set_const($db,"CASHDESK_ID_THIRDPARTY",(GETPOST('socid','int') > 0 ? GETPOST('socid','int') : ''),'chaine',0,'',$conf->entity); - $res = dolibarr_set_const($db,"CASHDESK_ID_BANKACCOUNT_CASH",(GETPOST('CASHDESK_ID_BANKACCOUNT_CASH','alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CASH','alpha') : ''),'chaine',0,'',$conf->entity); - $res = dolibarr_set_const($db,"CASHDESK_ID_BANKACCOUNT_CHEQUE",(GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE','alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE','alpha') : ''),'chaine',0,'',$conf->entity); - $res = dolibarr_set_const($db,"CASHDESK_ID_BANKACCOUNT_CB",(GETPOST('CASHDESK_ID_BANKACCOUNT_CB','alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CB','alpha') : ''),'chaine',0,'',$conf->entity); - $res = dolibarr_set_const($db,"CASHDESK_ID_WAREHOUSE",(GETPOST('CASHDESK_ID_WAREHOUSE','alpha') > 0 ? GETPOST('CASHDESK_ID_WAREHOUSE','alpha') : ''),'chaine',0,'',$conf->entity); - $res = dolibarr_set_const($db,"CASHDESK_NO_DECREASE_STOCK",GETPOST('CASHDESK_NO_DECREASE_STOCK','alpha'),'chaine',0,'',$conf->entity); - $res = dolibarr_set_const($db,"CASHDESK_SERVICES", GETPOST('CASHDESK_SERVICES','alpha'),'chaine',0,'',$conf->entity); - $res = dolibarr_set_const($db,"TAKEPOSCONNECTOR", GETPOST('TAKEPOSCONNECTOR','alpha'),'chaine',0,'',$conf->entity); - $res = dolibarr_set_const($db,"TAKEPOS_BAR_RESTAURANT", GETPOST('TAKEPOS_BAR_RESTAURANT','alpha'),'chaine',0,'',$conf->entity); - $res = dolibarr_set_const($db,"TAKEPOS_PRINT_SERVER", GETPOST('TAKEPOS_PRINT_SERVER','alpha'),'chaine',0,'',$conf->entity); - $res = dolibarr_set_const($db,"TAKEPOS_ORDER_PRINTERS", GETPOST('TAKEPOS_ORDER_PRINTERS','alpha'),'chaine',0,'',$conf->entity); + $res = dolibarr_set_const($db, "CASHDESK_ID_THIRDPARTY", (GETPOST('socid', 'int') > 0 ? GETPOST('socid', 'int') : ''), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CASH", (GETPOST('CASHDESK_ID_BANKACCOUNT_CASH', 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CASH', 'alpha') : ''), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CHEQUE", (GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE', 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE', 'alpha') : ''), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CB", (GETPOST('CASHDESK_ID_BANKACCOUNT_CB', 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CB', 'alpha') : ''), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "CASHDESK_ID_WAREHOUSE", (GETPOST('CASHDESK_ID_WAREHOUSE', 'alpha') > 0 ? GETPOST('CASHDESK_ID_WAREHOUSE', 'alpha') : ''), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "CASHDESK_NO_DECREASE_STOCK", GETPOST('CASHDESK_NO_DECREASE_STOCK', 'alpha'), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "CASHDESK_SERVICES", GETPOST('CASHDESK_SERVICES', 'alpha'), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "TAKEPOSCONNECTOR", GETPOST('TAKEPOSCONNECTOR', 'alpha'), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "TAKEPOS_BAR_RESTAURANT", GETPOST('TAKEPOS_BAR_RESTAURANT', 'alpha'), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "TAKEPOS_PRINT_SERVER", GETPOST('TAKEPOS_PRINT_SERVER', 'alpha'), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "TAKEPOS_ORDER_PRINTERS", GETPOST('TAKEPOS_ORDER_PRINTERS', 'alpha'), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "TAKEPOS_HEADER", GETPOST('TAKEPOS_HEADER', 'alpha'), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "TAKEPOS_FOOTER", GETPOST('TAKEPOS_FOOTER', 'alpha'), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "TAKEPOS_NUMPAD", GETPOST('TAKEPOS_NUMPAD', 'alpha'), 'chaine', 0, '', $conf->entity); - dol_syslog("admin/cashdesk: level ".GETPOST('level','alpha')); + dol_syslog("admin/cashdesk: level ".GETPOST('level', 'alpha')); if (! $res > 0) $error++; @@ -83,10 +87,10 @@ if (GETPOST('action','alpha') == 'set') $form=new Form($db); $formproduct=new FormProduct($db); -llxHeader('',$langs->trans("CashDeskSetup")); +llxHeader('', $langs->trans("CashDeskSetup")); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("CashDeskSetup").' (TakePOS)',$linkback,'title_setup'); +print load_fiche_titre($langs->trans("CashDeskSetup").' (TakePOS)', $linkback, 'title_setup'); print '
'; @@ -95,55 +99,101 @@ print '
'; print ''; print ''; +print ''; + +print ''; +print ''; +print "\n"; + if (! empty($conf->service->enabled)) { - print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'; - - print ''; - print ''; - print "\n"; - print '\n"; - - // Use Takepos printing - print '\n"; - - if ($conf->global->TAKEPOSCONNECTOR){ - print ''; - } - - // Bar Restaurant mode - print '\n"; - - if ($conf->global->TAKEPOS_BAR_RESTAURANT and $conf->global->TAKEPOSCONNECTOR){ - print ''; - } - - print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'; print $langs->trans("CashdeskShowServices"); print ''; - print $form->selectyesno("CASHDESK_SERVICES",$conf->global->CASHDESK_SERVICES,1); + print $form->selectyesno("CASHDESK_SERVICES", $conf->global->CASHDESK_SERVICES, 1); print "
'; - print $langs->trans("DolibarrReceiptPrinter").' ('.$langs->trans("TakeposConnectorNecesary").')'; - print ''; - print $form->selectyesno("TAKEPOSCONNECTOR",$conf->global->TAKEPOSCONNECTOR,1); - print "
'; - print $langs->trans("IPAddress").' ('.$langs->trans("TakeposConnectorNecesary").')'; - print ''; - print ''; - print '
'; - print 'Bar Restaurant'; - print ''; - print $form->selectyesno("TAKEPOS_BAR_RESTAURANT",$conf->global->TAKEPOS_BAR_RESTAURANT,1); - print "
'; - print $langs->trans("OrderPrinters").' ('.$langs->trans("Setup").')'; - print ''; - print $form->selectyesno("TAKEPOS_ORDER_PRINTERS",$conf->global->TAKEPOS_ORDER_PRINTERS,1); - print '
'; - - print '
'; } +// Use Takepos printing +print ''; +print $langs->trans("DolibarrReceiptPrinter").' ('.$langs->trans("TakeposConnectorNecesary").')'; +print ''; +print $form->selectyesno("TAKEPOSCONNECTOR", $conf->global->TAKEPOSCONNECTOR, 1); +print "\n"; + +if ($conf->global->TAKEPOSCONNECTOR){ + print ''; + print $langs->trans("IPAddress").' ('.$langs->trans("TakeposConnectorNecesary").')'; + print ''; + print ''; + print ''; +} + +// Bar Restaurant mode +print ''; +print 'Bar Restaurant'; +print ''; +print $form->selectyesno("TAKEPOS_BAR_RESTAURANT", $conf->global->TAKEPOS_BAR_RESTAURANT, 1); +print "\n"; + +if ($conf->global->TAKEPOS_BAR_RESTAURANT && $conf->global->TAKEPOSCONNECTOR){ + print ''; + print $langs->trans("OrderPrinters").' ('.$langs->trans("Setup").')'; + print ''; + print $form->selectyesno("TAKEPOS_ORDER_PRINTERS", $conf->global->TAKEPOS_ORDER_PRINTERS, 1); + print ''; +} + +// Payment numpad +print ''; +print $langs->trans("Paymentnumpad"); +print ''; +$array=array(0=>$langs->trans("Numberspad"), 1=>$langs->trans("BillsCoinsPad")); +print $form->selectarray('TAKEPOS_NUMPAD', $array, (empty($conf->global->TAKEPOS_NUMPAD)?'0':$conf->global->TAKEPOS_NUMPAD), 0); +print "\n"; + +$substitutionarray=pdf_getSubstitutionArray($langs, null, null, 2); +$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation"); +$htmltext = ''.$langs->trans("AvailableVariables").':
'; +foreach($substitutionarray as $key => $val) $htmltext.=$key.'
'; +$htmltext.='
'; + +print ''; +print $form->textwithpicto($langs->trans("FreeLegalTextOnInvoices")." - ".$langs->trans("Header"), $htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'
'; +print ''; +$variablename='TAKEPOS_HEADER'; +if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) +{ + print ''; +} +else +{ + include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); + print $doleditor->Create(); +} +print "\n"; + +print ''; +print $form->textwithpicto($langs->trans("FreeLegalTextOnInvoices")." - ".$langs->trans("Footer"), $htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'
'; +print ''; +$variablename='TAKEPOS_FOOTER'; +if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) +{ + print ''; +} +else +{ + include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); + print $doleditor->Create(); +} +print "\n"; + +print ''; + +print '
'; + print ''; print ''; @@ -159,19 +209,19 @@ if (! empty($conf->banque->enabled)) print ''; print ''; print ''; print ''; print ''; print ''; } @@ -181,12 +231,12 @@ if (! empty($conf->stock->enabled)) print ''; // Force warehouse (this is not a default value) print '
'.$langs->trans("CashDeskBankAccountForSell").''; - $form->select_comptes($conf->global->CASHDESK_ID_BANKACCOUNT_CASH,'CASHDESK_ID_BANKACCOUNT_CASH',0,"courant=2",1); + $form->select_comptes($conf->global->CASHDESK_ID_BANKACCOUNT_CASH, 'CASHDESK_ID_BANKACCOUNT_CASH', 0, "courant=2", 1); print '
'.$langs->trans("CashDeskBankAccountForCheque").''; - $form->select_comptes($conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE,'CASHDESK_ID_BANKACCOUNT_CHEQUE',0,"courant=1",1); + $form->select_comptes($conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE, 'CASHDESK_ID_BANKACCOUNT_CHEQUE', 0, "courant=1", 1); print '
'.$langs->trans("CashDeskBankAccountForCB").''; - $form->select_comptes($conf->global->CASHDESK_ID_BANKACCOUNT_CB,'CASHDESK_ID_BANKACCOUNT_CB',0,"courant=1",1); + $form->select_comptes($conf->global->CASHDESK_ID_BANKACCOUNT_CB, 'CASHDESK_ID_BANKACCOUNT_CB', 0, "courant=1", 1); print '
'.$langs->trans("CashDeskDoNotDecreaseStock").''; if (empty($conf->productbatch->enabled)) { - print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK',$conf->global->CASHDESK_NO_DECREASE_STOCK,1); + print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK', $conf->global->CASHDESK_NO_DECREASE_STOCK, 1); } else { if (!$conf->global->CASHDESK_NO_DECREASE_STOCK) { - $res = dolibarr_set_const($db,"CASHDESK_NO_DECREASE_STOCK",1,'chaine',0,'',$conf->entity); + $res = dolibarr_set_const($db, "CASHDESK_NO_DECREASE_STOCK", 1, 'chaine', 0, '', $conf->entity); } print $langs->trans("Yes").'
'; print ''.$langs->trans('StockDecreaseForPointOfSaleDisabledbyBatch').''; @@ -200,7 +250,7 @@ if (! empty($conf->stock->enabled)) print '
'; if (! $disabled) { - print $formproduct->selectWarehouses($conf->global->CASHDESK_ID_WAREHOUSE,'CASHDESK_ID_WAREHOUSE','',1,$disabled); + print $formproduct->selectWarehouses($conf->global->CASHDESK_ID_WAREHOUSE, 'CASHDESK_ID_WAREHOUSE', '', 1, $disabled); print ' ('.$langs->trans("Create").')'; } else @@ -223,14 +273,14 @@ print '

'; // Marketplace print "\n"; print "\n"; -print ''; +print ''; print ''; print ''; print "\n"; -$url='https://www.dolistore.com/en/modules/980-TakePOS-7-mobile.html'; -print ''; -print ''; +$url='https://www.dolistore.com/45-pos'; + print ''; +print ''; print ''; print ''; @@ -246,7 +296,7 @@ print ''; print "\n"; $url='http://www.takepos.com'; -print ''; +print ''; print ''; print ''; print ''; diff --git a/htdocs/takepos/css/pos.css b/htdocs/takepos/css/pos.css index 62a0865482f..87c74c8952d 100644 --- a/htdocs/takepos/css/pos.css +++ b/htdocs/takepos/css/pos.css @@ -1,22 +1,9 @@ html,body { - padding:0; + box-sizing: border-box; + padding:3px; margin:0; height:100%; -} - -body { - width:100%; -} - -.row { - width:100%; - height:50%; -} - -.row div { - width:33%; - height:100%; - float:left; + width:100%; } button.calcbutton { @@ -27,10 +14,11 @@ button.calcbutton { cursor: pointer; vertical-align: middle; text-align: center; - font-size:180%; overflow: visible; /* removes extra width in IE */ width:24%; height:24%; + font-weight: bold; + color: #555555; } button.calcbutton2 { @@ -41,10 +29,11 @@ button.calcbutton2 { cursor: pointer; vertical-align: middle; text-align: center; - font-size:120%; overflow: visible; /* removes extra width in IE */ width:24%; height:24%; + font-weight: bold; + color: #555555; } button.calcbutton3 { @@ -59,7 +48,6 @@ button.calcbutton3 { overflow: visible; /* removes extra width in IE */ width:12%; height:24%; - } button.actionbutton { @@ -70,35 +58,42 @@ button.actionbutton { cursor: pointer; vertical-align: middle; text-align: center; - font-size:100%; overflow: visible; /* removes extra width in IE */ - width:32%; - height:32%; + width:33%; + height:33%; } div.wrapper{ float:left; /* important */ position:relative; /* important(so we can absolutely position the description div */ - width:21.5%; - height:23%; - margin:1%; + width:25%; + height:25%; + margin:0; + padding:1px; border: 0.1em solid; box-shadow: 3px 3px 2px #888; text-align: center; + box-sizing: border-box; + background-color:#f0eeee; } div.wrapper2{ float:left; /* important */ position:relative; /* important(so we can absolutely position the description div */ - width:10.2%; - height:23%; - margin-top:0.5%; - margin-bottom:0.5%; - margin-left:0.5%; - margin-right:0.5%; + width:12.5%; + height:25%; + margin:0; + padding:1px; border: 0.1em solid; - box-shadow: 3px 3px 2px #888; + box-shadow: 2px 2px 1px #888; text-align: center; + box-sizing: border-box; + background-color:#f0eeee; +} + +button:active{ + background:black; + color: white; } div.description{ @@ -106,10 +101,9 @@ div.description{ bottom:0px; /* position will be on bottom */ left:0px; width:100%; - /* styling bellow */ + /* styling below */ background-color:black; font-family: 'tahoma'; - font-size:100%; color:white; opacity:0.8; /* transparency */ filter:alpha(opacity=80); /* IE transparency */ @@ -122,8 +116,126 @@ div.description{ } } +.container{ + width: 100%; + height: 100%; + margin: 0 auto; + overflow: visible; + box-sizing: border-box; +} + +.row1{ + margin: 0 auto; + width: 100%; + height: 34%; +} + +.row2{ + margin: 0 auto; + width: 100%; + height: 66%; +} + +.div1{ + height:100%; + width: 34%; + float: left; + text-align: center; + box-sizing: border-box; + overflow: auto; + background-color:white; +} + +.div2{ + height: 100%; + width: 33%; + font-size: 0; + float: left; + padding-left: 10px; + box-sizing: border-box; +} + +.div3{ + height: 100%; + width: 33%; + float: left; + box-sizing: border-box; +} + +.div4{ + height: 100%; + width: 34%; + float: left; + box-sizing: border-box; + font-size: 6px; + padding:3px; +} + +.div5{ + height: 100%; + width: 66%; + float: left; + box-sizing: border-box; + font-size: 6px; + padding:10px; +} + p.description_content{ padding:10px; margin:0px; } + +@media screen and (min-width: 892px) { + .calcbutton{ + font-size: 18px; + } + .calcbutton2{ + font-size: 14px; + } + .actionbutton{ + font-size: 13px; + } + div.description{ + font-size: 15px; + } + .invoice{ + font-size: 14px; + } +} + +@media (max-width: 891px) and (min-width: 386px) { + .calcbutton{ + font-size: 12px; + } + .calcbutton2{ + font-size: 9px; + } + .actionbutton{ + font-size: 12px; + } + div.description{ + font-size: 13px; + } + .invoice{ + font-size: 12px; + } +} + +@media screen and (max-width: 385px){ + .calcbutton{ + font-size: 8px; + } + .calcbutton2{ + font-size: 7px; + } + .actionbutton{ + font-size: 10px; + } + div.description{ + font-size: 11px; + } + .invoice{ + font-size: 10px; + } +} \ No newline at end of file diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 52d4864385f..ed3e5def318 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -189,7 +189,7 @@ if ($action=="order" and $placeid!=0){ ?>
TakePOS Marketplace'.$langs->trans("WebSiteDesc").''.$langs->trans("URL").'
TakePOS for mobile devices'.$langs->trans("DolistorePosCategory").''.$url.'
TakePOS original developers'.$url.'