Merge lp:~mikel-martin/openobject-addons/extra-5.0_esale_osc_enhancement into lp:openobject-addons/extra-5.0

Proposed by mikel
Status: Needs review
Proposed branch: lp:~mikel-martin/openobject-addons/extra-5.0_esale_osc_enhancement
Merge into: lp:openobject-addons/extra-5.0
Diff against target: 4794 lines (+1651/-1634) (has conflicts)
13 files modified
.bzrignore (+4/-0)
esale_osc/__terp__.py (+8/-2)
esale_osc/connector/ZhenIT_zencart_compatibility_functions.php (+244/-0)
esale_osc/connector/openerp-synchro.php (+371/-521)
esale_osc/connector/openerp_login.php (+41/-0)
esale_osc/connector/openerp_runonce.php (+10/-0)
esale_osc/esale_oscom.py (+348/-326)
esale_osc/esale_oscom_product.py (+13/-7)
esale_osc/esale_oscom_view.xml (+375/-372)
esale_osc/esale_oscom_workflow.xml (+0/-230)
esale_osc/i18n/es_ES.po (+36/-6)
esale_osc/i18n/esale_osc.pot (+200/-170)
esale_osc/wizard/wizard_esale_oscom_update_select_stocks.py (+1/-0)
Path conflict: <deleted> / account_product_fiscal_classification.py
Path conflict: <deleted> / __init__.py
Path conflict: <deleted> / product_view.xml
Path conflict: <deleted> / __terp__.py
Contents conflict in esale_osc/i18n/es.po
To merge this branch: bzr merge lp:~mikel-martin/openobject-addons/extra-5.0_esale_osc_enhancement
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+21279@code.launchpad.net
To post a comment you must log in.
6. By mikel <mikel@pcl2>

ok

7. By mikel <mikel@pcl2>

Merge totnto

8. By mikel <mikel@pcl2>

Fix oscom_prod_url qhen not oscommerce o not in root folder
Fix import multiple variants qhen options value name is different in different languages
Add option to avoid syncronization of shop products whit openerp's maodifies data

Unmerged revisions

8. By mikel <mikel@pcl2>

Fix oscom_prod_url qhen not oscommerce o not in root folder
Fix import multiple variants qhen options value name is different in different languages
Add option to avoid syncronization of shop products whit openerp's maodifies data

7. By mikel <mikel@pcl2>

Merge totnto

6. By mikel <mikel@pcl2>

ok

5. By mikel <mikel@pcl2>

Ability to define a default category for imported partners

added:
  .bzrignore
modified:
  esale_osc/connector/openerp-synchro.php
  esale_osc/esale_oscom.py
  esale_osc/esale_oscom_view.xml
  esale_osc/i18n/es_ES.po
  esale_osc/i18n/esale_osc.pot

4. By mikel <mikel@pcl2>

Comentarios idiomas y bug en sincronización de descripciones de productos
removed:
  esale_osc/i18n/es.po
modified:
  esale_osc/__terp__.py
  esale_osc/connector/openerp-synchro.php
  esale_osc/i18n/es_ES.po*
  esale_osc/i18n/esale_osc.pot*

3. By mikel <mikel@pcl2>

changes in credits

2. By mikel <mikel@pcl2>

missing files

1. By mikel <mikel@pcl2>

