@@ -51,7 +51,7 @@ function CreateOrder(purchase) {
51
51
* @transaction
52
52
*/
53
53
function Buy ( purchase ) {
54
- if ( purchase . order . status = JSON . stringify ( orderStatus . Created ) )
54
+ if ( purchase . order . status == JSON . stringify ( orderStatus . Created ) )
55
55
{
56
56
purchase . order . buyer = purchase . buyer ;
57
57
purchase . order . seller = purchase . seller ;
@@ -69,7 +69,7 @@ function Buy(purchase) {
69
69
* @transaction
70
70
*/
71
71
function OrderCancel ( purchase ) {
72
- if ( ( purchase . order . status = JSON . stringify ( orderStatus . Created ) ) || ( purchase . order . status = JSON . stringify ( orderStatus . Bought ) ) )
72
+ if ( ( purchase . order . status == JSON . stringify ( orderStatus . Created ) ) || ( purchase . order . status == JSON . stringify ( orderStatus . Bought ) ) || ( purchase . order . status == JSON . stringify ( orderStatus . Backordered ) ) )
73
73
{
74
74
purchase . order . buyer = purchase . buyer ;
75
75
purchase . order . seller = purchase . seller ;
@@ -87,7 +87,7 @@ function OrderCancel(purchase) {
87
87
* @transaction
88
88
*/
89
89
function OrderFromSupplier ( purchase ) {
90
- if ( purchase . order . status = JSON . stringify ( orderStatus . Bought ) )
90
+ if ( purchase . order . status == JSON . stringify ( orderStatus . Bought ) )
91
91
{
92
92
purchase . order . provider = purchase . provider ;
93
93
purchase . order . ordered = new Date ( ) . toISOString ( ) ;
@@ -104,7 +104,7 @@ function OrderFromSupplier(purchase) {
104
104
* @transaction
105
105
*/
106
106
function RequestShipping ( purchase ) {
107
- if ( purchase . order . status = JSON . stringify ( orderStatus . Ordered ) )
107
+ if ( purchase . order . status == JSON . stringify ( orderStatus . Ordered ) )
108
108
{
109
109
purchase . order . shipper = purchase . shipper ;
110
110
purchase . order . requestShipment = new Date ( ) . toISOString ( ) ;
@@ -121,7 +121,7 @@ function RequestShipping(purchase) {
121
121
* @transaction
122
122
*/
123
123
function Delivering ( purchase ) {
124
- if ( ( purchase . order . status = JSON . stringify ( orderStatus . ShipRequest ) ) || ( JSON . parse ( purchase . order . status ) . code = orderStatus . Delivering . code ) )
124
+ if ( ( purchase . order . status == JSON . stringify ( orderStatus . ShipRequest ) ) || ( JSON . parse ( purchase . order . status ) . code = = orderStatus . Delivering . code ) )
125
125
{
126
126
purchase . order . delivering = new Date ( ) . toISOString ( ) ;
127
127
var _status = orderStatus . Delivering ;
@@ -139,7 +139,7 @@ function Delivering(purchase) {
139
139
* @transaction
140
140
*/
141
141
function Deliver ( purchase ) {
142
- if ( ( purchase . order . status = JSON . stringify ( orderStatus . ShipRequest ) ) || ( JSON . parse ( purchase . order . status ) . code = orderStatus . Delivering . code ) )
142
+ if ( ( purchase . order . status == JSON . stringify ( orderStatus . ShipRequest ) ) || ( JSON . parse ( purchase . order . status ) . code = = orderStatus . Delivering . code ) )
143
143
{
144
144
purchase . order . delivered = new Date ( ) . toISOString ( ) ;
145
145
purchase . order . status = JSON . stringify ( orderStatus . Delivered ) ;
0 commit comments