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

(-)a/Koha/Edifact/Order.pm (-14 / +6 lines)
Lines 263-269 sub order_msg_header { Link Here
263
    push @header,
263
    push @header,
264
      beginning_of_message(
264
      beginning_of_message(
265
        $self->{basket}->basketno,
265
        $self->{basket}->basketno,
266
        $self->{recipient}->san,
266
        $self->{recipient}->standard,
267
        $self->{is_response}
267
        $self->{is_response}
268
      );
268
      );
269
269
Lines 297-325 sub order_msg_header { Link Here
297
297
298
sub beginning_of_message {
298
sub beginning_of_message {
299
    my $basketno            = shift;
299
    my $basketno            = shift;
300
    my $supplier_san        = shift;
300
    my $standard            = shift;
301
    my $response            = shift;
301
    my $response            = shift;
302
    my $document_message_no = sprintf '%011d', $basketno;
302
    my $document_message_no = sprintf '%011d', $basketno;
303
303
304
  # Peters & Bolinda use the BIC recommendation to use 22V a code not in Edifact
305
  # If the order is in response to a quote
306
    my %bic_sans = (
307
        '5013546025065' => 'Peters',
308
        '9377779308820' => 'Bolinda',
309
    );
310
311
    #    my $message_function = 9;    # original 7 = retransmission
304
    #    my $message_function = 9;    # original 7 = retransmission
312
    # message_code values
305
    # message_code values
313
    #      220 prder
306
    #      220 order
314
    #      224 rush order
307
    #      224 rush order
315
    #      228 sample order :: order for approval / inspection copies
308
    #      228 sample order :: order for approval / inspection copies
316
    #      22C continuation  order for volumes in a set etc.
309
    #      22C continuation  order for volumes in a set etc.
317
    #    my $message_code = '220';
310
    #    my $message_code = '220';
318
    if ( exists $bic_sans{$supplier_san} && $response ) {
319
        return "BGM+22V+$document_message_no+9$seg_terminator";
320
    }
321
311
322
    return "BGM+220+$document_message_no+9$seg_terminator";
312
    # If the order is in response to a quote and we're dealing with a BIC supplier
313
    my $code = ( $response && ( $standard eq 'BIC' ) ) ? '22V' : '220';
314
    return "BGM+$code+$document_message_no+9$seg_terminator";
323
}
315
}
324
316
325
sub name_and_address {
317
sub name_and_address {
(-)a/Koha/Schema/Result/VendorEdiAccount.pm (-2 / +11 lines)
Lines 80-85 __PACKAGE__->table("vendor_edi_accounts"); Link Here
80
  is_nullable: 1
80
  is_nullable: 1
81
  size: 20
81
  size: 20
82
82
83
=head2 standard
84
85
  data_type: 'varchar'
86
  default_value: 'EUR'
87
  is_nullable: 1
88
  size: 3
89
83
=head2 id_code_qualifier
90
=head2 id_code_qualifier
84
91
85
  data_type: 'varchar'
92
  data_type: 'varchar'
Lines 160-165 __PACKAGE__->add_columns( Link Here
160
  { data_type => "mediumtext", is_nullable => 1 },
167
  { data_type => "mediumtext", is_nullable => 1 },
161
  "san",
168
  "san",
162
  { data_type => "varchar", is_nullable => 1, size => 20 },
169
  { data_type => "varchar", is_nullable => 1, size => 20 },
170
  "standard",
171
  { data_type => "varchar", default_value => "EUR", is_nullable => 1, size => 3 },
163
  "id_code_qualifier",
172
  "id_code_qualifier",
164
  { data_type => "varchar", default_value => 14, is_nullable => 1, size => 3 },
173
  { data_type => "varchar", default_value => 14, is_nullable => 1, size => 3 },
165
  "transport",
174
  "transport",
Lines 250-257 __PACKAGE__->belongs_to( Link Here
250
);
259
);
251
260
252
261
253
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:54
262
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-02-18 14:08:05
254
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:TtWuTpP4Ac6/+T6OPMSsRA
263
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:yDbPFtwV40n3o+fFoxR99g
255
264
256
265
257
# You can replace this text with custom code or comments, and it will be preserved on regeneration
266
# You can replace this text with custom code or comments, and it will be preserved on regeneration
(-)a/admin/edi_accounts.pl (+11 lines)
Lines 76-81 else { Link Here
76
            upload_directory   => scalar $input->param('upload_directory'),
76
            upload_directory   => scalar $input->param('upload_directory'),
77
            download_directory => scalar $input->param('download_directory'),
77
            download_directory => scalar $input->param('download_directory'),
78
            san                => scalar $input->param('san'),
78
            san                => scalar $input->param('san'),
79
            standard           => scalar $input->param('standard'),
79
            transport          => scalar $input->param('transport'),
80
            transport          => scalar $input->param('transport'),
80
            quotes_enabled     => $input->param('quotes_enabled') ? 1 : 0,
81
            quotes_enabled     => $input->param('quotes_enabled') ? 1 : 0,
81
            invoices_enabled   => $input->param('invoices_enabled') ? 1 : 0,
82
            invoices_enabled   => $input->param('invoices_enabled') ? 1 : 0,
Lines 133-138 $template->param( Link Here
133
            code        => '92',
134
            code        => '92',
134
            description => 'Assigned by buyer',
135
            description => 'Assigned by buyer',
135
        },
136
        },
137
    ],
138
    standards => [
139
        {
140
            code => 'BIC',
141
            description => 'BiC'
142
        },
143
        {
144
            code => 'EUR',
145
            description => 'EDItEUR'
146
        }
136
    ]
147
    ]
137
);
148
);
138
149
(-)a/installer/data/mysql/atomicupdate/bug_30130.pl (+19 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => "30130",
5
    description => "A standard to edi_account",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
        unless ( column_exists('vendor_edi_accounts', 'standard') ) {
10
            $dbh->do(q{
11
                ALTER TABLE vendor_edi_accounts ADD standard varchar(3) DEFAULT 'EUR' AFTER san
12
            });
13
            
14
            $dbh->do(q{
15
                UPDATE vendor_edi_accounts SET standard = 'BIC' WHERE san IN ( '5013546025065', '9377779308820' )
16
            });
17
        }
18
    },
