-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from Eoxia/2.3.3
2.3.3
- Loading branch information
Showing
20 changed files
with
315 additions
and
143 deletions.
There are no files selected for viewing
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* @author Eoxia <[email protected]> | ||
* @copyright (c) 2011-2020 Eoxia <[email protected]>. | ||
* @since 2.0.0 | ||
* @version 2.0.0 | ||
* @version 2.3.3 | ||
*/ | ||
|
||
namespace wpshop; | ||
|
@@ -106,7 +106,7 @@ public function add_review_order_table_class( $class, $object ) { | |
* Change le statut d'une commande. | ||
* | ||
* @since 2.0.0 | ||
* @version 2.0.0 | ||
* @version 2.3.3 | ||
* | ||
* @param string $status Le statut d'une facture. | ||
* @param Doli_Invoice $object Les données d'une facture. | ||
|
@@ -119,8 +119,8 @@ public function wps_doli_status( $status, $object ) { | |
return __( 'Traitment in progress', 'wpshop' ); | ||
} | ||
|
||
if ( $object->data['delivered'] ) { | ||
return $status . ' ' . __( '(Delivery)', 'wpshop' ); | ||
if ( $object->data['billed'] ) { | ||
return $status . ' - ' . __( 'Billed', 'wpshop' ); | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* @author Eoxia <[email protected]> | ||
* @copyright (c) 2011-2020 Eoxia <[email protected]>. | ||
* @since 2.0.0 | ||
* @version 2.0.0 | ||
* @version 2.3.3 | ||
*/ | ||
|
||
namespace wpshop; | ||
|
@@ -70,4 +70,14 @@ | |
</tr> | ||
</tfoot> | ||
</table> | ||
|
||
<?php if ( ! empty( $invoices ) ) : | ||
foreach ( $invoices as $invoice ) : ?> | ||
<ul class="reference-title"> | ||
<?php if ( ! empty( $invoice->data['external_id'] ) ) : ?> | ||
<li><a href="<?php echo esc_attr( $doli_url ); ?>/compta/facture/card.php?facid=<?php echo $invoice->data['external_id']; ?>" target="_blank"><?php echo esc_html( $invoice->data['title'] ); ?></a></li> | ||
<?php endif; ?> | ||
</ul> | ||
<?php endforeach; | ||
endif; ?> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* @author Eoxia <[email protected]> | ||
* @copyright (c) 2011-2020 Eoxia <[email protected]>. | ||
* @since 2.0.0 | ||
* @version 2.0.0 | ||
* @version 2.3.3 | ||
*/ | ||
|
||
namespace wpshop; | ||
|
@@ -53,7 +53,7 @@ protected function construct() {} | |
* Synchronise Dolibarr vers WPshop. | ||
* | ||
* @since 2.0.0 | ||
* @version 2.0.0 | ||
* @version 2.3.3 | ||
* | ||
* @param stdClass $doli_proposal Les données d'une proposition commerciale Dolibarr. | ||
* @param Proposals $wp_proposal Les données d'une proposition commerciale WordPress. | ||
|
@@ -116,7 +116,7 @@ public function doli_to_wp( $doli_proposal, $wp_proposal ) { | |
$status = 'wps-refused'; | ||
break; | ||
case 4: | ||
$status = 'publish'; | ||
$status = 'wps-billed'; | ||
$wp_proposal->data['billed'] = 1; | ||
break; | ||
default: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
modules/dolibarr/doli-proposals/filter/class-doli-proposals-filter.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?php | ||
/** | ||
* La classe gérant les filtres des propositions commerciales de Dolibarr. | ||
* | ||
* @package WPshop | ||
* @author Eoxia <[email protected]> | ||
* @copyright (c) 2011-2020 Eoxia <[email protected]>. | ||
* @since 2.3.3 | ||
* @version 2.3.3 | ||
*/ | ||
|
||
namespace wpshop; | ||
|
||
defined( 'ABSPATH' ) || exit; | ||
|
||
/** | ||
* Doli Proposals Filter Class. | ||
*/ | ||
class Doli_Proposals_Filter { | ||
|
||
/** | ||
* Le constructeur. | ||
* | ||
* @since 2.3.3 | ||
* @version 2.3.3 | ||
*/ | ||
public function __construct() { | ||
add_filter( 'wps_doli_status', array( $this, 'wps_doli_status' ), 10, 2 ); | ||
} | ||
|
||
/** | ||
* Change le statut d'une proposition commerciale. | ||
* | ||
* @since 2.3.3 | ||
* @version 2.3.3 | ||
* | ||
* @param string $status Le statut d'une proposition commerciale. | ||
* @param Proposals $object Les données d'une proposition commerciale. | ||
* | ||
* @return string Le nouveau statut d'une proposition commerciale. | ||
*/ | ||
public function wps_doli_status( $status, $object ) { | ||
if ( $object->data['type'] == Proposals::g()->get_type() ) { | ||
switch ($object->data['status']) { | ||
case 'publish': | ||
$status .= __(' (open proposal)', 'wpshop'); | ||
break; | ||
case 'wps-accepted': | ||
$status .= __(' (to be invoiced)', 'wpshop'); | ||
break; | ||
case 'wps-refused': | ||
$status .= __(' (closed)', 'wpshop'); | ||
break; | ||
} | ||
} | ||
return $status; | ||
} | ||
} | ||
|
||
new Doli_Proposals_Filter(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?php | ||
// Silence is golden. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* @author Eoxia <[email protected]> | ||
* @copyright (c) 2011-2020 Eoxia <[email protected]>. | ||
* @since 2.0.0 | ||
* @version 2.0.0 | ||
* @version 2.3.3 | ||
*/ | ||
|
||
namespace wpshop; | ||
|
@@ -35,7 +35,7 @@ class Doli_Statut extends Singleton_Util { | |
* Le constructeur. | ||
* | ||
* @since 2.0.0 | ||
* @version 2.0.0 | ||
* @version 2.3.3 | ||
*/ | ||
protected function construct() { | ||
$this->status = array( | ||
|
@@ -45,20 +45,20 @@ protected function construct() { | |
'class' => 'status-grey', | ||
), | ||
'publish' => array( | ||
'text' => __( 'Waiting for a signature', 'wpshop' ), | ||
'text' => __( 'Validated', 'wpshop' ), | ||
'class' => 'status-orange', | ||
), | ||
'wps-accepted' => array( | ||
'text' => __( 'Signed', 'wpshop' ), | ||
'class' => 'status-orange', | ||
'class' => 'status-green', | ||
), | ||
'wps-refused' => array( | ||
'text' => __( 'Not signed', 'wpshop' ), | ||
'class' => 'status-red', | ||
'class' => 'status-grey', | ||
), | ||
'wps-billed' => array( | ||
'text' => __( 'Billed', 'wpshop' ), | ||
'class' => 'status-green', | ||
'class' => 'status-grey', | ||
), | ||
'wps-delivered' => array( | ||
'text' => __( 'Delivered', 'wpshop' ), | ||
|
@@ -71,15 +71,19 @@ protected function construct() { | |
'class' => 'status-grey', | ||
), | ||
'publish' => array( | ||
'text' => __( 'Not paid', 'wpshop' ), | ||
'text' => __( 'Validated', 'wpshop' ), | ||
'class' => 'status-orange', | ||
), | ||
'wps-canceled' => array( | ||
'text' => __( 'Canceled', 'wpshop' ), | ||
'class' => 'status-red', | ||
), | ||
'wps-billed' => array( | ||
'text' => __( 'Billed', 'wpshop' ), | ||
'text' => __( 'Processed', 'wpshop' ), | ||
'class' => 'status-grey', | ||
), | ||
'wps-shipmentprocess' => array( | ||
'text' => __( 'In progress', 'wpshop' ), | ||
'class' => 'status-green', | ||
), | ||
'wps-delivered' => array( | ||
|
@@ -93,12 +97,12 @@ protected function construct() { | |
'class' => 'status-grey', | ||
), | ||
'publish' => array( | ||
'text' => __( 'Not paid', 'wpshop' ), | ||
'text' => __( 'Unpaid', 'wpshop' ), | ||
'class' => 'status-orange', | ||
), | ||
'wps-billed' => array( | ||
'text' => __( 'Billed', 'wpshop' ), | ||
'class' => 'status-green', | ||
'text' => __( 'Paid', 'wpshop' ), | ||
'class' => 'status-grey', | ||
), | ||
'wps-abandoned' => array( | ||
'text' => __( 'Abandoned', 'wpshop' ), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.