Added to esale_osc:
- ZenCart compatibility
- osCommerce admin authentication

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file '.bzrignore'
--- .bzrignore 1970-01-01 00:00:00 +0000
+++ .bzrignore 2010-07-21 10:31:39 +0000
@@ -0,0 +1,4 @@
1.orig
2*.orig
3*.pyc
4*~
05
=== modified file 'esale_osc/__terp__.py'
--- esale_osc/__terp__.py 2009-11-16 19:09:09 +0000
+++ esale_osc/__terp__.py 2010-07-21 10:31:39 +0000
@@ -1,3 +1,4 @@
1# -*- coding: utf-8 -*-
1# -*- encoding: utf-8 -*-2# -*- encoding: utf-8 -*-
2##############################################################################3##############################################################################
3#4#
@@ -23,7 +24,7 @@
2324
24{25{
25 "name" : "OScommerce Interface / ZenCart",26 "name" : "OScommerce Interface / ZenCart",
26 "version" : "1.0",27 "version" : "1.5",
27 "author" : "Axelor/Zikzakmedia",28 "author" : "Axelor/Zikzakmedia",
28 "license" : "GPL-3",29 "license" : "GPL-3",
29 "category" : "Interfaces/CMS & eCommerce",30 "category" : "Interfaces/CMS & eCommerce",
@@ -41,7 +42,12 @@
41 2. Export Stocks. 42 2. Export Stocks.
42 3. Change Oscommerce Order status and include comments. Upload Osc Status and comments. 43 3. Change Oscommerce Order status and include comments. Upload Osc Status and comments.
4344
44Developed by Tiny, Axelor, Zikzakmedia and Ana Juaristi""",45New in this version (1.5.0):
46 * User validation at store's administration
47 * Out of the box ZenCart compatibility
48 * Encoding isues
49
50Developed by Tiny, Axelor, Zikzakmedia, Ana Juaristi and ZhenIT Software""",
45 "init_xml" : [],51 "init_xml" : [],
46 "demo_xml" : [],52 "demo_xml" : [],
47 "update_xml" : [53 "update_xml" : [
4854
=== added file 'esale_osc/connector/ZhenIT_zencart_compatibility_functions.php'
--- esale_osc/connector/ZhenIT_zencart_compatibility_functions.php 1970-01-01 00:00:00 +0000
+++ esale_osc/connector/ZhenIT_zencart_compatibility_functions.php 2010-07-21 10:31:39 +0000
@@ -0,0 +1,244 @@
1<?
2/*
3 OsCommerce/Zencart Compatibility Payment Module Copyright (c) 2010 ZhenIT Software
4
5 Valid for osCommerce, Zencart & soon for xt:commerce
6
7 http://ZhenIT.com
8 info@ZhenIT.com
9
10 Released under the GNU General Public License
11
12 No se limita la reutilización o mejora de este código pero se ruega
13 se mantengan los créditos y las referencias a ZhenIT, tanto las
14 explícitas como en los nombres de ficheros o de funciones.
15
16*/
17define('PLATAFORMA','zen');
18define("IS_ADMIN_FLAG","true");
19// include("../".DIR_WS_CLASSES."class.base.php");
20// require("../".DIR_WS_CLASSES."db/" .DB_TYPE . '/query_factory.php');
21// $db = new queryFactory();
22// $db->connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD, DB_DATABASE, USE_PCONNECT, false);
23if (file_exists("../".DIR_WS_INCLUDES."compat_ZhenIT/ZhenIT_zencart_compatibility_functions.php")){
24 include_once("../".DIR_WS_INCLUDES."compat_ZhenIT/ZhenIT_zencart_compatibility_functions.php");
25}else{
26 function tep_db_query($query)
27 {
28 global $db;
29 return($db->Execute($query));
30 }
31
32 function tep_db_fetch_array(&$query){
33 if(!$query->EOF){
34 $array = $query->fields;
35 $query->MoveNext();
36 return $array;
37 }
38 return false;
39 }
40
41 function tep_db_num_rows($query)
42 {
43 return($query->RecordCount());
44 }
45
46 function tep_db_input($string) {
47 if (function_exists('mysql_escape_string')) {
48 return mysql_escape_string($string);
49 }
50 return addslashes($string);
51 }
52
53 function tep_db_perform($table, $data, $action = 'insert', $parameters = '') {
54 reset($data);
55 if ($action == 'insert') {
56 $query = 'insert into ' . $table . ' (';
57 while (list($columns, ) = each($data)) {
58 $query .= $columns . ', ';
59 }
60 $query = substr($query, 0, -2) . ') values (';
61 reset($data);
62 while (list(, $value) = each($data)) {
63 switch ((string)$value) {
64 case 'now()':
65 $query .= 'now(), ';
66 break;
67 case 'null':
68 $query .= 'null, ';
69 break;
70 default:
71 $query .= '\'' . tep_db_input($value) . '\', ';
72 break;
73 }
74 }
75 $query = substr($query, 0, -2) . ')';
76 } elseif ($action == 'update') {
77 $query = 'update ' . $table . ' set ';
78 while (list($columns, $value) = each($data)) {
79 switch ((string)$value) {
80 case 'now()':
81 $query .= $columns . ' = now(), ';
82 break;
83 case 'null':
84 $query .= $columns .= ' = null, ';
85 break;
86 default:
87 $query .= $columns . ' = \'' . tep_db_input($value) . '\', ';
88 break;
89 }
90 }
91 $query = substr($query, 0, -2) . ' where ' . $parameters;
92 }
93
94 return tep_db_query($query);
95 }
96
97 function tep_db_insert_id() {
98 return mysql_insert_id();
99 }
100
101 function tep_draw_hidden_field($name, $value = '', $parameters = '') {
102 return zen_draw_hidden_field($name,$value,$parameters);
103 }
104
105 function tep_redirect($url) {
106 zen_redirect($url);
107 }
108
109 function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) {
110 return zen_href_link($page , $parameters, $connection , $add_session_id , $search_engine_safe);
111 }
112
113 function tep_cfg_pull_down_zone_classes($zone_class_id, $key = '') {
114 return zen_cfg_pull_down_zone_classes($zone_class_id, $key);
115 }
116 function tep_cfg_pull_down_order_statuses($zone_class_id, $key = '') {
117 return zen_cfg_pull_down_order_statuses($zone_class_id, $key);
118 }
119 function tep_get_order_status_name($zone_class_id, $key = '') {
120 return zen_get_order_status_name($zone_class_id, $key);
121 }
122 function tep_get_zone_class_title($zone_class_id, $key = '') {
123 return zen_get_zone_class_title($zone_class_id, $key);
124 }
125
126 function tep_cfg_select_option($select_array, $key_value, $key = '') {
127 return zen_cfg_select_option($select_array, $key_value, $key) ;
128 }
129 function tep_session_id($sessid = '') {
130 return zen_session_id($sessid );
131 }
132 function tep_session_register($param) {
133 return zen_session_register($param);
134 }
135 function tep_session_unregister($param) {
136 return zen_session_unregister($param);
137 }
138 function tep_cfg_pull_down_tax_classes($tax_class_id, $key = '') {
139 return zen_cfg_pull_down_tax_classes($tax_class_id, $key);
140 }
141 function tep_get_tax_class_title($tax_class_id) {
142 return zen_get_tax_class_title($tax_class_id);
143 }
144
145 function tep_get_tax_rate($tax_class_id){
146 return zen_get_tax_rate($tax_class_id);
147 }
148 function tep_get_tax_description($tax_class_id, $country, $zone){
149 return zen_get_tax_description($tax_class_id, $country, $zone);
150 }
151 function tep_calculate_tax($amount, $rate){
152 return zen_calculate_tax($amount, $rate);
153 }
154 function tep_get_prid($id){
155 return zen_get_prid($id);
156 }
157 function tep_not_null($variable){
158 return zen_not_null($variable);
159 }
160 function tep_session_is_registered($variable) {
161 if (PHP_VERSION < 4.3) {
162 return session_is_registered($variable);
163 } else {
164 return isset($_SESSION) && array_key_exists($variable, $_SESSION);
165 }
166 }
167 function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '') {
168 return zen_image($src, $alt, $width, $height, $parameters);
169 }
170 function tep_image_button($image, $alt = '', $parameters = '') {
171 global $language;
172 return zen_image(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image, $alt, '', '', $parameters);
173 }
174 function tep_draw_separator($image = 'pixel_black.gif', $width = '100%', $height = '1') {
175 return zen_image(DIR_WS_IMAGES . $image, '', $width, $height);
176 }
177 function tep_catalog_href_link($page = '', $parameters = '', $connection = 'NONSSL') {
178 return zen_catalog_href_link($page , $parameters , $connection );
179 }
180 function tep_call_function($function, $parameter, $object = '') {
181 return zen_call_function($function, $parameter, $object = '');
182 }
183 function tep_get_all_get_params($exclude_array = ''){
184 return zen_get_all_get_params($exclude_array);
185 }
186 function tep_db_prepare_input($sql){
187 return zen_db_prepare_input($sql);
188 }
189 function tep_date_short($raw_date){
190 return zen_date_short($raw_date);
191 }
192 function tep_datetime_short($raw_datetime) {
193 return zen_datetime_short($raw_date);
194 }
195 function tep_draw_pull_down_menu($name, $values, $default = '', $parameters = '', $required = false) {
196 return zen_draw_pull_down_menu($name, $values, $default, $parameters, $required);
197 }
198 function tep_draw_input_field($name, $value = '', $parameters = '', $required = false, $type = 'text', $reinsert_value = true){
199 return zen_draw_input_field($name, $value = '', $parameters = '', $required = false, $type = 'text', $reinsert_value = true);
200 }
201 function tep_draw_form($name, $action, $parameters = '', $method = 'post', $params = ''){
202 return zen_draw_form($name, $action, $parameters , $method, $params );
203 }
204 function tep_image_submit($image, $alt = '', $parameters = '') {
205 return zen_image_submit($image, $alt, $parameters);
206 }
207 function tep_hide_session_id() {
208 return zen_hide_session_id();
209 }
210 function tep_address_format($address_format_id, $address, $html, $boln, $eoln) {
211 return zen_address_format($address_format_id, $address, $html, $boln, $eoln) ;
212 }
213 function tep_display_tax_value($value, $padding = TAX_DECIMAL_PLACES) {
214 return zen_display_tax_value($value, $padding);
215 }
216 function tep_add_tax($price, $tax, $override = false) {
217 return zen_add_tax($price, $tax, $override );
218 }
219 function tep_db_output($string) {
220 return zen_db_output($string);
221 }
222 function tep_draw_textarea_field($name, $wrap, $width, $height, $text = '', $parameters = '', $reinsert_value = true) {
223 return zen_draw_textarea_field($name, $wrap, $width, $height, $text, $parameters, $reinsert_value);
224 }
225 function tep_draw_checkbox_field($name, $value = '', $checked = false, $compare = '') {
226 return zen_draw_checkbox_field($name, $value , $checked , $compare);
227 }
228 function tep_draw_radio_field($name, $value = '', $checked = false, $compare = '') {
229 return zen_draw_radio_field($name, $value , $checked , $compare );
230 }
231 function tep_get_category_name($category_id, $language_id) {
232 return zen_get_category_name($category_id, $language_id);
233 }
234 function tep_get_country_name($country_id){
235 return zen_get_country_name($country_id);
236 }
237 function tep_get_languages(){
238 return zen_get_languages();
239 }
240 function tep_validate_password($plain, $encrypted) {
241 return zen_validate_password($plain, $encrypted);
242 }
243}
244?>
0\ No newline at end of file245\ No newline at end of file
1246
=== modified file 'esale_osc/connector/openerp-synchro.php'
--- esale_osc/connector/openerp-synchro.php 2010-02-02 20:22:20 +0000
+++ esale_osc/connector/openerp-synchro.php 2010-07-21 10:31:39 +0000
@@ -3,9 +3,12 @@
3#3#
4# OpenERP, Open Source Management Solution4# OpenERP, Open Source Management Solution
5# Copyright (c) 2008 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved.5# Copyright (c) 2008 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved.
6# Jordi Esteve <jesteve@zikzakmedia.com> 6# Jordi Esteve <jesteve@zikzakmedia.com>
7# Ana Juaristi <ajuaristio@gmail.com>7# Ana Juaristi <ajuaristio@gmail.com>
8# $Id$8#
9# Copyright (c) 2010 ZhenIT Software http://ZhenIT.com
10# Added ZenCart compatibility out of the box
11# Added user validation in the stores administration.
9#12#
10# This program is free software: you can redistribute it and/or modify13# This program is free software: you can redistribute it and/or modify
11# it under the terms of the GNU General Public License as published by14# it under the terms of the GNU General Public License as published by
@@ -21,57 +24,75 @@
21# along with this program. If not, see <http://www.gnu.org/licenses/>.24# along with this program. If not, see <http://www.gnu.org/licenses/>.
22#25#
23##############################################################################*/26##############################################################################*/
2427//SET YOUR PREFERENCES
25////////////////////////////////////////////////////////////////////////////////////////////////////////////////////28define('DIR_WS_INCLUDES', 'includes/');
26///////////////// On windows servers line 65 use return utf8_encode($text); ////////////////////29define('TRANSACTIONAL',true); //Set true if you have installed transactional feature.
27///////////////// PLEASE CONFIGURE THE RIGHT INCLUDES AND DEFINES FOR YOUR CONFIGURATION ////////////////////30define('DEBUG_MODE', true); //Absolute path to debug and warning file
2831define('DEBUG_FILE', '../images/debug.xmlrpc.txt'); //Absolute path to debug and warning file
32
33
34///////login//////////////
35include("openerp_login.php");
36$url = ($_SERVER['HTTPS']?'https':'http').'://'.$_SERVER['HTTP_HOST'].substr($_SERVER['PHP_SELF'],0,strrpos($_SERVER['PHP_SELF'],'/')+1);
37login($url,$_GET['admin_user'],$_GET['admin_pass']);
38//////////////////////////
39
40
41//////////////////////////////////////////////////////////////////////////////////////////////////
42///////////////// THIS INCLUDES SHOULD BE OK, BUT CHANGE THEM IF YOU NEED ////////////////////
43include(DIR_WS_INCLUDES."application_top.php");
29include("xmlrpcutils/xmlrpc.inc");44include("xmlrpcutils/xmlrpc.inc");
30include("xmlrpcutils/xmlrpcs.inc");45include("xmlrpcutils/xmlrpcs.inc");
31include("../../includes/configure.php");46
3247////ZENCARTS FUCNTIONS MAPPING///////////////////////////////////////////////////////////////////
33define('TRANSACTIONAL',true); //Set true if you have intalled transactional feature.48if(function_exists('zen_redirect')){
34define('RESPONSE_ENCODING', 'ISO-8859-1'); //It must be your DDBB encoding49 include_once('ZhenIT_zencart_compatibility_functions.php');
35define('DEBUG_FILE', '../../temp/debug.xmlrpc.txt'); //Absolute path to debug and warning file50}else{
3651 define('PLATAFORMA','osc');
37////////////////////////////////////////////////////////////////////////////////////////////////////////////////////52}
53////////////////INSTALL/////////////
54//CHECKS TO MAKE ONCE (CREATE FIELDS IN DB ETC...)
55@include("openerp_runonce.php");
56////////////////////////////////////
57
58/////DEBUG/////////////////////////
59if(DEBUG_MODE){
60 @ini_set('display_errors', '1');
61 error_reporting(E_ALL & ~E_NOTICE);
62 function debug($s) {
63 $fp = fopen(DEBUG_FILE,"a");
64 fwrite($fp, $s."\n");
65 fclose($fp);
66 }
67
68 function debug_arr($para_arr,$tab='') {
69 if (is_array($para_arr)) {
70 foreach($para_arr as $key=>$values) {
71 debug($tab.'Key :'.$key.' Value :'.$values);
72 }
73 }
74 }
75}else{
76 function debug($s) {return;}
77 function debug_arr($para_arr,$tab='') {return;}
78}
3879
39$con = mysql_pconnect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD);80$con = mysql_pconnect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD);
40mysql_select_db(DB_DATABASE);81mysql_select_db(DB_DATABASE);
4182
4283//This function should let openERP know about the shop
43function debug($s) {84function init() {
44 $fp = fopen(DEBUG_FILE,"a");85 $values = array();
45 fwrite($fp, $s."\n");86 $values[] = new xmlrpcval(PLATAFORMA, "string");
46 fclose($fp);87 return new xmlrpcresp( new xmlrpcval($values, "array"));
47}
48
49function debug_arr($para_arr,$tab='') {
50 if (is_array($para_arr)) {
51 foreach($para_arr as $key=>$values) {
52 debug($tab.'Key :'.$key.' Value :'.$values);
53 /*
54 if (is_array($values)) {
55 $tab.='\t';
56 debug_arr($values,$tab);
57 }*/
58 }
59 }
60}
61
62function clean_special_chars($text){
63 for ($i=128; $i<=159; $i++){
64 $text = ereg_replace(chr($i), "?", $text );
65 }
66 return $text;
67}88}
6889
69function get_taxes() {90function get_taxes() {
70 $taxes = array();91 $taxes = array();
7192
72 $result = mysql_query("select tax_class_id, tax_class_title from tax_class;");93 $result = mysql_query("select tax_class_id, tax_class_title from ".TABLE_TAX_CLASS.";");
73 if ($result) while ($row = mysql_fetch_row($result)) {94 if ($result) while ($row = mysql_fetch_row($result)) {
74 $taxes[] = new xmlrpcval(array(new xmlrpcval($row[0], "int"), new xmlrpcval($row[1], "string")), "array");95 $taxes[] = new xmlrpcval(array(new xmlrpcval($row[0], "int"), new xmlrpcval(utf8_encode($row[1]), "string")), "array");
75 }96 }
76 return new xmlrpcresp( new xmlrpcval($taxes, "array"));97 return new xmlrpcresp( new xmlrpcval($taxes, "array"));
77}98}
@@ -79,9 +100,9 @@
79function get_statuses() {100function get_statuses() {
80 $status = array();101 $status = array();
81102
82 $result = mysql_query("select orders_status_id, orders_status_name, language_id from orders_status;");103 $result = mysql_query("select orders_status_id, orders_status_name, language_id from ".TABLE_ORDERS_STATUS);
83 if ($result) while ($row = mysql_fetch_row($result)) {104 if ($result) while ($row = mysql_fetch_row($result)) {
84 $status[] = new xmlrpcval(array(new xmlrpcval($row[0], "int"), new xmlrpcval(clean_special_chars($row[1]), "string"), new xmlrpcval($row[2], "int")), "array");105 $status[] = new xmlrpcval(array(new xmlrpcval($row[0], "int"), new xmlrpcval(utf8_encode($row[1]), "string"), new xmlrpcval($row[2], "int")), "array");
85 }106 }
86 return new xmlrpcresp( new xmlrpcval($status, "array"));107 return new xmlrpcresp( new xmlrpcval($status, "array"));
87}108}
@@ -89,10 +110,9 @@
89110
90function get_languages() {111function get_languages() {
91 $languages = array();112 $languages = array();
92113 $result = mysql_query("select languages_id, name from ".TABLE_LANGUAGES.";");
93 $result = mysql_query("select languages_id, name from languages;");
94 if ($result) while ($row = mysql_fetch_row($result)) {114 if ($result) while ($row = mysql_fetch_row($result)) {
95 $languages[] = new xmlrpcval(array(new xmlrpcval($row[0], "int"), new xmlrpcval(clean_special_chars($row[1]), "string")), "array");115 $languages[] = new xmlrpcval(array(new xmlrpcval($row[0], "int"), new xmlrpcval(utf8_encode($row[1]), "string")), "array");
96 }116 }
97 return new xmlrpcresp(new xmlrpcval($languages, "array"));117 return new xmlrpcresp(new xmlrpcval($languages, "array"));
98}118}
@@ -101,11 +121,11 @@
101function get_categories() {121function get_categories() {
102 $categories = array();122 $categories = array();
103123
104 $result = mysql_query("select categories_id, min(language_id) from categories_description group by categories_id;");124 $result = mysql_query("select categories_id, min(language_id) from ".TABLE_CATEGORIES_DESCRIPTION." group by categories_id;");
105 if ($result) while ($row = mysql_fetch_row($result)) {125 if ($result) while ($row = mysql_fetch_row($result)) {
106 $resultb = mysql_query("select categories_id, categories_name from categories_description where categories_id=".$row[0]." and language_id=".$row[1].";");126 $resultb = mysql_query("select categories_id, categories_name from ".TABLE_CATEGORIES_DESCRIPTION." where categories_id=".$row[0]." and language_id=".$row[1].";");
107 if ($resultb and $row = mysql_fetch_row($resultb)) {127 if ($resultb and $row = mysql_fetch_row($resultb)) {
108 $categories[] = new xmlrpcval(array(new xmlrpcval($row[0], "int"), new xmlrpcval(clean_special_chars(parent_category($row[0],$row[1])), "string")), "array");128 $categories[] = new xmlrpcval(array(new xmlrpcval($row[0], "int"), new xmlrpcval(utf8_encode(parent_category($row[0],$row[1])), "string")), "array");
109 }129 }
110 }130 }
111 return new xmlrpcresp( new xmlrpcval($categories, "array"));131 return new xmlrpcresp( new xmlrpcval($categories, "array"));
@@ -115,17 +135,16 @@
115 $categories = array();135 $categories = array();
116 $lang_ids = "";136 $lang_ids = "";
117137
118 foreach ($languages as $lang)138 foreach ($languages as $lang){
119 $lang_ids = $lang.", ";139 $lang_ids = $lang.", ";
140 }
120 $lang_ids = substr($lang_ids, 0, strlen($lang_ids)-2);141 $lang_ids = substr($lang_ids, 0, strlen($lang_ids)-2);
121 $result = mysql_query("select categories_id, parent_id from categories order by parent_id;");142 $result = mysql_query("select categories_id, parent_id from ".TABLE_CATEGORIES." order by parent_id;");
122 if ($result) while ($row = mysql_fetch_row($result)) {143 if ($result) while ($row = mysql_fetch_row($result)) {
123 //debug('Category: ' . $row[0].'-'. $row[1]);
124 $cat = array(new xmlrpcval($row[0], "int"), new xmlrpcval($row[1], "int"));144 $cat = array(new xmlrpcval($row[0], "int"), new xmlrpcval($row[1], "int"));
125 $resultlang = mysql_query("select categories_id, categories_name from categories_description where categories_id=".$row[0]." and language_id in ($lang_ids);");145 $resultlang = mysql_query("select categories_id, categories_name from ".TABLE_CATEGORIES_DESCRIPTION." where categories_id=".$row[0]." and language_id in ($lang_ids);");
126 if ($resultlang) while ($rowl = mysql_fetch_row($resultlang)) {146 if ($resultlang) while ($rowl = mysql_fetch_row($resultlang)) {
127 //debug('Category language: ' .$rowl[1]);147 $cat[] = new xmlrpcval(utf8_encode($rowl[1]), "string");
128 $cat[] = new xmlrpcval(clean_special_chars($rowl[1]), "string");
129 }148 }
130 $categories[] = new xmlrpcval($cat, "array");149 $categories[] = new xmlrpcval($cat, "array");
131 }150 }
@@ -133,6 +152,7 @@
133}152}
134153
135function get_products($languages, $osCodIni, $block, $last_date) {154function get_products($languages, $osCodIni, $block, $last_date) {
155 global $languages_id;
136 $products = array();156 $products = array();
137 $prod = array();157 $prod = array();
138 $prod_desc = array();158 $prod_desc = array();
@@ -159,59 +179,59 @@
159 products_status,179 products_status,
160 products_tax_class_id,180 products_tax_class_id,
161 manufacturers_id181 manufacturers_id
162 from products";182 from ".TABLE_PRODUCTS;
163183
164 $nexo = ' where ';184 $nexo = ' where ';
165185
166 if (TRANSACTIONAL){186 if (TRANSACTIONAL){
167 $sQuery .= $nexo . "( products_last_modified >= '" . $last_date . "' ";187 $sQuery .= $nexo . "( products_last_modified >= '" . $last_date . "' ";
168 $nexo = ' or ';188 $nexo = ' or ';
169 $sQuery .= $nexo . "products_date_added >= '" . $last_date . "' )" ;189 $sQuery .= $nexo . "products_date_added >= '" . $last_date . "' )" ;
170 $nexo = ' and ';190 $nexo = ' and ';
171 }191 }
172192
173 if ($osCodIni>0){193 if ($osCodIni>0){
174 $sQuery .= $nexo . "products_id > " . $osCodIni;194 $sQuery .= $nexo . "products_id > " . $osCodIni;
175 $nexo = ' and ';195 $nexo = ' and ';
176 }196 }
177197
178 $sQuery .= " order by products_id LIMIT " . $block;198 $sQuery .= " order by products_id LIMIT " . $block;
179 debug('Query: ' .$sQuery);199 debug('Query: ' .$sQuery);
180 $result = mysql_query($sQuery);200 $result = mysql_query($sQuery);
181201
182 //debug('IF-WHILE-get_products');202 //debug('IF-WHILE-get_products');
183 if ($result) while ($row_product = mysql_fetch_row($result)) {203 if ($result) while ($row_product = mysql_fetch_row($result)) {
184 $resultcateg = mysql_query("select min(categories_id) from products_to_categories204 $resultcateg = mysql_query("select min(categories_id) from ".TABLE_PRODUCTS_TO_CATEGORIES."
185 where products_id=".$row_product[0]." group by products_id;");205 where products_id=".$row_product[0]." group by products_id;");
186 if ($resultcateg) {206 if ($resultcateg) {
187 $row = mysql_fetch_row($resultcateg);207 $row = mysql_fetch_row($resultcateg);
188 $prod_cat = $row[0];208 $prod_cat = $row[0];
189209
190 }210 }
191 debug('Producto: ' .$row_product[0]);211 debug('Producto: ' .$row_product[0]);
192 //Get product's manufacturer name212 //Get product's manufacturer name
193 if ($row_product[11] > 0){213 if ($row_product[11] > 0){
194 $resultmanuf = mysql_query("select manufacturers_name from manufacturers where manufacturers_id = ".$row_product[11].";");214 $resultmanuf = mysql_query("select manufacturers_name from ".TABLE_MANUFACTURERS." where manufacturers_id = ".$row_product[11].";");
195 if ($resultmanuf){215 if ($resultmanuf){
196 $row_manuf = mysql_fetch_row($resultmanuf);216 $row_manuf = mysql_fetch_row($resultmanuf);
197 if (strlen($row_manuf[0]) > 0)217 if (strlen($row_manuf[0]) > 0)
198 $manufacturers_name = $row_manuf[0];218 $manufacturers_name = $row_manuf[0];
199 else219 else
200 $manufacturers_name = "";220 $manufacturers_name = "";
201 }221 }
202 //Get product's manufacturer url on each language222 //Get product's manufacturer url on each language
203 $manuf_url = array();223 $manuf_url = array();
204 $resultmanuflang = mysql_query("select manufacturers_url, languages_id224 $resultmanuflang = mysql_query("select manufacturers_url, languages_id
205 from manufacturers_info where manufacturers_id = ".$row_product[11]." and languages_id in (".$lang_ids.");");225 from ".TABLE_MANUFACTURERS_INFO." where manufacturers_id = ".$row_product[11]." and languages_id in (".$lang_ids.");");
206 if ($resultmanuflang) while ($row_manuflang = mysql_fetch_row($resultmanuflang)) {226 if ($resultmanuflang) while ($row_manuflang = mysql_fetch_row($resultmanuflang)) {
207 if (strlen($row_manuflang[0]) == 0)227 if (strlen($row_manuflang[0]) == 0)
208 $manufacturers_url = "";228 $manufacturers_url = "";
209 else229 else
210 $manufacturers_url = $row_manuflang[0];230 $manufacturers_url = $row_manuflang[0];
211 $manuf_url[] = new xmlrpcval(array(231 $manuf_url[] = new xmlrpcval(array(
212 "languages_id" => new xmlrpcval($row_manuflang[1],"int"),232 "languages_id" => new xmlrpcval($row_manuflang[1],"int"),
213 "manufacturers_url" => new xmlrpcval($manufacturers_url,"string"),233 "manufacturers_url" => new xmlrpcval($manufacturers_url,"string"),
214 ), "struct");234 ), "struct");
215 }235 }
216 } else {236 } else {
217 $manufacturers_name = "";237 $manufacturers_name = "";
@@ -221,16 +241,16 @@
221 $prod = new xmlrpcval(array(241 $prod = new xmlrpcval(array(
222 "products_id" => new xmlrpcval($row_product[0],"int"),242 "products_id" => new xmlrpcval($row_product[0],"int"),
223 "products_quantity" => new xmlrpcval($row_product[1],"int"),243 "products_quantity" => new xmlrpcval($row_product[1],"int"),
224 "products_model" => new xmlrpcval(clean_special_chars($row_product[2]),"string"),244 "products_model" => new xmlrpcval(utf8_encode($row_product[2]),"string"),
225 "products_image" => new xmlrpcval(clean_special_chars($row_product[3]),"string"),245 "products_image" => new xmlrpcval(utf8_encode($row_product[3]),"string"),
226 "products_price" => new xmlrpcval(clean_special_chars($row_product[4]),"string"),246 "products_price" => new xmlrpcval(utf8_encode($row_product[4]),"string"),
227 "products_date_added" => new xmlrpcval(clean_special_chars($row_product[5]),"string"),247 "products_date_added" => new xmlrpcval(utf8_encode($row_product[5]),"string"),
228 "products_last_modified" => new xmlrpcval(clean_special_chars($row_product[6]),"string"),248 "products_last_modified" => new xmlrpcval(utf8_encode($row_product[6]),"string"),
229 "products_date_available" => new xmlrpcval(clean_special_chars($row_product[7]),"string"),249 "products_date_available" => new xmlrpcval(utf8_encode($row_product[7]),"string"),
230 "products_weight" => new xmlrpcval(clean_special_chars($row_product[8]),"string"),250 "products_weight" => new xmlrpcval(utf8_encode($row_product[8]),"string"),
231 "products_status" => new xmlrpcval($row_product[9],"int"),251 "products_status" => new xmlrpcval($row_product[9],"int"),
232 "products_tax_class_id" => new xmlrpcval($row_product[10],"int"),252 "products_tax_class_id" => new xmlrpcval($row_product[10],"int"),
233 "manufacturers_name" => new xmlrpcval(clean_special_chars($manufacturers_name),"string"),253 "manufacturers_name" => new xmlrpcval(utf8_encode($manufacturers_name),"string"),
234 "categ_id" => new xmlrpcval($prod_cat,"int")), "struct");254 "categ_id" => new xmlrpcval($prod_cat,"int")), "struct");
235 //debug('Product_id: ' . $row_product[0] . '-IMG:' .$row_product[3]. '-CAT:' . $prod_cat);255 //debug('Product_id: ' . $row_product[0] . '-IMG:' .$row_product[3]. '-CAT:' . $prod_cat);
236256
@@ -242,33 +262,23 @@
242 products_description,262 products_description,
243 products_url,263 products_url,
244 products_viewed264 products_viewed
245 from products_description where products_id=".$row_product[0]." and language_id in (".$lang_ids.");");265 from ".TABLE_PRODUCTS_DESCRIPTION." where products_id=".$row_product[0]." and language_id in (".$lang_ids.");");
246 if ($resultlang) while ($row_desc = mysql_fetch_row($resultlang)) {266 if ($resultlang) while ($row_desc = mysql_fetch_row($resultlang)) {
247 /* if (strlen($row_desc[3] == 0))267 $description=utf8_encode($row_desc[3]);
248 $products_description_str = "";268 if ($description!=$row_desc[3]){
249 else
250 $products_description_str = $row_desc[3];
251 if (strlen($row_desc[4] == 0))
252 $products_url_str = "";
253 else
254 $products_url_str = $row_desc[4];
255 */
256
257 $description=clean_special_chars($row_desc[3]);
258 if ($description!=$row_desc[3]){
259 debug(date(DATE_ATOM) . ' -- Product_id: ' . $row_desc[0] . ' Language_id: ' . $row_desc[1] . ' -> Undefined characters: Description has been updated.');269 debug(date(DATE_ATOM) . ' -- Product_id: ' . $row_desc[0] . ' Language_id: ' . $row_desc[1] . ' -> Undefined characters: Description has been updated.');
260 }270 }
261271
262 $prod_desc[] = new xmlrpcval(array(272 $prod_desc[] = new xmlrpcval(array(
263 //"products_id" => new xmlrpcval($row_desc[0],"int"),273 //"products_id" => new xmlrpcval($row_desc[0],"int"),
264 "language_id" => new xmlrpcval($row_desc[1],"int"),274 "language_id" => new xmlrpcval($row_desc[1],"int"),
265 "products_name" => new xmlrpcval(clean_special_chars($row_desc[2]),"string"),275 "products_name" => new xmlrpcval(utf8_encode($row_desc[2]),"string"),
266 "products_description" => new xmlrpcval($description,"string"),276 "products_description" => new xmlrpcval(utf8_encode($row_desc[3]),"string"),
267 "products_url" => new xmlrpcval(clean_special_chars($row_desc[4]),"string"),277 "products_url" => new xmlrpcval(utf8_encode($row_desc[4]),"string"),
268 "products_viewed" => new xmlrpcval(clean_special_chars($row_desc[5]),"string")), "struct");278 "products_viewed" => new xmlrpcval(utf8_encode($row_desc[5]),"string")), "struct");
269 //debug('Product_id: ' . $row_desc[0] . 'language_id: ' . $row_desc[1] . 'products_name: ' . $row_desc[2]);279 //debug('Product_id: ' . $row_desc[0] . 'language_id: ' . $row_desc[1] . 'products_name: ' . $row_desc[2]);
270 }280 }
271 281
272 // Get product discounts282 // Get product discounts
273 $prod_spec = new xmlrpcval(array(), "struct"); // If product has not any discount283 $prod_spec = new xmlrpcval(array(), "struct"); // If product has not any discount
274 $resultspec = mysql_query("select specials_new_products_price,284 $resultspec = mysql_query("select specials_new_products_price,
@@ -277,48 +287,44 @@
277 expires_date,287 expires_date,
278 date_status_change,288 date_status_change,
279 status289 status
280 from specials where products_id=". $row_product[0] .290 from ".TABLE_SPECIALS." where products_id=". $row_product[0] .
281 " and specials_date_added =291 " and specials_date_added =
282 (select max(specials_date_added) from specials where products_id=". $row_product[0] . ");");292 (select max(specials_date_added) from ".TABLE_SPECIALS." where products_id=". $row_product[0] . ");");
283 if ($resultspec) {293 if ($resultspec) {
284 $rowesp = mysql_fetch_row($resultspec);294 $rowesp = mysql_fetch_row($resultspec);
285 //debug('Product specials: ' . $rowesp[0] . " " . $rowesp[3]);295 //debug('Product specials: ' . $rowesp[0] . " " . $rowesp[3]);
286 $prod_spec = new xmlrpcval(array(296 $prod_spec = new xmlrpcval(array(
287 "specials_new_products_price" => new xmlrpcval($rowesp[0],"string"),297 "specials_new_products_price" => new xmlrpcval($rowesp[0],"string"),
288 //"specials_date_added" => new xmlrpcval($rowesp[1],"string"),298 //"specials_date_added" => new xmlrpcval($rowesp[1],"string"),
289 //"specials_last_modified" => new xmlrpcval($rowesp[2],"string"),299 //"specials_last_modified" => new xmlrpcval($rowesp[2],"string"),
290 "expires_date" => new xmlrpcval($rowesp[3],"string"),300 "expires_date" => new xmlrpcval($rowesp[3],"string"),
291 //"date_status_change" => new xmlrpcval($rowesp[4],"string"),301 //"date_status_change" => new xmlrpcval($rowesp[4],"string"),
292 "status" => new xmlrpcval($rowesp[5],"int")), "struct");302 "status" => new xmlrpcval($rowesp[5],"int")), "struct");
293 }303 }
294 // Get product attributes304 // Get product attributes
295 debug('Inicio atributos: ' . $row_product[0]);305 debug('Inicio atributos: ' . $row_product[0]);
296 debug("Query: SELECT p.products_id, op.products_options_name , opv.products_options_values_name306 $sql = "SELECT p.products_id, op.products_options_name , opv.products_options_values_name
297 FROM products p, products_attributes pa, products_options op, products_options_values opv307 FROM ".TABLE_PRODUCTS." p, ".TABLE_PRODUCTS_ATTRIBUTES." pa, ".TABLE_PRODUCTS_OPTIONS." op, ".TABLE_PRODUCTS_OPTIONS_VALUES." opv
298 WHERE p.products_id = pa.products_id308 WHERE p.products_id = pa.products_id
299 AND pa.options_id = op.products_options_id309 AND pa.options_id = op.products_options_id
300 AND pa.options_values_id = opv.products_options_values_id 310 AND pa.options_values_id = opv.products_options_values_id
301 and p.products_id =". $row_product[0]);311 and p.products_id =". $row_product[0] . "
312 AND opv.language_id=".(int)$languages_id.";";
313 debug("Query: ".$sql);
302314
303 $prod_atrib = array();// If product has not attributes315 $prod_atrib = array();// If product has not attributes
304 316 $result_atrib = mysql_query($sql);
305 $result_atrib = mysql_query("SELECT p.products_id, op.products_options_name , opv.products_options_values_name
306 FROM products p, products_attributes pa, products_options op, products_options_values opv
307 WHERE p.products_id = pa.products_id
308 AND pa.options_id = op.products_options_id
309 AND pa.options_values_id = opv.products_options_values_id
310 and p.products_id =". $row_product[0] . ";");
311 if ($result_atrib) while ($rowatr = mysql_fetch_row($result_atrib)) {317 if ($result_atrib) while ($rowatr = mysql_fetch_row($result_atrib)) {
312318
313 $num_atrib = explode("-", clean_special_chars($rowatr[2])); 319 $num_atrib = explode("-", utf8_encode($rowatr[2]));
314 $auxi_model = clean_special_chars($row_product[2]) . '-' . $num_atrib[0];320 $auxi_model = utf8_encode($row_product[2]) . '-' . $num_atrib[0];
315321
316 debug('Product atributes: ' . $rowatr[0] . " " . $rowatr[1]. " " . $rowatr[2] . 'Codigo prod: ' . $auxi_model);322 debug('Product atributes: ' . $rowatr[0] . " " . $rowatr[1]. " " . $rowatr[2] . 'Codigo prod: ' . $auxi_model);
317 $prod_atrib[] = new xmlrpcval(array(323 $prod_atrib[] = new xmlrpcval(array(
318 "variants_name" => new xmlrpcval(clean_special_chars($rowatr[1]),"string"),324 "variants_name" => new xmlrpcval(utf8_encode($rowatr[1]),"string"),
319 "variants_value" => new xmlrpcval(clean_special_chars($rowatr[2]),"string"),325 "variants_value" => new xmlrpcval(utf8_encode($rowatr[2]),"string"),
320 "composed_code" => new xmlrpcval($auxi_model,"string"),326 "composed_code" => new xmlrpcval($auxi_model,"string"),
321 ), "struct");327 ), "struct");
322 }328 }
323329
324330
@@ -328,50 +334,59 @@
328 'product_special' => $prod_spec,334 'product_special' => $prod_spec,
329 'manufacturers_url' => new xmlrpcval($manuf_url, "array"),335 'manufacturers_url' => new xmlrpcval($manuf_url, "array"),
330 'variants' => new xmlrpcval($prod_atrib, "array"),336 'variants' => new xmlrpcval($prod_atrib, "array"),
331 ), "struct");337 ), "struct");
332 }338 }
333 //debug('END-IF-WHILE-get_products');339 //debug('END-IF-WHILE-get_products');
334 return new xmlrpcresp(new xmlrpcval($products, "array"));340 return new xmlrpcresp(new xmlrpcval($products, "array"));
335}341}
336342
337function get_payment_methods() {343function get_payment_methods() {
344 global $language;
338 $payment_methods = array();345 $payment_methods = array();
339346
340 $result_modules = mysql_query("SELECT configuration_value FROM configuration WHERE (configuration_key = 'MODULE_PAYMENT_INSTALLED');");347 $result_modules = mysql_query("SELECT configuration_value FROM ".TABLE_CONFIGURATION." WHERE (configuration_key = 'MODULE_PAYMENT_INSTALLED');");
341 if ($result_modules && $row_modules=mysql_fetch_row($result_modules)) {348 if ($result_modules && $row_modules=mysql_fetch_row($result_modules)) {
342 $modules = explode(';', $row_modules[0]);349 $modules = explode(';', $row_modules[0]);
343 }350 }
344 reset($modules);351 reset($modules);
345 while (list($key, $value) = each($modules)) {352 while (list($key, $value) = each($modules)) {
346 include("../../includes/modules/payment/".$value);353 $file = DIR_FS_CATALOG_MODULES."payment/".$value;
347 include("../../includes/languages/espanol/modules/payment/".$value);354 if (!file_exists($file))continue;
355 include($file);
356 include(DIR_FS_CATALOG_LANGUAGES.$language."/modules/payment/".$value);
348 $class = substr($value, 0, strrpos($value, '.'));357 $class = substr($value, 0, strrpos($value, '.'));
349 $obj = new $class();358 $obj = new $class();
350 $payment_methods[] = new xmlrpcval(array(new xmlrpcval($key, "int"), new xmlrpcval(clean_special_chars($obj->title), "string")), "array");359 $payment_methods[] = new xmlrpcval(array(new xmlrpcval($key, "int"), new xmlrpcval(trim(utf8_encode(html_entity_decode(strip_tags($obj->title)))), "string")), "array");
351 }360 }
352 return new xmlrpcresp( new xmlrpcval($payment_methods, "array"));361 return new xmlrpcresp( new xmlrpcval($payment_methods, "array"));
353}362}
354363
364$arrLanguagesDirs = null;
365function _loadArrLanguageDirs(){//Avoid making this query more then once
366 global $arrLanguagesDirs;
367 $arrLanguagesDirs = array();;
368 $result=mysql_query("select directory from ".TABLE_LANGUAGES.";");
369 if ($result) while ($row=mysql_fetch_row($result)) {
370 $arrLanguagesDirs[] = $row[0];
371 }
372}
373
355function search_payment_method($payment_name) {374function search_payment_method($payment_name) {
356 $languages = array();375 global $arrLanguagesDirs;
376 if(is_null($arrLanguagesDirs))_loadArrLanguageDirs();
357377
358 $result_modules = mysql_query("SELECT configuration_value FROM configuration WHERE (configuration_key = 'MODULE_PAYMENT_INSTALLED');");378 $result_modules = mysql_query("SELECT configuration_value FROM ".TABLE_CONFIGURATION." WHERE (configuration_key = 'MODULE_PAYMENT_INSTALLED');");
359 if ($result_modules && $row_modules = mysql_fetch_row($result_modules)) {379 if ($result_modules && $row_modules = mysql_fetch_row($result_modules)) {
360 $modules = explode(';', $row_modules[0]);380 $modules = explode(';', $row_modules[0]);
361 }381 }
362382
363 $result=mysql_query("select directory from languages;");
364 if ($result) while ($row=mysql_fetch_row($result)) {
365 $languages[] = $row[0];
366 }
367
368 reset($modules);383 reset($modules);
369 while (list($key, $value) = each($modules)) {384 while (list($key, $value) = each($modules)) {
370 foreach ($languages as $lang) {385 foreach ($arrLanguagesDirs as $lang) {
371 $title = "";386 $title = "";
372 // We must extract the payment method name from the translation file of the payment module387 // We must extract the payment method name from the translation file of the payment module
373 // We search lines containing the TEXT_TITLE constant like: define('MODULE_PAYMENT_COD_TEXT_TITLE', 'Cash on Delivery');388 // We search lines containing the TEXT_TITLE constant like: define('MODULE_PAYMENT_COD_TEXT_TITLE', 'Cash on Delivery');
374 $gestor = @fopen("../../includes/languages/$lang/modules/payment/$value", "r");389 $gestor = @fopen(DIR_FS_CATALOG_LANGUAGES.$lang."/modules/payment/$value", "r");
375 if ($gestor) {390 if ($gestor) {
376 while (!feof($gestor) and $title=="") {391 while (!feof($gestor) and $title=="") {
377 // Read translation file line by line392 // Read translation file line by line
@@ -392,14 +407,14 @@
392407
393408
394function parent_category($id, $name) {409function parent_category($id, $name) {
395 $result = mysql_query("select parent_id from categories where categories_id=".$id.";");410 $result = mysql_query("select parent_id from ".TABLE_CATEGORIES." where categories_id=".$id.";");
396 if ($result && $row = mysql_fetch_row($result)) {411 if ($result && $row = mysql_fetch_row($result)) {
397 if ($row[0] == 0) {412 if ($row[0] == 0) {
398 return $name;413 return $name;
399 } else {414 } else {
400 $resultb = mysql_query("select min(language_id) from categories_description where categories_id=".$row[0].";");415 $resultb = mysql_query("select min(language_id) from ".TABLE_CATEGORIES_DESCRIPTION." where categories_id=".$row[0].";");
401 if ($resultb && $rowb=mysql_fetch_row($resultb)) {416 if ($resultb && $rowb=mysql_fetch_row($resultb)) {
402 $resultb = mysql_query("select categories_name from categories_description where categories_id=".$row[0]." and language_id=".$rowb[0].";\n");417 $resultb = mysql_query("select categories_name from ".TABLE_CATEGORIES_DESCRIPTION." where categories_id=".$row[0]." and language_id=".$rowb[0].";\n");
403 if ($resultb && $rowb=mysql_fetch_row($resultb)) {418 if ($resultb && $rowb=mysql_fetch_row($resultb)) {
404 $name = parent_category($row[0], $rowb[0] . " \\ ". $name);419 $name = parent_category($row[0], $rowb[0] . " \\ ". $name);
405 return $name;420 return $name;
@@ -415,13 +430,15 @@
415}430}
416431
417function setSyncronizedFlag($product_id) {432function setSyncronizedFlag($product_id) {
418 mysql_query("update products set products_syncronized = 1, products_last_syncronized = now() where products_id=" . $product_id . ";");433 if(mysql_query("update ".TABLE_PRODUCTS." set products_syncronized = 1, products_last_syncronized = now() where products_id=" . $product_id . ";")){
419 return new xmlrpcresp(new xmlrpcval(true,"boolean"));434 return new xmlrpcresp(new xmlrpcval(true,"boolean"));
435 }
436 return new xmlrpcresp(new xmlrpcval(false,"boolean"));
420}437}
421438
422function set_product_stock($tiny_product) {439function set_product_stock($tiny_product) {
423 mysql_query("update products set products_quantity=".$tiny_product['quantity']." where products_id=".$tiny_product['product_id'].";");440 mysql_query("update ".TABLE_PRODUCTS." set products_quantity=".$tiny_product['quantity']." where products_id=".$tiny_product['product_id'].";");
424 mysql_query("update products set products_status=".(($tiny_product['quantity']>0)?1:0)." where products_id=".$tiny_product['product_id'].";");441 mysql_query("update ".TABLE_PRODUCTS." set products_status=".(($tiny_product['quantity']>0)?1:0)." where products_id=".$tiny_product['product_id'].";");
425 return new xmlrpcresp(new xmlrpcval(0,"int"));442 return new xmlrpcresp(new xmlrpcval(0,"int"));
426}443}
427444
@@ -430,29 +447,29 @@
430 $oscom_id = 0;447 $oscom_id = 0;
431448
432 if(array_key_exists('manufacturers_name',$tiny_product)) {449 if(array_key_exists('manufacturers_name',$tiny_product)) {
433 $result = mysql_query("select l.languages_id from languages as l ,configuration as c where450 $result = mysql_query("select l.languages_id from ".TABLE_LANGUAGES." as l ,configuration as c where
434 c.configuration_key='DEFAULT_LANGUAGE' and c.configuration_value=l.code;");451 c.configuration_key='DEFAULT_LANGUAGE' and c.configuration_value=l.code;");
435452
436 if ($result && $row = mysql_fetch_row($result)) {453 if ($result && $row = mysql_fetch_row($result)) {
437 $lang_id = $row[0];454 $lang_id = $row[0];
438 }455 }
439 $result = mysql_query("select manufacturers_id from manufacturers where (manufacturers_name='".$tiny_product['manufacturers_name']."');");456 $result = mysql_query("select manufacturers_id from ".TABLE_MANUFACTURERS." where (manufacturers_name='".$tiny_product['manufacturers_name']."');");
440 if ($result && $row = mysql_fetch_row($result)) {457 if ($result && $row = mysql_fetch_row($result)) {
441 $id_exist = 1;458 $id_exist = 1;
442 $oscom_id = $row[0];459 $oscom_id = $row[0];
443 }460 }
444 if ($id_exist == 0) {461 if ($id_exist == 0) {
445 mysql_query("insert into manufacturers (manufacturers_name, date_added) values ('".$tiny_product['manufacturers_name']."', now());");462 mysql_query("insert into ".TABLE_MANUFACTURERS." (manufacturers_name, date_added) values ('".$tiny_product['manufacturers_name']."', now());");
446 $oscom_id = mysql_insert_id();463 $oscom_id = mysql_insert_id();
447 mysql_query("insert into manufacturers_info (manufacturers_id, languages_id,manufacturers_url) values (".$oscom_id.",".$lang_id.",'".$tiny_product['manufacturers_url']."');");464 mysql_query("insert into ".TABLE_MANUFACTURERS_INFO." (manufacturers_id, languages_id,manufacturers_url) values (".$oscom_id.",".$lang_id.",'".$tiny_product['manufacturers_url']."');");
448 foreach ($tiny_product['manufacturer_langs'] as $lang=>$values){465 foreach ($tiny_product['manufacturer_langs'] as $lang=>$values){
449 mysql_query("insert into manufacturers_info (manufacturers_id, languages_id,manufacturers_url) values (".$oscom_id.",".$lang.",'".$values['manufacturers_url']."');");466 mysql_query("insert into ".TABLE_MANUFACTURERS_INFO." (manufacturers_id, languages_id,manufacturers_url) values (".$oscom_id.",".$lang.",'".$values['manufacturers_url']."');");
450 }467 }
451 } else {468 } else {
452 mysql_query("update manufacturers_info set manufacturers_url='".$tiny_product['manufacturers_url']."' where manufacturers_id=".$oscom_id." and languages_id=".$lang_id.";");469 mysql_query("update ".TABLE_MANUFACTURERS_INFO." set manufacturers_url='".$tiny_product['manufacturers_url']."' where manufacturers_id=".$oscom_id." and languages_id=".$lang_id.";");
453 foreach ($tiny_product['manufacturer_langs'] as $lang=>$values){470 foreach ($tiny_product['manufacturer_langs'] as $lang=>$values){
454 mysql_query("delete from manufacturers_info where manufacturers_id=".$oscom_id." and languages_id=".$lang.";");471 mysql_query("delete from ".TABLE_MANUFACTURERS_INFO." where manufacturers_id=".$oscom_id." and languages_id=".$lang.";");
455 mysql_query("insert into manufacturers_info (manufacturers_id, languages_id,manufacturers_url) values (".$oscom_id.",".$lang.",'".$values['manufacturers_url']."');");472 mysql_query("insert into ".TABLE_MANUFACTURERS_INFO." (manufacturers_id, languages_id,manufacturers_url) values (".$oscom_id.",".$lang.",'".$values['manufacturers_url']."');");
456 }473 }
457 }474 }
458 }475 }
@@ -472,123 +489,31 @@
472 $i = $i + 1;489 $i = $i + 1;
473 }490 }
474 foreach(array('_description','_to_categories','') as $key) {491 foreach(array('_description','_to_categories','') as $key) {
475 mysql_query("delete from products".$key." where products_id in (".$a.");");492 mysql_query("delete from ".TABLE_PRODUCTS.$key." where products_id in (".$a.");");
476 }493 }
477 }494 }
478 return new xmlrpcresp(new xmlrpcval(1, "int"));495 return new xmlrpcresp(new xmlrpcval(1, "int"));
479}496}
480497
481function del_spe_price($tiny_val) {498function del_spe_price($tiny_val) {
482 mysql_query("delete from specials where products_id = ".$tiny_val.";");499 mysql_query("delete from ".TABLE_SPECIALS." where products_id = ".$tiny_val.";");
483 return new xmlrpcresp(new xmlrpcval(1, "int"));500 return new xmlrpcresp(new xmlrpcval(1, "int"));
484}501}
485502
486function set_product_spe($tiny_product) {503function set_product_spe($tiny_product) {
487 $lang_id = 1;504 return set_product_classical($tiny_product,true);
488 $id_exist = 0;
489
490 ////////Check for existance of product_id ///////////
491 debug("localizando producto Oferta: select products_id from products where products_model='".$tiny_product['model']."'");
492 $result = mysql_query("select products_id from products where (products_id=".$tiny_product['product_id'].");");
493 if ($result && $row=mysql_fetch_row($result)) {
494 $id_exist = 1;
495 }
496
497 $result = mysql_query("select l.languages_id from languages as l configuration as c where c.configuration_key='DEFAULT_LANGUAGE' and c.configuration_value = l.code;");
498
499 if ($result && $row = mysql_fetch_row($result)) {
500 $lang_id = $row[0];
501 }
502 //if ($tiny_product['quantity']>0) {
503 // $tiny_product['status']=1;
504 //} else {
505 // $tiny_product['status']=0;
506 //}
507 $manufacturers_id = set_product_manufacturer($tiny_product);
508 if ($id_exist == 0) {
509 mysql_query("insert into products (products_quantity, products_model, products_price, products_weight, products_tax_class_id, products_status, manufacturers_id, products_date_added) values (".$tiny_product['quantity'].", '". $tiny_product['model']."', ".$tiny_product['price'].", ".$tiny_product['weight'].", ".$tiny_product['tax_class_id'].", ".$tiny_product['status'].", ".$manufacturers_id.", now());");
510
511 $oscom_id = mysql_insert_id();
512 if ( $tiny_product['date_available'] != 'NULL') {
513 mysql_query("update products set products_date_available='".$tiny_product['date_available']."' where products_id=".$oscom_id.";");
514 }
515 mysql_query("insert into specials (products_id, specials_new_products_price, specials_date_added, date_status_change, status) values (".$oscom_id.",".$tiny_product['spe_price'].",now(),now(),".$tiny_product['spe_price_status'].");");
516 if ( $tiny_product['exp_date'] != 'NULL') {
517 mysql_query("update specials set expires_date='".$tiny_product['exp_date']."' where products_id=".$oscom_id.";");
518 }
519 mysql_query("insert into products_description (products_id, language_id, products_name, products_description, products_url) values (".$oscom_id.", ".$lang_id.", '".$tiny_product['name']."', '".$tiny_product['description']."', '".$tiny_product['url']."');");
520 mysql_query("insert into products_to_categories (categories_id, products_id) values(".$tiny_product['category_id'].",".$oscom_id.");");
521 foreach ($tiny_product['langs'] as $lang=>$values) {
522 mysql_query("insert into products_description(products_id, language_id, products_name, products_description, products_url)
523 values (".$oscom_id.", ".$lang.", '".$values['name']."', '".$values['description']."', '".$values['url']."');");
524 }
525 } else {
526 debug("localizando producto Modelo existe: select products_id from products where products_id=".$tiny_product['product_id']);
527 $result = mysql_query("select products_id from products where (products_id=".$tiny_product['product_id'].");");
528 if ($result && $row=mysql_fetch_row($result)) {
529 $id_exist = 1;
530 }
531 if ($id_exist){
532 $oscom_id = $tiny_product['product_id'];
533 foreach (array('quantity', 'price', 'weight', 'tax_class_id', 'status', 'date_available') as $key) {
534 if ($key == 'date_available' and $tiny_product[$key] != 'NULL') {
535 mysql_query("update products set products_".$key."='".$tiny_product[$key]."' where products_id=".$oscom_id.";");
536 } else {
537 mysql_query("update products set products_".$key."=".$tiny_product[$key]." where products_id=".$oscom_id.";");
538 }
539 }
540 mysql_query("delete from specials where products_id=".$oscom_id.";");
541 mysql_query("insert into specials (products_id, specials_new_products_price, specials_date_added, date_status_change, status) values (".$oscom_id.",".$tiny_product['spe_price'].",now(),now(),".$tiny_product['spe_price_status'].");");
542 if ( $tiny_product['exp_date'] != 'NULL') {
543 mysql_query("update specials set expires_date='".$tiny_product['exp_date']."' where products_id=".$oscom_id.";");
544 }
545
546 mysql_query("update products set products_model='".$tiny_product['model']."', manufacturers_id=".$manufacturers_id." where products_id=".$oscom_id.";");
547
548 mysql_query("update products_to_categories set categories_id=".$tiny_product['category_id']." where products_id=".$oscom_id.";");
549 foreach ($tiny_product['langs'] as $lang=>$values) {
550 mysql_query("update products_description set ".
551 " products_id = " . $oscom_id .
552 ", language_id = ". $lang .
553 ", products_name = '".$values['name']."'" .
554 ", products_description = '".$values['description']."'" .
555 ", products_url = '".$values['url']."'".
556 " where products_id=".$oscom_id." and language_id=".$lang.";");
557 }
558 }
559 }
560
561 $cpt = 0;
562 if ($tiny_product['haspic']==1) {
563 if (file_exists('../../images/'.$cpt.'-'.$tiny_product['fname'])) {
564 unlink('../../images/'.$cpt.'-'.$tiny_product['fname']); // DELETE THE EXISTING IMAGES
565 }
566 if ($hd = fopen('../../images/'.$cpt.'-'.$tiny_product['fname'], "w")) {
567 fwrite($hd, base64_decode($tiny_product['picture']));
568 fclose($hd);
569 mysql_query("update products set products_image='".$cpt."-".$tiny_product['fname']."' where products_id=".$oscom_id.";");
570 }
571 } else if ($tiny_product['haspic']==2) {
572 if (file_exists('../../images/'.$cpt.'-'.$tiny_product['fname'])) {
573 unlink('../../images/'.$cpt.'-'.$tiny_product['fname']); // DELETE THE EXISTING IMAGES
574 }
575 mysql_query("update products set products_image='".$tiny_product['fname']."' where products_id=".$oscom_id.";");
576 } else {
577 mysql_query("update products set products_image=NULL where products_id=".$oscom_id.";");
578 }
579 return new xmlrpcresp(new xmlrpcval($oscom_id, "int"));
580}505}
581506
582function set_product_classical($tiny_product) {507function set_product_classical($tiny_product,$spe = false ) {
583 $lang_id = 1;508 $lang_id = 1;
584 $id_exist = 0;509 $id_exist = 0;
585510
586 ////////Check for existance of product ///////////511 ////////Check for existance of product ///////////
587 $result = mysql_query("select products_id from products where (products_id=".$tiny_product['product_id'].");");512 $result = mysql_query("select products_id from ".TABLE_PRODUCTS." where (products_id=".$tiny_product['product_id'].");");
588 if ($result && $row=mysql_fetch_row($result)) {513 if ($result && $row=mysql_fetch_row($result)) {
589 $id_exist = 1;514 $id_exist = 1;
590 }515 }
591 $result = mysql_query("select l.languages_id from languages as l configuration as c where c.configuration_key='DEFAULT_LANGUAGE' and c.configuration_value=l.code;");516 $result = mysql_query("select l.languages_id from ".TABLE_LANGUAGES." as l, ".TABLE_CONFIGURATION." as c where c.configuration_key='DEFAULT_LANGUAGE' and c.configuration_value=l.code;");
592517
593 if ($result && $row = mysql_fetch_row($result)) {518 if ($result && $row = mysql_fetch_row($result)) {
594 $lang_id = $row[0];519 $lang_id = $row[0];
@@ -600,75 +525,87 @@
600 //}525 //}
601 $manufacturers_id = set_product_manufacturer($tiny_product);526 $manufacturers_id = set_product_manufacturer($tiny_product);
602 if ($id_exist == 0) {527 if ($id_exist == 0) {
603 mysql_query("insert into products (products_quantity, products_model, products_price, products_weight, products_tax_class_id, products_status, manufacturers_id, products_date_added) values (".$tiny_product['quantity'].", '". $tiny_product['model']."', ".$tiny_product['price'].", ".$tiny_product['weight'].", ".$tiny_product['tax_class_id'].", ".$tiny_product['status'].", ".$manufacturers_id.", now());");528 mysql_query("insert into ".TABLE_PRODUCTS." (products_quantity, products_model, products_price, products_weight, products_tax_class_id, products_status, manufacturers_id, products_date_added) values (".$tiny_product['quantity'].", '". $tiny_product['model']."', ".$tiny_product['price'].", ".$tiny_product['weight'].", ".$tiny_product['tax_class_id'].", ".$tiny_product['status'].", ".$manufacturers_id.", now());");
604529
605 $oscom_id = mysql_insert_id();530 $oscom_id = mysql_insert_id();
606 if ( $tiny_product['date_available'] != 'NULL') {531 if ( $tiny_product['date_available'] != 'NULL') {
607 mysql_query("update products set products_date_available='".$tiny_product['date_available']."' where products_id=".$oscom_id.";");532 mysql_query("update ".TABLE_PRODUCTS." set products_date_available='".$tiny_product['date_available']."' where products_id=".$oscom_id.";");
608 }533 }
609 mysql_query("insert into products_description (products_id, language_id, products_name, products_description, products_url) values (".$oscom_id.", ".$lang_id.", '".$tiny_product['name']."', '".$tiny_product['description']."', '".$tiny_product['url']."');");534 if($spe){
610 mysql_query("insert into products_to_categories (categories_id, products_id) values(".$tiny_product['category_id'].",".$oscom_id.");");535 mysql_query("insert into ".TABLE_SPECIALS." (products_id, specials_new_products_price, specials_date_added, date_status_change, status) values (".$oscom_id.",".$tiny_product['spe_price'].",now(),now(),".$tiny_product['spe_price_status'].");");
536 if ( $tiny_product['exp_date'] != 'NULL') {
537 mysql_query("update ".TABLE_SPECIALS." set expires_date='".$tiny_product['exp_date']."' where products_id=".$oscom_id.";");
538 }
539 }
540 mysql_query("insert into ".TABLE_PRODUCTS_DESCRIPTION." (products_id, language_id, products_name, products_description, products_url) values (".$oscom_id.", ".$lang_id.", '".$tiny_product['name']."', '".$tiny_product['description']."', '".$tiny_product['url']."');");
541 mysql_query("insert into ".TABLE_PRODUCTS_TO_CATEGORIES." (categories_id, products_id) values(".$tiny_product['category_id'].",".$oscom_id.");");
611 foreach ($tiny_product['langs'] as $lang=>$values) {542 foreach ($tiny_product['langs'] as $lang=>$values) {
612 mysql_query("insert into products_description(products_id, language_id, products_name, products_description, products_url)543 mysql_query("insert into ".TABLE_PRODUCTS_DESCRIPTION." (products_id, language_id, products_name, products_description, products_url)
613 values (".$oscom_id.", ".$lang.", '".$values['name']."', '".$values['description']."', '".$values['url']."');");544 values (".$oscom_id.", ".$lang.", '".$values['name']."', '".$values['description']."', '".$values['url']."');");
614 }545 }
615 } else {546 } else {
616 debug("localizando producto Modelo existe: select products_id from products where products_id=".$tiny_product['product_id']);547 $sql = "select products_id from ".TABLE_PRODUCTS." where (products_id=".$tiny_product['product_id'].");";
617 $result = mysql_query("select products_id from products where (products_id=".$tiny_product['product_id'].");");548 debug("localizando producto Modelo existe: ".$sql);
549 $result = mysql_query($sql);
618 if ($result && $row=mysql_fetch_row($result)) {550 if ($result && $row=mysql_fetch_row($result)) {
619 $id_exist = 1;551 $id_exist = 1;
620 }552 }
621 if ($id_exist){553 if ($id_exist){
622 554
623 $oscom_id = $tiny_product['product_id'];555 $oscom_id = $tiny_product['product_id'];
624 foreach (array('quantity', 'price', 'weight', 'tax_class_id', 'status', 'date_available') as $key) {556 foreach (array('quantity', 'price', 'weight', 'tax_class_id', 'status', 'date_available') as $key) {
625 if ($key == 'date_available' and $tiny_product[$key] != 'NULL') {557 if ($key == 'date_available' and $tiny_product[$key] != 'NULL') {
626 mysql_query("update products set products_".$key."='".$tiny_product[$key]."' where products_id=".$oscom_id.";");558 mysql_query("update ".TABLE_PRODUCTS." set products_".$key."='".$tiny_product[$key]."' where products_id=".$oscom_id.";");
627 } else {559 } else {
628 mysql_query("update products set products_".$key."=".$tiny_product[$key]." where products_id=".$oscom_id.";");560 mysql_query("update ".TABLE_PRODUCTS." set products_".$key."=".$tiny_product[$key]." where products_id=".$oscom_id.";");
629 }561 }
630 }562 }
631563 if($spe){
632 mysql_query("update products set products_model='".$tiny_product['model']."', manufacturers_id=".$manufacturers_id." where products_id=".$oscom_id.";");564 mysql_query("delete from ".TABLE_SPECIALS." where products_id=".$oscom_id.";");
633565 mysql_query("insert into ".TABLE_SPECIALS." (products_id, specials_new_products_price, specials_date_added, date_status_change, status) values (".$oscom_id.",".$tiny_product['spe_price'].",now(),now(),".$tiny_product['spe_price_status'].");");
634 mysql_query("update products_to_categories set categories_id=".$tiny_product['category_id']." where products_id=".$oscom_id.";");566 if ( $tiny_product['exp_date'] != 'NULL') {
635 foreach ($tiny_product['langs'] as $lang=>$values) {567 mysql_query("update ".TABLE_SPECIALS." set expires_date='".$tiny_product['exp_date']."' where products_id=".$oscom_id.";");
636 mysql_query("update products_description set ". 568 }
569 }
570 mysql_query("update ".TABLE_PRODUCTS." set products_model='".$tiny_product['model']."', manufacturers_id=".$manufacturers_id." where products_id=".$oscom_id.";");
571
572 mysql_query("update ".TABLE_PRODUCTS_TO_CATEGORIES." set categories_id=".$tiny_product['category_id']." where products_id=".$oscom_id.";");
573 foreach ($tiny_product['langs'] as $lang=>$values) {
574 mysql_query("update ".TABLE_PRODUCTS_DESCRIPTION." set ".
637 " products_id = " . $oscom_id . 575 " products_id = " . $oscom_id .
638 ", language_id = ". $lang .576 ", language_id = ". $lang .
639 ", products_name = '".$values['name']."'" .577 ", products_name = '".$values['name']."'" .
640 ", products_description = '".$values['description']."'" .578 ", products_description = '".$values['description']."'" .
641 ", products_url = '".$values['url']."'".579 ", products_url = '".$values['url']."'".
642 " where products_id=".$oscom_id." and language_id=".$lang.";"); 580 " where products_id=".$oscom_id." and language_id=".$lang.";");
581 }
643 }582 }
644 }583 }
645 }
646 $cpt = 0;584 $cpt = 0;
647 if ($tiny_product['haspic']==1) {585 if ($tiny_product['haspic']==1) {
648 if (file_exists('../../images/'.$cpt.'-'.$tiny_product['fname'])) {586 if (file_exists(DIR_WS_CATALOG_IMAGES.$cpt.'-'.$tiny_product['fname'])) {
649 unlink('../../images/'.$cpt.'-'.$tiny_product['fname']); // DELETE THE EXISTING IMAGES587 unlink(DIR_WS_CATALOG_IMAGES.$cpt.'-'.$tiny_product['fname']); // DELETE THE EXISTING IMAGES
650 }588 }
651 if ($hd=fopen('../../images/'.$cpt.'-'.$tiny_product['fname'], "w")){589 if ($hd=fopen(DIR_WS_CATALOG_IMAGES.$cpt.'-'.$tiny_product['fname'], "w")){
652 fwrite($hd, base64_decode($tiny_product['picture']));590 fwrite($hd, base64_decode($tiny_product['picture']));
653 fclose($hd);591 fclose($hd);
654 mysql_query("update products set products_image='".$cpt."-".$tiny_product['fname']."' where products_id=".$oscom_id.";");592 mysql_query("update ".TABLE_PRODUCTS." set products_image='".$cpt."-".$tiny_product['fname']."' where products_id=".$oscom_id.";");
655 }593 }
656 } else if ($tiny_product['haspic']==2) {594 } else if ($tiny_product['haspic']==2) {
657 if (file_exists('../../images/'.$cpt.'-'.$tiny_product['fname'])) {595 if (file_exists(DIR_WS_CATALOG_IMAGES.$cpt.'-'.$tiny_product['fname'])) {
658 unlink('../../images/'.$cpt.'-'.$tiny_product['fname']); // DELETE THE EXISTING IMAGES596 unlink(DIR_WS_CATALOG_IMAGES.$cpt.'-'.$tiny_product['fname']); // DELETE THE EXISTING IMAGES
659 }597 }
660 mysql_query("update products set products_image='".$tiny_product['fname']."' where products_id=".$oscom_id.";");598 mysql_query("update ".TABLE_PRODUCTS." set products_image='".$tiny_product['fname']."' where products_id=".$oscom_id.";");
661 } else {599 } else {
662 mysql_query("update products set products_image=NULL where products_id=".$oscom_id.";");600 mysql_query("update ".TABLE_PRODUCTS." set products_image=NULL where products_id=".$oscom_id.";");
663 }601 }
664 return new xmlrpcresp(new xmlrpcval($oscom_id, "int"));602 return new xmlrpcresp(new xmlrpcval($oscom_id, "int"));
665}603}
666604
667
668function get_order_address($address_condition, $oscom_id, $name, $street, $street2, $zip, $city, $state, $zone, $country, $email="", $phone="", $fax="") {605function get_order_address($address_condition, $oscom_id, $name, $street, $street2, $zip, $city, $state, $zone, $country, $email="", $phone="", $fax="") {
669 $addresses = array();606 $addresses = array();
670 $num_rows = 0; 607 $num_rows = 0;
671 $query = "SELECT address_book_id,CONCAT(entry_firstname,' ',entry_lastname) as name, entry_street_address, entry_suburb, entry_postcode, entry_city, entry_state, entry_country_id, entry_zone_id FROM address_book";608 $query = "SELECT address_book_id,CONCAT(entry_firstname,' ',entry_lastname) as name, entry_street_address, entry_suburb, entry_postcode, entry_city, entry_state, entry_country_id, entry_zone_id FROM ".TABLE_ADDRESS_BOOK;
672 //debug("Init address controll:". $name . "-zip: ". $zip . "-city" . $city . "-state" . $state . "-country" . $country);609 //debug("Init address controll:". $name . "-zip: ". $zip . "-city" . $city . "-state" . $state . "-country" . $country);
673610
674 if (is_array($address_condition)) {611 if (is_array($address_condition)) {
@@ -692,7 +629,7 @@
692 }629 }
693 $result = mysql_query($query.$where);630 $result = mysql_query($query.$where);
694 $num_rows = mysql_num_rows($result);631 $num_rows = mysql_num_rows($result);
695 }632 }
696 if ($num_rows>0) {633 if ($num_rows>0) {
697 return get_partner_address($address_condition,$email, $phone, $fax);634 return get_partner_address($address_condition,$email, $phone, $fax);
698 }635 }
@@ -708,16 +645,16 @@
708 $state_data = get_state_detail($country,$state_name);645 $state_data = get_state_detail($country,$state_name);
709 $ret_address = array(646 $ret_address = array(
710 "esale_oscom_id" => new xmlrpcval($oscom_id,"int"),647 "esale_oscom_id" => new xmlrpcval($oscom_id,"int"),
711 "name" => new xmlrpcval(clean_special_chars($name),"string"),648 "name" => new xmlrpcval(utf8_encode($name),"string"),
712 "street" => new xmlrpcval(clean_special_chars($street),"string"),649 "street" => new xmlrpcval(utf8_encode($street),"string"),
713 "street2" => new xmlrpcval(clean_special_chars($street2),"string"),650 "street2" => new xmlrpcval(utf8_encode($street2),"string"),
714 "zip" => new xmlrpcval(clean_special_chars($zip),"string"),651 "zip" => new xmlrpcval(utf8_encode($zip),"string"),
715 "city" => new xmlrpcval(clean_special_chars($city),"string"),652 "city" => new xmlrpcval(utf8_encode($city),"string"),
716 "state" => $state_data,653 "state" => $state_data,
717 "country" => $country_data,654 "country" => $country_data,
718 "email" => new xmlrpcval(clean_special_chars($email),"string"),655 "email" => new xmlrpcval(utf8_encode($email),"string"),
719 "phone" => new xmlrpcval(clean_special_chars($phone),"string"),656 "phone" => new xmlrpcval(utf8_encode($phone),"string"),
720 "fax" => new xmlrpcval(clean_special_chars($fax),"string")657 "fax" => new xmlrpcval(utf8_encode($fax),"string")
721 );658 );
722659
723 $addresses[] = new xmlrpcval($ret_address,"struct");660 $addresses[] = new xmlrpcval($ret_address,"struct");
@@ -729,7 +666,7 @@
729666
730function get_partner_address($address_condition, $email="", $phone="", $fax="") {667function get_partner_address($address_condition, $email="", $phone="", $fax="") {
731 $addresses = array();668 $addresses = array();
732 $query = "SELECT address_book_id,CONCAT(entry_firstname,' ',entry_lastname) as name, entry_street_address, entry_suburb, entry_postcode, entry_city, entry_state, entry_country_id, entry_zone_id FROM address_book";669 $query = "SELECT address_book_id,CONCAT(entry_firstname,' ',entry_lastname) as name, entry_street_address, entry_suburb, entry_postcode, entry_city, entry_state, entry_country_id, entry_zone_id FROM ".TABLE_ADDRESS_BOOK;
733670
734 if (is_array($address_condition)) {671 if (is_array($address_condition)) {
735 $where = " where ";672 $where = " where ";
@@ -762,16 +699,16 @@
762 $state_data = get_state_detail($row_address['entry_country_id'],$state_name);699 $state_data = get_state_detail($row_address['entry_country_id'],$state_name);
763 $ret_address = array(700 $ret_address = array(
764 "esale_oscom_id" => new xmlrpcval($row_address['address_book_id'],"int"),701 "esale_oscom_id" => new xmlrpcval($row_address['address_book_id'],"int"),
765 "name" => new xmlrpcval(clean_special_chars($row_address['name']),"string"),702 "name" => new xmlrpcval(utf8_encode($row_address['name']),"string"),
766 "street" => new xmlrpcval(clean_special_chars($row_address['entry_street_address']),"string"),703 "street" => new xmlrpcval(utf8_encode($row_address['entry_street_address']),"string"),
767 "street2" => new xmlrpcval(clean_special_chars($row_address['entry_suburb']),"string"),704 "street2" => new xmlrpcval(utf8_encode($row_address['entry_suburb']),"string"),
768 "zip" => new xmlrpcval(clean_special_chars($row_address['entry_postcode']),"string"),705 "zip" => new xmlrpcval(utf8_encode($row_address['entry_postcode']),"string"),
769 "city" => new xmlrpcval(clean_special_chars($row_address['entry_city']),"string"),706 "city" => new xmlrpcval(utf8_encode($row_address['entry_city']),"string"),
770 "state" => $state_data,707 "state" => $state_data,
771 "country" => $country_data,708 "country" => $country_data,
772 "email" => new xmlrpcval(clean_special_chars($email),"string"),709 "email" => new xmlrpcval(utf8_encode($email),"string"),
773 "phone" => new xmlrpcval(clean_special_chars($phone),"string"),710 "phone" => new xmlrpcval(utf8_encode($phone),"string"),
774 "fax" => new xmlrpcval(clean_special_chars($fax),"string")711 "fax" => new xmlrpcval(utf8_encode($fax),"string")
775 );712 );
776 $addresses[] = new xmlrpcval($ret_address,"struct");713 $addresses[] = new xmlrpcval($ret_address,"struct");
777 }714 }
@@ -781,52 +718,22 @@
781718
782function get_customer($cust_id) {719function get_customer($cust_id) {
783 $ret_partners = array();720 $ret_partners = array();
784 $condition = '';721 $query = "SELECT customers_id, CONCAT(customers_firstname,' ',customers_lastname) as name, customers_email_address, customers_default_address_id, customers_telephone, customers_fax from ".TABLE_CUSTOMERS.($cust_id != 0?" where customers_id=".$cust_id:"");
785 $file="../../temp/logsynchrophp.txt";722 $result = mysql_query($query);
786 $f=fopen($file,"a");723
787
788 $query = "SELECT customers_id, CONCAT(customers_firstname,' ',customers_lastname) as name, customers_email_address, customers_default_address_id, customers_telephone, customers_fax from customers";
789
790 if ($cust_id != 0) {
791 $condition = " where customers_id=".$cust_id;
792 }
793 $result = mysql_query($query.$condition.';');
794 if ($result) while ($row_cust=mysql_fetch_array($result, MYSQL_ASSOC)) {724 if ($result) while ($row_cust=mysql_fetch_array($result, MYSQL_ASSOC)) {
795 $addresses = get_partner_address(array('customers_id'=>$row_cust['customers_id']));725 $addresses = get_partner_address(array('customers_id'=>$row_cust['customers_id']));
726 $query_company = "select IF(isnull(entry_nif) OR entry_nif='','23232323T',entry_nif) entry_nif,IF(isnull(entry_company) OR entry_company='','NO_COMPANY',entry_company) entry_company from ".TABLE_ADDRESS_BOOK." where customers_id = " .$row_cust['customers_id'];
727 $result_company = mysql_fetch_array(mysql_query($query_company), MYSQL_ASSOC);
796 $partner = array();728 $partner = array();
729 //$partner['nif'] = $result_company[0];
730 //$partner['company'] = new xmlrpcval($result_company['entry_company'], "string");
797 $partner['esale_oscom_id'] = new xmlrpcval($row_cust['customers_id'],"int");731 $partner['esale_oscom_id'] = new xmlrpcval($row_cust['customers_id'],"int");
798 $partner['name'] = new xmlrpcval(clean_special_chars($row_cust['name']),"string");732 $partner['vat'] = new xmlrpcval("ES" . $result_company['entry_nif'], "string");
799733 if ($partner['company']<> 'NO_COMPANY' ) {
800//!!!!!!!!!!! BE CAREFULL, ENTRY_NIF is VAT NUMBER IN SPAIN, if you obtain734 $partner['name'] = new xmlrpcval(utf8_encode($row_cust['name']),"string");
801///// response error when executing sales order download, remove the field or addecuate the name735 }else {
802 $query_company = "select a.entry_nif, a.entry_company 736 $partner['name'] = new xmlrpcval(utf8_encode($partner['company']),"string");
803 from address_book a, customers c
804 where c.customers_id = " . $row_cust['customers_id'] . " and a.address_book_id = c.customers_default_address_id;";
805 $result_company = mysql_query($query_company);
806 if ($result_company) while ($row_nif=mysql_fetch_array($result_company, MYSQL_ASSOC)) {
807 $cif_nif = str_replace(' ', '',str_replace('-', '',strtoupper($row_nif['entry_nif'])));
808 fwrite($f, "TRATANDO NIF: " . $cif_nif . " -- Longitud: " . strlen($cif_nif) );
809
810 if (strlen($cif_nif)== 9) {
811 $partner['vat'] = new xmlrpcval("ES" . clean_special_chars($cif_nif), "string");
812 fwrite($f, " -- NIF CORRECTO: " . "ES" . $cif_nif);
813 fwrite($f, " -- Nombre: " . $row_cust['name']);
814 fwrite($f, " -- Compania: " . $row_nif['entry_company']. " -- IDCliente: " . $row_cust['customers_id'] . "\n");
815 }else {
816 $cif_nif = "01234567L";
817 $partner['vat'] = new xmlrpcval("ES" . clean_special_chars($cif_nif), "string");
818 fwrite($f, " -- ERROR EN NIF: " . "ES" . $cif_nif);
819 fwrite($f, " -- Nombre: " . $row_cust['name']);
820 fwrite($f, " -- Compania " . $row_nif['entry_company']. " -- IDCliente " . $row_cust['customers_id'] . "\n");
821 }
822
823 if ($row_nif['entry_company']!= '' ) {
824 $partner['name'] = new xmlrpcval(clean_special_chars($row_nif['entry_company']),"string");
825 fwrite($f, "existe compania " . $row_nif['entry_company'] . "\n");
826 }else{
827 $partner['name'] = new xmlrpcval(clean_special_chars($row_cust['name']),"string");
828 fwrite($f, "NO existe compania " . $partner['company'] . "\n");
829 }
830 }737 }
831 $partner['addresses'] = $addresses;738 $partner['addresses'] = $addresses;
832 $ret_partners[] = new xmlrpcval($partner,"struct");739 $ret_partners[] = new xmlrpcval($partner,"struct");
@@ -836,8 +743,7 @@
836743
837744
838function get_country_detail($country_name) {745function get_country_detail($country_name) {
839 $query = "select countries_id, countries_name, countries_iso_code_2, countries_iso_code_3 from countries";746 $query = "select countries_id, countries_name, countries_iso_code_2, countries_iso_code_3 from ".TABLE_COUNTRIES;
840 $ret_country = '0';
841747
842 if (!is_numeric($country_name)) {748 if (!is_numeric($country_name)) {
843 if($country_name != '') {749 if($country_name != '') {
@@ -849,19 +755,24 @@
849 if ($result && $row=mysql_fetch_row($result)) {755 if ($result && $row=mysql_fetch_row($result)) {
850 $ret_country = new xmlrpcval( array (756 $ret_country = new xmlrpcval( array (
851 "esale_oscom_id" => new xmlrpcval($row[0],"int"),757 "esale_oscom_id" => new xmlrpcval($row[0],"int"),
852 "name" => new xmlrpcval(clean_special_chars($row[1]),"string"),758 "name" => new xmlrpcval(utf8_encode($row[1]),"string"),
853 "code" => new xmlrpcval(clean_special_chars($row[2]),"string"),759 "code" => new xmlrpcval(utf8_encode($row[2]),"string"),
854 "code3" => new xmlrpcval(clean_special_chars($row[3]),"string")760 "code3" => new xmlrpcval(utf8_encode($row[3]),"string")
855 ),"struct");761 ),"struct");
856 return $ret_country;762 return $ret_country;
857 }763 }
858 return new xmlrpcval($ret_country,'string');764 return new xmlrpcval( array (
765 "esale_oscom_id" => new xmlrpcval(0,"int"),
766 "name" => new xmlrpcval("UNKNOWN","string"),
767 "code" => new xmlrpcval("UN","string"),
768 "code3" => new xmlrpcval("UNK","string")
769 ),"struct");
859}770}
860771
861772
862function get_state_detail($country_id,$state_name) {773function get_state_detail($country_id,$state_name) {
863 $ret_state = '0';774 $ret_state = '0';
864 $query = "select zone_id, zone_code, zone_name from zones";775 $query = "select zone_id, zone_code, zone_name from ".TABLE_ZONES;
865 $condition = '';776 $condition = '';
866777
867 if (!is_numeric($state_name)) {778 if (!is_numeric($state_name)) {
@@ -875,42 +786,49 @@
875 if ($result && $row=mysql_fetch_row($result)) {786 if ($result && $row=mysql_fetch_row($result)) {
876 $ret_state = new xmlrpcval( array (787 $ret_state = new xmlrpcval( array (
877 "esale_oscom_id" => new xmlrpcval($row[0],"int"),788 "esale_oscom_id" => new xmlrpcval($row[0],"int"),
878 "name" => new xmlrpcval(clean_special_chars($row[2]),"string"),789 "name" => new xmlrpcval(utf8_encode($row[2]),"string"),
879 "code" => new xmlrpcval(clean_special_chars($row[1]),"string")790 "code" => new xmlrpcval(utf8_encode($row[1]),"string")
880 ),"struct");791 ),"struct");
881 return $ret_state;792 return $ret_state;
882 }793 }
883 $ret_state = new xmlrpcval( array (794 $ret_state = new xmlrpcval( array (
884 "esale_oscom_id" => new xmlrpcval(0,"int"),795 "esale_oscom_id" => new xmlrpcval(0,"int"),
885 "name" => new xmlrpcval(clean_special_chars($state_name),"string"),796 "name" => new xmlrpcval(utf8_encode($state_name),"string"),
886 "code" => new xmlrpcval('',"string")797 "code" => new xmlrpcval('',"string")
887 ),"struct");798 ),"struct");
888 return $ret_state;799 return $ret_state;
889}800}
890801
891802
892function get_saleorders($last_so, $statuses_ids) {803function get_saleorders($last_so, $statuses_ids, $block_size=100) {
893 $saleorders = array();804 $saleorders = array();
894 $status_ids = implode(", ", $statuses_ids);805 $status_ids = implode(", ", $statuses_ids);
895806
896807 $result = mysql_query("SELECT `orders_id` , `customers_name` , `customers_street_address` , `customers_city` , `customers_postcode` , `customers_state` , `customers_country` , `customers_email_address`, `customers_telephone` , `delivery_name` , `delivery_street_address` , `delivery_city` , `delivery_postcode` , `delivery_state` , `delivery_country` , `billing_name` , `billing_street_address` , `billing_city` , `billing_postcode` , `billing_state` , `billing_country` , `date_purchased` , `orders_status`, `customers_id`, `payment_method`, `customers_id`,`customers_company`,`delivery_company`,`billing_company`
897 debug("SELECT `orders_id` , `customers_name` , `customers_street_address` , `customers_city` , `customers_postcode` , `customers_state` , `customers_country` , `customers_telephone` , `customers_email_address` , `delivery_name` , `delivery_street_address` , `delivery_city` , `delivery_postcode` , `delivery_state` , `delivery_country` , `billing_name` , `billing_street_address` , `billing_city` , `billing_postcode` , `billing_state` , `billing_country` , `date_purchased` , `orders_status`, `customers_id`, `payment_method`, `customers_id`,`customers_company`,`delivery_company`,`billing_company` 808 FROM ".TABLE_ORDERS." where (orders_id > ".$last_so." and orders_status in (" . $status_ids . ")) order by orders_id limit ".$block_size.";");
898 FROM `orders` where (orders_id > ".$last_so." and orders_status in (" . $status_ids . ")) order by orders_id limit 1;");
899
900 $result = mysql_query("SELECT `orders_id` , `customers_name` , `customers_street_address` , `customers_city` , `customers_postcode` , `customers_state` , `customers_country` , `customers_telephone` , `customers_email_address` , `delivery_name` , `delivery_street_address` , `delivery_city` , `delivery_postcode` , `delivery_state` , `delivery_country` , `billing_name` , `billing_street_address` , `billing_city` , `billing_postcode` , `billing_state` , `billing_country` , `date_purchased` , `orders_status`, `customers_id`, `payment_method`, `customers_id`,`customers_company`,`delivery_company`,`billing_company`
901 FROM `orders` where (orders_id > ".$last_so." and orders_status in (" . $status_ids . ")) order by orders_id limit 1;");
902809
903 if ($result){810 if ($result){
904 while ($row = mysql_fetch_row($result)) {811 while ($row = mysql_fetch_row($result)) {
905 debug("En pedido while: " . $row[0]);
906 $shopping_price = 0;812 $shopping_price = 0;
907 $result_shopping = mysql_query("SELECT value, title from orders_total where class='ot_shipping' and orders_id=".$row[0].";");813 $result_shopping = mysql_query("SELECT value, title from ".TABLE_ORDERS_TOTAL." where class='ot_shipping' and orders_id=".$row[0].";");
908 if ($result_shopping && $row_shopping=mysql_fetch_row($result_shopping)) {814 if ($result_shopping && $row_shopping=mysql_fetch_row($result_shopping)) {
909 $shopping_price = $row_shopping[0];815 $shopping_price = $row_shopping[0];
910 $shipping_title = $row_shopping[1];816 $shipping_title = $row_shopping[1];
911 }817 }
818 $dcoupon_price = 0;
819 $result_coupon = mysql_query("SELECT value, title from ".TABLE_ORDERS_TOTAL." where class='ot_discount_coupon' and orders_id=".$row[0].";");
820 if ($result_coupon && $row_coupon=mysql_fetch_row($result_coupon)) {
821 $dcoupon_price = $row_coupon[0];
822 $dcoupon_title = $row_coupon[1];
823 }
824 $cash_price = 0;
825 $result_cash = mysql_query("SELECT value, title from ".TABLE_ORDERS_TOTAL." where class='ot_fixed_payment_chg' and orders_id=".$row[0].";");
826 if ($result_cash && $row_cash=mysql_fetch_row($result_cash)) {
827 $cash_price = $row_cash[0];
828 $cash_title = $row_cash[1];
829 }
912830
913 $result_customer = mysql_query("SELECT customers_email_address, customers_telephone, customers_fax FROM customers WHERE customers_id=".$row[25].";");831 $result_customer = mysql_query("SELECT customers_email_address, customers_telephone, customers_fax FROM ".TABLE_CUSTOMERS." WHERE customers_id=".$row[25].";");
914 if ($result_customer && $row_customer=mysql_fetch_row($result_customer)) {832 if ($result_customer && $row_customer=mysql_fetch_row($result_customer)) {
915 $email = $row_customer[0];833 $email = $row_customer[0];
916 $phone = $row_customer[1];834 $phone = $row_customer[1];
@@ -922,7 +840,7 @@
922 "entry_street_address"=>$row[2],840 "entry_street_address"=>$row[2],
923 "entry_city"=>$row[3],841 "entry_city"=>$row[3],
924 "entry_postcode"=>$row[4]842 "entry_postcode"=>$row[4]
925 );843 );
926 $oscom_id = 9990;844 $oscom_id = 9990;
927 $name= $row[1];845 $name= $row[1];
928 $street = $row[2];846 $street = $row[2];
@@ -944,7 +862,7 @@
944 "entry_street_address"=>$row[10],862 "entry_street_address"=>$row[10],
945 "entry_city"=>$row[11],863 "entry_city"=>$row[11],
946 "entry_postcode"=>$row[12]864 "entry_postcode"=>$row[12]
947 );865 );
948 $oscom_id = 9991;866 $oscom_id = 9991;
949 $name= $row[9];867 $name= $row[9];
950 $street = $row[10];868 $street = $row[10];
@@ -963,7 +881,7 @@
963 "entry_street_address"=>$row[16],881 "entry_street_address"=>$row[16],
964 "entry_city"=>$row[17],882 "entry_city"=>$row[17],
965 "entry_postcode"=>$row[18]883 "entry_postcode"=>$row[18]
966 );884 );
967 $oscom_id = 9992;885 $oscom_id = 9992;
968 $name= $row[15];886 $name= $row[15];
969 $street = $row[16];887 $street = $row[16];
@@ -976,63 +894,62 @@
976 $billing_address =get_order_address($billing_condition, $oscom_id, $name, $street, $street2, $zip, $city, $state, $zone, $country, $email, $phone, $fax);894 $billing_address =get_order_address($billing_condition, $oscom_id, $name, $street, $street2, $zip, $city, $state, $zone, $country, $email, $phone, $fax);
977 //$billing_address = get_partner_address($billing_condition, $email, $phone, $fax);895 //$billing_address = get_partner_address($billing_condition, $email, $phone, $fax);
978896
979 $result_status = mysql_query("select orders_status_name from orders_status where orders_status_id = " . $row[22].";");897 $result_status = mysql_query("select orders_status_name from ".TABLE_ORDER_STATUS." where orders_status_id = " . $row[22].";");
980 if ($result_status && $row_status=mysql_fetch_row($result_status)) {898 if ($result_status && $row_status=mysql_fetch_row($result_status)) {
981 $status = $row_status[0];899 $status = $row_status[0];
982 }900 }
983 $orderlines = array();901 $orderlines = array();
984 $resultb = mysql_query("select products_id, products_quantity, products_price, products_tax, products_name, orders_products_id, products_model from orders_products where orders_id=".$row[0]." UNION select 999999, 1, value, '16.0000', title, 0,'' from orders_total where class not in('ot_subtotal', 'ot_total', 'ot_tax') and orders_id=".$row[0].";");902 $resultb = mysql_query("select products_id, products_quantity, products_price, products_tax, products_name, orders_products_id from ".TABLE_ORDERS_PRODUCTS." where orders_id=".$row[0].";");
985 debug("query lineas pedidos:". $resultb);
986 if ($resultb){903 if ($resultb){
987 while ($rowb = mysql_fetch_row($resultb)) {904 while ($rowb = mysql_fetch_row($resultb)) {
988 $values_array = array("product_id" => new xmlrpcval($rowb[0], "int"),905 $values_array = array("product_id" => new xmlrpcval($rowb[0], "int"),
989 "product_qty" => new xmlrpcval($rowb[1], "int"),906 "product_qty" => new xmlrpcval($rowb[1], "int"),
990 "price" => new xmlrpcval($rowb[2], "double"),907 "price" => new xmlrpcval($rowb[2], "double"),
991 "tax_rate" => new xmlrpcval($rowb[3],"double"),908 "tax_rate" => new xmlrpcval($rowb[3],"double"),
992 "products_model" => new xmlrpcval(html_entity_decode(clean_special_chars($rowb[6])),"string"),909 "products_model" => new xmlrpcval(trim(utf8_encode(html_entity_decode($rowb[6]))),"string"),
993 "name" => new xmlrpcval(html_entity_decode(clean_special_chars($rowb[4])),"string"));910 "name" => new xmlrpcval(utf8_encode(html_entity_decode($rowb[4])),"string"));
994 $result_orders_product_attributes = mysql_query("select products_options, products_options_values, options_values_price, price_prefix from orders_products_attributes where orders_id=".$row[0]." and orders_products_id=".$rowb[5].";");911 $result_orders_product_attributes = mysql_query("select products_options, products_options_values, options_values_price, if(isnull(price_prefix) OR price_prefix='','+',price_prefix) price_prefix from ".TABLE_ORDERS_PRODUCTS_ATTRIBUTES." where orders_id=".$row[0]." and orders_products_id=".$rowb[5].";");
995 if($result_orders_product_attributes && $row_orders_product_attributes= mysql_fetch_row($result_orders_product_attributes)) {912 if($result_orders_product_attributes && $row_orders_product_attributes= mysql_fetch_row($result_orders_product_attributes)) {
996 //debug("En atributos línea:" . $row_orders_product_attributes[0]); 913 $num_atrib = explode("-", utf8_encode($row_orders_product_attributes[1]));
997 if ($row_orders_product_attributes[3] !== '+' and $row_orders_product_attributes[3] !== '-'){$row_orders_product_attributes[3]='+';}914 $auxi_model = utf8_encode($rowb[6]) . '-' . $num_atrib[0];
998
999 //debug("En atributos línea prefijo :" . $row_orders_product_attributes[3]);
1000 $num_atrib = explode("-", clean_special_chars($row_orders_product_attributes[1]));
1001 $auxi_model = clean_special_chars($rowb[6]) . '-' . $num_atrib[0];
1002915
1003 $orders_product_attributes = new xmlrpcval( array(916 $orders_product_attributes = new xmlrpcval( array(
1004 "products_options" => new xmlrpcval(clean_special_chars($row_orders_product_attributes[0]),"string"),917 "products_options" => new xmlrpcval(utf8_encode($row_orders_product_attributes[0]),"string"),
1005 "products_options_values" => new xmlrpcval(clean_special_chars($row_orders_product_attributes[1]),"string"),918 "products_options_values" => new xmlrpcval(utf8_encode($row_orders_product_attributes[1]),"string"),
1006 "options_values_price" => new xmlrpcval($row_orders_product_attributes[2],"double"),919 "options_values_price" => new xmlrpcval($row_orders_product_attributes[2],"double"),
1007 "composed_code" => new xmlrpcval($auxi_model,"string"),920 "composed_code" => new xmlrpcval($auxi_model,"string"),
1008 "price_prefix" => new xmlrpcval(clean_special_chars($row_orders_product_attributes[3]),"string")), "struct");921 "price_prefix" => new xmlrpcval(utf8_encode($row_orders_product_attributes[3]),"string")), "struct");
1009 $values_array["attributes"] = $orders_product_attributes;922 $values_array["attributes"] = $orders_product_attributes;
1010 }923 }
1011 $orderlines[] = new xmlrpcval($values_array, "struct");924 $orderlines[] = new xmlrpcval($values_array, "struct");
1012 }925 }
1013 }926 }
1014 $note = "";927 $note = "";
1015 $result_comments = mysql_query("select comments FROM orders_status_history where (orders_id = ".$row[0]." and orders_status_id = 1);");928 $result_comments = mysql_query("select comments FROM ".TABLE_ORDERS_STATUS_HISTORY." where (orders_id = ".$row[0]." and orders_status_id = 1);");
1016 if ($result_comments && $row_comments=mysql_fetch_row($result_comments)) {929 if ($result_comments && $row_comments=mysql_fetch_row($result_comments)) {
1017 $note=$row_comments[0];930 $note=$row_comments[0];
1018 }931 }
1019// $result_price_with_tax = mysql_query("SELECT configuration_value FROM configuration where (configuration_key = 'DISPLAY_PRICE_WITH_TAX');");932 // $result_price_with_tax = mysql_query("SELECT configuration_value FROM configuration where (configuration_key = 'DISPLAY_PRICE_WITH_TAX');");
1020// if ($result_price_with_tax && $row_price_with_tax=mysql_fetch_row($result_price_with_tax)) {933 // if ($result_price_with_tax && $row_price_with_tax=mysql_fetch_row($result_price_with_tax)) {
1021// if ($row_price_with_tax[0] == 'false') {934 // if ($row_price_with_tax[0] == 'false') {
1022 $price_type="tax_excluded";935 $price_type="tax_excluded";
1023// } else {936 // } else {
1024// $price_type="tax_included";937 // $price_type="tax_included";
1025// }938 // }
1026// }939 // }
1027 $saleorders[] = new xmlrpcval( array("id" => new xmlrpcval( $row[0], "int"),940 $saleorders[] = new xmlrpcval( array("id" => new xmlrpcval( $row[0], "int"),
1028 "price_type" => new xmlrpcval( clean_special_chars($price_type), "string" ),941 "price_type" => new xmlrpcval( utf8_encode($price_type), "string" ),
1029 "note" => new xmlrpcval(clean_special_chars($note), "string" ),942 "note" => new xmlrpcval(utf8_encode($note), "string" ),
1030 "lines" => new xmlrpcval( $orderlines, "array"),943 "lines" => new xmlrpcval( $orderlines, "array"),
1031 "pay_met" => new xmlrpcval( search_payment_method($row[24]), "int"),944 "pay_met" => new xmlrpcval(search_payment_method($row[24]), "int"),
1032 "pay_met_title" => new xmlrpcval( clean_special_chars($row[24]), "string"),945 "pay_met_title" => new xmlrpcval( trim(utf8_encode(html_entity_decode(strip_tags($row[24])))), "string"),
1033 "shipping_price" => new xmlrpcval( $shopping_price, "double"),946 "shipping_price" => new xmlrpcval( $shopping_price, "double"),
1034 "shipping_title" => new xmlrpcval(html_entity_decode(clean_special_chars($shipping_title)), "string"),947 "shipping_title" => new xmlrpcval(utf8_encode($shipping_title), "string"),
1035 "orders_status" => new xmlrpcval( clean_special_chars($status), "string"),948 "dcoupon_price" => new xmlrpcval( $dcoupon_price, "double"),
949 "dcoupon_title" => new xmlrpcval(utf8_encode($dcoupon_title), "string"),
950 "cash_price" => new xmlrpcval( $cash_price, "double"),
951 "cash_title" => new xmlrpcval(utf8_encode($cash_title), "string"),
952 "orders_status" => new xmlrpcval( utf8_encode($status), "string"),
1036 "partner" => get_customer($row[25]),953 "partner" => get_customer($row[25]),
1037 "date" => new xmlrpcval( $row[21], "string"),954 "date" => new xmlrpcval( $row[21], "string"),
1038 "address" => $default_address,955 "address" => $default_address,
@@ -1046,79 +963,77 @@
1046963
1047964
1048function get_min_open_orders($last_so) {965function get_min_open_orders($last_so) {
1049 $result = mysql_query("SELECT min(`orders_id`) as min FROM `orders` where (orders_id <= ".$last_so.") and (orders_status = 2);");966 $result = mysql_query("SELECT min(`orders_id`) as min FROM ".TABLE_ORDERS." where (orders_id <= ".$last_so.") and (orders_status = 2);");
1050 if ($result) {967 if ($result) {
1051 $min = mysql_fetch_row($result);968 $min = mysql_fetch_row($result);
1052 return new xmlrpcresp( new xmlrpcval($min[0], "int"));969 return new xmlrpcresp( new xmlrpcval($min[0], "int"));
1053 } else970 } else
1054 return new xmlrpcresp( new xmlrpcval(-1, "int"));971 return new xmlrpcresp( new xmlrpcval(-1, "int"));
1055}972}
1056973
1057974
1058975
1059function get_max_products_id() {976function get_max_products_id() {
1060 $result = mysql_query("SELECT max(`products_id`) as max FROM `products`;");977 $result = mysql_query("SELECT max(`products_id`) as max FROM ".TABLE_PRODUCTS);
1061 if ($result) {978 if ($result) {
1062 $max = mysql_fetch_row($result);979 $max = mysql_fetch_row($result);
1063 return new xmlrpcresp( new xmlrpcval($max[0], "int"));980 return new xmlrpcresp( new xmlrpcval($max[0], "int"));
1064 } else981 } else
1065 return new xmlrpcresp( new xmlrpcval(-1, "int"));982 return new xmlrpcresp( new xmlrpcval(-1, "int"));
1066}983}
1067984
1068function get_min_products_id() {985function get_min_products_id() {
1069 $result = mysql_query("SELECT min(`products_id`) as min FROM `products`;");986 $result = mysql_query("SELECT min(`products_id`) as min FROM ".TABLE_PRODUCTS);
1070 if ($result) {987 if ($result) {
1071 $min = mysql_fetch_row($result);988 $min = mysql_fetch_row($result);
1072 return new xmlrpcresp( new xmlrpcval($min[0], "int"));989 return new xmlrpcresp( new xmlrpcval($min[0], "int"));
1073 } else990 } else
1074 return new xmlrpcresp( new xmlrpcval(-1, "int"));991 return new xmlrpcresp( new xmlrpcval(-1, "int"));
1075}992}
1076993
1077994
1078function close_open_orders($order_id, $order_status_id) {995function close_open_orders($order_id, $order_status_id) {
1079 mysql_query("update orders set orders_status= " . $order_status_id . " where orders_id=".$order_id.";");996 mysql_query("update ".TABLE_ORDERS." set orders_status=3 where orders_id=".$order_id.";");
1080 return new xmlrpcresp(new xmlrpcval(0, "int"));997 return new xmlrpcresp(new xmlrpcval(0, "int"));
1081}998}
1082999
10831000
1084function process_order($order_id, $order_status_id) {1001function process_order($order_id, $order_status_id) {
1085 debug("ONPROCESS: update orders set orders_status = " . $order_status_id . " where orders_id = ".$order_id.";");1002 mysql_query("update ".TABLE_ORDERS." set orders_status= " . $order_status_id . " where orders_id=".$order_id.";");
1086
1087 mysql_query("update orders set orders_status= " . $order_status_id . " where orders_id=".$order_id.";");
1088 return new xmlrpcresp(new xmlrpcval(0, "int"));1003 return new xmlrpcresp(new xmlrpcval(0, "int"));
1089}1004}
10901005
10911006
1092function update_order_status($order_id, $order_status_id, $status_comment, $update_comment, $send_web_email) {1007function update_order_status($order_id, $order_status_id, $status_comment, $update_comment, $send_web_email) {
1093 1008
1094 $oID = $order_id;1009 $oID = $order_id;
1095 1010
1096 mysql_query("update orders set orders_status = '" . $order_status_id . "', last_modified = now() where orders_id = '" . (int)$oID . "'");1011 mysql_query("update ".TABLE_ORDERS." set orders_status = '" . $order_status_id . "', last_modified = now() where orders_id = '" . (int)$oID . "'");
1097 $customer_notified = $send_web_email;1012 $customer_notified = $send_web_email;
10981013
1099 if ($update_comment){1014 if ($update_comment){
1100 debug("ACTUALIZAR COMENTARIOS insert into orders_status_history (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . $order_status_id . "', now(), '1', '" . $status_comment . "')");1015 debug("ACTUALIZAR COMENTARIOS insert into orders_status_history (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . $order_status_id . "', now(), '1', '" . $status_comment . "')");
1101 mysql_query("insert into orders_status_history (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . $order_status_id . "', now(), '". $customer_notified . "', '" . $status_comment . "')");1016 mysql_query("insert into ".TABLE_ORDERS_STATUS_HISTORY." (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . $order_status_id . "', now(), '". $customer_notified . "', '" . $status_comment . "')");
1102 }else {1017 }else {
1103 debug("NO ACTUALIZAR COMENTARIOS insert into orders_status_history (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . $order_status_id . "', now(), '1', '')");1018 debug("NO ACTUALIZAR COMENTARIOS insert into orders_status_history (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . $order_status_id . "', now(), '1', '')");
1104 mysql_query("insert into orders_status_history (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . $order_status_id . "', now(), '". $customer_notified . "', '')");1019 mysql_query("insert into ".TABLE_ORDERS_STATUS_HISTORY." (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . $order_status_id . "', now(), '". $customer_notified . "', '')");
1105 }1020 }
11061021
1107 if ($send_web_email) {1022 if ($send_web_email) {
1108 $check_status_query = mysql_query("select customers_name, customers_email_address, orders_status, date_purchased 1023 $check_status_query = mysql_query("select customers_name, customers_email_address, orders_status, date_purchased
1109 from orders where orders_id = '" . (int)$oID . "'");1024 from ".TABLE_ORDER." where orders_id = '" . (int)$oID . "'");
11101025
1111 if ($check_status_query && $check_status=mysql_fetch_row($check_status_query)) {1026 if ($check_status_query && $check_status=mysql_fetch_row($check_status_query)) {
1112 debug("ONCHANGEORDER1: en envio e-mail;");1027 debug("ONCHANGEORDER1: en envio e-mail;");
1113 $email = $status_comment ;1028 $email = $status_comment ;
11141029
1115 debug("ONCHANGEORDER2: " . $email);1030 debug("ONCHANGEORDER2: " . $email);
1116 // $headers = "From: \r\n";1031 // $headers = "From: \r\n";
1117 // mail($check_status['customers_email_address'],'Subject', $email, $headers );1032 // mail($check_status['customers_email_address'],'Subject', $email, $headers );
1118 1033
11191034
1120 debug("ONCHANGEORDER: en envio e-mail;");1035 debug("ONCHANGEORDER: en envio e-mail;");
1121 }1036 }
1122 } else {1037 } else {
1123 debug("ONCHANGEORDER: en NO envio e-mail;");1038 debug("ONCHANGEORDER: en NO envio e-mail;");
1124 }1039 }
@@ -1127,99 +1042,34 @@
1127 return new xmlrpcresp(new xmlrpcval(0, "int"));1042 return new xmlrpcresp(new xmlrpcval(0, "int"));
1128}1043}
11291044
1130$server = new xmlrpc_server( array( "get_taxes" => array( "function" => "get_taxes",1045$server = new xmlrpc_server(array(
1131 "signature" => array( array($xmlrpcArray)1046 "init" => array("function" => "init" ,"signature" => array(array($xmlrpcArray))),
1132 )1047 "get_taxes" => array("function" => "get_taxes" ,"signature" => array(array($xmlrpcArray))),
1133 ),1048 "get_statuses" => array("function" => "get_statuses" ,"signature" => array(array($xmlrpcArray))),
1134 "get_statuses" => array( "function" => "get_statuses",1049 "get_languages" => array("function" => "get_languages" ,"signature" => array(array($xmlrpcArray))),
1135 "signature" => array( array($xmlrpcArray)1050 "get_categories" => array("function" => "get_categories" ,"signature" => array(array($xmlrpcArray))),
1136 )1051 "get_categories_parent" => array("function" => "get_categories_parent","signature" => array(array($xmlrpcArray, $xmlrpcArray))),
1137 ),1052 "get_products" => array("function" => "get_products" ,"signature" => array(array($xmlrpcArray, $xmlrpcArray, $xmlrpcInt, $xmlrpcInt, $xmlrpcString))),
11381053 "get_payment_methods" => array("function" => "get_payment_methods" ,"signature" => array(array($xmlrpcArray))),
1139 "get_languages" => array( "function" => "get_languages",1054 "get_saleorders" => array("function" => "get_saleorders" ,"signature" => array(array($xmlrpcArray, $xmlrpcInt ,$xmlrpcArray, $xmlrpcInt))),
1140 "signature" => array( array($xmlrpcArray)1055 "get_min_products_id" => array("function" => "get_min_products_id" ,"signature" => array(array($xmlrpcInt))),
1141 )1056 "get_max_products_id" => array("function" => "get_max_products_id" ,"signature" => array(array($xmlrpcInt))),
1142 ),1057 "get_min_open_orders" => array("function" => "get_min_open_orders" ,"signature" => array(array($xmlrpcInt, $xmlrpcInt))),
1143 "get_categories" => array( "function" => "get_categories",1058 "set_product_spe" => array("function" => "set_product_spe" ,"signature" => array(array($xmlrpcInt, $xmlrpcStruct))),
1144 "signature" => array( array($xmlrpcArray)1059 "set_product_classical" => array("function" => "set_product_classical","signature" => array(array($xmlrpcInt, $xmlrpcStruct))),
1145 )1060 "remove_product" => array("function" => "remove_product" ,"signature" => array(array($xmlrpcInt, $xmlrpcStruct))),
1146 ),1061 "del_spe_price" => array("function" => "del_spe_price" ,"signature" => array(array($xmlrpcInt, $xmlrpcInt))),
1147 "get_categories_parent" => array( "function" => "get_categories_parent",1062 "update_order_status" => array("function" => "update_order_status" ,"signature" => array(array($xmlrpcInt, $xmlrpcInt, $xmlrpcInt, $xmlrpcString, $xmlrpcInt, $xmlrpcInt))),
1148 "signature" => array( array($xmlrpcArray, $xmlrpcArray)1063 "isTransactional" => array("function" => "isTransactional" ,"signature" => array(array($xmlrpcBoolean))),
1149 )1064 "setSyncronizedFlag" => array("function" => "setSyncronizedFlag" ,"signature" => array(array($xmlrpcBoolean, $xmlrpcInt))),
1150 ),1065 "set_product_stock" => array("function" => "set_product_stock" ,"signature" => array(array($xmlrpcInt, $xmlrpcStruct))),
1151 "get_products" => array( "function" => "get_products",1066 "process_order" => array("function" => "process_order" ,"signature" => array(array($xmlrpcInt, $xmlrpcInt, $xmlrpcInt))),
1152 "signature" => array( array($xmlrpcArray, $xmlrpcArray, $xmlrpcInt, $xmlrpcInt, $xmlrpcString)1067 "close_open_orders" => array("function" => "close_open_orders" ,"signature" => array(array($xmlrpcInt, $xmlrpcInt, $xmlrpcInt))),
1153 )1068 "get_customer" => array("function" => "get_customer" ,"signature" => array(array($xmlrpcArray, $xmlrpcInt)))
1154 ), 1069
1155 "get_payment_methods" => array( "function" => "get_payment_methods",1070), false);
1156 "signature" => array( array($xmlrpcArray)
1157 )
1158 ),
1159 "get_saleorders" => array( "function" => "get_saleorders",
1160 "signature" => array( array($xmlrpcArray, $xmlrpcInt ,$xmlrpcArray)
1161 )
1162 ),
1163 "get_min_products_id" => array( "function" => "get_min_products_id",
1164 "signature" => array( array($xmlrpcInt)
1165 )
1166 ),
1167 "get_max_products_id" => array( "function" => "get_max_products_id",
1168 "signature" => array( array($xmlrpcInt)
1169 )
1170 ),
1171 "get_min_open_orders" => array( "function" => "get_min_open_orders",
1172 "signature" => array( array($xmlrpcInt, $xmlrpcInt)
1173 )
1174 ),
1175 "set_product_spe" => array( "function" => "set_product_spe",
1176 "signature" => array( array($xmlrpcInt, $xmlrpcStruct)
1177 )
1178 ),
1179 "set_product_classical" => array( "function" => "set_product_classical",
1180 "signature" => array( array($xmlrpcInt, $xmlrpcStruct)
1181 )
1182 ),
1183 "remove_product" => array( "function" => "remove_product",
1184 "signature" => array( array($xmlrpcInt, $xmlrpcStruct)
1185 )
1186 ),
1187 "del_spe_price" => array( "function" => "del_spe_price",
1188 "signature" => array( array($xmlrpcInt, $xmlrpcInt)
1189 )
1190 ),
1191 "update_order_status" => array( "function" => "update_order_status",
1192 "signature" => array( array($xmlrpcInt, $xmlrpcInt, $xmlrpcInt, $xmlrpcString, $xmlrpcInt, $xmlrpcInt)
1193 )
1194 ),
1195
1196 "isTransactional" => array( "function" => "isTransactional",
1197 "signature" => array( array($xmlrpcBoolean)
1198 )
1199 ),
1200 "setSyncronizedFlag" => array( "function" => "setSyncronizedFlag",
1201 "signature" => array( array($xmlrpcBoolean, $xmlrpcInt)
1202 )
1203 ),
1204 "set_product_stock" => array( "function" => "set_product_stock",
1205 "signature" => array( array($xmlrpcInt, $xmlrpcStruct)
1206 )
1207 ),
1208 "process_order" => array( "function" => "process_order",
1209 "signature" => array( array($xmlrpcInt, $xmlrpcInt, $xmlrpcInt)
1210 )
1211 ),
1212 "close_open_orders" => array( "function" => "close_open_orders",
1213 "signature" => array( array($xmlrpcInt, $xmlrpcInt, $xmlrpcInt)
1214 )
1215 ),
1216 "get_customer" => array( "function" => "get_customer",
1217 "signature" => array( array($xmlrpcArray, $xmlrpcInt)
1218 )
1219 )
1220
1221 ), false);
1222$server->functions_parameters_type = 'phpvals';1071$server->functions_parameters_type = 'phpvals';
1223$server->response_charset_encoding = RESPONSE_ENCODING;1072//$server->response_charset_encoding = RESPONSE_ENCODING;
1224$server->service();1073$server->service();
1225?>1074include(DIR_WS_INCLUDES."application_bottom.php");
1075?>
1226\ No newline at end of file1076\ No newline at end of file
12271077
=== added file 'esale_osc/connector/openerp_login.php'
--- esale_osc/connector/openerp_login.php 1970-01-01 00:00:00 +0000
+++ esale_osc/connector/openerp_login.php 2010-07-21 10:31:39 +0000
@@ -0,0 +1,41 @@
1<?php
2function login($url,$user,$pass){
3 //GET SESSION COOKIE AND SECURITY TOKEN FOR ZENCART
4 $ch = curl_init();
5 curl_setopt($ch, CURLOPT_URL, $url."login.php");
6 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
7 curl_setopt($ch, CURLOPT_HEADER, 1);
8 curl_setopt($ch, CURLOPT_POST, 0);
9 curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
10 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
11 curl_setopt($ch, CURLOPT_TIMEOUT, 30);
12 $res = curl_exec ($ch);
13 preg_match("/Set-Cookie\: ([^;]*);/",$res,$cookie);
14 preg_match("/name=\"securityToken\" value=\"([^\"]*)\"/",$res,$sec_token);
15 if($sec_token[1]){
16 $post_fields="admin_name=".$user."&admin_pass=".$pass."&securityToken=".$sec_token[1]."&submit=Login";
17 }else{
18 $post_fields="username=".$user."&password=".$pass;
19 }
20 //LOGIN INTO ADMINISTRATION
21 $header[] = "Content-type: application/x-www-form-urlencoded"; //Important header, won't work if any other content type set
22 $header[] = "Content-length: ".strlen($post_fields);
23 $header[] = "Cookie: ".$cookie[1];
24 $ch = curl_init();
25 curl_setopt($ch, CURLOPT_URL, $url."login.php?action=process&".$cookie[1]);
26 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
27 curl_setopt($ch, CURLOPT_HEADER, 1);
28 curl_setopt($ch, CURLOPT_POST, 1);
29 curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
30 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
31 curl_setopt($ch, CURLOPT_HTTPHEADER,$header);
32 curl_setopt($ch, CURLOPT_POSTFIELDS,$post_fields);
33 curl_setopt($ch, CURLOPT_TIMEOUT, 30);
34 $res = curl_exec ($ch);
35 preg_match("/Set-Cookie\: ([^;]*);/",$res,$new_cookie);
36 if($new_cookie[1])$cookie[1]=$new_cookie[1];
37 list($ses_name,$sessid)=split('=',$cookie[1]);
38 session_id($sessid);
39 //echo $res;
40}
41?>
0\ No newline at end of file42\ No newline at end of file
143
=== added file 'esale_osc/connector/openerp_runonce.php'
--- esale_osc/connector/openerp_runonce.php 1970-01-01 00:00:00 +0000
+++ esale_osc/connector/openerp_runonce.php 2010-07-21 10:31:39 +0000
@@ -0,0 +1,10 @@
1<?php
2if(tep_db_num_rows(tep_db_query('describe '.TABLE_ADDRESS_BOOK.' entry_nif'))==0){
3 tep_db_query('ALTER TABLE '.TABLE_ADDRESS_BOOK.' ADD entry_nif VARCHAR( 32 )');
4}
5if(tep_db_num_rows(tep_db_query('describe '.TABLE_PRODUCTS.' products_syncronized'))==0){
6 tep_db_query('ALTER TABLE '.TABLE_PRODUCTS.' ADD products_syncronized int(1)');
7 tep_db_query('ALTER TABLE '.TABLE_PRODUCTS.' ADD products_last_syncronized datetime');
8}
9unlink(__FILE__);
10?>
0\ No newline at end of file11\ No newline at end of file
112
=== modified file 'esale_osc/esale_oscom.py'
--- esale_osc/esale_oscom.py 2010-06-04 15:39:08 +0000
+++ esale_osc/esale_oscom.py 2010-07-21 10:31:39 +0000
@@ -1,3 +1,4 @@
1# -*- coding: utf-8 -*-
1# -*- encoding: utf-8 -*-2# -*- encoding: utf-8 -*-
2##############################################################################3##############################################################################
3#4#
@@ -5,6 +6,7 @@
5# Copyright (c) 2008 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved.6# Copyright (c) 2008 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved.
6# Jordi Esteve <jesteve@zikzakmedia.com>7# Jordi Esteve <jesteve@zikzakmedia.com>
7# Ana Juaristi <ajuaristio@gmail.com>8# Ana Juaristi <ajuaristio@gmail.com>
9# Copyright (c) 2010 ZhenIT Software (http://ZhenIT.com/).
8# $Id$10# $Id$
9#11#
10# This program is free software: you can redistribute it and/or modify12# This program is free software: you can redistribute it and/or modify
@@ -30,24 +32,6 @@
30from mx import DateTime32from mx import DateTime
31from tools.translate import _33from tools.translate import _
3234
33
34class esale_oscom_web(osv.osv):
35 _name = 'esale.oscom.web'
36esale_oscom_web()
37
38
39class esale_oscom_tax(osv.osv):
40 _name = "esale.oscom.tax"
41 _description = "esale_oscom Tax"
42 _columns = {
43 'name': fields.char('Tax name', size=32, required=True, readonly=True),
44 'esale_oscom_id': fields.integer('OScommerce Id'),
45 'web_id': fields.many2one('esale.oscom.web', 'Website'),
46 'tax_id': fields.many2one('account.tax', 'OpenERP tax'),
47 }
48esale_oscom_tax()
49
50
51class esale_oscom_status(osv.osv):35class esale_oscom_status(osv.osv):
52 _name = "esale.oscom.status"36 _name = "esale.oscom.status"
53 _description = "esale_oscom Status"37 _description = "esale_oscom Status"
@@ -60,86 +44,16 @@
60 }44 }
61esale_oscom_status()45esale_oscom_status()
6246
63
64class esale_oscom_category(osv.osv):
65 _name = "esale.oscom.category"
66 _description = "esale_oscom Category"
67 _columns = {
68 'name': fields.char('Name', size=64, required=True, readonly=True),
69 'esale_oscom_id': fields.integer('OScommerce Id', required=True),
70 'web_id': fields.many2one('esale.oscom.web', 'Website'),
71 'category_id': fields.many2one('product.category', 'OpenERP category'),
72 }
73esale_oscom_category()
74
75
76class esale_oscom_paytype(osv.osv):
77 _name = "esale.oscom.paytype"
78 _description = "esale_oscom PayType"
79 _columns = {
80 'name': fields.char('Name', size=64, required=True, readonly=True),
81 'esale_oscom_id': fields.integer('OScommerce Id', required=True),
82 'web_id': fields.many2one('esale.oscom.web', 'Website'),
83 'payment_id': fields.many2one('payment.type', 'OpenERP payment'),
84 'paytyp': fields.selection([('type1','SO in State Draft'),('type2','SO Confirmed'),('type3','Invoice Draft'),('type4','Invoice Confirmed'),('type5','Invoice Payed')], 'Payment type'),
85 'journal_id': fields.many2one('account.journal', 'OpenERP payment journal'),
86 }
87esale_oscom_paytype()
88
89
90class esale_oscom_language(osv.osv):
91 _name = "esale.oscom.lang"
92 _description = "esale_oscom Language"
93 _columns = {
94 'name': fields.char('Name', size=32, required=True, readonly=True),
95 'esale_oscom_id': fields.integer('OScommerce Id', required=True),
96 'web_id': fields.many2one('esale.oscom.web', 'Website'),
97 'language_id': fields.many2one('res.lang', 'OpenERP language'),
98 }
99esale_oscom_language()
100
101
102class esale_oscom_product(osv.osv):
103 _name = "esale.oscom.product"
104 _description = "esale_oscom Product"
105 _columns = {
106 'name': fields.char('Name', size=64, required=True, readonly=True),
107 'esale_oscom_id': fields.integer('OScommerce product Id'),
108 'web_id': fields.many2one('esale.oscom.web', 'Website'),
109 'product_id': fields.many2one('product.product', 'OpenERP product'),
110 }
111
112 def onchange_product_id(self, cr, uid, ids, product_id, web_id):
113 value = {}
114 if (product_id):
115 product = self.pool.get('product.product').browse(cr, uid, product_id)
116 value['name'] = product.name
117 return {'value': value}
118
119 def unlink(self, cr, uid, ids, context=None):
120 websites = {}
121 for esale_product in self.browse(cr, uid, ids):
122 web_product_ids = websites.get(esale_product.web_id and esale_product.web_id.id)
123 if web_product_ids and len(web_product_ids):
124 web_product_ids.append(esale_product.esale_oscom_id)
125 else:
126 websites[esale_product.web_id and esale_product.web_id.id] = [esale_product.esale_oscom_id]
127 websites_objs = self.pool.get('esale.oscom.web').browse(cr, uid, [x for x in websites.keys() if type(x) is int])
128 for website in websites_objs:
129 server = xmlrpclib.ServerProxy("%s/openerp-synchro.php" % website.url)
130 server.remove_product({'oscom_product_ids':websites.get(website.id)})
131 return super(esale_oscom_product,self).unlink(cr, uid, ids, context)
132esale_oscom_product()
133
134
135class esale_oscom_web(osv.osv):47class esale_oscom_web(osv.osv):
136 _name = "esale.oscom.web"48 _name = "esale.oscom.web"
137 _description = "OScommerce Website"49 _description = "OScommerce Website"
138 _columns = {50 _columns = {
139 'name': fields.char('Name',size=64, required=True),51 'name': fields.char('Name',size=64, required=True),
140 'url': fields.char('URL', size=128, required=True),52 'url': fields.char('URL', size=128, required=True),
53 'admin_user': fields.char('Admin User', size=128, required=True),
54 'admin_pass': fields.char('Admin Pass', size=128, required=True),
141 'shop_id': fields.many2one('sale.shop', 'Sale shop', required=True),55 'shop_id': fields.many2one('sale.shop', 'Sale shop', required=True),
142# 'partner_anonymous_id': fields.many2one('res.partner', 'Anonymous', required=True),56 'default_partner_category': fields.many2one('res.partner.category', 'Customers partner category', required=False),
143 'active': fields.boolean('Active'),57 'active': fields.boolean('Active'),
144 'product_ids': fields.one2many('esale.oscom.product', 'web_id', 'Web products'),58 'product_ids': fields.one2many('esale.oscom.product', 'web_id', 'Web products'),
145 'language_ids': fields.one2many('esale.oscom.lang', 'web_id', 'Languages'),59 'language_ids': fields.one2many('esale.oscom.lang', 'web_id', 'Languages'),
@@ -152,13 +66,22 @@
152 'date_download_from':fields.date('Date Download From', help="Specify date since you want to download modified or new products"),66 'date_download_from':fields.date('Date Download From', help="Specify date since you want to download modified or new products"),
153 'intermediate': fields.many2one('esale.oscom.status', 'Intermediate Status', help="Select intermediate status for Osc downloaded Orders"), 67 'intermediate': fields.many2one('esale.oscom.status', 'Intermediate Status', help="Select intermediate status for Osc downloaded Orders"),
154 'download_number': fields.integer('Download number', help="Osc product number to download by block. You should find the optimum block to download for your shop"),68 'download_number': fields.integer('Download number', help="Osc product number to download by block. You should find the optimum block to download for your shop"),
69 'override_products_data': fields.boolean('Override Products Data', help="Click if you want to Update products data on the shop with changes made in openerp."),
70 'plataforma': fields.char('Plataforma', size=16),
155 }71 }
156 _defaults = {72 _defaults = {
157 'active': lambda *a: 1,73 'active': lambda *a: 1,
158 'price_type': lambda *a:'0', 74 'plataforma': lambda *a:'osc',
75 'price_type': lambda *a:'0',
76 'override_products_data': lambda *a:True,
159 'download_number': lambda *a:30,77 'download_number': lambda *a:30,
160 }78 }
16179 def create(self, cr, uid, vals, context=None):
80 server = xmlrpclib.ServerProxy("%s/openerp-synchro.php?admin_user=%s&admin_pass=%s" % (vals['url'],vals['admin_user'],vals['admin_pass']))
81 init_vals = server.init()
82 vals["plataforma"] = init_vals[0]
83 return super(esale_oscom_web, self).create(cr, uid, vals, context=context)
84
162 def add_all_products(self, cr, uid, ids, *args):85 def add_all_products(self, cr, uid, ids, *args):
163 esale_product_obj = self.pool.get('esale.oscom.product')86 esale_product_obj = self.pool.get('esale.oscom.product')
164 for id in ids:87 for id in ids:
@@ -176,7 +99,7 @@
176 def tax_import(self, cr, uid, ids, *args):99 def tax_import(self, cr, uid, ids, *args):
177 esale_tax_obj = self.pool.get('esale.oscom.tax')100 esale_tax_obj = self.pool.get('esale.oscom.tax')
178 for website in self.browse(cr, uid, ids):101 for website in self.browse(cr, uid, ids):
179 server = xmlrpclib.ServerProxy("%s/openerp-synchro.php" % website.url)102 server = xmlrpclib.ServerProxy("%s/openerp-synchro.php?admin_user=%s&admin_pass=%s" % (website.url,website.admin_user,website.admin_pass))
180 taxes = server.get_taxes()103 taxes = server.get_taxes()
181 for tax in taxes:104 for tax in taxes:
182 update_taxes_ids = esale_tax_obj.search(cr, uid, [('web_id','=',website.id), ('esale_oscom_id','=',tax[0])])105 update_taxes_ids = esale_tax_obj.search(cr, uid, [('web_id','=',website.id), ('esale_oscom_id','=',tax[0])])
@@ -194,7 +117,7 @@
194 def status_import(self, cr, uid, ids, *args):117 def status_import(self, cr, uid, ids, *args):
195 esale_status_obj = self.pool.get('esale.oscom.status')118 esale_status_obj = self.pool.get('esale.oscom.status')
196 for website in self.browse(cr, uid, ids):119 for website in self.browse(cr, uid, ids):
197 server = xmlrpclib.ServerProxy("%s/openerp-synchro.php" % website.url)120 server = xmlrpclib.ServerProxy("%s/openerp-synchro.php?admin_user=%s&admin_pass=%s" % (website.url,website.admin_user,website.admin_pass))
198 statuses = server.get_statuses()121 statuses = server.get_statuses()
199 for status in statuses:122 for status in statuses:
200 update_statuses_ids = esale_status_obj.search(cr, uid, [('web_id','=',website.id), ('esale_oscom_id','=',status[0])])123 update_statuses_ids = esale_status_obj.search(cr, uid, [('web_id','=',website.id), ('esale_oscom_id','=',status[0])])
@@ -215,7 +138,7 @@
215 def lang_import(self, cr, uid, ids, *args):138 def lang_import(self, cr, uid, ids, *args):
216 esale_lang_obj = self.pool.get('esale.oscom.lang')139 esale_lang_obj = self.pool.get('esale.oscom.lang')
217 for website in self.browse(cr, uid, ids):140 for website in self.browse(cr, uid, ids):
218 server = xmlrpclib.ServerProxy("%s/openerp-synchro.php" % website.url)141 server = xmlrpclib.ServerProxy("%s/openerp-synchro.php?admin_user=%s&admin_pass=%s" % (website.url,website.admin_user,website.admin_pass))
219 languages = server.get_languages()142 languages = server.get_languages()
220 for language in languages:143 for language in languages:
221 update_language_ids = esale_lang_obj.search(cr, uid, [('web_id','=',website.id), ('esale_oscom_id','=',language[0])])144 update_language_ids = esale_lang_obj.search(cr, uid, [('web_id','=',website.id), ('esale_oscom_id','=',language[0])])
@@ -234,7 +157,7 @@
234 def get_payment_methods(self, cr, uid, ids, *args):157 def get_payment_methods(self, cr, uid, ids, *args):
235 esale_paytype_obj = self.pool.get('esale.oscom.paytype')158 esale_paytype_obj = self.pool.get('esale.oscom.paytype')
236 for website in self.browse(cr, uid, ids):159 for website in self.browse(cr, uid, ids):
237 server = xmlrpclib.ServerProxy("%s/openerp-synchro.php" % website.url)160 server = xmlrpclib.ServerProxy("%s/openerp-synchro.php?admin_user=%s&admin_pass=%s" % (website.url,website.admin_user,website.admin_pass))
238 payment_methods = server.get_payment_methods()161 payment_methods = server.get_payment_methods()
239 for payment_method in payment_methods:162 for payment_method in payment_methods:
240 value={163 value={
@@ -254,7 +177,7 @@
254 """Imports product categories from OSCommerce"""177 """Imports product categories from OSCommerce"""
255 esale_category_obj = self.pool.get('esale.oscom.category')178 esale_category_obj = self.pool.get('esale.oscom.category')
256 for website in self.browse(cr, uid, ids):179 for website in self.browse(cr, uid, ids):
257 server = xmlrpclib.ServerProxy("%s/openerp-synchro.php" % website.url)180 server = xmlrpclib.ServerProxy("%s/openerp-synchro.php?admin_user=%s&admin_pass=%s" % (website.url,website.admin_user,website.admin_pass))
258 categories = server.get_categories()181 categories = server.get_categories()
259 for category in categories:182 for category in categories:
260 value = {183 value = {
@@ -277,7 +200,7 @@
277200
278 created, updated = 0,0201 created, updated = 0,0
279 for website in self.browse(cr, uid, ids):202 for website in self.browse(cr, uid, ids):
280 server = xmlrpclib.ServerProxy("%s/openerp-synchro.php" % website.url)203 server = xmlrpclib.ServerProxy("%s/openerp-synchro.php?admin_user=%s&admin_pass=%s" % (website.url,website.admin_user,website.admin_pass))
281204
282 # Search OScommerce languages mapped to OpenERP205 # Search OScommerce languages mapped to OpenERP
283 osc_langs = [lang.esale_oscom_id for lang in website.language_ids if lang.language_id and lang.language_id.translatable]206 osc_langs = [lang.esale_oscom_id for lang in website.language_ids if lang.language_id and lang.language_id.translatable]
@@ -356,6 +279,17 @@
356 """If you want create additonal information in OpenERP objects related to product you can redefine this method in your own module"""279 """If you want create additonal information in OpenERP objects related to product you can redefine this method in your own module"""
357 return True280 return True
358281
282 def get_products_oscom_url(self, cr, uid, website, prod_id,cat_id):
283 website_url = website.url.split("/")
284 prod_url = website_url[0] + "//" + website_url[2] + "/"
285 for x in range(3,len(website_url)-1):
286 prod_url += website_url[x] + "/"
287 if(website.plataforma=='zen'):
288 prod_url += "index.php?page=product_info&cPath=" + cat_id + "&products_id=" + prod_id
289 else:
290 prod_url += "product_info.php?cPath=" + cat_id + "&products_id=" + prod_id
291 return prod_url
292
359293
360 def product_import_create(self, cr, uid, ids, *args):294 def product_import_create(self, cr, uid, ids, *args):
361 """Imports products from OSCommerce and creates/updates OpenERP products"""295 """Imports products from OSCommerce and creates/updates OpenERP products"""
@@ -367,8 +301,7 @@
367301
368 created, updated = 0,0302 created, updated = 0,0
369 for website in self.browse(cr, uid, ids):303 for website in self.browse(cr, uid, ids):
370 server = xmlrpclib.ServerProxy("%s/openerp-synchro.php" % website.url)304 server = xmlrpclib.ServerProxy("%s/openerp-synchro.php?admin_user=%s&admin_pass=%s" % (website.url,website.admin_user,website.admin_pass))
371 website_url = website.url.split("/")
372305
373 # Search esale languages mapped to OpenERP306 # Search esale languages mapped to OpenERP
374 osc_langs = [lang.esale_oscom_id for lang in website.language_ids if lang.language_id and lang.language_id.translatable]307 osc_langs = [lang.esale_oscom_id for lang in website.language_ids if lang.language_id and lang.language_id.translatable]
@@ -457,7 +390,7 @@
457 'spe_price_status': 'status' in spec_prod and str(spec_prod['status']) or False,390 'spe_price_status': 'status' in spec_prod and str(spec_prod['status']) or False,
458 'spe_price': 'specials_new_products_price' in spec_prod and spec_prod['specials_new_products_price'] or False,391 'spe_price': 'specials_new_products_price' in spec_prod and spec_prod['specials_new_products_price'] or False,
459 'exp_date': 'expires_date' in spec_prod and spec_prod['expires_date']!='0000-00-00 00:00:00' and spec_prod['expires_date'] or False,392 'exp_date': 'expires_date' in spec_prod and spec_prod['expires_date']!='0000-00-00 00:00:00' and spec_prod['expires_date'] or False,
460 'oscom_url': website_url[0] + "//" + website_url[2] + "/" +"product_info.php?cPath=" + str(info_prod['categ_id']) + "&products_id=" + str(info_prod['products_id']),393 'oscom_url': self.get_products_oscom_url(cr, uid, website, str(info_prod['products_id']),str(info_prod['categ_id'])),
461 'manufacturer_id': manuf_id or False,394 'manufacturer_id': manuf_id or False,
462 #'ean13': info_prod['products_model'],395 #'ean13': info_prod['products_model'],
463 #'type': 'Stockable product',396 #'type': 'Stockable product',
@@ -560,6 +493,8 @@
560 oscom_id = info_prod['products_id']493 oscom_id = info_prod['products_id']
561 else:494 else:
562 raise osv.except_osv(_('Product import done'),_('New or updated products are not found'))495 raise osv.except_osv(_('Product import done'),_('New or updated products are not found'))
496 #website.date_download_from = lambda *a:time.strftime('%Y-%m-%d')
497 #website.write(cr, uid, website.id, {'date_download_from':time.strftime('%Y-%m-%d')})
563 raise osv.except_osv(_('Product import done'), _('Created: %d products\nUpdated: %d products\n\nRefresh screen to see updates') % (created, updated))498 raise osv.except_osv(_('Product import done'), _('Created: %d products\nUpdated: %d products\n\nRefresh screen to see updates') % (created, updated))
564 return True499 return True
565500
@@ -632,241 +567,328 @@
632 website = self.pool.get('esale.oscom.web').browse(cr, uid, website_id)567 website = self.pool.get('esale.oscom.web').browse(cr, uid, website_id)
633 osc_int = esale_status_obj.read(cr, uid, website.intermediate.id, ['esale_oscom_id'])568 osc_int = esale_status_obj.read(cr, uid, website.intermediate.id, ['esale_oscom_id'])
634 intermediate = osc_int['esale_oscom_id']569 intermediate = osc_int['esale_oscom_id']
635 #print "intermediate before import", intermediate570
636571 server = xmlrpclib.ServerProxy("%s/openerp-synchro.php?admin_user=%s&admin_pass=%s" % (website.url,website.admin_user,website.admin_pass))
637 server = xmlrpclib.ServerProxy("%s/openerp-synchro.php" % website.url)572 exists_more_packages = True
638 cr.execute("select max(esale_oscom_id) from sale_order where esale_oscom_web=%s;" % str(website.id))
639 max_web_id = cr.fetchone()[0]
640
641 min_openorder=-1
642 if max_web_id:
643 saleorders = server.get_saleorders(max_web_id, statuses_ids)
644 min_openorder = server.get_min_open_orders(max_web_id)
645 else:
646 saleorders = server.get_saleorders(0, statuses_ids)
647 no_of_so = 0573 no_of_so = 0
648 for saleorder in saleorders:574 while exists_more_packages:
575 cr.execute("select max(esale_oscom_id) from sale_order where esale_oscom_web=%s;" % str(website.id))
576 max_web_id = cr.fetchone()[0]
577
578 min_openorder=-1
579 if max_web_id:
580 saleorders = server.get_saleorders(max_web_id, statuses_ids,website.download_number)
581 min_openorder = server.get_min_open_orders(max_web_id)
582 else:
583 saleorders = server.get_saleorders(0, statuses_ids,website.download_number)
584 if len(saleorders) != website.download_number:
585 exists_more_packages = False
586 for saleorder in saleorders:
649 #print "==========*********NEW**************==========="587 #print "==========*********NEW**************==========="
650 #print "== Oscommerce Sale Order Number :", saleorder['id']588 #print "== Oscommerce Sale Order Number :", saleorder['id']
651 #print "PEDIDO VENTA: " , saleorder589 #print "PEDIDO VENTA: " , saleorder
652 if len(saleorder['partner']) > 0 :590 if len(saleorder['partner']) > 0 :
653 oscom_partner = saleorder['partner'][0]591 oscom_partner = saleorder['partner'][0]
654 #print "== Sale order partner:", saleorder['partner'][0]592 #print "== Sale order partner:", saleorder['partner'][0]
655 partner_ids = partner_obj.search(cr, uid, [('esale_oscom_id','=',oscom_partner['esale_oscom_id'])])593 partner_ids = partner_obj.search(cr, uid, [('esale_oscom_id','=',oscom_partner['esale_oscom_id'])])
656 if len(partner_ids):594 if len(partner_ids):
657 partner_id = partner_ids[0]595 partner_id = partner_ids[0]
658 #print "partner: ", partner_ids596 #print "partner: ", partner_ids
659 partner_obj.write(cr, uid, partner_ids, {'name':oscom_partner['name']})597 partner_obj.write(cr, uid, partner_ids, {'name':oscom_partner['name']})
660 else:598 else:
661 del oscom_partner['addresses']599 del oscom_partner['addresses']
662 partner_id = partner_obj.create(cr, uid, oscom_partner)600 partner_id = partner_obj.create(cr, uid, oscom_partner)
663 partner_obj.write(cr, uid, partner_ids, {'ref':oscom_partner['esale_oscom_id']})601 partner_obj.write(cr, uid, partner_ids, {'ref':oscom_partner['esale_oscom_id']})
664602 cr.execute("INSERT INTO res_partner_category_rel(partner_id, category_id) VALUES (%d,%d);" % (partner_id,(website.default_partner_category)['id']))
665 self.customer_extra_info(cr, uid, website, partner_id, oscom_partner['esale_oscom_id']) # Creates additonal information in OpenERP objects related to customer603
666604 self.customer_extra_info(cr, uid, website, partner_id, oscom_partner['esale_oscom_id']) # Creates additonal information in OpenERP objects related to customer
667 # Default address is right on Website so we create the order.605
668 if len(saleorder['address']) > 0 :606 # Default address is right on Website so we create the order.
669 #print ""607 if len(saleorder['address']) > 0 :
670 #print "===Sale order default address:",saleorder['address'][0]608 #print ""
671 default_address = saleorder['address'][0]609 #print "===Sale order default address:",saleorder['address'][0]
672 del saleorder['address']610 default_address = saleorder['address'][0]
673 default_address['type'] = 'default'611 del saleorder['address']
674 default_address_id = _add_address(self, cr, uid, default_address.copy(), partner_id, context)612 default_address['type'] = 'default'
675 shipping_address = []613 default_address_id = _add_address(self, cr, uid, default_address.copy(), partner_id, context)
676 if len(saleorder['delivery']) > 0 :614 shipping_address = []
677 #print ""615 if len(saleorder['delivery']) > 0 :
678 #print "===Sale order Delivery:",saleorder['delivery'][0]616 #print ""
679 shipping_address = saleorder['delivery'][0]617 #print "===Sale order Delivery:",saleorder['delivery'][0]
680 del saleorder['delivery']618 shipping_address = saleorder['delivery'][0]
681 shipping_address['type'] = 'delivery'619 del saleorder['delivery']
682 shipping_address_id = _add_address(self, cr, uid, shipping_address.copy(), partner_id, context)620 shipping_address['type'] = 'delivery'
683 billing_address = []621 shipping_address_id = _add_address(self, cr, uid, shipping_address.copy(), partner_id, context)
684 if len(saleorder['billing']) > 0 :622 billing_address = []
685 #print ""623 if len(saleorder['billing']) > 0 :
686 #print "===Sale order Billing:",saleorder['billing'][0]624 #print ""
687 billing_address = saleorder['billing'][0]625 #print "===Sale order Billing:",saleorder['billing'][0]
688 del saleorder['billing']626 billing_address = saleorder['billing'][0]
689 billing_address['type'] = 'invoice'627 del saleorder['billing']
690 billing_address_id = _add_address(self, cr, uid, billing_address.copy(),partner_id, context)628 billing_address['type'] = 'invoice'
691629 billing_address_id = _add_address(self, cr, uid, billing_address.copy(),partner_id, context)
692 value={ 'esale_oscom_web': website.id,630
693 'esale_oscom_id' : saleorder['id'],631 value={ 'esale_oscom_web': website.id,
694 'shop_id' : website.shop_id.id,632 'esale_oscom_id' : saleorder['id'],
695 'partner_id' : partner_id,633 'shop_id' : website.shop_id.id,
696 'note' : saleorder['note'],634 'partner_id' : partner_id,
697 'pay_met_title' : saleorder['pay_met_title'],635 'note' : saleorder['note'],
698 'shipping_title' : saleorder['shipping_title'],636 'pay_met_title' : saleorder['pay_met_title'],
699 'orders_status' : saleorder['orders_status'],637 'shipping_title' : saleorder['shipping_title'],
700 'date_order' : saleorder['date'],638 'orders_status' : saleorder['orders_status'],
701 #'price_type' : saleorder['price_type']639 'date_order' : saleorder['date'],
702 }640 #'price_type' : saleorder['price_type']
703641 }
704 value.update(saleorder_obj.onchange_shop_id(cr, uid, [], value['shop_id'])['value'])642
705 value.update(saleorder_obj.onchange_partner_id(cr, uid, [], value['partner_id'])['value'])643 value.update(saleorder_obj.onchange_shop_id(cr, uid, [], value['shop_id'])['value'])
706 # address_obj = self.pool.get('res.partner.address')644 value.update(saleorder_obj.onchange_partner_id(cr, uid, [], value['partner_id'])['value'])
707 # for address in [('address','order'), ('billing', 'invoice'), ('delivery', 'shipping')]:645 # address_obj = self.pool.get('res.partner.address')
708 # criteria = [('partner_id', '=', website.partner_anonymous_id.id)]646 # for address in [('address','order'), ('billing', 'invoice'), ('delivery', 'shipping')]:
709 # insert = {'partner_id': website.partner_anonymous_id.id}647 # criteria = [('partner_id', '=', website.partner_anonymous_id.id)]
710 # for criterium in [('city', 'city'), ('name', 'name'), ('zip','zip'), ('address', 'street') ]:648 # insert = {'partner_id': website.partner_anonymous_id.id}
711 # criteria.append((criterium[1], 'like', saleorder[address[0]][criterium[0]]))649 # for criterium in [('city', 'city'), ('name', 'name'), ('zip','zip'), ('address', 'street') ]:
712 # insert[criterium[1]] = saleorder[address[0]][criterium[0]]650 # criteria.append((criterium[1], 'like', saleorder[address[0]][criterium[0]]))
713 # address_ids = address_obj.search(cr, uid, criteria)651 # insert[criterium[1]] = saleorder[address[0]][criterium[0]]
714 # if len(address_ids):652 # address_ids = address_obj.search(cr, uid, criteria)
715 # id = address_ids[0]653 # if len(address_ids):
716 # else:654 # id = address_ids[0]
717 # country_ids = self.pool.get('res.country').search(cr, uid, [('name', 'ilike', saleorder[address[0]]['country'])])655 # else:
718 # if len(country_ids):656 # country_ids = self.pool.get('res.country').search(cr, uid, [('name', 'ilike', saleorder[address[0]]['country'])])
719 # country_id = country_ids[0]657 # if len(country_ids):
720 # else:658 # country_id = country_ids[0]
721 # country_id = self.pool.get('res.country').create(cr, uid, { 'name' : saleorder[address[0]]['country'],659 # else:
722 # 'code' : saleorder[address[0]]['country'][0:2].lower()})660 # country_id = self.pool.get('res.country').create(cr, uid, { 'name' : saleorder[address[0]]['country'],
723 # insert['country_id'] = country_id661 # 'code' : saleorder[address[0]]['country'][0:2].lower()})
724 # if address[0] == 'address':662 # insert['country_id'] = country_id
725 # insert['email'] = saleorder['address']['email']663 # if address[0] == 'address':
726 # id = address_obj.create(cr, uid, insert)664 # insert['email'] = saleorder['address']['email']
727 #665 # id = address_obj.create(cr, uid, insert)
728 # value.update({'partner_%s_id' % address[1]: id})666 #
729 value['partner_order_id'] = default_address_id667 # value.update({'partner_%s_id' % address[1]: id})
730 if len(shipping_address) > 0 :668 value['partner_order_id'] = default_address_id
731 value['partner_shipping_id'] = shipping_address_id669 if len(shipping_address) > 0 :
732 else:670 value['partner_shipping_id'] = shipping_address_id
733 value['partner_shipping_id'] = default_address_id671 else:
734672 value['partner_shipping_id'] = default_address_id
735 if len(billing_address) > 0 :673
736 value['partner_invoice_id'] = billing_address_id674 if len(billing_address) > 0 :
737 else:675 value['partner_invoice_id'] = billing_address_id
738 value['partner_invoice_id'] = default_address_id676 else:
739 order_id = saleorder_obj.create(cr, uid, value)677 value['partner_invoice_id'] = default_address_id
740 order_id_obj = saleorder_obj.browse(cr, uid, order_id)678 order_id = saleorder_obj.create(cr, uid, value)
741 concat_cod = self.sale_order_code(order_id_obj)679 order_id_obj = saleorder_obj.browse(cr, uid, order_id)
742 saleorder_obj.write(cr, uid, order_id, {'name':concat_cod})680 concat_cod = self.sale_order_code(order_id_obj)
743 681 saleorder_obj.write(cr, uid, order_id, {'name':concat_cod})
744 for orderline in saleorder['lines']:682
745 ids = esale_product_obj.search(cr, uid, [('esale_oscom_id', '=', orderline['product_id']), ('web_id', '=', website.id)])683 for orderline in saleorder['lines']:
746 if len(ids):684 ids = esale_product_obj.search(cr, uid, [('esale_oscom_id', '=', orderline['product_id']), ('web_id', '=', website.id)])
747 oscom_product_id = ids[0]
748 oscom_product = esale_product_obj.browse(cr, uid, oscom_product_id)
749 product_id = oscom_product.product_id.id
750 #print "producto oscommerce encontrado:", product_id
751 else:
752 product_id = product_obj.search(cr, uid, [('name','=','Shipping Cost')])[0]
753 # if product comes with attributes, we will try to find the exact product variant
754 #print "tratando linea" , orderline
755 attributes = (orderline.has_key('attributes') and orderline['attributes']) or False
756 if attributes:
757 #print orderline['attributes']
758 #print "codigo producto", attributes['composed_code']
759 ids = product_obj.search(cr, uid, [('default_code', '=', attributes['composed_code']),('variants', '=', attributes['products_options_values'])])
760 if len(ids):685 if len(ids):
761 #print "producto con atributos encontrado:", ids686 oscom_product_id = ids[0]
762 product_id = ids[0]687 oscom_product = esale_product_obj.browse(cr, uid, oscom_product_id)
763688 product_id = oscom_product.product_id.id
764 linevalue = {689 #print "producto oscommerce encontrado:", product_id
765 'product_id' : product_id,690 else:
766 'product_uom_qty': orderline['product_qty'],691 #raise osv.except_osv(_('Ordered product not found in OpenErp'), _('Default product named \'Shipping Cost\' will be used.\nIn case it doesn\'t exist, please create it'))
767 'order_id' : order_id,692 product_id = product_obj.search(cr, uid, [('name','=','Shipping Cost')])[0]
768 }693 # if product comes with attributes, we will try to find the exact product variant
769 onchange_product_sol = saleorder_line_obj.product_id_change(cr, uid, [], value['pricelist_id'], linevalue['product_id'], linevalue['product_uom_qty'],False, 0, False, '', value['partner_id'])['value']694 #print "tratando linea" , orderline
770 onchange_product_sol['tax_id'] = False695 attributes = (orderline.has_key('attributes') and orderline['attributes']) or False
771 if orderline['tax_rate'] > 0.0000:
772 tax_rate_search_ids = tax_obj.search(cr, uid, [('tax_group','=','vat'),('amount','=',orderline['tax_rate']/100), ('type_tax_use', '=','sale')])
773 else:
774 tax_rate_search_ids = tax_obj.search(cr, uid, [('tax_group','=','vat'),('amount','=',0), ('type_tax_use', '=','sale')])
775 if tax_rate_search_ids:
776 onchange_product_sol['tax_id'] = tax_rate_search_ids
777 price = orderline['price']
778 name = orderline['name']
779 if saleorder['price_type'] == 'tax_excluded' and attributes:
780 # print "EVALUANDO PRECIOS ATRIBUTOS: ", str(price)
781 # print "prefix: ", attributes['price_prefix']
782 # print "EVALUANDO PRECIOS ATRIBUTOS2: ", str(attributes['options_values_price'])
783 price = eval(str(price) + attributes['price_prefix'] + str(attributes['options_values_price']))
784 name = name + ' ' + attributes['products_options'] + ' + ' + attributes['products_options_values']
785 elif saleorder['price_type'] == 'tax_included':
786 price = price * (1+orderline['tax_rate']/100)
787 if attributes:696 if attributes:
788 options_value_price = attributes['options_values_price']697 #print orderline['attributes']
789 cal_options_value_price = options_value_price * (1+orderline['tax_rate']/100)698 #print "codigo producto", attributes['composed_code']
790 price = eval(str(price) + attributes['price_prefix'] + str(cal_options_value_price))699 ids = product_obj.search(cr, uid, [('default_code', '=', attributes['composed_code']),('variants', '=', attributes['products_options_values'])])
700 if len(ids):
701 #print "producto con atributos encontrado:", ids
702 product_id = ids[0]
703
704 linevalue = {
705 'product_id' : product_id,
706 'product_uom_qty': orderline['product_qty'],
707 'order_id' : order_id,
708 }
709 onchange_product_sol = saleorder_line_obj.product_id_change(cr, uid, [], value['pricelist_id'], linevalue['product_id'], linevalue['product_uom_qty'],False, 0, False, '', value['partner_id'])['value']
710 onchange_product_sol['tax_id'] = False
711 if orderline['tax_rate'] > 0.0000:
712 tax_rate_search_ids = tax_obj.search(cr, uid, [('tax_group','=','vat'),('amount','=',orderline['tax_rate']/100), ('type_tax_use', '=','sale')])
713 else:
714 tax_rate_search_ids = tax_obj.search(cr, uid, [('tax_group','=','vat'),('amount','=',0), ('type_tax_use', '=','sale')])
715 if tax_rate_search_ids:
716 onchange_product_sol['tax_id'] = tax_rate_search_ids
717 price = orderline['price']
718 name = orderline['name']
719 if saleorder['price_type'] == 'tax_excluded' and attributes:
720 # print "EVALUANDO PRECIOS ATRIBUTOS: ", str(price)
721 # print "prefix: ", attributes['price_prefix']
722 # print "EVALUANDO PRECIOS ATRIBUTOS2: ", str(attributes['options_values_price'])
723 price = eval(str(price) + attributes['price_prefix'] + str(attributes['options_values_price']))
791 name = name + ' ' + attributes['products_options'] + ' + ' + attributes['products_options_values']724 name = name + ' ' + attributes['products_options'] + ' + ' + attributes['products_options_values']
792 onchange_product_sol['price_unit'] = round(price,2)725 elif saleorder['price_type'] == 'tax_included':
793 linevalue.update(onchange_product_sol)726 price = price * (1+orderline['tax_rate']/100)
794 linevalue.update(saleorder_line_obj.default_get(cr, uid, ['sequence', 'invoiced', 'state', 'product_packaging']))727 if attributes:
795 linevalue['name'] = name728 options_value_price = attributes['options_values_price']
796 if linevalue.get('weight',False):729 cal_options_value_price = options_value_price * (1+orderline['tax_rate']/100)
797 del linevalue['weight']730 price = eval(str(price) + attributes['price_prefix'] + str(cal_options_value_price))
798 linevalue["product_uos"] = linevalue['product_uos'] and linevalue['product_uos'][0]731 name = name + ' ' + attributes['products_options'] + ' + ' + attributes['products_options_values']
799 tax_id = linevalue['tax_id'] and linevalue['tax_id'][0]732 onchange_product_sol['price_unit'] = round(price,2)
800 del linevalue['tax_id']733 linevalue.update(onchange_product_sol)
801 ptax_id = [tax_id]734 linevalue.update(saleorder_line_obj.default_get(cr, uid, ['sequence', 'invoiced', 'state', 'product_packaging']))
802 id_orderline = saleorder_line_obj.create(cr, uid, linevalue)735 linevalue['name'] = name
803 saleorder_line_obj.write(cr, uid, [id_orderline], {'tax_id':[(6, 0, ptax_id)]})736 if linevalue.get('weight',False):
804 no_of_so +=1737 del linevalue['weight']
805738 linevalue["product_uos"] = linevalue['product_uos'] and linevalue['product_uos'][0]
806 ######################################################################################739 tax_id = linevalue['tax_id'] and linevalue['tax_id'][0]
807 oscom_pay_met = saleorder['pay_met']740 del linevalue['tax_id']
808 typ_ids = esale_paytype_obj.search(cr, uid, [('esale_oscom_id', '=', oscom_pay_met), ('web_id', '=', website.id)])741 if tax_id:
809 saleorder = saleorder_obj.browse(cr, uid, order_id)742 ptax_id = [tax_id]
810 if typ_ids:743 id_orderline = saleorder_line_obj.create(cr, uid, linevalue)
811 typ_data = esale_paytype_obj.browse(cr, uid, typ_ids)[0]744 saleorder_line_obj.write(cr, uid, [id_orderline], {'tax_id':[(6, 0, ptax_id)]})
812 paytype = typ_data.paytyp745 no_of_so +=1
813 cr.execute('select * from ir_module_module where name=%s and state=%s', ('sale_payment','installed'))746
814 if cr.fetchone():747 ######################################################################################
815 saleorder_obj.write(cr, uid, [order_id], {'payment_type': typ_data.payment_id.id})748 oscom_pay_met = saleorder['pay_met']
816 else:749 typ_ids = esale_paytype_obj.search(cr, uid, [('esale_oscom_id', '=', oscom_pay_met), ('web_id', '=', website.id)])
817 paytype = 'type1'750 saleorder = saleorder_obj.browse(cr, uid, order_id)
818 wf_service = netsvc.LocalService("workflow")751 if typ_ids:
819 if paytype == 'type1':752 typ_data = esale_paytype_obj.browse(cr, uid, typ_ids)[0]
820 #SO in state draft so nothing753 paytype = typ_data.paytyp
821 pass754 cr.execute('select * from ir_module_module where name=%s and state=%s', ('sale_payment','installed'))
822 elif paytype == 'type2':755 if cr.fetchone():
823 #SO in state confirmed756 saleorder_obj.write(cr, uid, [order_id], {'payment_type': typ_data.payment_id.id})
824 wf_service.trg_validate(uid, 'sale.order', order_id, 'order_confirm', cr)757 else:
825 elif paytype == 'type3':758 paytype = 'type1'
826 #INVOICE draft759 wf_service = netsvc.LocalService("workflow")
827 wf_service.trg_validate(uid, 'sale.order', order_id, 'order_confirm', cr)760 if paytype == 'type1':
828 wf_service.trg_validate(uid, 'sale.order', order_id, 'manual_invoice', cr)761 #SO in state draft so nothing
829 elif paytype == 'type4':762 pass
830 wf_service.trg_validate(uid, 'sale.order', order_id, 'order_confirm', cr)763 elif paytype == 'type2':
831 wf_service.trg_validate(uid, 'sale.order', order_id, 'manual_invoice', cr)764 #SO in state confirmed
832 inv_ids = inv_obj.search(cr, uid, [('origin','=',saleorder.name)])765 wf_service.trg_validate(uid, 'sale.order', order_id, 'order_confirm', cr)
833 inv_obj.button_compute(cr, uid, inv_ids)766 elif paytype == 'type3':
834 wf_service.trg_validate(uid, 'account.invoice',inv_ids[0], 'invoice_open', cr)767 #INVOICE draft
835 elif paytype == 'type5':768 wf_service.trg_validate(uid, 'sale.order', order_id, 'order_confirm', cr)
836 #INVOICE payed769 wf_service.trg_validate(uid, 'sale.order', order_id, 'manual_invoice', cr)
837 wf_service.trg_validate(uid, 'sale.order', order_id, 'order_confirm', cr)770 elif paytype == 'type4':
838 wf_service.trg_validate(uid, 'sale.order', order_id, 'manual_invoice', cr)771 wf_service.trg_validate(uid, 'sale.order', order_id, 'order_confirm', cr)
839 pay_account_id = (website.esale_account_id)['id']772 wf_service.trg_validate(uid, 'sale.order', order_id, 'manual_invoice', cr)
840 pay_journal_id = typ_data.journal_id.id773 inv_ids = inv_obj.search(cr, uid, [('origin','=',saleorder.name)])
841 inv_ids = inv_obj.search(cr, uid, [('origin','=',saleorder.name)])774 inv_obj.button_compute(cr, uid, inv_ids)
842 inv_obj.button_compute(cr, uid, inv_ids)775 wf_service.trg_validate(uid, 'account.invoice',inv_ids[0], 'invoice_open', cr)
843 wf_service.trg_validate(uid, 'account.invoice',inv_ids[0], 'invoice_open', cr)776 elif paytype == 'type5':
844 ids = self.pool.get('account.period').find(cr, uid, context=context)777 #INVOICE payed
845 period_id = False778 wf_service.trg_validate(uid, 'sale.order', order_id, 'order_confirm', cr)
846 if len(ids):779 wf_service.trg_validate(uid, 'sale.order', order_id, 'manual_invoice', cr)
847 period_id = ids[0]780 pay_account_id = (website.esale_account_id)['id']
848781 pay_journal_id = typ_data.journal_id.id
849 invoice = inv_obj.browse(cr, uid,inv_ids[0],{})782 inv_ids = inv_obj.search(cr, uid, [('origin','=',saleorder.name)])
850 company_currency = self.pool.get('res.users').browse(cr, uid, uid).company_id.currency_id.id783 inv_obj.button_compute(cr, uid, inv_ids)
851 if invoice.currency_id.id != company_currency:784 wf_service.trg_validate(uid, 'account.invoice',inv_ids[0], 'invoice_open', cr)
852 amount = round(self.pool.get('res.currency').compute(cr, uid, invoice.currency_id.id, company_currency, invoice.amount_total), 2)785 ids = self.pool.get('account.period').find(cr, uid, context=context)
853 else:786 period_id = False
854 amount = invoice.amount_total787 if len(ids):
855788 period_id = ids[0]
856 inv_obj.pay_and_reconcile(cr, uid, inv_ids, amount, pay_account_id, period_id, pay_journal_id, False, False, False, context={})789
857 else:790 invoice = inv_obj.browse(cr, uid,inv_ids[0],{})
858 #The payment method hasn't been mapped791 company_currency = self.pool.get('res.users').browse(cr, uid, uid).company_id.currency_id.id
859 pass792 if invoice.currency_id.id != company_currency:
860 cr.commit()793 amount = round(self.pool.get('res.currency').compute(cr, uid, invoice.currency_id.id, company_currency, invoice.amount_total), 2)
861 for saleorder in saleorders:794 else:
862 #print "website.intermediate: " , intermediate795 amount = invoice.amount_total
863 server.update_order_status(saleorder['id'], intermediate, '',0,0)796
797 inv_obj.pay_and_reconcile(cr, uid, inv_ids, amount, pay_account_id, period_id, pay_journal_id, False, False, False, context={})
798 else:
799 #The payment method hasn't been mapped
800 pass
801 cr.commit()
802 for saleorder in saleorders:
803 #print "website.intermediate: " , intermediate
804 server.update_order_status(saleorder['id'], intermediate, '',0,0)
805
864806
865 ###################### look for open orders in site that are 'done' in TinyERP ###################807 ###################### look for open orders in site that are 'done' in TinyERP ###################
866 ###################### and close them ###################808 ###################### and close them ###################
867 return no_of_so809 return no_of_so
868esale_oscom_web()810esale_oscom_web()
869811
812class esale_oscom_tax(osv.osv):
813 _name = "esale.oscom.tax"
814 _description = "esale_oscom Tax"
815 _columns = {
816 'name': fields.char('Tax name', size=32, required=True, readonly=True),
817 'esale_oscom_id': fields.integer('OScommerce Id'),
818 'web_id': fields.many2one('esale.oscom.web', 'Website'),
819 'tax_id': fields.many2one('account.tax', 'OpenERP tax'),
820 }
821esale_oscom_tax()
822
823class esale_oscom_category(osv.osv):
824 _name = "esale.oscom.category"
825 _description = "esale_oscom Category"
826 _columns = {
827 'name': fields.char('Name', size=64, required=True, readonly=True),
828 'esale_oscom_id': fields.integer('OScommerce Id', required=True),
829 'web_id': fields.many2one('esale.oscom.web', 'Website'),
830 'category_id': fields.many2one('product.category', 'OpenERP category'),
831 }
832esale_oscom_category()
833
834class esale_oscom_paytype(osv.osv):
835 _name = "esale.oscom.paytype"
836 _description = "esale_oscom PayType"
837 _columns = {
838 'name': fields.char('Name', size=64, required=True, readonly=True),
839 'esale_oscom_id': fields.integer('OScommerce Id', required=True),
840 'web_id': fields.many2one('esale.oscom.web', 'Website'),
841 'payment_id': fields.many2one('payment.type', 'OpenERP payment'),
842 'paytyp': fields.selection([('type1','SO in State Draft'),('type2','SO Confirmed'),('type3','Invoice Draft'),('type4','Invoice Confirmed'),('type5','Invoice Payed')], 'Payment type'),
843 'journal_id': fields.many2one('account.journal', 'OpenERP payment journal'),
844 }
845esale_oscom_paytype()
846
847
848class esale_oscom_language(osv.osv):
849 _name = "esale.oscom.lang"
850 _description = "esale_oscom Language"
851 _columns = {
852 'name': fields.char('Name', size=32, required=True, readonly=True),
853 'esale_oscom_id': fields.integer('OScommerce Id', required=True),
854 'web_id': fields.many2one('esale.oscom.web', 'Website'),
855 'language_id': fields.many2one('res.lang', 'OpenERP language'),
856 }
857esale_oscom_language()
858
859
860class esale_oscom_product(osv.osv):
861 _name = "esale.oscom.product"
862 _description = "esale_oscom Product"
863 _columns = {
864 'name': fields.char('Name', size=64, required=True, readonly=True),
865 'esale_oscom_id': fields.integer('OScommerce product Id'),
866 'web_id': fields.many2one('esale.oscom.web', 'Website'),
867 'product_id': fields.many2one('product.product', 'OpenERP product'),
868 }
869
870 def onchange_product_id(self, cr, uid, ids, product_id, web_id):
871 value = {}
872 if (product_id):
873 product = self.pool.get('product.product').browse(cr, uid, product_id)
874 value['name'] = product.name
875 return {'value': value}
876
877 def unlink(self, cr, uid, ids, context=None):
878 websites = {}
879 for esale_product in self.browse(cr, uid, ids):
880 web_product_ids = websites.get(esale_product.web_id and esale_product.web_id.id)
881 if web_product_ids and len(web_product_ids):
882 web_product_ids.append(esale_product.esale_oscom_id)
883 else:
884 websites[esale_product.web_id and esale_product.web_id.id] = [esale_product.esale_oscom_id]
885 websites_objs = self.pool.get('esale.oscom.web').browse(cr, uid, [x for x in websites.keys() if type(x) is int])
886 for website in websites_objs:
887 server = xmlrpclib.ServerProxy("%s/openerp-synchro.php?admin_user=%s&admin_pass=%s" % (website.url,website.admin_user,website.admin_pass))
888 server.remove_product({'oscom_product_ids':websites.get(website.id)})
889 return super(esale_oscom_product,self).unlink(cr, uid, ids, context)
890esale_oscom_product()
891
870892
871class esale_oscom_saleorder_line(osv.osv):893class esale_oscom_saleorder_line(osv.osv):
872 def _amount_line_net(self, cr, uid, ids, field_name, arg, context):894 def _amount_line_net(self, cr, uid, ids, field_name, arg, context):
@@ -925,7 +947,7 @@
925 value={}947 value={}
926 if esale_oscom_web:948 if esale_oscom_web:
927 website = self.pool.get('esale.oscom.web').browse(cr, uid, esale_oscom_web)949 website = self.pool.get('esale.oscom.web').browse(cr, uid, esale_oscom_web)
928 server = xmlrpclib.ServerProxy("%s/openerp-synchro.php" % website.url)950 server = xmlrpclib.ServerProxy("%s/openerp-synchro.php?admin_user=%s&admin_pass=%s" % (website.url,website.admin_user,website.admin_pass))
929 esale_status_obj = self.pool.get('esale.oscom.status')951 esale_status_obj = self.pool.get('esale.oscom.status')
930 osc_int = esale_status_obj.read(cr, uid, orders_status_id, ['esale_oscom_id'])952 osc_int = esale_status_obj.read(cr, uid, orders_status_id, ['esale_oscom_id'])
931 ostatus_id = osc_int['esale_oscom_id'] 953 ostatus_id = osc_int['esale_oscom_id']
@@ -1022,4 +1044,4 @@
1022 _columns = {1044 _columns = {
1023 'esale_oscom_id': fields.integer('OScommerce Id'),1045 'esale_oscom_id': fields.integer('OScommerce Id'),
1024 }1046 }
1025esale_oscom_partner_address()1047esale_oscom_partner_address()
1026\ No newline at end of file1048\ No newline at end of file
10271049
=== modified file 'esale_osc/esale_oscom_product.py'
--- esale_osc/esale_oscom_product.py 2010-02-02 20:22:20 +0000
+++ esale_osc/esale_oscom_product.py 2010-07-21 10:31:39 +0000
@@ -1,3 +1,4 @@
1# -*- coding: utf-8 -*-
1# -*- encoding: utf-8 -*-2# -*- encoding: utf-8 -*-
2##############################################################################3##############################################################################
3#4#
@@ -18,9 +19,9 @@
18#19#
19# You should have received a copy of the GNU General Public License20# You should have received a copy of the GNU General Public License
20# along with this program. If not, see <http://www.gnu.org/licenses/>.21# along with this program. If not, see <http://www.gnu.org/licenses/>.
21#22#
22##############################################################################23##############################################################################
2324
24from osv import fields,osv,orm25from osv import fields,osv,orm
25import xmlrpclib26import xmlrpclib
26from tools.translate import _27from tools.translate import _
@@ -203,8 +204,10 @@
203 websites_objs = esale_web_obj.browse(cr, uid, websites.keys())204 websites_objs = esale_web_obj.browse(cr, uid, websites.keys())
204 #print websites_objs205 #print websites_objs
205 for website in websites_objs:206 for website in websites_objs:
207 if not website.override_products_data:
208 continue
206 # print "%s/openerp-synchro.php" % website.url209 # print "%s/openerp-synchro.php" % website.url
207 server = xmlrpclib.ServerProxy("%s/openerp-synchro.php" % website.url)210 server = xmlrpclib.ServerProxy("%s/openerp-synchro.php?admin_user=%s&admin_pass=%s" % (website.url,website.admin_user,website.admin_pass))
208 website_url = website.url.split("/")211 website_url = website.url.split("/")
209212
210 # Pricelist of the web shop213 # Pricelist of the web shop
@@ -351,7 +354,7 @@
351 esale_prod_ids = esale_product_obj.search(cr, uid, [('esale_oscom_id','=',oscom_id)])354 esale_prod_ids = esale_product_obj.search(cr, uid, [('esale_oscom_id','=',oscom_id)])
352 esale_prod = esale_product_obj.browse(cr, uid, esale_prod_ids[0])355 esale_prod = esale_product_obj.browse(cr, uid, esale_prod_ids[0])
353 #print "ESALE PROD DATA (id, web, product, category):",esale_prod.id, esale_prod.web_id.id, esale_prod.product_id.id, esale_prod.product_id.categ_id.id356 #print "ESALE PROD DATA (id, web, product, category):",esale_prod.id, esale_prod.web_id.id, esale_prod.product_id.id, esale_prod.product_id.categ_id.id
354 prod_url = website_url[0] + "//" + website_url[2] + "/" +"product_info.php?cPath=" + str(category_id) + "&products_id=" + str(oscom_id)357 prod_url = website.get_products_oscom_url(cr, uid, website, str(oscom_id),str(category_id)),
355 super(esale_oscom_product_inherit, self).write(cr, uid, esale_prod.product_id.id, {'oscom_url': prod_url})358 super(esale_oscom_product_inherit, self).write(cr, uid, esale_prod.product_id.id, {'oscom_url': prod_url})
356359
357 # Remove delete products360 # Remove delete products
@@ -382,7 +385,7 @@
382 else:385 else:
383 websites_objs.append(website)386 websites_objs.append(website)
384 for website in websites_objs:387 for website in websites_objs:
385 server = xmlrpclib.ServerProxy("%s/openerp-synchro.php" % website.url)388 server = xmlrpclib.ServerProxy("%s/openerp-synchro.php?admin_user=%s&admin_pass=%s" % (website.url,website.admin_user,website.admin_pass))
386 if not product_ids:389 if not product_ids:
387 esale_products = website.product_ids390 esale_products = website.product_ids
388 else:391 else:
@@ -394,7 +397,10 @@
394 'quantity': product_obj._product_available(cr, uid, [esale_product.product_id.id], ['virtual_available'], False, {'shop':website.shop_id.id})[esale_product.product_id.id]['virtual_available']397 'quantity': product_obj._product_available(cr, uid, [esale_product.product_id.id], ['virtual_available'], False, {'shop':website.shop_id.id})[esale_product.product_id.id]['virtual_available']
395 }398 }
396 oscom_id = server.set_product_stock(webproduct)399 oscom_id = server.set_product_stock(webproduct)
397400 if(int(webproduct['quantity'])>0):
401 product_obj.write(cr, uid, [esale_product.product_id.id], {'in_out_stock':'1'})
402 else:
403 product_obj.write(cr, uid, [esale_product.product_id.id], {'in_out_stock':'0'})
398 return {}404 return {}
399405
400## def on_change_gross_price(self, cr, uid, ids, list_price):406## def on_change_gross_price(self, cr, uid, ids, list_price):
401407
=== modified file 'esale_osc/esale_oscom_view.xml'
--- esale_osc/esale_oscom_view.xml 2010-02-20 13:12:01 +0000
+++ esale_osc/esale_oscom_view.xml 2010-07-21 10:31:39 +0000
@@ -1,385 +1,388 @@
1<?xml version="1.0" encoding="utf-8"?>1<?xml version="1.0" encoding="utf-8"?>
2<openerp>2<openerp>
3<data>3<data>
4 <menuitem name="Sales Management/Internet Sales" id="menu_esale_oscom_root"/>4 <menuitem name="Sales Management/Internet Sales" id="menu_esale_oscom_root"/>
55
6 <record model="ir.ui.view" id="view_esale_oscom_form">6 <record model="ir.ui.view" id="view_esale_oscom_form">
7 <field name="name">esale.oscom.web.form</field>7 <field name="name">esale.oscom.web.form</field>
8 <field name="model">esale.oscom.web</field>8 <field name="model">esale.oscom.web</field>
9 <field name="type">form</field>9 <field name="type">form</field>
10 <field name="arch" type="xml">10 <field name="arch" type="xml">
11 <form string="OScommerce Web Shop">11 <form string="OScommerce Web Shop">
12 <notebook>12 <notebook>
13 <page string="General Informations">13 <page string="General Informations">
14 <separator string="esale_oscom Shop Info" colspan="4"/>14 <separator string="esale_oscom Shop Info" colspan="4"/>
15 <field name="name" select="1" colspan="4"/>15 <field name="name" select="1"/>
16 <field name="url" widget="url" required="1"/>16 <field name="admin_user" required="1"/>
17 <field name="active" select="1"/>17 <field name="url" widget="url" required="1"/>
18 <field name="shop_id" select="1" required="1"/>18 <field name="admin_pass" required="1" password="True"/>
19 <!--<field name="partner_anonymous_id" required="1"/>-->19 <newline/>
20 <field name="price_type"/>20 <field name="active" select="1"/>
21 <field name="esale_account_id"/>21 <field name="shop_id" select="1" required="1"/>
22 <newline/>22 <field name="default_partner_category" required="False"/>
23 <label string="Proceed with the mappings before adding products!" colspan="2"/>23 <field name="price_type"/>
24 <field name="date_download_from"/>24 <field name="esale_account_id"/>
25 <field name="download_number"/>25 <newline/>
26 <button name="product_import_create" string="Import all products from OSCommerce" colspan="2" type="object"/>26 <label string="Proceed with the mappings before adding products!" colspan="2"/>
27 <separator string="Active Products" colspan="4"/>27 <field name="date_download_from" required="1"/>
28 <field name="product_ids" colspan="4" widget="one2many_list" nolabel="1" readonly="1"/>28 <field name="download_number"/>
29 </page>29 <field name="override_products_data"/>
30 <page string="Taxes Mapping">30 <button name="product_import_create" string="Import all products from OSCommerce" colspan="2" type="object"/>
31 <button type="object" string="Import Taxes" name="tax_import"/>31 <separator string="Active Products" colspan="4"/>
32 <field colspan="4" name="tax_ids" widget="one2many_list" nolabel="1"/>32 <field name="product_ids" colspan="4" widget="one2many_list" nolabel="1" readonly="1"/>
33 </page>33 </page>
34 <page string="Languages Mapping">34 <page string="Taxes Mapping">
35 <button type="object" string="Import Languages" name="lang_import"/>35 <button type="object" string="Import Taxes" name="tax_import"/>
36 <field colspan="4" name="language_ids" widget="one2many_list" nolabel="1"/>36 <field colspan="4" name="tax_ids" widget="one2many_list" nolabel="1"/>
37 </page>37 </page>
38 <page string="Categories Mapping">38 <page string="Languages Mapping">
39 <button type="object" string="Import Categories" name="category_import"/>39 <button type="object" string="Import Languages" name="lang_import"/>
40 <button type="object" string="Import and create/update Categories" name="category_import_create"/>40 <field colspan="4" name="language_ids" widget="one2many_list" nolabel="1"/>
41 <field colspan="4" name="category_ids" widget="one2many_list" nolabel="1"/>41 </page>
42 </page>42 <page string="Categories Mapping">
43 <page string="Payment types Mapping">43 <button type="object" string="Import Categories" name="category_import"/>
44 <button type="object" string="Import Payment Methods" name="get_payment_methods"/>44 <button type="object" string="Import and create/update Categories" name="category_import_create"/>
45 <field colspan="4" name="pay_typ_ids" widget="one2many_list" nolabel="1"/>45 <field colspan="4" name="category_ids" widget="one2many_list" nolabel="1"/>
46 </page>46 </page>
47 <page string="Oscommerce Status Mapping">47 <page string="Payment types Mapping">
48 <button type="object" string="Import Oscommerce Status" name="status_import" colspan="4"/>48 <button type="object" string="Import Payment Methods" name="get_payment_methods"/>
49 <separator string="Status" colspan="4"/>49 <field colspan="4" name="pay_typ_ids" widget="one2many_list" nolabel="1"/>
50 <field name="intermediate"/>50 </page>
51 <field colspan="4" name="status_ids" widget="one2many_list" nolabel="1"/>51 <page string="Oscommerce Status Mapping">
52 </page>52 <button type="object" string="Import Oscommerce Status" name="status_import" colspan="4"/>
53 </notebook>53 <separator string="Status" colspan="4"/>
54 </form>54 <field name="intermediate"/>
55 </field>55 <field colspan="4" name="status_ids" widget="one2many_list" nolabel="1"/>
56 </record>56 </page>
57 <record model="ir.ui.view" id="view_esale_oscom_tree">57 </notebook>
58 <field name="name">esale.oscom.web.form</field>58 </form>
59 <field name="model">esale.oscom.web</field>59 </field>
60 <field name="type">tree</field>60 </record>
61 <field name="arch" type="xml">61 <record model="ir.ui.view" id="view_esale_oscom_tree">
62 <tree string="OScommerce Web Shop">62 <field name="name">esale.oscom.web.form</field>
63 <field name="name"/>63 <field name="model">esale.oscom.web</field>
64 <field name="url"/>64 <field name="type">tree</field>
65 <field name="active"/>65 <field name="arch" type="xml">
66 <field name="shop_id"/>66 <tree string="OScommerce Web Shop">
67 <field name="price_type"/>67 <field name="name"/>
68 <field name="esale_account_id"/>68 <field name="url"/>
69 </tree>69 <field name="active"/>
70 </field>70 <field name="shop_id"/>
71 </record>71 <field name="price_type"/>
72 <record model="ir.actions.act_window" id="action_esale_oscom_form">72 <field name="esale_account_id"/>
73 <field name="type">ir.actions.act_window</field>73 </tree>
74 <field name="res_model">esale.oscom.web</field>74 </field>
75 <field name="view_type">form</field>75 </record>
76 <field name="view_id" ref="view_esale_oscom_tree"/>76 <record model="ir.actions.act_window" id="action_esale_oscom_form">
77 </record>77 <field name="type">ir.actions.act_window</field>
7878 <field name="res_model">esale.oscom.web</field>
79 <menuitem name="Sales Management/Internet Sales/Websites" id="menu_action_esale_oscom_web" action="action_esale_oscom_form" groups="group_esale_oscom_user"/>79 <field name="view_type">form</field>
8080 <field name="view_id" ref="view_esale_oscom_tree"/>
81 <record model="ir.ui.view" id="esale_oscom_language_web_form">81 </record>
82 <field name="name">esale.oscom.language.web.form</field>82
83 <field name="model">esale.oscom.lang</field>83 <menuitem name="Sales Management/Internet Sales/Websites" id="menu_action_esale_oscom_web" action="action_esale_oscom_form" groups="group_esale_oscom_user"/>
84 <field name="type">form</field>84
85 <field name="arch" type="xml">85 <record model="ir.ui.view" id="esale_oscom_language_web_form">
86 <form string="Language">86 <field name="name">esale.oscom.language.web.form</field>
87 <separator colspan="4" string="Language mapping"/>87 <field name="model">esale.oscom.lang</field>
88 <field colspan="4" name="name" select="1" required="1"/>88 <field name="type">form</field>
89 <field name="language_id" select="1"/>89 <field name="arch" type="xml">
90 <field name="esale_oscom_id" readonly="1" select="1"/>90 <form string="Language">
91 </form>91 <separator colspan="4" string="Language mapping"/>
92 </field>92 <field colspan="4" name="name" select="1" required="1"/>
93 </record>93 <field name="language_id" select="1"/>
94 <record model="ir.ui.view" id="esale_oscom_language_web_tree">94 <field name="esale_oscom_id" readonly="1" select="1"/>
95 <field name="name">esale.oscom.language.web.tree</field>95 </form>
96 <field name="model">esale.oscom.lang</field>96 </field>
97 <field name="type">tree</field>97 </record>
98 <field name="arch" type="xml">98 <record model="ir.ui.view" id="esale_oscom_language_web_tree">
99 <tree string="Language">99 <field name="name">esale.oscom.language.web.tree</field>
100 <field name="name" />100 <field name="model">esale.oscom.lang</field>
101 <field name="language_id" />101 <field name="type">tree</field>
102 </tree>102 <field name="arch" type="xml">
103 </field>103 <tree string="Language">
104 </record>104 <field name="name" />
105 <record model="ir.ui.view" id="esale_oscom_tax_web_form">105 <field name="language_id" />
106 <field name="name">esale.oscom.tax.web.form</field>106 </tree>
107 <field name="model">esale.oscom.tax</field>107 </field>
108 <field name="type">form</field>108 </record>
109 <field name="arch" type="xml">109 <record model="ir.ui.view" id="esale_oscom_tax_web_form">
110 <form string="Taxes">110 <field name="name">esale.oscom.tax.web.form</field>
111 <separator colspan="4" string="Taxes mapping"/>111 <field name="model">esale.oscom.tax</field>
112 <field colspan="4" name="name" select="1" required="1"/>112 <field name="type">form</field>
113 <field name="tax_id" select="1"/>113 <field name="arch" type="xml">
114 <field name="esale_oscom_id" readonly="1" select="1"/>114 <form string="Taxes">
115 </form>115 <separator colspan="4" string="Taxes mapping"/>
116 </field>116 <field colspan="4" name="name" select="1" required="1"/>
117 </record>117 <field name="tax_id" select="1"/>
118 <record model="ir.ui.view" id="esale_oscom_tax_web_tree">118 <field name="esale_oscom_id" readonly="1" select="1"/>
119 <field name="name">esale.oscom.tax.web.tree</field>119 </form>
120 <field name="model">esale.oscom.tax</field>120 </field>
121 <field name="type">tree</field>121 </record>
122 <field name="arch" type="xml">122 <record model="ir.ui.view" id="esale_oscom_tax_web_tree">
123 <tree string="Taxes">123 <field name="name">esale.oscom.tax.web.tree</field>
124 <field name="name" />124 <field name="model">esale.oscom.tax</field>
125 <field name="tax_id" />125 <field name="type">tree</field>
126 </tree>126 <field name="arch" type="xml">
127 </field>127 <tree string="Taxes">
128 </record>128 <field name="name" />
129129 <field name="tax_id" />
130<!-- ####################################################################################### -->130 </tree>
131 <record model="ir.ui.view" id="esale_oscom_pay_typ_form">131 </field>
132 <field name="name">esale.oscom.pay.typ.form</field>132 </record>
133 <field name="model">esale.oscom.paytype</field>133
134 <field name="type">form</field>134<!-- ####################################################################################### -->
135 <field name="arch" type="xml">135 <record model="ir.ui.view" id="esale_oscom_pay_typ_form">
136 <form string="Payment types">136 <field name="name">esale.oscom.pay.typ.form</field>
137 <separator colspan="4" string="Payment types mapping"/>137 <field name="model">esale.oscom.paytype</field>
138 <field colspan="4" name="name" select="1" required="1"/>138 <field name="type">form</field>
139 <field name="payment_id" select="1"/>139 <field name="arch" type="xml">
140 <field name="esale_oscom_id" readonly="1" select="1"/>140 <form string="Payment types">
141 <field name="paytyp" select="1"/>141 <separator colspan="4" string="Payment types mapping"/>
142 <field name="journal_id" select="2" attrs="{'required':[('paytyp','=','type5')]}"/>142 <field colspan="4" name="name" select="1" required="1"/>
143 </form>143 <field name="payment_id" select="1"/>
144 </field>144 <field name="esale_oscom_id" readonly="1" select="1"/>
145 </record>145 <field name="paytyp" select="1"/>
146 <record model="ir.ui.view" id="esale_oscom_pay_typ_tree">146 <field name="journal_id" select="2" attrs="{'required':[('paytyp','=','type5')]}"/>
147 <field name="name">esale.oscom.pay.typ.tree</field>147 </form>
148 <field name="model">esale.oscom.paytype</field>148 </field>
149 <field name="type">tree</field>149 </record>
150 <field name="arch" type="xml">150 <record model="ir.ui.view" id="esale_oscom_pay_typ_tree">
151 <tree string="Payment types">151 <field name="name">esale.oscom.pay.typ.tree</field>
152 <field name="name" />152 <field name="model">esale.oscom.paytype</field>
153 <field name="payment_id" />153 <field name="type">tree</field>
154 <field name="paytyp" />154 <field name="arch" type="xml">
155 <field name="journal_id" />155 <tree string="Payment types">
156 </tree>156 <field name="name" />
157 </field>157 <field name="payment_id" />
158 </record>158 <field name="paytyp" />
159<!-- ####################################################################################### -->159 <field name="journal_id" />
160 <record model="ir.ui.view" id="esale_oscom_status_form">160 </tree>
161 <field name="name">esale.oscom.status.form</field>161 </field>
162 <field name="model">esale.oscom.status</field>162 </record>
163 <field name="type">form</field>163<!-- ####################################################################################### -->
164 <field name="arch" type="xml">164 <record model="ir.ui.view" id="esale_oscom_status_form">
165 <form string="Osc status">165 <field name="name">esale.oscom.status.form</field>
166 <separator colspan="4" string="Oscommerce Status mapping"/>166 <field name="model">esale.oscom.status</field>
167 <field colspan="4" name="name" select="1" required="1"/>167 <field name="type">form</field>
168 <field name="language_id" select="1"/>168 <field name="arch" type="xml">
169 <field name="esale_oscom_id" readonly="1" select="1"/>169 <form string="Osc status">
170 <field name="download" select="1"/>170 <separator colspan="4" string="Oscommerce Status mapping"/>
171 </form>171 <field colspan="4" name="name" select="1" required="1"/>
172 </field>172 <field name="language_id" select="1"/>
173 </record>173 <field name="esale_oscom_id" readonly="1" select="1"/>
174 <record model="ir.ui.view" id="esale_oscom_status_tree">174 <field name="download" select="1"/>
175 <field name="name">esale.oscom.status.tree</field>175 </form>
176 <field name="model">esale.oscom.status</field>176 </field>
177 <field name="type">tree</field>177 </record>
178 <field name="arch" type="xml">178 <record model="ir.ui.view" id="esale_oscom_status_tree">
179 <tree string="Payment types">179 <field name="name">esale.oscom.status.tree</field>
180 <field name="name" />180 <field name="model">esale.oscom.status</field>
181 <field name="language_id" />181 <field name="type">tree</field>
182 <field name="esale_oscom_id" />182 <field name="arch" type="xml">
183 <field name="download" />183 <tree string="Payment types">
184 </tree>184 <field name="name" />
185 </field>185 <field name="language_id" />
186 </record>186 <field name="esale_oscom_id" />
187187 <field name="download" />
188188 </tree>
189<!-- ####################################################################################### -->189 </field>
190 <record model="ir.ui.view" id="esale_oscom_category_web_form">190 </record>
191 <field name="name">esale.oscom.category.web.form</field>191
192 <field name="model">esale.oscom.category</field>192
193 <field name="type">form</field>193<!-- ####################################################################################### -->
194 <field name="arch" type="xml">194 <record model="ir.ui.view" id="esale_oscom_category_web_form">
195 <form string="Categories">195 <field name="name">esale.oscom.category.web.form</field>
196 <separator colspan="4" string="taxes"/>196 <field name="model">esale.oscom.category</field>
197 <field name="name" select="1" colspan="4" required="1"/>197 <field name="type">form</field>
198 <field name="category_id" select="1"/>198 <field name="arch" type="xml">
199 <field name="esale_oscom_id" select="1" readonly="1"/>199 <form string="Categories">
200 </form>200 <separator colspan="4" string="taxes"/>
201 </field>201 <field name="name" select="1" colspan="4" required="1"/>
202 </record>202 <field name="category_id" select="1"/>
203 <record model="ir.ui.view" id="esale_oscom_category_web_tree">203 <field name="esale_oscom_id" select="1" readonly="1"/>
204 <field name="name">esale.oscom.category.web.v</field>204 </form>
205 <field name="model">esale.oscom.category</field>205 </field>
206 <field name="type">tree</field>206 </record>
207 <field name="arch" type="xml">207 <record model="ir.ui.view" id="esale_oscom_category_web_tree">
208 <tree string="Categories">208 <field name="name">esale.oscom.category.web.v</field>
209 <field name="name" />209 <field name="model">esale.oscom.category</field>
210 <field name="category_id" />210 <field name="type">tree</field>
211 </tree>211 <field name="arch" type="xml">
212 </field>212 <tree string="Categories">
213 </record>213 <field name="name" />
214214 <field name="category_id" />
215 <record model="ir.ui.view" id="esale_oscom_product_web_form">215 </tree>
216 <field name="name">esale.oscom.product.web.form</field>216 </field>
217 <field name="model">esale.oscom.product</field>217 </record>
218 <field name="type">form</field>218
219 <field name="arch" type="xml">219 <record model="ir.ui.view" id="esale_oscom_product_web_form">
220 <form string="Product">220 <field name="name">esale.oscom.product.web.form</field>
221 <separator colspan="4" string="Product Information"/>221 <field name="model">esale.oscom.product</field>
222 <field name="name" colspan="4" select="1" required="1"/>222 <field name="type">form</field>
223 <field name="product_id" on_change="onchange_product_id(product_id, web_id)" select="1" required="1"/>223 <field name="arch" type="xml">
224 <field name="esale_oscom_id" readonly="1" select="1"/>224 <form string="Product">
225 </form>225 <separator colspan="4" string="Product Information"/>
226 </field>226 <field name="name" colspan="4" select="1" required="1"/>
227 </record>227 <field name="product_id" on_change="onchange_product_id(product_id, web_id)" select="1" required="1"/>
228 <field name="esale_oscom_id" readonly="1" select="1"/>
229 </form>
230 </field>
231 </record>
228232
229233
230<!-- Web sale orders -->234<!-- Web sale orders -->
231 <record model="ir.ui.view" id="esale_oscom_saleorder_tree">235 <record model="ir.ui.view" id="esale_oscom_saleorder_tree">
232 <field name="name">esale.oscom.saleorder.tree</field>236 <field name="name">esale.oscom.saleorder.tree</field>
233 <field name="model">sale.order</field>237 <field name="model">sale.order</field>
234 <field name="type">tree</field>238 <field name="type">tree</field>
235 <field name="arch" type="xml">239 <field name="arch" type="xml">
236 <tree string="Sales Orders">240 <tree string="Sales Orders">
237 <field name="date_order"/>241 <field name="date_order"/>
238 <field name="name" string="Reference"/>242 <field name="name" string="Reference"/>
239 <field name="state"/>243 <field name="state"/>
240 <field name="partner_id"/>244 <field name="partner_id"/>
241 <field name="partner_shipping_id"/>245 <field name="partner_shipping_id"/>
242 <field name="esale_oscom_web"/>246 <field name="esale_oscom_web"/>
243 <field name="esale_oscom_id"/>247 <field name="esale_oscom_id"/>
244 <field name="shipped"/>248 <field name="shipped"/>
245 <field name="invoiced"/>249 <field name="invoiced"/>
246 <field name="orders_status"/>250 <field name="orders_status"/>
247 <field name="amount_untaxed"/>251 <field name="amount_untaxed"/>
248 <field name="shipping_title"/>252 <field name="shipping_title"/>
249 <field name="pay_met_title"/>253 <field name="pay_met_title"/>
250 </tree>254 </tree>
251 </field>255 </field>
252 </record>256 </record>
253 <record model="ir.ui.view" id="esale_oscom_saleorder_form">257 <record model="ir.ui.view" id="esale_oscom_saleorder_form">
254 <field name="name">esale.oscom.saleorder.form</field>258 <field name="name">esale.oscom.saleorder.form</field>
255 <field name="model">sale.order</field>259 <field name="model">sale.order</field>
256 <field name="type">form</field>260 <field name="type">form</field>
257 <field name="inherit_id" ref="sale.view_order_form" />261 <field name="inherit_id" ref="sale.view_order_form" />
258 <field name="arch" type="xml">262 <field name="arch" type="xml">
259 <notebook>263 <notebook>
260 <page string="Os Commerce Information" position="inside">264 <page string="Os Commerce Information" position="inside">
261 <separator string="OsCommerce" colspan="4"/>265 <separator string="OsCommerce" colspan="4"/>
262 <group col="2" colspan="2">266 <group col="2" colspan="2">
263 <field name="esale_oscom_id" readonly="1" select="1"/>267 <field name="esale_oscom_id" readonly="1" select="1"/>
264 <field name="esale_oscom_web" on_change="onchange_esale_oscom_web(esale_oscom_web)" select="1"/>268 <field name="esale_oscom_web" on_change="onchange_esale_oscom_web(esale_oscom_web)" select="1"/>
265 </group>269 </group>
266 <group col="2" colspan="2">270 <group col="2" colspan="2">
267 <field name="pay_met_title" readonly="1"/>271 <field name="pay_met_title" readonly="1"/>
268 <field name="shipping_title" readonly="1"/>272 <field name="shipping_title" readonly="1"/>
269 </group>273 </group>
270 <field name="orders_status" readonly="1"/>274 <field name="orders_status" readonly="1"/>
271 <field name="shipping_agency"/>275 <field name="shipping_agency"/>
272 <field name="tracking_number"/>276 <field name="tracking_number"/>
273 <field name="number_of_packages"/>277 <field name="number_of_packages"/>
274 <field name="volume"/>278 <field name="volume"/>
275 <separator string="Options selected will be applied on changing osc order status" colspan="4"/>279 <separator string="Options selected will be applied on changing osc order status" colspan="4"/>
276 <group col="2" colspan="2">280 <group col="2" colspan="2">
277 <field name="update_comment"/>281 <field name="update_comment"/>
278 <field name="send_web_email"/>282 <field name="send_web_email"/>
279 </group>283 </group>
280 <field colspan="4" name="status_comment"/>284 <field colspan="4" name="status_comment"/>
281 <field name="orders_status_id" on_change="onchange_esale_oscom_status(esale_oscom_web, esale_oscom_id, orders_status_id, status_comment, update_comment, send_web_email,tracking_number )" select="1"/>285 <field name="orders_status_id" on_change="onchange_esale_oscom_status(esale_oscom_web, esale_oscom_id, orders_status_id, status_comment, update_comment, send_web_email,tracking_number )" select="1"/>
282 <field colspan="4" name="additional_info"/>286 <field colspan="4" name="additional_info"/>
283 </page>287 </page>
284 </notebook>288 </notebook>
285 </field>289 </field>
286 </record>290 </record>
287 <record model="ir.actions.act_window" id="action_saleorder_tree">291 <record model="ir.actions.act_window" id="action_saleorder_tree">
288 <field name="type">ir.actions.act_window</field>292 <field name="type">ir.actions.act_window</field>
289 <field name="res_model">sale.order</field>293 <field name="res_model">sale.order</field>
290 <field name="view_type">form</field>294 <field name="view_type">form</field>
291 <field name="view_id" ref="esale_oscom_saleorder_tree"/>295 <field name="view_id" ref="esale_oscom_saleorder_tree"/>
292 <field name="view_mode">tree,form</field>296 <field name="view_mode">tree,form</field>
293 <field name="domain">[('esale_oscom_id','!=', 0)]</field>297 <field name="domain">[('esale_oscom_id','!=', 0)]</field>
294 </record>298 </record>
295299
296 <menuitem name="Sales Management/Internet Sales/Web sale orders" id="menu_action_esale_oscom_saleorder" action="action_saleorder_tree" groups="group_esale_oscom_user"/>300 <menuitem name="Sales Management/Internet Sales/Web sale orders" id="menu_action_esale_oscom_saleorder" action="action_saleorder_tree" groups="group_esale_oscom_user"/>
297301
298 <record model="ir.actions.act_window" id="action_saleorder_form">302 <record model="ir.actions.act_window" id="action_saleorder_form">
299 <field name="type">ir.actions.act_window</field>303 <field name="type">ir.actions.act_window</field>
300 <field name="res_model">sale.order</field>304 <field name="res_model">sale.order</field>
301 <field name="view_type">form</field>305 <field name="view_type">form</field>
302 <field name="view_id" ref="esale_oscom_saleorder_form"/>306 <field name="view_id" ref="esale_oscom_saleorder_form"/>
303 <field name="domain">[('esale_oscom_id','!=', 0)]</field>307 <field name="domain">[('esale_oscom_id','!=', 0)]</field>
304 </record>308 </record>
305309
306 <menuitem name="Sales Management/Internet Sales/Web sale orders/New order" id="menu_action_esale_oscom_saleorder_new" action="action_saleorder_form"/>310 <menuitem name="Sales Management/Internet Sales/Web sale orders/New order" id="menu_action_esale_oscom_saleorder_new" action="action_saleorder_form"/>
307311
308 <record model="ir.actions.act_window" id="action_saleorder_tree_draft">312 <record model="ir.actions.act_window" id="action_saleorder_tree_draft">
309 <field name="type">ir.actions.act_window</field>313 <field name="type">ir.actions.act_window</field>
310 <field name="res_model">sale.order</field>314 <field name="res_model">sale.order</field>
311 <field name="view_type">form</field>315 <field name="view_type">form</field>
312 <field name="view_id" ref="esale_oscom_saleorder_tree"/>316 <field name="view_id" ref="esale_oscom_saleorder_tree"/>
313 <field name="view_mode">tree,form</field>317 <field name="view_mode">tree,form</field>
314 <field name="domain">[('esale_oscom_web','!=', ''),('state','=','draft'),('user_id','=',uid)]</field>318 <field name="domain">[('esale_oscom_web','!=', ''),('state','=','draft'),('user_id','=',uid)]</field>
315 </record>319 </record>
316320
317 <menuitem name="Sales Management/Internet Sales/Web sale orders/Request for quotation" id="menu_action_saleorder_tree_draft" action="action_saleorder_tree_draft"/>321 <menuitem name="Sales Management/Internet Sales/Web sale orders/Request for quotation" id="menu_action_saleorder_tree_draft" action="action_saleorder_tree_draft"/>
318322
319 <record model="ir.actions.act_window" id="action_saleorder_tree_manual">323 <record model="ir.actions.act_window" id="action_saleorder_tree_manual">
320 <field name="type">ir.actions.act_window</field>324 <field name="type">ir.actions.act_window</field>
321 <field name="res_model">sale.order</field>325 <field name="res_model">sale.order</field>
322 <field name="view_type">form</field>326 <field name="view_type">form</field>
323 <field name="view_id" ref="esale_oscom_saleorder_tree"/>327 <field name="view_id" ref="esale_oscom_saleorder_tree"/>
324 <field name="view_mode">tree,form</field>328 <field name="view_mode">tree,form</field>
325 <field name="domain">[('esale_oscom_web','!=', ''),('state','=','manual'),('user_id','=',uid)]</field>329 <field name="domain">[('esale_oscom_web','!=', ''),('state','=','manual'),('user_id','=',uid)]</field>
326 </record>330 </record>
327331
328 <menuitem name="Sales Management/Internet Sales/Web sale orders/Waiting invoice" id="menu_action_saleorder_tree_manual" action="action_saleorder_tree_manual"/>332 <menuitem name="Sales Management/Internet Sales/Web sale orders/Waiting invoice" id="menu_action_saleorder_tree_manual" action="action_saleorder_tree_manual"/>
329333
330 <record model="ir.actions.act_window" id="action_saleorder_tree_progress">334 <record model="ir.actions.act_window" id="action_saleorder_tree_progress">
331 <field name="type">ir.actions.act_window</field>335 <field name="type">ir.actions.act_window</field>
332 <field name="res_model">sale.order</field>336 <field name="res_model">sale.order</field>
333 <field name="view_type">form</field>337 <field name="view_type">form</field>
334 <field name="view_id" ref="esale_oscom_saleorder_tree"/>338 <field name="view_id" ref="esale_oscom_saleorder_tree"/>
335 <field name="view_mode">tree,form</field>339 <field name="view_mode">tree,form</field>
336 <field name="domain">[('esale_oscom_web','!=', ''),('state','=','progress'),('user_id','=',uid)]</field>340 <field name="domain">[('esale_oscom_web','!=', ''),('state','=','progress'),('user_id','=',uid)]</field>
337 </record>341 </record>
338342
339 <menuitem name="Sales Management/Internet Sales/Web sale orders/In progress" id="menu_action_saleorder_tree_progress" action="action_saleorder_tree_progress"/>343 <menuitem name="Sales Management/Internet Sales/Web sale orders/In progress" id="menu_action_saleorder_tree_progress" action="action_saleorder_tree_progress"/>
340344
341345
342<!-- Web sale invoices -->346<!-- Web sale invoices -->
343 <record model="ir.actions.act_window" id="action_oscom_invoice_tree">347 <record model="ir.actions.act_window" id="action_oscom_invoice_tree">
344 <field name="type">ir.actions.act_window</field>348 <field name="type">ir.actions.act_window</field>
345 <field name="res_model">account.invoice</field>349 <field name="res_model">account.invoice</field>
346 <field name="view_type">form</field>350 <field name="view_type">form</field>
347 <field name="view_mode">tree,form</field>351 <field name="view_mode">tree,form</field>
348 <field name="domain">[('esale_oscom_web','!=', False)]</field>352 <field name="domain">[('esale_oscom_web','!=', False)]</field>
349 </record>353 </record>
350354
351 <menuitem name="Sales Management/Internet Sales/Invoices" id="menu_action_esale_oscom_invoices" action="action_oscom_invoice_tree" groups="group_esale_oscom_user"/>355 <menuitem name="Sales Management/Internet Sales/Invoices" id="menu_action_esale_oscom_invoices" action="action_oscom_invoice_tree" groups="group_esale_oscom_user"/>
352356
353 <record model="ir.actions.act_window" id="action_oscom_invoice_draft_tree">357 <record model="ir.actions.act_window" id="action_oscom_invoice_draft_tree">
354 <field name="type">ir.actions.act_window</field>358 <field name="type">ir.actions.act_window</field>
355 <field name="res_model">account.invoice</field>359 <field name="res_model">account.invoice</field>
356 <field name="view_type">form</field>360 <field name="view_type">form</field>
357 <field name="view_mode">tree,form</field>361 <field name="view_mode">tree,form</field>
358 <field name="domain">[('esale_oscom_web','!=', False),('state','=','draft')]</field>362 <field name="domain">[('esale_oscom_web','!=', False),('state','=','draft')]</field>
359 </record>363 </record>
360364
361 <menuitem name="Sales Management/Internet Sales/Invoices/Draft" id="menu_action_oscom_invoice_draft_tree" action="action_oscom_invoice_draft_tree"/>365 <menuitem name="Sales Management/Internet Sales/Invoices/Draft" id="menu_action_oscom_invoice_draft_tree" action="action_oscom_invoice_draft_tree"/>
362366
363 <record model="ir.actions.act_window" id="action_oscom_invoice_proforma">367 <record model="ir.actions.act_window" id="action_oscom_invoice_proforma">
364 <field name="type">ir.actions.act_window</field>368 <field name="type">ir.actions.act_window</field>
365 <field name="res_model">account.invoice</field>369 <field name="res_model">account.invoice</field>
366 <field name="view_type">form</field>370 <field name="view_type">form</field>
367 <field name="view_mode">tree,form</field>371 <field name="view_mode">tree,form</field>
368 <field name="domain">[('esale_oscom_web','!=',False),('state','=','proforma')]</field>372 <field name="domain">[('esale_oscom_web','!=',False),('state','=','proforma')]</field>
369 </record>373 </record>
370374
371 <menuitem name="Sales Management/Internet Sales/Invoices/PRO-FORMA" id="menu_action_oscom_invoice_proforma_tree" action="action_oscom_invoice_proforma"/>375 <menuitem name="Sales Management/Internet Sales/Invoices/PRO-FORMA" id="menu_action_oscom_invoice_proforma_tree" action="action_oscom_invoice_proforma"/>
372376
373 <record model="ir.actions.act_window" id="action_oscom_invoice_open">377 <record model="ir.actions.act_window" id="action_oscom_invoice_open">
374 <field name="type">ir.actions.act_window</field>378 <field name="type">ir.actions.act_window</field>
375 <field name="res_model">account.invoice</field>379 <field name="res_model">account.invoice</field>
376 <field name="view_type">form</field>380 <field name="view_type">form</field>
377 <field name="view_mode">tree,form</field>381 <field name="view_mode">tree,form</field>
378 <field name="domain">[('esale_oscom_web','!=', False),('state','=','open')]</field>382 <field name="domain">[('esale_oscom_web','!=', False),('state','=','open')]</field>
379 </record>383 </record>
380384
381 <menuitem name="Sales Management/Internet Sales/Invoices/Opened" id="menu_action_oscom_invoice_open_tree" action="action_oscom_invoice_open"/>385 <menuitem name="Sales Management/Internet Sales/Invoices/Opened" id="menu_action_oscom_invoice_open_tree" action="action_oscom_invoice_open"/>
382386
383</data>387</data>
384</openerp>388</openerp>
385
386\ No newline at end of file389\ No newline at end of file
387390
=== removed file 'esale_osc/esale_oscom_workflow.xml'
--- esale_osc/esale_oscom_workflow.xml 2009-03-23 14:47:31 +0000
+++ esale_osc/esale_oscom_workflow.xml 1970-01-01 00:00:00 +0000
@@ -1,230 +0,0 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3<data>
4 <record model="workflow" id="wkf_oscom_sale">
5 <field name="name">esale_oscom.saleorder.basic</field>
6 <field name="osv">esale_oscom.saleorder</field>
7 <field name="on_create">True</field>
8 </record>
9
10 #----------------------------------------------
11 # Activity
12 #----------------------------------------------
13 <record model="workflow.activity" id="act_draft">
14 <field name="wkf_id" ref="wkf_oscom_sale"/>
15 <field name="flow_start">True</field>
16 <field name="name">draft</field>
17 </record>
18 <record model="workflow.activity" id="act_router">
19 <field name="wkf_id" ref="wkf_oscom_sale"/>
20 <field name="name">router</field>
21 <field name="kind">function</field>
22 <field name="action">action_wait()</field>
23 <field name="split_mode">OR</field>
24 </record>
25 <record model="workflow.activity" id="act_wait_invoice">
26 <field name="wkf_id" ref="wkf_oscom_sale"/>
27 <field name="name">wait_invoice</field>
28 </record>
29 <record model="workflow.activity" id="act_wait_ship">
30 <field name="wkf_id" ref="wkf_oscom_sale"/>
31 <field name="name">wait_ship</field>
32 </record>
33
34 <record model="workflow.activity" id="act_done">
35 <field name="wkf_id" ref="wkf_oscom_sale"/>
36 <field name="name">done</field>
37 <field name="flow_stop">True</field>
38 <field name="kind">function</field>
39 <field name="action">write({'state':'done'})</field>
40 <field name="join_mode">AND</field>
41 </record>
42 <record model="workflow.activity" id="act_cancel">
43 <field name="wkf_id" ref="wkf_oscom_sale"/>
44 <field name="name">cancel</field>
45 <field name="flow_stop">True</field>
46 <field name="kind">stopall</field>
47 <field name="action">action_cancel()</field>
48 </record>
49 <record model="workflow.activity" id="act_cancel2">
50 <field name="wkf_id" ref="wkf_oscom_sale"/>
51 <field name="name">cancel2</field>
52 <field name="flow_stop">True</field>
53 <field name="kind">stopall</field>
54 <field name="action">action_cancel()</field>
55 </record>
56 <record model="workflow.activity" id="act_cancel3">
57 <field name="wkf_id" ref="wkf_oscom_sale"/>
58 <field name="name">cancel3</field>
59 <field name="flow_stop">True</field>
60 <field name="kind">stopall</field>
61 <field name="action">action_cancel()</field>
62 </record>
63
64 <record model="workflow.activity" id="act_invoice">
65 <field name="wkf_id" ref="wkf_oscom_sale"/>
66 <field name="name">invoice</field>
67 <field name="kind">subflow</field>
68 <field name="subflow_id" search="[('name','=','account.invoice.basic')]"/>
69 <field name="action">action_invoice_create()</field>
70 </record>
71 <record model="workflow.activity" id="act_invoice_except">
72 <field name="wkf_id" ref="wkf_oscom_sale"/>
73 <field name="name">invoice_except</field>
74 <field name="kind">function</field>
75 <field name="action">write({'state':'invoice_except', 'invoice_id':False})</field>
76 </record>
77 <record model="workflow.activity" id="act_invoice_end">
78 <field name="wkf_id" ref="wkf_oscom_sale"/>
79 <field name="name">invoice_end</field>
80 <field name="kind">function</field>
81 <field name="action">write({'invoiced':1})</field>
82 </record>
83 <record model="workflow.activity" id="act_invoice_cancel">
84 <field name="wkf_id" ref="wkf_oscom_sale"/>
85 <field name="name">invoice_cancel</field>
86 <field name="flow_stop">True</field>
87 <field name="kind">stopall</field>
88 <field name="action">action_cancel()</field>
89 </record>
90
91 <record model="workflow.activity" id="act_ship">
92 <field name="wkf_id" ref="wkf_oscom_sale"/>
93 <field name="name">ship</field>
94 <field name="kind">function</field>
95 <!--
96 <field name="kind">subflow</field>
97 <field name="subflow_id" search="[('osv','=','stock.picking')]"/>
98 -->
99 <field name="action">action_ship_create()</field>
100 </record>
101 <record model="workflow.activity" id="act_ship_except">
102 <field name="wkf_id" ref="wkf_oscom_sale"/>
103 <field name="name">ship_except</field>
104 <field name="kind">function</field>
105 <field name="action">write({'state':'shipping_except'})</field>
106 </record>
107 <record model="workflow.activity" id="act_ship_end">
108 <field name="wkf_id" ref="wkf_oscom_sale"/>
109 <field name="name">ship_end</field>
110 <field name="kind">function</field>
111 <field name="action">action_ship_end()</field>
112 </record>
113 <record model="workflow.activity" id="act_ship_cancel">
114 <field name="wkf_id" ref="wkf_oscom_sale"/>
115 <field name="name">ship_cancel</field>
116 <field name="flow_stop">True</field>
117 <field name="kind">stopall</field>
118 <field name="action">action_cancel()</field>
119 </record>
120
121 #----------------------------------------------
122 # Transistion
123 #----------------------------------------------
124
125 <record model="workflow.transition" id="trans_invoice_end_done">
126 <field name="act_from" ref="act_invoice_end"/>
127 <field name="act_to" ref="act_done"/>
128 </record>
129 <record model="workflow.transition" id="trans_draft_router">
130 <field name="act_from" ref="act_draft"/>
131 <field name="act_to" ref="act_router"/>
132 <field name="signal">order_confirm</field>
133 </record>
134 <record model="workflow.transition" id="trans_draft_cancel">
135 <field name="act_from" ref="act_draft"/>
136 <field name="act_to" ref="act_cancel"/>
137 <field name="signal">cancel</field>
138 </record>
139 <record model="workflow.transition" id="trans_router_wait_invoice">
140 <field name="act_from" ref="act_router"/>
141 <field name="act_to" ref="act_wait_invoice"/>
142 </record>
143 <record model="workflow.transition" id="trans_router_wait_ship">
144 <field name="act_from" ref="act_router"/>
145 <field name="act_to" ref="act_wait_ship"/>
146 </record>
147 <record model="workflow.transition" id="trans_wait_invoice_cancel2">
148 <field name="act_from" ref="act_wait_invoice"/>
149 <field name="act_to" ref="act_cancel2"/>
150 <field name="signal">cancel</field>
151 </record>
152 <record model="workflow.transition" id="trans_wait_ship_cancel3">
153 <field name="act_from" ref="act_wait_ship"/>
154 <field name="act_to" ref="act_cancel3"/>
155 <field name="signal">cancel</field>
156 </record>
157 <record model="workflow.transition" id="trans_wait_ship_ship">
158 <field name="act_from" ref="act_wait_ship"/>
159 <field name="act_to" ref="act_ship"/>
160 <field name="condition">(order_policy!='prepaid') or invoiced</field>
161 </record>
162 <record model="workflow.transition" id="trans_wait_invoice_invoice">
163 <field name="act_from" ref="act_wait_invoice"/>
164 <field name="act_to" ref="act_invoice"/>
165 <field name="condition">(order_policy=='prepaid') or ((order_policy=='postpaid') and shipped)</field>
166 </record>
167 <record model="workflow.transition" id="trans_wait_invoice_invoice_manual">
168 <field name="act_from" ref="act_wait_invoice"/>
169 <field name="act_to" ref="act_invoice"/>
170 <field name="signal">manual_invoice</field>
171 </record>
172 <record model="workflow.transition" id="trans_invoice_invoice_end">
173 <field name="act_from" ref="act_invoice"/>
174 <field name="act_to" ref="act_invoice_end"/>
175 <field name="signal">subflow.paid</field>
176 </record>
177 <record model="workflow.transition" id="trans_invoice_invoice_except">
178 <field name="act_from" ref="act_invoice"/>
179 <field name="act_to" ref="act_invoice_except"/>
180 <field name="signal">subflow.cancel</field>
181 </record>
182 <record model="workflow.transition" id="trans_invoice_except_invoice">
183 <field name="act_from" ref="act_invoice_except"/>
184 <field name="act_to" ref="act_invoice"/>
185 <field name="signal">invoice_recreate</field>
186 </record>
187 <record model="workflow.transition" id="trans_invoice_except_invoice_end">
188 <field name="act_from" ref="act_invoice_except"/>
189 <field name="act_to" ref="act_invoice_end"/>
190 <field name="signal">invoice_corrected</field>
191 </record>
192 <record model="workflow.transition" id="trans_invoice_except_invoice_cancel">
193 <field name="act_from" ref="act_invoice_except"/>
194 <field name="act_to" ref="act_invoice_cancel"/>
195 <field name="signal">invoice_cancel</field>
196 </record>
197 <record model="workflow.transition" id="trans_ship_end_done">
198 <field name="act_from" ref="act_ship_end"/>
199 <field name="act_to" ref="act_done"/>
200 </record>
201 <record model="workflow.transition" id="trans_ship_ship_end">
202 <field name="act_from" ref="act_ship"/>
203 <field name="act_to" ref="act_ship_end"/>
204 <field name="trigger_model">mrp.procurement</field>
205 <field name="trigger_expr_id">procurement_lines_get()</field>
206 <field name="condition">test_procurement_finnished()</field>
207 </record>
208 <record model="workflow.transition" id="trans_ship_ship_except">
209 <field name="act_from" ref="act_ship"/>
210 <field name="act_to" ref="act_ship_except"/>
211 <field name="condition">test_procurement_finnished('cancel')</field>
212 </record>
213 <record model="workflow.transition" id="trans_ship_except_ship">
214 <field name="act_from" ref="act_ship_except"/>
215 <field name="act_to" ref="act_ship"/>
216 <field name="signal">ship_recreate</field>
217 </record>
218 <record model="workflow.transition" id="trans_">
219 <field name="act_from" ref="act_ship_except"/>
220 <field name="act_to" ref="act_ship_end"/>
221 <field name="signal">ship_corrected</field>
222 </record>
223 <record model="workflow.transition" id="trans_ship_except_ship_cancel">
224 <field name="act_from" ref="act_ship_except"/>
225 <field name="act_to" ref="act_ship_cancel"/>
226 <field name="signal">ship_cancel</field>
227 </record>
228
229</data>
230</openerp>
2310
=== renamed file 'esale_osc/i18n/es.po' => 'esale_osc/i18n/es.po.THIS'
=== modified file 'esale_osc/i18n/es_ES.po' (properties changed: -x to +x)
--- esale_osc/i18n/es_ES.po 2010-02-02 20:22:20 +0000
+++ esale_osc/i18n/es_ES.po 2010-07-21 10:31:39 +0000
@@ -6,14 +6,15 @@
6msgstr ""6msgstr ""
7"Project-Id-Version: OpenERP Server 5.0.6\n"7"Project-Id-Version: OpenERP Server 5.0.6\n"
8"Report-Msgid-Bugs-To: support@openerp.com\n"8"Report-Msgid-Bugs-To: support@openerp.com\n"
9"POT-Creation-Date: 2009-12-30 02:38:48+0000\n"9"POT-Creation-Date: 2009-12-30 02:49+0000\n"
10"PO-Revision-Date: 2009-12-30 03:47+0100\n"10"PO-Revision-Date: 2010-04-21 14:57+0100\n"
11"Last-Translator: Ana Juaristi <ajuaristio@gmail.com>\n"11"Last-Translator: ZhenIT Software <info@ZhenIT.com>\n"
12"Language-Team: \n"12"Language-Team: \n"
13"MIME-Version: 1.0\n"13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: 8bit\n"15"Content-Transfer-Encoding: 8bit\n"
16"Plural-Forms: \n"16"X-Launchpad-Export-Date: 2010-02-15 15:01+0000\n"
17"X-Generator: Launchpad (build Unknown)\n"
1718
18#. module: esale_osc19#. module: esale_osc
19#: view:esale.oscom.web:020#: view:esale.oscom.web:0
@@ -58,7 +59,7 @@
58#. module: esale_osc59#. module: esale_osc
59#: field:product.product,manufacturer_id:060#: field:product.product,manufacturer_id:0
60msgid " Manufacturer"61msgid " Manufacturer"
61msgstr "Fabricante"62msgstr " Fabricante"
6263
63#. module: esale_osc64#. module: esale_osc
64#: model:ir.ui.menu,name:esale_osc.menu_esale_oscom_products65#: model:ir.ui.menu,name:esale_osc.menu_esale_oscom_products
@@ -520,7 +521,7 @@
520#. module: esale_osc521#. module: esale_osc
521#: help:sale.order,shipping_agency:0522#: help:sale.order,shipping_agency:0
522msgid " Include Carrier to delivery order with"523msgid " Include Carrier to delivery order with"
523msgstr "Incluya al transportista con el que enviará el pedido"524msgstr " Incluya al transportista con el que enviará el pedido"
524525
525#. module: esale_osc526#. module: esale_osc
526#: help:sale.order,orders_status_id:0527#: help:sale.order,orders_status_id:0
@@ -862,3 +863,32 @@
862msgid "In/Out Stock"863msgid "In/Out Stock"
863msgstr "Disponible/Agotado"864msgstr "Disponible/Agotado"
864865
866#. module: esale_osc
867#: field:esale.oscom.web,admin_user:0
868msgid "Admin User"
869msgstr "Usuario admin"
870
871#. module: esale_osc
872#: field:esale.oscom.web,admin_pass:0
873msgid "Admin Pass"
874msgstr "Clave admin"
875
876#. module: esale_osc
877#: field:esale.oscom.web,default_partner_category:0
878msgid "Customers partner category"
879msgstr "Categoría clientes"
880
881#. module: esale_osc
882#: field:esale.oscom.web,download_number:30
883msgid "Download number"
884msgstr "Descarga en bloques de"
885
886#. module: esale_osc
887#: field:esale.oscom.web,override_products_data:0
888msgid "Override Products Data"
889msgstr "Sobreescribir datos de productos"
890
891#. module: esale_osc
892#: help:esale.oscom.web,override_products_data:0
893msgid "Click if you want to Update products data on the shop with changes made in openerp."
894msgstr "Marca para actualizar los datos de los productos de la tienda cuando se modifiquen en openERP"
865\ No newline at end of file895\ No newline at end of file
866896
=== modified file 'esale_osc/i18n/esale_osc.pot' (properties changed: -x to +x)
--- esale_osc/i18n/esale_osc.pot 2010-02-02 20:22:20 +0000
+++ esale_osc/i18n/esale_osc.pot 2010-07-21 10:31:39 +0000
@@ -1,252 +1,247 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * esale_osc
4#
5msgid ""1msgid ""
6msgstr ""2msgstr ""
7"Project-Id-Version: OpenERP Server 5.0.6\n"3"Project-Id-Version: \n"
8"Report-Msgid-Bugs-To: support@openerp.com\n"4"POT-Creation-Date: \n"
9"POT-Creation-Date: 2009-12-30 02:49:33+0000\n"5"PO-Revision-Date: \n"
10"PO-Revision-Date: 2009-12-30 02:49:33+0000\n"6"Last-Translator: ZhenIT Software <info@ZhenIT.com>\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"7"Language-Team: \n"
13"MIME-Version: 1.0\n"8"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"9"Content-Type: text/plain; charset=iso-8859-1\n"
15"Content-Transfer-Encoding: \n"10"Content-Transfer-Encoding: 8bit\n"
16"Plural-Forms: \n"
1711
12#: view:esale.oscom.web:0
18#. module: esale_osc13#. module: esale_osc
19#: view:esale.oscom.web:0
20msgid "Taxes Mapping"14msgid "Taxes Mapping"
21msgstr ""15msgstr ""
2216
23#. module: esale_osc
24#: model:ir.model,name:esale_osc.model_esale_oscom_paytype17#: model:ir.model,name:esale_osc.model_esale_oscom_paytype
18#. module: esale_osc
25msgid "esale_oscom PayType"19msgid "esale_oscom PayType"
26msgstr ""20msgstr ""
2721
28#. module: esale_osc
29#: field:esale.oscom.tax,name:022#: field:esale.oscom.tax,name:0
23#. module: esale_osc
30msgid "Tax name"24msgid "Tax name"
31msgstr ""25msgstr ""
3226
33#. module: esale_osc
34#: field:esale.oscom.status,download:027#: field:esale.oscom.status,download:0
28#. module: esale_osc
35msgid "Download Orders on Status"29msgid "Download Orders on Status"
36msgstr ""30msgstr ""
3731
38#. module: esale_osc
39#: model:ir.model,name:esale_osc.model_esale_oscom_web32#: model:ir.model,name:esale_osc.model_esale_oscom_web
33#. module: esale_osc
40msgid "esale.oscom.web"34msgid "esale.oscom.web"
41msgstr ""35msgstr ""
4236
43#. module: esale_osc
44#: constraint:ir.actions.act_window:037#: constraint:ir.actions.act_window:0
38#. module: esale_osc
45msgid "Invalid model name in the action definition."39msgid "Invalid model name in the action definition."
46msgstr ""40msgstr ""
4741
42#: view:esale.oscom.status:0
48#. module: esale_osc43#. module: esale_osc
49#: view:esale.oscom.status:0
50msgid "Oscommerce Status mapping"44msgid "Oscommerce Status mapping"
51msgstr ""45msgstr ""
5246
47#: view:esale.oscom.web:0
53#. module: esale_osc48#. module: esale_osc
54#: view:esale.oscom.web:0
55msgid "Import Languages"49msgid "Import Languages"
56msgstr ""50msgstr ""
5751
58#. module: esale_osc
59#: field:product.product,manufacturer_id:052#: field:product.product,manufacturer_id:0
53#. module: esale_osc
60msgid " Manufacturer"54msgid " Manufacturer"
61msgstr ""55msgstr ""
6256
63#. module: esale_osc
64#: model:ir.ui.menu,name:esale_osc.menu_esale_oscom_products57#: model:ir.ui.menu,name:esale_osc.menu_esale_oscom_products
58#. module: esale_osc
65msgid "Synchronize products and stocks to all OScommerce web shops"59msgid "Synchronize products and stocks to all OScommerce web shops"
66msgstr ""60msgstr ""
6761
68#. module: esale_osc
69#: field:sale.order,orders_status_id:062#: field:sale.order,orders_status_id:0
63#. module: esale_osc
70msgid "Osc Status Actual"64msgid "Osc Status Actual"
71msgstr ""65msgstr ""
7266
73#. module: esale_osc
74#: model:ir.actions.wizard,name:esale_osc.wizard_esale_oscom_select_stocks67#: model:ir.actions.wizard,name:esale_osc.wizard_esale_oscom_select_stocks
75#: model:ir.actions.wizard,name:esale_osc.wizard_esale_oscom_stocks68#: model:ir.actions.wizard,name:esale_osc.wizard_esale_oscom_stocks
69#. module: esale_osc
76msgid "Update stocks"70msgid "Update stocks"
77msgstr ""71msgstr ""
7872
73#: view:product.product:0
79#. module: esale_osc74#. module: esale_osc
80#: view:product.product:0
81msgid "E-Sale Information"75msgid "E-Sale Information"
82msgstr ""76msgstr ""
8377
78#: view:esale.oscom.web:0
84#. module: esale_osc79#. module: esale_osc
85#: view:esale.oscom.web:0
86msgid "Oscommerce Status Mapping"80msgid "Oscommerce Status Mapping"
87msgstr ""81msgstr ""
8882
83#: constraint:product.product:0
89#. module: esale_osc84#. module: esale_osc
90#: constraint:product.product:0
91msgid "You can not give other value in Special Price! Please enter number with % or decimal value"85msgid "You can not give other value in Special Price! Please enter number with % or decimal value"
92msgstr ""86msgstr ""
9387
94#. module: esale_osc
95#: model:ir.ui.menu,name:esale_osc.menu_action_esale_oscom_product_manufacturer88#: model:ir.ui.menu,name:esale_osc.menu_action_esale_oscom_product_manufacturer
89#. module: esale_osc
96msgid "Manufacturers"90msgid "Manufacturers"
97msgstr ""91msgstr ""
9892
99#. module: esale_osc
100#: model:ir.actions.wizard,name:esale_osc.wizard_esale_oscom_products93#: model:ir.actions.wizard,name:esale_osc.wizard_esale_oscom_products
101#: model:ir.actions.wizard,name:esale_osc.wizard_esale_oscom_select_products94#: model:ir.actions.wizard,name:esale_osc.wizard_esale_oscom_select_products
95#. module: esale_osc
102msgid "Sync. products and stocks"96msgid "Sync. products and stocks"
103msgstr ""97msgstr ""
10498
105#. module: esale_osc
106#: model:ir.model,name:esale_osc.model_esale_oscom_product99#: model:ir.model,name:esale_osc.model_esale_oscom_product
100#. module: esale_osc
107msgid "esale_oscom Product"101msgid "esale_oscom Product"
108msgstr ""102msgstr ""
109103
110#. module: esale_osc
111#: field:product.product,oscom_url:0104#: field:product.product,oscom_url:0
105#. module: esale_osc
112msgid "URL to OScommerce"106msgid "URL to OScommerce"
113msgstr ""107msgstr ""
114108
109#: selection:product.product,spe_price_status:0
115#. module: esale_osc110#. module: esale_osc
116#: selection:product.product,spe_price_status:0
117msgid "On"111msgid "On"
118msgstr ""112msgstr ""
119113
120#. module: esale_osc
121#: field:esale.oscom.web,url:0114#: field:esale.oscom.web,url:0
122#: field:product.manufacturer,manufacturer_url:0115#: field:product.manufacturer,manufacturer_url:0
123#: field:product.product,product_url:0116#: field:product.product,product_url:0
117#. module: esale_osc
124msgid "URL"118msgid "URL"
125msgstr ""119msgstr ""
126120
127#. module: esale_osc
128#: model:ir.ui.menu,name:esale_osc.menu_esale_oscom_stocks121#: model:ir.ui.menu,name:esale_osc.menu_esale_oscom_stocks
122#. module: esale_osc
129msgid "Update stocks to all OScommerce web shops"123msgid "Update stocks to all OScommerce web shops"
130msgstr ""124msgstr ""
131125
126#: selection:product.product,in_out_stock:0
132#. module: esale_osc127#. module: esale_osc
133#: selection:product.product,in_out_stock:0
134msgid "In Stock"128msgid "In Stock"
135msgstr ""129msgstr ""
136130
137#. module: esale_osc
138#: model:ir.actions.wizard,name:esale_osc.wizard_esale_oscom_saleorders131#: model:ir.actions.wizard,name:esale_osc.wizard_esale_oscom_saleorders
132#. module: esale_osc
139msgid "Import sale orders"133msgid "Import sale orders"
140msgstr ""134msgstr ""
141135
142#. module: esale_osc
143#: field:sale.order,shipping_title:0136#: field:sale.order,shipping_title:0
137#. module: esale_osc
144msgid "Shipping"138msgid "Shipping"
145msgstr ""139msgstr ""
146140
141#: view:esale.oscom.web:0
147#. module: esale_osc142#. module: esale_osc
148#: view:esale.oscom.web:0
149msgid "Import Oscommerce Status"143msgid "Import Oscommerce Status"
150msgstr ""144msgstr ""
151145
152#. module: esale_osc
153#: help:sale.order,send_web_email:0146#: help:sale.order,send_web_email:0
147#. module: esale_osc
154msgid "Click if you want Sending comments to customer from web. Requires modifying .php procedure"148msgid "Click if you want Sending comments to customer from web. Requires modifying .php procedure"
155msgstr ""149msgstr ""
156150
157#. module: esale_osc
158#: help:esale.oscom.web,intermediate:0151#: help:esale.oscom.web,intermediate:0
152#. module: esale_osc
159msgid "Select intermediate status for Osc downloaded Orders"153msgid "Select intermediate status for Osc downloaded Orders"
160msgstr ""154msgstr ""
161155
156#: view:sale.order:0
162#. module: esale_osc157#. module: esale_osc
163#: view:sale.order:0
164msgid "Reference"158msgid "Reference"
165msgstr ""159msgstr ""
166160
167#. module: esale_osc
168#: help:sale.order,additional_info:0161#: help:sale.order,additional_info:0
162#. module: esale_osc
169msgid "Include any additional info you need internaly include on order"163msgid "Include any additional info you need internaly include on order"
170msgstr ""164msgstr ""
171165
172#. module: esale_osc
173#: constraint:product.category:0166#: constraint:product.category:0
167#. module: esale_osc
174msgid "Error ! You can not create recursive categories."168msgid "Error ! You can not create recursive categories."
175msgstr ""169msgstr ""
176170
171#: view:esale.oscom.category:0
177#. module: esale_osc172#. module: esale_osc
178#: view:esale.oscom.category:0
179msgid "taxes"173msgid "taxes"
180msgstr ""174msgstr ""
181175
176#: view:esale.oscom.paytype:0
182#. module: esale_osc177#. module: esale_osc
183#: view:esale.oscom.paytype:0
184msgid "Payment types mapping"178msgid "Payment types mapping"
185msgstr ""179msgstr ""
186180
187#. module: esale_osc
188#: model:ir.ui.menu,name:esale_osc.menu_esale_oscom_root181#: model:ir.ui.menu,name:esale_osc.menu_esale_oscom_root
182#. module: esale_osc
189msgid "Internet Sales"183msgid "Internet Sales"
190msgstr ""184msgstr ""
191185
192#. module: esale_osc
193#: model:ir.model,name:esale_osc.model_product_manufacturer186#: model:ir.model,name:esale_osc.model_product_manufacturer
187#. module: esale_osc
194msgid "Product Manufacturer that produces the product"188msgid "Product Manufacturer that produces the product"
195msgstr ""189msgstr ""
196190
191#: view:sale.order:0
197#. module: esale_osc192#. module: esale_osc
198#: view:sale.order:0
199msgid "OsCommerce"193msgid "OsCommerce"
200msgstr ""194msgstr ""
201195
202#. module: esale_osc
203#: field:esale.oscom.status,language_id:0196#: field:esale.oscom.status,language_id:0
197#. module: esale_osc
204msgid "Language Id"198msgid "Language Id"
205msgstr ""199msgstr ""
206200
207#. module: esale_osc
208#: wizard_button:esale.oscom.products,init,end:0201#: wizard_button:esale.oscom.products,init,end:0
209#: wizard_button:esale.oscom.saleorders,init,end:0202#: wizard_button:esale.oscom.saleorders,init,end:0
210#: wizard_button:esale.oscom.select.products,init,end:0203#: wizard_button:esale.oscom.select.products,init,end:0
211#: wizard_button:esale.oscom.select.stocks,init,end:0204#: wizard_button:esale.oscom.select.stocks,init,end:0
212#: wizard_button:esale.oscom.stocks,init,end:0205#: wizard_button:esale.oscom.stocks,init,end:0
206#. module: esale_osc
213msgid "End"207msgid "End"
214msgstr ""208msgstr ""
215209
216#. module: esale_osc
217#: model:ir.module.module,shortdesc:esale_osc.module_meta_information210#: model:ir.module.module,shortdesc:esale_osc.module_meta_information
211#. module: esale_osc
218msgid "OScommerce Interface / ZenCart"212msgid "OScommerce Interface / ZenCart"
219msgstr ""213msgstr ""
220214
221#. module: esale_osc
222#: wizard_view:esale.oscom.products,init:0215#: wizard_view:esale.oscom.products,init:0
223#: wizard_view:esale.oscom.select.products,init:0216#: wizard_view:esale.oscom.select.products,init:0
217#. module: esale_osc
224msgid "Products exported"218msgid "Products exported"
225msgstr ""219msgstr ""
226220
227#. module: esale_osc
228#: field:esale.oscom.lang,language_id:0221#: field:esale.oscom.lang,language_id:0
222#. module: esale_osc
229msgid "OpenERP language"223msgid "OpenERP language"
230msgstr ""224msgstr ""
231225
226#: view:product.product:0
232#. module: esale_osc227#. module: esale_osc
233#: view:product.product:0
234msgid "Special price information"228msgid "Special price information"
235msgstr ""229msgstr ""
236230
237#. module: esale_osc
238#: field:sale.order,tracking_number:0231#: field:sale.order,tracking_number:0
232#. module: esale_osc
239msgid "Num tracking"233msgid "Num tracking"
240msgstr ""234msgstr ""
241235
236#: selection:product.product,spe_price_status:0
242#. module: esale_osc237#. module: esale_osc
243#: selection:product.product,spe_price_status:0
244msgid "Off"238msgid "Off"
245msgstr ""239msgstr ""
246240
247#. module: esale_osc
248#: model:ir.module.module,description:esale_osc.module_meta_information241#: model:ir.module.module,description:esale_osc.module_meta_information
249msgid "OSCommerce (Zencart) eCommerce interface synchronisation.\n"242#. module: esale_osc
243msgid ""
244"OSCommerce (Zencart) eCommerce interface synchronisation.\n"
250"\n"245"\n"
251"Syncro Oscommerce to Openerp\n"246"Syncro Oscommerce to Openerp\n"
252" 1. Import/upgrade categories.\n"247" 1. Import/upgrade categories.\n"
@@ -261,462 +256,461 @@
261"Developed by Tiny, Axelor, Zikzakmedia and Ana Juaristi"256"Developed by Tiny, Axelor, Zikzakmedia and Ana Juaristi"
262msgstr ""257msgstr ""
263258
264#. module: esale_osc
265#: wizard_view:esale.oscom.saleorders,init:0259#: wizard_view:esale.oscom.saleorders,init:0
260#. module: esale_osc
266msgid "Sale orders succesfully imported"261msgid "Sale orders succesfully imported"
267msgstr ""262msgstr ""
268263
269#. module: esale_osc
270#: wizard_field:esale.oscom.products,init,prod_update:0264#: wizard_field:esale.oscom.products,init,prod_update:0
271#: wizard_field:esale.oscom.select.products,init,prod_update:0265#: wizard_field:esale.oscom.select.products,init,prod_update:0
266#. module: esale_osc
272msgid "Updated products"267msgid "Updated products"
273msgstr ""268msgstr ""
274269
275#. module: esale_osc
276#: help:sale.order,volume:0270#: help:sale.order,volume:0
271#. module: esale_osc
277msgid "Include volume of packages to send"272msgid "Include volume of packages to send"
278msgstr ""273msgstr ""
279274
280#. module: esale_osc
281#: wizard_field:esale.oscom.products,init,prod_new:0275#: wizard_field:esale.oscom.products,init,prod_new:0
282#: wizard_field:esale.oscom.select.products,init,prod_new:0276#: wizard_field:esale.oscom.select.products,init,prod_new:0
277#. module: esale_osc
283msgid "New products"278msgid "New products"
284msgstr ""279msgstr ""
285280
281#: view:esale.oscom.web:0
286#. module: esale_osc282#. module: esale_osc
287#: view:esale.oscom.web:0
288msgid "Active Products"283msgid "Active Products"
289msgstr ""284msgstr ""
290285
286#: selection:esale.oscom.paytype,paytyp:0
291#. module: esale_osc287#. module: esale_osc
292#: selection:esale.oscom.paytype,paytyp:0
293msgid "SO in State Draft"288msgid "SO in State Draft"
294msgstr ""289msgstr ""
295290
296#. module: esale_osc
297#: field:esale.oscom.web,date_download_from:0291#: field:esale.oscom.web,date_download_from:0
292#. module: esale_osc
298msgid "Date Download From"293msgid "Date Download From"
299msgstr ""294msgstr ""
300295
301#. module: esale_osc
302#: help:sale.order,status_comment:0296#: help:sale.order,status_comment:0
297#. module: esale_osc
303msgid "Write a comment to include on Osc order. It will be uploaded to Osc Web on changing actual osc status"298msgid "Write a comment to include on Osc order. It will be uploaded to Osc Web on changing actual osc status"
304msgstr ""299msgstr ""
305300
301#: view:esale.oscom.web:0
306#. module: esale_osc302#. module: esale_osc
307#: view:esale.oscom.web:0
308msgid "General Informations"303msgid "General Informations"
309msgstr ""304msgstr ""
310305
311#. module: esale_osc
312#: constraint:ir.ui.view:0306#: constraint:ir.ui.view:0
307#. module: esale_osc
313msgid "Invalid XML for View Architecture!"308msgid "Invalid XML for View Architecture!"
314msgstr ""309msgstr ""
315310
311#: constraint:product.template:0
316#. module: esale_osc312#. module: esale_osc
317#: constraint:product.template:0
318msgid "Error: UOS must be in a different category than the UOM"313msgid "Error: UOS must be in a different category than the UOM"
319msgstr ""314msgstr ""
320315
316#: view:esale.oscom.web:0
321#. module: esale_osc317#. module: esale_osc
322#: view:esale.oscom.web:0
323msgid "Proceed with the mappings before adding products!"318msgid "Proceed with the mappings before adding products!"
324msgstr ""319msgstr ""
325320
326#. module: esale_osc
327#: model:ir.model,name:esale_osc.model_esale_oscom_tax321#: model:ir.model,name:esale_osc.model_esale_oscom_tax
322#. module: esale_osc
328msgid "esale_oscom Tax"323msgid "esale_oscom Tax"
329msgstr ""324msgstr ""
330325
331#. module: esale_osc
332#: field:sale.order,esale_oscom_id:0326#: field:sale.order,esale_oscom_id:0
327#. module: esale_osc
333msgid "esale_oscom Id"328msgid "esale_oscom Id"
334msgstr ""329msgstr ""
335330
336#. module: esale_osc
337#: help:sale.order,tracking_number:0331#: help:sale.order,tracking_number:0
332#. module: esale_osc
338msgid "Include order trucking number given by carrier"333msgid "Include order trucking number given by carrier"
339msgstr ""334msgstr ""
340335
341#. module: esale_osc
342#: field:sale.order,update_comment:0336#: field:sale.order,update_comment:0
337#. module: esale_osc
343msgid "Update Comment"338msgid "Update Comment"
344msgstr ""339msgstr ""
345340
346#. module: esale_osc
347#: model:ir.ui.menu,name:esale_osc.menu_action_esale_oscom_saleorder_new341#: model:ir.ui.menu,name:esale_osc.menu_action_esale_oscom_saleorder_new
342#. module: esale_osc
348msgid "New order"343msgid "New order"
349msgstr ""344msgstr ""
350345
346#: view:esale.oscom.web:0
351#. module: esale_osc347#. module: esale_osc
352#: view:esale.oscom.web:0
353msgid "Payment types Mapping"348msgid "Payment types Mapping"
354msgstr ""349msgstr ""
355350
351#: view:esale.oscom.web:0
356#. module: esale_osc352#. module: esale_osc
357#: view:esale.oscom.web:0
358msgid "OScommerce Web Shop"353msgid "OScommerce Web Shop"
359msgstr ""354msgstr ""
360355
361#. module: esale_osc
362#: model:ir.ui.menu,name:esale_osc.menu_action_saleorder_tree_progress356#: model:ir.ui.menu,name:esale_osc.menu_action_saleorder_tree_progress
357#. module: esale_osc
363msgid "In progress"358msgid "In progress"
364msgstr ""359msgstr ""
365360
366#. module: esale_osc
367#: model:ir.ui.menu,name:esale_osc.menu_esale_oscom_saleorders361#: model:ir.ui.menu,name:esale_osc.menu_esale_oscom_saleorders
362#. module: esale_osc
368msgid "Import sale orders from all OScommerce web shops"363msgid "Import sale orders from all OScommerce web shops"
369msgstr ""364msgstr ""
370365
371#. module: esale_osc
372#: help:esale.oscom.web,esale_account_id:0366#: help:esale.oscom.web,esale_account_id:0
367#. module: esale_osc
373msgid "Payment account for web invoices."368msgid "Payment account for web invoices."
374msgstr ""369msgstr ""
375370
376#. module: esale_osc
377#: model:ir.ui.menu,name:esale_osc.menu_action_esale_oscom_invoices371#: model:ir.ui.menu,name:esale_osc.menu_action_esale_oscom_invoices
372#. module: esale_osc
378msgid "Invoices"373msgid "Invoices"
379msgstr ""374msgstr ""
380375
381#. module: esale_osc
382#: model:ir.ui.menu,name:esale_osc.menu_action_esale_oscom_saleorder376#: model:ir.ui.menu,name:esale_osc.menu_action_esale_oscom_saleorder
377#. module: esale_osc
383msgid "Web sale orders"378msgid "Web sale orders"
384msgstr ""379msgstr ""
385380
386#. module: esale_osc
387#: field:esale.oscom.web,product_ids:0381#: field:esale.oscom.web,product_ids:0
382#. module: esale_osc
388msgid "Web products"383msgid "Web products"
389msgstr ""384msgstr ""
390385
391#. module: esale_osc
392#: help:sale.order,update_comment:0386#: help:sale.order,update_comment:0
387#. module: esale_osc
393msgid "Click if you want to Update comments on order"388msgid "Click if you want to Update comments on order"
394msgstr ""389msgstr ""
395390
391#: selection:esale.oscom.web,price_type:0
396#. module: esale_osc392#. module: esale_osc
397#: selection:esale.oscom.web,price_type:0
398msgid "Taxed price"393msgid "Taxed price"
399msgstr ""394msgstr ""
400395
401#. module: esale_osc
402#: model:ir.model,name:esale_osc.model_esale_oscom_category396#: model:ir.model,name:esale_osc.model_esale_oscom_category
397#. module: esale_osc
403msgid "esale_oscom Category"398msgid "esale_oscom Category"
404msgstr ""399msgstr ""
405400
406#. module: esale_osc
407#: model:ir.model,name:esale_osc.model_esale_oscom_status401#: model:ir.model,name:esale_osc.model_esale_oscom_status
402#. module: esale_osc
408msgid "esale_oscom Status"403msgid "esale_oscom Status"
409msgstr ""404msgstr ""
410405
406#: view:esale.oscom.web:0
411#. module: esale_osc407#. module: esale_osc
412#: view:esale.oscom.web:0
413msgid "Languages Mapping"408msgid "Languages Mapping"
414msgstr ""409msgstr ""
415410
416#. module: esale_osc
417#: field:sale.order,volume:0411#: field:sale.order,volume:0
412#. module: esale_osc
418msgid "Volum"413msgid "Volum"
419msgstr ""414msgstr ""
420415
421#. module: esale_osc
422#: field:sale.order,number_of_packages:0416#: field:sale.order,number_of_packages:0
417#. module: esale_osc
423msgid "Num pack"418msgid "Num pack"
424msgstr ""419msgstr ""
425420
421#: view:esale.oscom.web:0
426#. module: esale_osc422#. module: esale_osc
427#: view:esale.oscom.web:0
428msgid "Categories Mapping"423msgid "Categories Mapping"
429msgstr ""424msgstr ""
430425
431#. module: esale_osc
432#: model:ir.ui.menu,name:esale_osc.menu_action_oscom_invoice_open_tree426#: model:ir.ui.menu,name:esale_osc.menu_action_oscom_invoice_open_tree
427#. module: esale_osc
433msgid "Opened"428msgid "Opened"
434msgstr ""429msgstr ""
435430
431#: selection:esale.oscom.paytype,paytyp:0
436#. module: esale_osc432#. module: esale_osc
437#: selection:esale.oscom.paytype,paytyp:0
438msgid "Invoice Payed"433msgid "Invoice Payed"
439msgstr ""434msgstr ""
440435
436#: constraint:product.template:0
441#. module: esale_osc437#. module: esale_osc
442#: constraint:product.template:0
443msgid "Error: The default UOM and the purchase UOM must be in the same category."438msgid "Error: The default UOM and the purchase UOM must be in the same category."
444msgstr ""439msgstr ""
445440
446#. module: esale_osc
447#: field:esale.oscom.web,language_ids:0441#: field:esale.oscom.web,language_ids:0
442#. module: esale_osc
448msgid "Languages"443msgid "Languages"
449msgstr ""444msgstr ""
450445
451#. module: esale_osc
452#: model:ir.ui.menu,name:esale_osc.menu_action_oscom_invoice_draft_tree446#: model:ir.ui.menu,name:esale_osc.menu_action_oscom_invoice_draft_tree
447#. module: esale_osc
453msgid "Draft"448msgid "Draft"
454msgstr ""449msgstr ""
455450
456#. module: esale_osc
457#: wizard_view:esale.oscom.products,init:0451#: wizard_view:esale.oscom.products,init:0
458#: wizard_view:esale.oscom.select.products,init:0452#: wizard_view:esale.oscom.select.products,init:0
453#. module: esale_osc
459msgid "Product Export"454msgid "Product Export"
460msgstr ""455msgstr ""
461456
462#. module: esale_osc
463#: field:esale.oscom.web,esale_account_id:0457#: field:esale.oscom.web,esale_account_id:0
458#. module: esale_osc
464msgid "Dest. account"459msgid "Dest. account"
465msgstr ""460msgstr ""
466461
467#. module: esale_osc
468#: field:esale.oscom.tax,tax_id:0462#: field:esale.oscom.tax,tax_id:0
463#. module: esale_osc
469msgid "OpenERP tax"464msgid "OpenERP tax"
470msgstr ""465msgstr ""
471466
472#. module: esale_osc
473#: model:ir.ui.menu,name:esale_osc.menu_action_oscom_invoice_proforma_tree467#: model:ir.ui.menu,name:esale_osc.menu_action_oscom_invoice_proforma_tree
468#. module: esale_osc
474msgid "PRO-FORMA"469msgid "PRO-FORMA"
475msgstr ""470msgstr ""
476471
472#: selection:esale.oscom.paytype,paytyp:0
477#. module: esale_osc473#. module: esale_osc
478#: selection:esale.oscom.paytype,paytyp:0
479msgid "Invoice Draft"474msgid "Invoice Draft"
480msgstr ""475msgstr ""
481476
482#. module: esale_osc
483#: view:esale.oscom.web:0477#: view:esale.oscom.web:0
484#: field:product.product,spe_price_status:0478#: field:product.product,spe_price_status:0
479#. module: esale_osc
485msgid "Status"480msgid "Status"
486msgstr ""481msgstr ""
487482
488#. module: esale_osc
489#: field:product.product,date_available:0483#: field:product.product,date_available:0
484#. module: esale_osc
490msgid "Available Date"485msgid "Available Date"
491msgstr ""486msgstr ""
492487
488#: selection:esale.oscom.paytype,paytyp:0
493#. module: esale_osc489#. module: esale_osc
494#: selection:esale.oscom.paytype,paytyp:0
495msgid "SO Confirmed"490msgid "SO Confirmed"
496msgstr ""491msgstr ""
497492
498#. module: esale_osc
499#: field:esale.oscom.paytype,journal_id:0493#: field:esale.oscom.paytype,journal_id:0
494#. module: esale_osc
500msgid "OpenERP payment journal"495msgid "OpenERP payment journal"
501msgstr ""496msgstr ""
502497
503#. module: esale_osc
504#: wizard_field:esale.oscom.products,init,prod_delete:0498#: wizard_field:esale.oscom.products,init,prod_delete:0
505#: wizard_field:esale.oscom.select.products,init,prod_delete:0499#: wizard_field:esale.oscom.select.products,init,prod_delete:0
500#. module: esale_osc
506msgid "Deleted products"501msgid "Deleted products"
507msgstr ""502msgstr ""
508503
509#. module: esale_osc
510#: help:sale.order,shipping_agency:0504#: help:sale.order,shipping_agency:0
505#. module: esale_osc
511msgid " Include Carrier to delivery order with"506msgid " Include Carrier to delivery order with"
512msgstr ""507msgstr ""
513508
514#. module: esale_osc
515#: help:sale.order,orders_status_id:0509#: help:sale.order,orders_status_id:0
510#. module: esale_osc
516msgid "Indicates the actual status of order on Osc Web"511msgid "Indicates the actual status of order on Osc Web"
517msgstr ""512msgstr ""
518513
514#: view:esale.oscom.lang:0
519#. module: esale_osc515#. module: esale_osc
520#: view:esale.oscom.lang:0
521msgid "Language mapping"516msgid "Language mapping"
522msgstr ""517msgstr ""
523518
519#: view:esale.oscom.web:0
524#. module: esale_osc520#. module: esale_osc
525#: view:esale.oscom.web:0
526msgid "Import Taxes"521msgid "Import Taxes"
527msgstr ""522msgstr ""
528523
529#. module: esale_osc
530#: view:esale.oscom.paytype:0524#: view:esale.oscom.paytype:0
531#: view:esale.oscom.status:0525#: view:esale.oscom.status:0
532#: field:esale.oscom.web,pay_typ_ids:0526#: field:esale.oscom.web,pay_typ_ids:0
527#. module: esale_osc
533msgid "Payment types"528msgid "Payment types"
534msgstr ""529msgstr ""
535530
536#. module: esale_osc
537#: field:esale.oscom.web,active:0531#: field:esale.oscom.web,active:0
532#. module: esale_osc
538msgid "Active"533msgid "Active"
539msgstr ""534msgstr ""
540535
541#. module: esale_osc
542#: field:product.product,product_picture:0536#: field:product.product,product_picture:0
537#. module: esale_osc
543msgid "Product Picture"538msgid "Product Picture"
544msgstr ""539msgstr ""
545540
546#. module: esale_osc
547#: field:esale.oscom.web,status_ids:0541#: field:esale.oscom.web,status_ids:0
542#. module: esale_osc
548msgid "Osc Status"543msgid "Osc Status"
549msgstr ""544msgstr ""
550545
551#. module: esale_osc
552#: view:product.manufacturer:0546#: view:product.manufacturer:0
547#. module: esale_osc
553msgid "Manufacturer"548msgid "Manufacturer"
554msgstr ""549msgstr ""
555550
556#. module: esale_osc
557#: field:product.product,exp_date:0551#: field:product.product,exp_date:0
552#. module: esale_osc
558msgid "Expiry date"553msgid "Expiry date"
559msgstr ""554msgstr ""
560555
556#: view:esale.oscom.web:0
561#. module: esale_osc557#. module: esale_osc
562#: view:esale.oscom.web:0
563msgid "esale_oscom Shop Info"558msgid "esale_oscom Shop Info"
564msgstr ""559msgstr ""
565560
561#: view:esale.oscom.lang:0
566#. module: esale_osc562#. module: esale_osc
567#: view:esale.oscom.lang:0
568msgid "Language"563msgid "Language"
569msgstr ""564msgstr ""
570565
566#: view:esale.oscom.web:0
571#. module: esale_osc567#. module: esale_osc
572#: view:esale.oscom.web:0
573msgid "Import Payment Methods"568msgid "Import Payment Methods"
574msgstr ""569msgstr ""
575570
576#. module: esale_osc
577#: field:esale.oscom.product,product_id:0571#: field:esale.oscom.product,product_id:0
572#. module: esale_osc
578msgid "OpenERP product"573msgid "OpenERP product"
579msgstr ""574msgstr ""
580575
581#. module: esale_osc
582#: model:ir.ui.menu,name:esale_osc.menu_action_esale_oscom_web576#: model:ir.ui.menu,name:esale_osc.menu_action_esale_oscom_web
577#. module: esale_osc
583msgid "Websites"578msgid "Websites"
584msgstr ""579msgstr ""
585580
586#. module: esale_osc
587#: field:esale.oscom.product,esale_oscom_id:0581#: field:esale.oscom.product,esale_oscom_id:0
582#. module: esale_osc
588msgid "OScommerce product Id"583msgid "OScommerce product Id"
589msgstr ""584msgstr ""
590585
591#. module: esale_osc
592#: help:esale.oscom.web,date_download_from:0586#: help:esale.oscom.web,date_download_from:0
587#. module: esale_osc
593msgid "Specify date since you want to download modified or new products"588msgid "Specify date since you want to download modified or new products"
594msgstr ""589msgstr ""
595590
591#: view:esale.oscom.web:0
596#. module: esale_osc592#. module: esale_osc
597#: view:esale.oscom.web:0
598msgid "Import Categories"593msgid "Import Categories"
599msgstr ""594msgstr ""
600595
601#. module: esale_osc
602#: field:esale.oscom.category,category_id:0596#: field:esale.oscom.category,category_id:0
597#. module: esale_osc
603msgid "OpenERP category"598msgid "OpenERP category"
604msgstr ""599msgstr ""
605600
601#: view:product.product:0
606#. module: esale_osc602#. module: esale_osc
607#: view:product.product:0
608msgid "Link to Oscommerce"603msgid "Link to Oscommerce"
609msgstr ""604msgstr ""
610605
611#. module: esale_osc
612#: field:esale.oscom.paytype,payment_id:0606#: field:esale.oscom.paytype,payment_id:0
607#. module: esale_osc
613msgid "OpenERP payment"608msgid "OpenERP payment"
614msgstr ""609msgstr ""
615610
616#. module: esale_osc
617#: model:product.template,name:esale_osc.product_product_discount_coupon_product_template611#: model:product.template,name:esale_osc.product_product_discount_coupon_product_template
612#. module: esale_osc
618msgid "Discount Coupon"613msgid "Discount Coupon"
619msgstr ""614msgstr ""
620615
621#. module: esale_osc
622#: field:esale.oscom.web,intermediate:0616#: field:esale.oscom.web,intermediate:0
617#. module: esale_osc
623msgid "Intermediate Status"618msgid "Intermediate Status"
624msgstr ""619msgstr ""
625620
626#. module: esale_osc
627#: model:ir.ui.menu,name:esale_osc.menu_action_saleorder_tree_draft621#: model:ir.ui.menu,name:esale_osc.menu_action_saleorder_tree_draft
622#. module: esale_osc
628msgid "Request for quotation"623msgid "Request for quotation"
629msgstr ""624msgstr ""
630625
631#. module: esale_osc
632#: model:ir.ui.menu,name:esale_osc.menu_action_saleorder_tree_manual626#: model:ir.ui.menu,name:esale_osc.menu_action_saleorder_tree_manual
627#. module: esale_osc
633msgid "Waiting invoice"628msgid "Waiting invoice"
634msgstr ""629msgstr ""
635630
636#. module: esale_osc
637#: model:product.template,name:esale_osc.product_product_cash_delivery_product_template631#: model:product.template,name:esale_osc.product_product_cash_delivery_product_template
632#. module: esale_osc
638msgid "Cash On Delivery"633msgid "Cash On Delivery"
639msgstr ""634msgstr ""
640635
636#: selection:product.product,in_out_stock:0
641#. module: esale_osc637#. module: esale_osc
642#: selection:product.product,in_out_stock:0
643msgid "Out Stock"638msgid "Out Stock"
644msgstr ""639msgstr ""
645640
646#. module: esale_osc
647#: model:product.category,name:esale_osc.cat_shipping_cost641#: model:product.category,name:esale_osc.cat_shipping_cost
648#: model:product.template,name:esale_osc.product_product_shipping_Cost_product_template642#: model:product.template,name:esale_osc.product_product_shipping_Cost_product_template
643#. module: esale_osc
649msgid "Shipping Cost"644msgid "Shipping Cost"
650msgstr ""645msgstr ""
651646
652#. module: esale_osc
653#: model:ir.model,name:esale_osc.model_esale_oscom_lang647#: model:ir.model,name:esale_osc.model_esale_oscom_lang
648#. module: esale_osc
654msgid "esale_oscom Language"649msgid "esale_oscom Language"
655msgstr ""650msgstr ""
656651
657#. module: esale_osc
658#: field:product.product,spe_price:0652#: field:product.product,spe_price:0
653#. module: esale_osc
659msgid "Special price"654msgid "Special price"
660msgstr ""655msgstr ""
661656
657#: view:sale.order:0
662#. module: esale_osc658#. module: esale_osc
663#: view:sale.order:0
664msgid "Sales Orders"659msgid "Sales Orders"
665msgstr ""660msgstr ""
666661
667#. module: esale_osc
668#: constraint:ir.model:0662#: constraint:ir.model:0
663#. module: esale_osc
669msgid "The Object name must start with x_ and not contain any special character !"664msgid "The Object name must start with x_ and not contain any special character !"
670msgstr ""665msgstr ""
671666
672#. module: esale_osc
673#: field:sale.order,shipping_agency:0667#: field:sale.order,shipping_agency:0
668#. module: esale_osc
674msgid "Carrier Partner"669msgid "Carrier Partner"
675msgstr ""670msgstr ""
676671
672#: view:esale.oscom.product:0
677#. module: esale_osc673#. module: esale_osc
678#: view:esale.oscom.product:0
679msgid "Product Information"674msgid "Product Information"
680msgstr ""675msgstr ""
681676
682#. module: esale_osc
683#: view:esale.oscom.category:0677#: view:esale.oscom.category:0
684#: field:esale.oscom.web,category_ids:0678#: field:esale.oscom.web,category_ids:0
679#. module: esale_osc
685msgid "Categories"680msgid "Categories"
686msgstr ""681msgstr ""
687682
683#: view:product.product:0
688#. module: esale_osc684#. module: esale_osc
689#: view:product.product:0
690msgid "Other information"685msgid "Other information"
691msgstr ""686msgstr ""
692687
688#: view:esale.oscom.status:0
693#. module: esale_osc689#. module: esale_osc
694#: view:esale.oscom.status:0
695msgid "Osc status"690msgid "Osc status"
696msgstr ""691msgstr ""
697692
698#. module: esale_osc
699#: field:esale.oscom.web,price_type:0693#: field:esale.oscom.web,price_type:0
694#. module: esale_osc
700msgid "Price type"695msgid "Price type"
701msgstr ""696msgstr ""
702697
698#: view:esale.oscom.product:0
703#. module: esale_osc699#. module: esale_osc
704#: view:esale.oscom.product:0
705msgid "Product"700msgid "Product"
706msgstr ""701msgstr ""
707702
708#. module: esale_osc
709#: field:sale.order,pay_met_title:0703#: field:sale.order,pay_met_title:0
704#. module: esale_osc
710msgid "Payment Method"705msgid "Payment Method"
711msgstr ""706msgstr ""
712707
713#. module: esale_osc
714#: wizard_view:esale.oscom.select.stocks,init:0708#: wizard_view:esale.oscom.select.stocks,init:0
715#: wizard_view:esale.oscom.stocks,init:0709#: wizard_view:esale.oscom.stocks,init:0
710#. module: esale_osc
716msgid "Stock Update"711msgid "Stock Update"
717msgstr ""712msgstr ""
718713
719#. module: esale_osc
720#: field:esale.oscom.category,esale_oscom_id:0714#: field:esale.oscom.category,esale_oscom_id:0
721#: field:esale.oscom.lang,esale_oscom_id:0715#: field:esale.oscom.lang,esale_oscom_id:0
722#: field:esale.oscom.paytype,esale_oscom_id:0716#: field:esale.oscom.paytype,esale_oscom_id:0
@@ -724,76 +718,76 @@
724#: field:esale.oscom.tax,esale_oscom_id:0718#: field:esale.oscom.tax,esale_oscom_id:0
725#: field:res.partner,esale_oscom_id:0719#: field:res.partner,esale_oscom_id:0
726#: field:res.partner.address,esale_oscom_id:0720#: field:res.partner.address,esale_oscom_id:0
721#. module: esale_osc
727msgid "OScommerce Id"722msgid "OScommerce Id"
728msgstr ""723msgstr ""
729724
730#. module: esale_osc
731#: field:sale.order,orders_status:0725#: field:sale.order,orders_status:0
726#. module: esale_osc
732msgid "Osc Status Inic"727msgid "Osc Status Inic"
733msgstr ""728msgstr ""
734729
730#: view:esale.oscom.web:0
735#. module: esale_osc731#. module: esale_osc
736#: view:esale.oscom.web:0
737msgid "Import and create/update Categories"732msgid "Import and create/update Categories"
738msgstr ""733msgstr ""
739734
735#: view:esale.oscom.web:0
740#. module: esale_osc736#. module: esale_osc
741#: view:esale.oscom.web:0
742msgid "Import all products from OSCommerce"737msgid "Import all products from OSCommerce"
743msgstr ""738msgstr ""
744739
745#. module: esale_osc
746#: field:sale.order,send_web_email:0740#: field:sale.order,send_web_email:0
741#. module: esale_osc
747msgid "Send web E-mail"742msgid "Send web E-mail"
748msgstr ""743msgstr ""
749744
750#. module: esale_osc
751#: field:sale.order,additional_info:0745#: field:sale.order,additional_info:0
746#. module: esale_osc
752msgid "Aditional Info"747msgid "Aditional Info"
753msgstr ""748msgstr ""
754749
750#: view:sale.order:0
755#. module: esale_osc751#. module: esale_osc
756#: view:sale.order:0
757msgid "Options selected will be applied on changing osc order status"752msgid "Options selected will be applied on changing osc order status"
758msgstr ""753msgstr ""
759754
760#. module: esale_osc
761#: help:sale.order,number_of_packages:0755#: help:sale.order,number_of_packages:0
756#. module: esale_osc
762msgid "Include number of packages to send"757msgid "Include number of packages to send"
763msgstr ""758msgstr ""
764759
765#. module: esale_osc
766#: field:esale.oscom.category,name:0760#: field:esale.oscom.category,name:0
767#: field:esale.oscom.lang,name:0761#: field:esale.oscom.lang,name:0
768#: field:esale.oscom.paytype,name:0762#: field:esale.oscom.paytype,name:0
769#: field:esale.oscom.product,name:0763#: field:esale.oscom.product,name:0
770#: field:esale.oscom.web,name:0764#: field:esale.oscom.web,name:0
771#: field:product.manufacturer,name:0765#: field:product.manufacturer,name:0
766#. module: esale_osc
772msgid "Name"767msgid "Name"
773msgstr ""768msgstr ""
774769
770#: selection:esale.oscom.paytype,paytyp:0
775#. module: esale_osc771#. module: esale_osc
776#: selection:esale.oscom.paytype,paytyp:0
777msgid "Invoice Confirmed"772msgid "Invoice Confirmed"
778msgstr ""773msgstr ""
779774
780#. module: esale_osc
781#: field:esale.oscom.paytype,paytyp:0775#: field:esale.oscom.paytype,paytyp:0
776#. module: esale_osc
782msgid "Payment type"777msgid "Payment type"
783msgstr ""778msgstr ""
784779
785#. module: esale_osc
786#: view:esale.oscom.tax:0780#: view:esale.oscom.tax:0
787#: field:esale.oscom.web,tax_ids:0781#: field:esale.oscom.web,tax_ids:0
782#. module: esale_osc
788msgid "Taxes"783msgid "Taxes"
789msgstr ""784msgstr ""
790785
791#. module: esale_osc
792#: field:esale.oscom.web,shop_id:0786#: field:esale.oscom.web,shop_id:0
787#. module: esale_osc
793msgid "Sale shop"788msgid "Sale shop"
794msgstr ""789msgstr ""
795790
796#. module: esale_osc
797#: field:account.invoice,esale_oscom_web:0791#: field:account.invoice,esale_oscom_web:0
798#: field:esale.oscom.category,web_id:0792#: field:esale.oscom.category,web_id:0
799#: field:esale.oscom.lang,web_id:0793#: field:esale.oscom.lang,web_id:0
@@ -802,52 +796,88 @@
802#: field:esale.oscom.status,web_id:0796#: field:esale.oscom.status,web_id:0
803#: field:esale.oscom.tax,web_id:0797#: field:esale.oscom.tax,web_id:0
804#: field:sale.order,esale_oscom_web:0798#: field:sale.order,esale_oscom_web:0
799#. module: esale_osc
805msgid "Website"800msgid "Website"
806msgstr ""801msgstr ""
807802
803#: view:sale.order:0
808#. module: esale_osc804#. module: esale_osc
809#: view:sale.order:0
810msgid "Os Commerce Information"805msgid "Os Commerce Information"
811msgstr ""806msgstr ""
812807
813#. module: esale_osc
814#: wizard_view:esale.oscom.select.stocks,init:0808#: wizard_view:esale.oscom.select.stocks,init:0
815#: wizard_view:esale.oscom.stocks,init:0809#: wizard_view:esale.oscom.stocks,init:0
810#. module: esale_osc
816msgid "Stock succesfully updated"811msgid "Stock succesfully updated"
817msgstr ""812msgstr ""
818813
814#: view:esale.oscom.tax:0
819#. module: esale_osc815#. module: esale_osc
820#: view:esale.oscom.tax:0
821msgid "Taxes mapping"816msgid "Taxes mapping"
822msgstr ""817msgstr ""
823818
824#. module: esale_osc
825#: field:esale.oscom.status,name:0819#: field:esale.oscom.status,name:0
820#. module: esale_osc
826msgid "Status name"821msgid "Status name"
827msgstr ""822msgstr ""
828823
824#: selection:esale.oscom.web,price_type:0
829#. module: esale_osc825#. module: esale_osc
830#: selection:esale.oscom.web,price_type:0
831msgid "Untaxed price"826msgid "Untaxed price"
832msgstr ""827msgstr ""
833828
834#. module: esale_osc
835#: help:sale.order,orders_status:0829#: help:sale.order,orders_status:0
830#. module: esale_osc
836msgid "Indicates the initial status of order on Osc Web"831msgid "Indicates the initial status of order on Osc Web"
837msgstr ""832msgstr ""
838833
834#: constraint:product.product:0
839#. module: esale_osc835#. module: esale_osc
840#: constraint:product.product:0
841msgid "Error: Invalid ean code"836msgid "Error: Invalid ean code"
842msgstr ""837msgstr ""
843838
844#. module: esale_osc
845#: field:sale.order,status_comment:0839#: field:sale.order,status_comment:0
840#. module: esale_osc
846msgid "Status Comment"841msgid "Status Comment"
847msgstr ""842msgstr ""
848843
849#. module: esale_osc
850#: field:product.product,in_out_stock:0844#: field:product.product,in_out_stock:0
845#. module: esale_osc
851msgid "In/Out Stock"846msgid "In/Out Stock"
852msgstr ""847msgstr ""
853848
849#. module: esale_osc
850msgid ""
851"Default product named \'Shipping Cost\' will be used.\n"
852"In case it doesn\'t exist, please create it"
853msgstr ""
854
855#. module: esale_osc
856#: field:esale.oscom.web,admin_user:0
857msgid "Admin User"
858msgstr ""
859
860#. module: esale_osc
861#: field:esale.oscom.web,admin_pass:0
862msgid "Admin Pass"
863msgstr ""
864
865#. module: esale_osc
866#: field:esale.oscom.web,default_partner_category:0
867msgid "Customers partner category"
868msgstr ""
869
870#. module: esale_osc
871#: field:esale.oscom.web,download_number:30
872msgid "Download number"
873msgstr ""
874
875#. module: esale_osc
876#: field:esale.oscom.web,override_products_data:0
877msgid "Override Products Data"
878msgstr ""
879
880#. module: esale_osc
881#: help:esale.oscom.web,override_products_data:0
882msgid "Click if you want to Update products data on the shop with changes made in openerp."
883msgstr ""
854\ No newline at end of file884\ No newline at end of file
855885
=== modified file 'esale_osc/wizard/wizard_esale_oscom_update_select_stocks.py'
--- esale_osc/wizard/wizard_esale_oscom_update_select_stocks.py 2010-01-21 09:33:17 +0000
+++ esale_osc/wizard/wizard_esale_oscom_update_select_stocks.py 2010-07-21 10:31:39 +0000
@@ -1,3 +1,4 @@
1# -*- coding: utf-8 -*-
1# -*- encoding: utf-8 -*-2# -*- encoding: utf-8 -*-
2##############################################################################3##############################################################################
3#4#