19
};
(-)a/installer/data/mysql/kohastructure.sql (+1 lines)
Lines 5230-5235 CREATE TABLE `vendor_edi_accounts` ( Link Here
5230
  `download_directory` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
5230
  `download_directory` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
5231
  `upload_directory` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
5231
  `upload_directory` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
5232
  `san` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
5232
  `san` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
5233
  `standard` varchar(3) COLLATE utf8mb4_unicode_ci DEFAULT 'EUR',
5233
  `id_code_qualifier` varchar(3) COLLATE utf8mb4_unicode_ci DEFAULT '14',
5234
  `id_code_qualifier` varchar(3) COLLATE utf8mb4_unicode_ci DEFAULT '14',
5234
  `transport` varchar(6) COLLATE utf8mb4_unicode_ci DEFAULT 'FTP',
5235
  `transport` varchar(6) COLLATE utf8mb4_unicode_ci DEFAULT 'FTP',
5235
  `quotes_enabled` tinyint(1) NOT NULL DEFAULT 0,
5236
  `quotes_enabled` tinyint(1) NOT NULL DEFAULT 0,
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/edi_accounts.tt (-1 / +18 lines)
Lines 185-190 EDI accounts › Administration › Koha Link Here
185
     <label for="san">SAN: </label>
185
     <label for="san">SAN: </label>
186
     <input type="text" name="san" id="san" size="20" maxlength="20" value="[% account.san | html %]" />
186
     <input type="text" name="san" id="san" size="20" maxlength="20" value="[% account.san | html %]" />
187
  </li>
187
  </li>
188
  <li>
189
     <label for="standard">Standard:</label>
190
     <select name="standard" id="standard">
191
     [% FOREACH standard IN standards %]
192
        [% IF standard.code == account.standard %]
193
           <option value="[% standard.code | html %]" selected="selected">
194
               [% standard.description | html %]
195
           </option>
196
        [% ELSE %]
197
           <option value="[% standard.code | html %]">
198
              [% standard.description | html %]
199
           </option>
200
        [% END %]
201
     [% END %]
202
   </select>
203
  </li>
188
  <li>
204
  <li>
189
     <label for="quotes_enabled">Quotes enabled: </label>
205
     <label for="quotes_enabled">Quotes enabled: </label>
190
      [% IF account.quotes_enabled %]
206
      [% IF account.quotes_enabled %]
Lines 284-289 EDI accounts &rsaquo; Administration &rsaquo; Koha Link Here
284
       <th>Upload directory</th>
300
       <th>Upload directory</th>
285
       <th>Qualifier</th>
301
       <th>Qualifier</th>
286
       <th>SAN</th>
302
       <th>SAN</th>
303
       <th>Standard</th>
287
       <th>Quotes</th>
304
       <th>Quotes</th>
288
       <th>Orders</th>
305
       <th>Orders</th>
289
       <th>Invoices</th>
306
       <th>Invoices</th>
Lines 311-316 EDI accounts &rsaquo; Administration &rsaquo; Koha Link Here
311
         ([% account.id_code_qualifier | html %])
328
         ([% account.id_code_qualifier | html %])
312
     </td>
329
     </td>
313
      <td>[% account.san | html %]</td>
330
      <td>[% account.san | html %]</td>
331
      <td>[% account.standard | html %]</td>
314
      [% IF account.quotes_enabled %]
332
      [% IF account.quotes_enabled %]
315
         <td>Yes</td>
333
         <td>Yes</td>
316
      [% ELSE %]
334
      [% ELSE %]
317
- 

Return to bug 30130