View | Details | Raw Unified | Return to bug 10556
Collapse All | Expand All

(-)a/C4/Bookseller.pm (-47 / +46 lines)
Lines 175-206 sub AddBookseller { Link Here
175
    my $query  = q|
175
    my $query  = q|
176
        INSERT INTO aqbooksellers
176
        INSERT INTO aqbooksellers
177
            (
177
            (
178
                name,      address1,      address2,   address3,      address4,
178
                name,      address1,      address2,     address3,   address4,
179
                postal,    phone,         accountnumber,   fax,      url,           
179
                postal,    phone,         accountnumber,fax,        url,
180
                contact,
180
                contact,   contpos,       contphone,    contfax,    contaltphone,
181
                contpos,   contphone,     contfax,    contaltphone,  contemail,
181
                contemail, contnotes,     active,       listprice,  invoiceprice,
182
                contnotes, active,        listprice,  invoiceprice,  gstreg,
182
                gstreg,    listincgst,    invoiceincgst,gstrate,    discount,
183
                listincgst,invoiceincgst, gstrate,    discount,
183
                notes,     deliverytime
184
                notes
185
            )
184
            )
186
        VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) |
185
        VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) |
187
      ;
186
      ;
188
    my $sth = $dbh->prepare($query);
187
    my $sth = $dbh->prepare($query);
189
    $sth->execute(
188
    $sth->execute(
190
        $data->{'name'},         $data->{'address1'},
189
        $data->{name}         ,$data->{address1},
191
        $data->{'address2'},     $data->{'address3'},
190
        $data->{address2}     ,$data->{address3},
192
        $data->{'address4'},     $data->{'postal'},
191
        $data->{address4}     ,$data->{postal},
193
        $data->{'phone'},        $data->{'accountnumber'},
192
        $data->{phone}        ,$data->{accountnumber},
194
        $data->{'fax'},
193
        $data->{fax},
195
        $data->{'url'},          $data->{'contact'},
194
        $data->{url}          ,$data->{contact},
196
        $data->{'contpos'},      $data->{'contphone'},
195
        $data->{contpos}      ,$data->{contphone},
197
        $data->{'contfax'},      $data->{'contaltphone'},
196
        $data->{contfax}      ,$data->{contaltphone},
198
        $data->{'contemail'},    $data->{'contnotes'},
197
        $data->{contemail}    ,$data->{contnotes},
199
        $data->{'active'},       $data->{'listprice'},
198
        $data->{active}       ,$data->{listprice},
200
        $data->{'invoiceprice'}, $data->{'gstreg'},
199
        $data->{invoiceprice} ,$data->{gstreg},
201
        $data->{'listincgst'},   $data->{'invoiceincgst'},
200
        $data->{listincgst}   ,$data->{invoiceincgst},
202
        $data->{'gstrate'},
201
        $data->{gstrate}      ,$data->{discount},
203
        $data->{'discount'},     $data->{'notes'}
202
        $data->{notes}        ,$data->{deliverytime},
204
    );
203
    );
205
204
206
    # return the id of this new supplier
205
    # return the id of this new supplier
Lines 227-258 C<&ModBookseller> with the result. Link Here
227
sub ModBookseller {
226
sub ModBookseller {
228
    my ($data) = @_;
227
    my ($data) = @_;
229
    my $dbh    = C4::Context->dbh;
228
    my $dbh    = C4::Context->dbh;
230
    my $query  = 'UPDATE aqbooksellers
229
    my $query  = q|
231
        SET name=?,address1=?,address2=?,address3=?,address4=?,
230
        UPDATE aqbooksellers
232
            postal=?,phone=?,accountnumber=?,fax=?,url=?,contact=?,contpos=?,
231
        SET name = ?,      address1 = ?,     address2 = ?,      address3 = ?,  address4 = ?,
233
            contphone=?,contfax=?,contaltphone=?,contemail=?,
232
            postal = ?,    phone = ?,        accountnumber = ?, fax = ?,       url = ?,
234
            contnotes=?,active=?,listprice=?, invoiceprice=?,
233
            contact = ?,   contpos = ?,      contphone = ?,     contfax = ?,   contaltphone = ?,
235
            gstreg=?,listincgst=?,invoiceincgst=?,
234
            contemail = ?, contnotes = ?,    active = ?,        listprice = ?, invoiceprice = ?,
236
            discount=?,notes=?,gstrate=?,deliverytime=?
235
            gstreg = ?,    listincgst = ?,   invoiceincgst = ?, gstrate = ?,   discount = ?,
237
        WHERE id=?';
236
            notes = ?,     deliverytime = ?
237
        WHERE id=?
238
    |;
238
    my $sth = $dbh->prepare($query);
239
    my $sth = $dbh->prepare($query);
239
    $sth->execute(
240
    $sth->execute(
240
        $data->{'name'},         $data->{'address1'},
241
        $data->{name}         ,$data->{address1},
241
        $data->{'address2'},     $data->{'address3'},
242
        $data->{address2}     ,$data->{address3},
242
        $data->{'address4'},     $data->{'postal'},
243
        $data->{address4}     ,$data->{postal},
243
        $data->{'phone'},        $data->{'accountnumber'},
244
        $data->{phone}        ,$data->{accountnumber},
244
        $data->{'fax'},
245
        $data->{fax},
245
        $data->{'url'},          $data->{'contact'},
246
        $data->{url}          ,$data->{contact},
246
        $data->{'contpos'},      $data->{'contphone'},
247
        $data->{contpos}      ,$data->{contphone},
247
        $data->{'contfax'},      $data->{'contaltphone'},
248
        $data->{contfax}      ,$data->{contaltphone},
248
        $data->{'contemail'},    $data->{'contnotes'},
249
        $data->{contemail}    ,$data->{contnotes},
249
        $data->{'active'},       $data->{'listprice'},
250
        $data->{active}       ,$data->{listprice},
250
        $data->{'invoiceprice'}, $data->{'gstreg'},
251
        $data->{invoiceprice} ,$data->{gstreg},
251
        $data->{'listincgst'},   $data->{'invoiceincgst'},
252
        $data->{listincgst}   ,$data->{invoiceincgst},
252
        $data->{'discount'},     $data->{'notes'},
253
        $data->{gstrate}      ,$data->{discount},
253
        $data->{'gstrate'},
254
        $data->{notes}        ,$data->{deliverytime},
254
        $data->{deliverytime},
255
        $data->{id},
255
        $data->{'id'}
256
    );
256
    );
257
    return;
257
    return;
258
}
258
}
259
- 

Return to bug 10556